Code

Updated terminal copy & paste
[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        = "";  
25   var $view_logged  =FALSE;
28   function goLogDBServer($config,$dn)
29   {
30     goService::goService($config,$dn);
31     $this->DisplayName = _("Logging database");
32   }
35   function execute()
36   { 
37     $smarty = get_smarty(); 
39     if($this->is_account && !$this->view_logged){
40       $this->view_logged = TRUE;
41       new log("view","server/".get_class($this),$this->dn);
42     }
44     $tmp = $this->plInfo();
45     foreach($tmp['plProvidedAcls'] as $name => $translation){
46       $smarty->assign($name."ACL",$this->getacl($name));
47     }
49     foreach($this->attributes as $attr){
50       $smarty->assign($attr,$this->$attr);
51     }
52     return($smarty->fetch(get_template_path("goLogDBServer.tpl",TRUE,dirname(__FILE__))));
53   }
56   function getListEntry()
57   {
58     $fields = goService::getListEntry();
59     $fields['Message']      = _("Logging database");
60     $fields['AllowEdit']    = true;
61     return($fields);
62   }
65   function check()
66   { 
67     $message = plugin::check();
68     if (empty($this->goLogAdmin)){
69       $message[]= sprintf_("The attribute user is empty or contains invalid characters.");
70     }
71     if (empty($this->goLogPassword)){
72       $message[]= sprintf_("The attribute password is empty or contains invalid characters.");
73     }
74     return($message);
75   }
78   function save_object()
79   {
80     if(isset($_POST['goLogDBServerPosted'])){
81       plugin::save_object();
82     }
83   } 
85   /* Return plugin informations for acl handling */
86   function plInfo()
87   {
88     return (array(
89           "plShortName"   => _("Logging database"),
90           "plDescription" => _("Logging database")." ("._("Services").")",
91           "plSelfModify"  => FALSE,
92           "plDepends"     => array(),
93           "plPriority"    => 97,
94           "plSection"     => array("administration"),
95           "plCategory"    => array("server"),
97           "plProvidedAcls"=> array(
98             "start"         => _("Start"),
99             "stop"          => _("Stop"),
100             "restart"       => _("Restart"),
101             "goLogAdmin"    => _("Admin"),
102             "goLogPassword" => _("Password"))
103           ));
104   }
106 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
107 ?>