From 598e2f7825e81f61fc71ec12a6253bd8113edcf6 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 11 Aug 2006 11:17:46 +0000 Subject: [PATCH] Only allow Start/Stop/Restart if it is allowed for this service git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4487 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_serverService.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/admin/systems/class_serverService.inc b/plugins/admin/systems/class_serverService.inc index b0065d6cf..57138cca8 100644 --- a/plugins/admin/systems/class_serverService.inc +++ b/plugins/admin/systems/class_serverService.inc @@ -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{ -- 2.30.2