1 <?php
3 class goLogDBServer extends goService{
5 var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
6 var $cli_description = "Some longer text\nfor help";
7 var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
9 /* This plugin only writes its objectClass */
10 var $objectclasses = array("goLogDBServer");
11 var $attributes = array("goLogAdmin", "goLogPassword");
12 var $StatusFlag = "goLogDBServerStatus";
14 /* This class can't be assigned twice so it conflicts with itsself */
15 var $conflicts = array("goLogDBServer");
17 var $DisplayName = "";
18 var $dn = NULL;
19 var $acl;
20 var $cn = "";
21 var $goLogDBServerStatus = "";
22 var $goLogAdmin = "";
23 var $goLogPassword = "";
24 var $view_logged =FALSE;
27 function goLogDBServer(&$config,$dn)
28 {
29 goService::goService($config,$dn);
30 $this->DisplayName = _("Logging database");
31 }
34 function execute()
35 {
36 $smarty = get_smarty();
38 if($this->is_account && !$this->view_logged){
39 $this->view_logged = TRUE;
40 new log("view","server/".get_class($this),$this->dn);
41 }
43 $tmp = $this->plInfo();
44 foreach($tmp['plProvidedAcls'] as $name => $translation){
45 $smarty->assign($name."ACL",$this->getacl($name));
46 }
48 foreach($this->attributes as $attr){
49 $smarty->assign($attr,$this->$attr);
50 }
51 return($smarty->fetch(get_template_path("goLogDBServer.tpl",TRUE,dirname(__FILE__))));
52 }
55 function getListEntry()
56 {
57 $fields = goService::getListEntry();
58 $fields['Message'] = _("Logging database");
59 $fields['AllowEdit'] = true;
60 return($fields);
61 }
64 function check()
65 {
66 $message = plugin::check();
67 if (empty($this->goLogAdmin)){
68 $message[]= sprintf_("The attribute user is empty or contains invalid characters.");
69 }
70 if (empty($this->goLogPassword)){
71 $message[]= sprintf_("The attribute password is empty or contains invalid characters.");
72 }
73 return($message);
74 }
77 function save_object()
78 {
79 if(isset($_POST['goLogDBServerPosted'])){
80 plugin::save_object();
81 }
82 }
84 /* Return plugin informations for acl handling */
85 function plInfo()
86 {
87 return (array(
88 "plShortName" => _("Logging database"),
89 "plDescription" => _("Logging database")." ("._("Services").")",
90 "plSelfModify" => FALSE,
91 "plDepends" => array(),
92 "plPriority" => 97,
93 "plSection" => array("administration"),
94 "plCategory" => array("server"),
96 "plProvidedAcls"=> array(
97 "start" => _("Start"),
98 "stop" => _("Stop"),
99 "restart" => _("Restart"),
100 "goLogAdmin" => _("Admin"),
101 "goLogPassword" => _("Password"))
102 ));
103 }
104 }
105 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
106 ?>