Code

added some checks for external hook
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Apr 2006 07:53:33 +0000 (07:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Apr 2006 07:53:33 +0000 (07:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2950 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servRepositorySetup.inc

index 538fed150ed2b7748e4c5ce1542a7ff6cbcc2d6d..b5e5c14f2d54f93cebf170488f7ed8f1450b1674 100644 (file)
@@ -162,9 +162,12 @@ class servRepositorySetup  extends plugin
     $cmd= search_config($this->config->data['TABS'], "servrepository", "EXTERNAL_HOOK");
     if(!empty($cmd)){
       $res = shell_exec($cmd);
-      if(!$res){
-        print_red(sprintf(_("Can't execute specified '%s' please check your gosa.conf."),$cmd));
-      }else{
+      $res2 = trim($res);
+      if((!$res)){
+        print_red(sprintf(_("Can't execute specified EXTERNAL_HOOK '%s' please check your gosa.conf."),$cmd));
+      }elseif(empty($res2)){
+        print_red(sprintf(_("The specified EXTERNAL_HOOK '%s', specified in your gosa.conf, returns an empty string."),$cmd));
+      }else{  
         $tmp = split("\n",$res);
         foreach($tmp as $hook){
           /* skip empty */