Code

Only allow Start/Stop/Restart if it is allowed for this service
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 11:17:46 +0000 (11:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 11:17:46 +0000 (11:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4487 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_serverService.inc

index b0065d6cf0ca0c75d6cf06dac4662bbb9eb68087..57138cca822a692c1887f988ebdad9f2e9fb58f0 100644 (file)
@@ -283,8 +283,20 @@ class ServerService extends plugin
             $this->plugins[$name]->$var = $this->$var;  
           }
         }
-        if($this->plugins[$name]->initially_was_account && $this->plugins[$name]->is_account){
-          $this->plugins[$name]->setStatus($action);
+
+        /* check if services can be restarted */
+        $map =array(SERVICE_STARTED=> "AllowStart" ,
+                    SERVICE_STOPPED => "AllowStop",
+                    SERVICE_RESTARTED => "AllowRestart");
+
+        /* get plugins informations, restart/start/stop actions allowed ?*/
+        $tmp = $this->plugins[$name]->getListEntry();
+
+        /* Check if given action is allowed for this service */
+        if($tmp[$map[$action]]){
+          if($this->plugins[$name]->initially_was_account && $this->plugins[$name]->is_account){
+            $this->plugins[$name]->setStatus($action);
+          }
         }
       }
     }else{