Code

Added check to detect type of script
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 06:15:17 +0000 (06:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 06:15:17 +0000 (06:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2756 594d385d-05f5-0310-b6e9-bd551577e9d8

html/getFAIscript.php

index ba480b780b7c33624773eafee94aad80a4db5780..a4c242e7dfb815ada0b718b5d29f453ad91b040b 100644 (file)
@@ -28,6 +28,12 @@ restore_error_handler();
   $ei= ldap_first_entry($ldap->cid, $sr);
   $tmp = ldap_get_values_len($ldap->cid, $ei,"FAIscript");
   $tmp2 = $ldap->fetch();
+
+  if(in_array("FAIhookEntry",$tmp2['objectClass'])){
+    $suff = ".FAIhook";
+  }else{
+    $suff = ".FAIscript";
+  }
   $name= $tmp2['cn'][0];
 
   if(isset($tmp[0])){
@@ -37,7 +43,7 @@ restore_error_handler();
     header("Pragma: no-cache");
     header("Cache-Control: post-check=0, pre-check=0");
     header("Content-type: application/octet-stream");
-    header("Content-Disposition: attachment; filename=".$name.".FAIscript");
+    header("Content-Disposition: attachment; filename=".$name.$suff);
     echo $tmp[0];
   }else{
     echo sprintf("Can't query for this item '%s'",$id);