Code

Updated serverService : Set acl base/category for services
[gosa.git] / plugins / admin / systems / class_goLogDBServer.inc
1 <?php
2 require_once("class_goService.inc");
4 class goLogDBServer extends goService{
5         
6   var $cli_summary      = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
7   var $cli_description  = "Some longer text\nfor help";
8   var $cli_parameters   = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
10   /* This plugin only writes its objectClass */
11   var $objectclasses    = array("goLogDBServer");
12   var $attributes       = array("goLogAdmin", "goLogPassword");
13   var $StatusFlag       = "goLogDBServerStatus";
15   /* This class can't be assigned twice so it conflicts with itsself */
16   var $conflicts        = array("goLogDBServer");
18   var $DisplayName      = "";
19   var $dn               = NULL;
20   var $acl;
21   var $cn                   = "";
22   var $goLogDBServerStatus  = "";
23   var $goLogAdmin           = "";
24   var $goLogPassword        = "";  
27   function goLogDBServer($config,$dn)
28   {
29     plugin::plugin($config,$dn);
30     $this->DisplayName = _("Logging database");
31   }
34   function execute()
35   { 
36     $smarty = get_smarty(); 
37     foreach($this->attributes as $attr){
38       $smarty->assign($attr,$this->$attr);
39       $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
40     }
41     return($smarty->fetch(get_template_path("goLogDBServer.tpl",TRUE,dirname(__FILE__))));
42   }
45   function getListEntry()
46   {
47     $fields = goService::getListEntry();
48     $fields['Message']      = _("Logging database");
49     $fields['AllowEdit']    = true;
50     return($fields);
51   }
54   function check()
55   { 
56     $message = plugin::check();
57     if (empty($this->goLogAdmin)){
58       $message[]= sprintf_("The attribute user is empty or contains invalid characters.");
59     }
60     if (empty($this->goLogPassword)){
61       $message[]= sprintf_("The attribute password is empty or contains invalid characters.");
62     }
63     return($message);
64   }
67   function save_object()
68   {
69     if(isset($_POST['goLogDBServerPosted'])){
70       plugin::save_object();
71     }
72   } 
74   /* Return plugin informations for acl handling */
75   function plInfo()
76   {
77     return (array(
78           "plShortName"   => _("Log"),
79           "plDescription" => _("Log service"),
80           "plSelfModify"  => FALSE,
81           "plDepends"     => array(),
82           "plPriority"    => 0,
83           "plSection"     => array("administration"),
84           "plCategory"    => array("server"),
86           "plProvidedAcls"=> array(
87             "start"         => _("Start"),
88             "stop"          => _("Stop"),
89             "restart"       => _("Restart"),
90             "goLogAdmin"    => _("Admin"),
91             "goLogPassword" => _("Password"))
92           ));
93   }
94 }
95 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
96 ?>