Code

Reverted dojo stuff
[gosa.git] / html / get_attachment.php
index eb36008b1029891a6aa1093a21f6c9a06ceeb336..d853e5b9f49ec20e414be00da8c451add981f589 100644 (file)
@@ -26,8 +26,8 @@ session_start ();
 
 /* Logged in? Simple security check */
 if (!isset($_SESSION['ui'])){
-  gosa_log ("Error: get_attachment.php called without session");
-  header ("Location: ../index.php");
+  new log("security","glpi/all","",array(),"Error: get_attachment.php called without session") ;
+  header ("Location: index.php");
   exit;
 }
 $ui= $_SESSION["ui"];
@@ -65,10 +65,10 @@ if(count($att)== 0){
   return;
 }
 
-if(!is_readable("/etc/gosa/glpi/".$att['filename'])){
-  print sprintf(_("Can't open file '%s'."),"/etc/gosa/glpi/".$att['filename']);
+if(!is_readable(CONFIG_DIR."/glpi/".$att['filename'])){
+  print sprintf(_("Can't open file '%s'."),CONFIG_DIR."/glpi/".$att['filename']);
 }
-$data = file_get_contents("/etc/gosa/glpi/".$att['filename']);
+$data = file_get_contents(CONFIG_DIR."/glpi/".$att['filename']);
 
 /* force download dialog */
 header("Content-type: ".$att['mime']."\n");