Code

Added check for external hook
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Apr 2006 07:45:03 +0000 (07:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Apr 2006 07:45:03 +0000 (07:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2949 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servRepositorySetup.inc

index ddc4e1e8d21358bae33b9ea630bf86ca746720b1..538fed150ed2b7748e4c5ce1542a7ff6cbcc2d6d 100644 (file)
@@ -162,14 +162,17 @@ class servRepositorySetup  extends plugin
     $cmd= search_config($this->config->data['TABS'], "servrepository", "EXTERNAL_HOOK");
     if(!empty($cmd)){
       $res = shell_exec($cmd);
-      $tmp = split("\n",$res);
-      foreach($tmp as $hook){
-
-        /* skip empty */
-        if((empty($hook)) || (!preg_match("/:/",$hook))) continue;
-
-        $hookinfo = split(":",$hook);
-        $ret[$hookinfo[1]] = $hookinfo[0];
+      if(!$res){
+        print_red(sprintf(_("Can't execute specified '%s' please check your gosa.conf."),$cmd));
+      }else{
+        $tmp = split("\n",$res);
+        foreach($tmp as $hook){
+          /* skip empty */
+          if((empty($hook)) || (!preg_match("/:/",$hook))) continue;
+
+          $hookinfo = split(":",$hook);
+          $ret[$hookinfo[1]] = $hookinfo[0];
+        }
       }
     }
     return($ret);