Code

Fixed wrong existance check
[gosa.git] / gosa-plugins / systems / admin / systems / class_serverService.inc
index 3ce35118cc1d85df0dcc0b6cb3cc71fb45bdb968..4bd58ed1894d29ca7ff73227e0b95b6f0595615e 100644 (file)
@@ -192,9 +192,11 @@ class ServerService extends plugin
     /* Edit a service and make a backup from all attributes, 
        to be able to restore old values after aborting dialog */ 
     if($s_action == "EditSingleService"){
-      $this->backup   = get_object_vars($this->plugins[$s_entry]);
-      $this->dialog   = $this->plugins[$s_entry];
-      $this->current  = $s_entry;
+      if($this->plugins[$s_entry]->acl_is_readable("")){
+        $this->backup   = get_object_vars($this->plugins[$s_entry]);
+        $this->dialog   = $this->plugins[$s_entry];
+        $this->current  = $s_entry;
+      }
     }
 
    
@@ -380,7 +382,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);
           }
@@ -427,7 +429,7 @@ 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]->krb_host_key->remove_from_parent_by_prefix($this->plugins[$name]->krb_service_prefix);
         }
         $this->plugins[$name]->remove_from_parent();
       }