1 <?php
2 require_once("class_goService.inc");
4 class goLogDBServer extends goService{
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();
38 $tmp = $this->plInfo();
39 foreach($tmp['plProvidedAcls'] as $name => $translation){
40 $smarty->assign($name."ACL",$this->getacl($name));
41 }
43 foreach($this->attributes as $attr){
44 $smarty->assign($attr,$this->$attr);
45 }
46 return($smarty->fetch(get_template_path("goLogDBServer.tpl",TRUE,dirname(__FILE__))));
47 }
50 function getListEntry()
51 {
52 $fields = goService::getListEntry();
53 $fields['Message'] = _("Logging database");
54 $fields['AllowEdit'] = true;
55 return($fields);
56 }
59 function check()
60 {
61 $message = plugin::check();
62 if (empty($this->goLogAdmin)){
63 $message[]= sprintf_("The attribute user is empty or contains invalid characters.");
64 }
65 if (empty($this->goLogPassword)){
66 $message[]= sprintf_("The attribute password is empty or contains invalid characters.");
67 }
68 return($message);
69 }
72 function save_object()
73 {
74 if(isset($_POST['goLogDBServerPosted'])){
75 plugin::save_object();
76 }
77 }
79 /* Return plugin informations for acl handling */
80 function plInfo()
81 {
82 return (array(
83 "plShortName" => _("Logging database"),
84 "plDescription" => _("Logging database")." ("._("Services").")",
85 "plSelfModify" => FALSE,
86 "plDepends" => array(),
87 "plPriority" => 97,
88 "plSection" => array("administration"),
89 "plCategory" => array("server"),
91 "plProvidedAcls"=> array(
92 "start" => _("Start"),
93 "stop" => _("Stop"),
94 "restart" => _("Restart"),
95 "goLogAdmin" => _("Admin"),
96 "goLogPassword" => _("Password"))
97 ));
98 }
99 }
100 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
101 ?>