From e83a3fb018565e4211e428d4a199ae70bc43a3e3 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Feb 2006 06:15:17 +0000 Subject: [PATCH] Added check to detect type of script git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2756 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/getFAIscript.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/html/getFAIscript.php b/html/getFAIscript.php index ba480b780..a4c242e7d 100644 --- a/html/getFAIscript.php +++ b/html/getFAIscript.php @@ -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); -- 2.30.2