From 3cfea2bff34eb4b8311377b84768d00e6d579a53 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 3 Apr 2006 07:45:03 +0000 Subject: [PATCH] Added check for external hook git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2949 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_servRepositorySetup.inc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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); -- 2.30.2