Code

removed unused code
[gosa.git] / gosa-plugins / systems / admin / systems / class_serverService.inc
index 7416989e7d6b366dece99b29826b94c89dd6b479..da80ccb8f23525ed2be53a2a5b97e6fa4b881304 100644 (file)
@@ -69,8 +69,7 @@ class ServerService extends plugin
 
         /* Initialize kerberos key support */ 
         if(isset($this->plugins[$name]->krb_service_prefix) && !empty($this->plugins[$name]->krb_service_prefix)){
-          $this->plugins[$name]->krb_host_key = new krb_host_keys($this->config,$this->parent,$this->plugins[$name]->krb_service_prefix);
-          $this->plugins[$name]->krb_host_key->ServiceKey(TRUE);
+          $this->plugins[$name]->krb_host_key = &$this->parent->kerberos_key_service;
         }
 
         /* Capture all service objectClases, necessary for acl handling */ 
@@ -80,7 +79,7 @@ class ServerService extends plugin
           }
         }
       }else{
-        trigger_error("Service class missing: ".$plug['CLASS']);
+        #trigger_error("Service class missing: ".$plug['CLASS']);
       }
     }
     $this->divList = new divListSystemService($config,$this);
@@ -211,7 +210,7 @@ class ServerService extends plugin
        Restore vars with values before editing */
     if(isset($_POST['CancelService']) && !empty($this->current)){
       if($this->backup == NULL){
-        $this->plugins[$this->current] = new $this->current($this->config,$this->dn);
+        $this->plugins[$this->current] = new $this->current($this->config,$this->dn,$this);
         $this->plugins[$this->current]-> set_acl_base($this->acl_base);
         $this->plugins[$this->current]-> set_acl_category(preg_replace("/\/$/","",$this->acl_category));
 
@@ -258,11 +257,10 @@ class ServerService extends plugin
 
     /* There is currently a subdialog open, display this dialog */
     if(is_object($this->dialog)){
-#      $this->dialog->save_object();
       $add ="";
-      if(isset($this->dialog->krb_host_key)){
-        $add = $this->dialog->krb_host_key->save_object();
-        $add = $this->dialog->krb_host_key->execute();
+      if(isset($this->dialog->krb_host_key) && $this->dialog->krb_host_key instanceof krbHostKeys){
+        $add = $this->dialog->krb_host_key->save_object_by_prefix($this->dialog->krb_service_prefix);
+        $add = $this->dialog->krb_host_key->execute_by_prefix($this->dialog->krb_service_prefix,TRUE);
       }
       return($add.$this->dialog->execute());
     }
@@ -382,7 +380,7 @@ class ServerService extends plugin
         $tmp = $this->plugins[$name]->getListEntry();
 
         /* Check if given action is allowed for this service */
-        if($tmp[$map[$action]]){
+        if($tmp[$map[$action]] && !empty($this->plugins[$name]->StatusFlag)){
           if($this->plugins[$name]->initially_was_account && $this->plugins[$name]->is_account){
             $this->plugins[$name]->setStatus($action);
           }
@@ -428,6 +426,9 @@ class ServerService extends plugin
         }
       }
       if($this->plugins[$name]->initially_was_account){
+        if(isset($this->plugins[$name]->krb_host_key) && $this->plugins[$name]->krb_host_key instanceof krbHostKeys){
+          $this->plugins[$name]->krb_host_key->remove_from_parent_by_prefix($this->plugins[$name]->krb_host_key);
+        }
         $this->plugins[$name]->remove_from_parent();
       }
     }