From: hickert Date: Mon, 3 Apr 2006 07:45:03 +0000 (+0000) Subject: Added check for external hook X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3cfea2bff34eb4b8311377b84768d00e6d579a53;p=gosa.git Added check for external hook git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2949 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servRepositorySetup.inc b/plugins/admin/systems/class_servRepositorySetup.inc index ddc4e1e8d..538fed150 100644 --- a/plugins/admin/systems/class_servRepositorySetup.inc +++ b/plugins/admin/systems/class_servRepositorySetup.inc @@ -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);