Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_servRepositorySetup.inc
index a1c62e7baad9a62b52d3681d66f81a5dc41eb0ad..40f37b0628acca88f431cc89042a7e16b31cdcf2 100644 (file)
@@ -20,8 +20,9 @@ class servRepositorySetup  extends plugin
   var $ParentServers    = "";
   var $initialy_was     = false;
   var $cn               = "";
+  var $parent           = "";
 
-  function servRepositorySetup ($config, $dn= NULL,$data = false)
+  function servRepositorySetup (&$config, $dn= NULL,$data = false)
   {
     plugin::plugin ($config, $dn);
     if($data != false){
@@ -107,9 +108,15 @@ class servRepositorySetup  extends plugin
   
     $smarty->assign("Sections",$divlist->DrawList());
 
+    /* Get && assign acls */
+    $tmp = $this->parent->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translated){
+      $smarty->assign($name."ACL",$this->parent->getacl($name));
+    }
+
+    /* Assign values */
     foreach($this->attributes as $attr){
       $smarty->assign($attr       ,$this->$attr);
-      $smarty->assign($attr."ACL" ,chkacl($this->acl,$attr));
     }
   
     $tmp = $this->getParentServers();
@@ -122,7 +129,14 @@ class servRepositorySetup  extends plugin
   /* Save data to object */
   function save_object()
   {
-    plugin::save_object();
+    if(isset($_POST['servRepositorySetup_Posted'])) {
+  
+      foreach($this->attributes as $attr){
+        if(($this->parent->acl_is_writeable($attr)) && (isset($_POST[$attr]))){
+          $this->$attr = $_POST[$attr];      
+        }
+      }
+    }
   }
 
 
@@ -179,7 +193,7 @@ class servRepositorySetup  extends plugin
   function GetHookElements()
   {
     $ret = array();
-    $cmd= search_config($this->config->data['TABS'], "servrepository", "REPOSITORY_HOOK");
+    $cmd = $this->config->search("servrepository", "REPOSITORY_HOOK",array('tabs'));
     if(!empty($cmd)){
       $res = shell_exec($cmd);
       $res2 = trim($res);