diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc
index 338052b7e3b4a6e6b8b681d64ace29ab7cb4c64e..14ff1970e53462dfb6881e61aafb6e2c13578644 100644 (file)
<?php
<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
define("START_SERVICE",1);
define("STOP_SERVICE",2);
define("START_SERVICE",1);
define("STOP_SERVICE",2);
class ServerService extends plugin
{
class ServerService extends plugin
{
- /* CLI vars */
- var $cli_summary = "Manage server services";
- var $cli_description = "Managing services by adding,removing and configuring services. Allows to start/stop used services.";
- var $cli_parameters = array("config"=>"Config object" , "dn"=>"Object dn");
-
/* attribute list for save action */
var $ignore_account = TRUE;
var $attributes = array();
/* attribute list for save action */
var $ignore_account = TRUE;
var $attributes = array();
plugin::plugin($config);
$this->dn= $dn;
foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
plugin::plugin($config);
$this->dn= $dn;
foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
- $name= $plug['CLASS'];
- $this->plugin_names[]= $name;
- $this->plugins[$name]= new $name($config, $dn);
-
- /* Capture all service objectClases, necessary for acl handling */
- if(isset($this->plugins[$name]->objectclasses)){
- foreach($this->plugins[$name]->objectclasses as $oc){
- $this->objectclasses[] = $oc;
+
+ if(class_available($plug['CLASS'])){
+
+ $name= $plug['CLASS'];
+ $this->plugin_names[]= $name;
+ $this->plugins[$name]= new $name($config, $dn);
+
+ /* Capture all service objectClases, necessary for acl handling */
+ if(isset($this->plugins[$name]->objectclasses)){
+ foreach($this->plugins[$name]->objectclasses as $oc){
+ $this->objectclasses[] = $oc;
+ }
}
}
+ }else{
+ trigger_error("Service class missing: ".$plug['CLASS']);
}
}
$this->divList = new divListSystemService($config,$this);
}
}
$this->divList = new divListSystemService($config,$this);
$this->plugins[$s_entry] = $new_obj;
$this->plugins[$s_entry]->is_account = false;
}else{
$this->plugins[$s_entry] = $new_obj;
$this->plugins[$s_entry]->is_account = false;
}else{
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
}
}
}
}
}
}
$msgs = $this->dialog->check();
if(count($msgs)){
foreach($msgs as $msg){
$msgs = $this->dialog->check();
if(count($msgs)){
foreach($msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
}
}else{
$this->plugins[$this->current] = $this->dialog;
}
}else{
$this->plugins[$this->current] = $this->dialog;
{
/* Skip if this is a new server */
if($this->dn == "new"){
{
/* Skip if this is a new server */
if($this->dn == "new"){
- print_red(_("Can't set status while this server is not saved."));
+ msg_dialog::display(_("Information"), _("Cannot update service status until it has been saved!"), INFO_DIALOG);
return;
}
return;
}
}elseif($method == RESTART_SERVICE){
$action = SERVICE_RESTARTED;
}else{
}elseif($method == RESTART_SERVICE){
$action = SERVICE_RESTARTED;
}else{
- print_red(sprintf(_("The specified method '%s' can't executed for services."),$action));
+ msg_dialog::display(_("Error"), _("Cannot update service status!"), ERROR_DIALOG);
return;
}
return;
}
function save_object()
{
foreach($this->plugins as $name => $obj){
function save_object()
{
foreach($this->plugins as $name => $obj){
- if($obj->is_account){
- $this->plugins[$name]->save_object();
- }
+
+# if($obj->is_account){
+# $this->plugins[$name]->save_object();
+# }
}
}
}
}