From 56402602079b0aec88baa2b964e297070f8d3430 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Feb 2006 12:28:41 +0000 Subject: [PATCH] Added external hook git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2765 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_servRepositorySetup.inc | 32 +++++++++++++++++-- plugins/admin/systems/network.tpl | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_servRepositorySetup.inc b/plugins/admin/systems/class_servRepositorySetup.inc index b83b68fd9..661adfabe 100644 --- a/plugins/admin/systems/class_servRepositorySetup.inc +++ b/plugins/admin/systems/class_servRepositorySetup.inc @@ -93,9 +93,10 @@ class servRepositorySetup extends plugin $smarty->assign($attr ,$this->$attr); $smarty->assign($attr."ACL" ,chkacl($this->acl,$attr)); } - - $smarty->assign("ParentServers" ,$this->getParentServers()); - $smarty->assign("ParentServerKeys",array_flip($this->getParentServers())); + + $tmp = $this->getParentServers(); + $smarty->assign("ParentServers" ,$tmp); + $smarty->assign("ParentServerKeys",array_flip($tmp)); return($smarty->fetch(get_template_path('servRepositorySetup.tpl', TRUE))); } @@ -144,10 +145,35 @@ class servRepositorySetup extends plugin while($attr = $ldap->fetch()){ $ret[$attr['cn'][0]]= $attr['cn'][0]; } + + $ret = array_merge($ret,$this->GetHookElements()); + $ret['none']= " "; return($ret); } + /* this funtions calls a defined hook + and parses all additional serverdata + */ + function GetHookElements() + { + $ret = array(); + $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]; + } + } + return($ret); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/network.tpl b/plugins/admin/systems/network.tpl index dd7f66931..da562328c 100644 --- a/plugins/admin/systems/network.tpl +++ b/plugins/admin/systems/network.tpl @@ -25,7 +25,7 @@ changeState('AddNewRecord'); {$changeStateForRecords} "> - {t}Enable DNS for this device.{/t} + {t}Enable DNS for this device{/t} -- 2.30.2