Code

Added external hook
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 12:28:41 +0000 (12:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Feb 2006 12:28:41 +0000 (12:28 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2765 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servRepositorySetup.inc
plugins/admin/systems/network.tpl

index b83b68fd98c8272a19bed7bd1c99962130c85d3a..661adfabeff021c7442476347bea50973fb032b9 100644 (file)
@@ -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']= "&nbsp;";
     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:
index dd7f669313321896ab8f2e6a6cb371841104f4f3..da562328cde6265ea58d6da1c85fea13c1e4f196 100644 (file)
@@ -25,7 +25,7 @@
           changeState('AddNewRecord');
           {$changeStateForRecords}
                 ">
-      {t}Enable DNS for this device.{/t}
+      {t}Enable DNS for this device{/t}
       <input type="submit" name="reloadThisDNSStuff" value="{t}Refresh{/t}">
     
                        <table  summary="" id="test2">