2043c0bd247f77ee8a4dfa79c69ed19fb890cb38
1 <?php
3 class goFaxServer extends goService {
5 var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports fax informations.";
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("goFaxServer");
11 var $attributes = array("goFaxAdmin", "goFaxPassword");
12 var $StatusFlag = "goFaxServerStatus";
14 /* This class can't be assigned twice so it conflicts with itsself */
15 var $conflicts = array("goFaxServer");
17 var $DisplayName = "";
18 var $dn = NULL;
19 var $acl;
21 var $goFaxAdmin = "";
22 var $goFaxPassword = "";
23 var $goFaxServerStatus = "";
24 var $cn = "";
25 var $view_logged =FALSE;
27 function goFaxServer(&$config,$dn)
28 {
29 goService::goService($config,$dn);
30 $this->DisplayName = _("FAX 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 /* Assign acls */
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("goFaxServer.tpl",TRUE,dirname(__FILE__))));
53 }
56 function getListEntry()
57 {
58 $fields = goService::getListEntry();
59 $fields['Message'] = _("FAX database configuration");
60 $fields['AllowEdit'] = true;
61 return($fields);
62 }
64 function check()
65 {
66 $message = plugin::check();
67 if (empty($this->goFaxAdmin)){
68 $message[]= msgPool::required(_("User"));
69 }
70 if (empty($this->goFaxPassword)){
71 $message[]= msgPool::required(_("Password"));
72 }
73 return($message);
74 }
77 function save_object()
78 {
79 if(isset($_POST['goFaxServerPosted'])){
80 plugin::save_object();
81 }
82 }
84 /* Return plugin informations for acl handling */
85 static function plInfo()
86 {
87 return (array(
88 "plShortName" => _("Fax database"),
89 "plDescription" => _("Fax database")." ("._("Services").")",
90 "plSelfModify" => FALSE,
91 "plDepends" => array(),
92 "plPriority" => 99,
93 "plSection" => array("administration"),
94 "plCategory" => array("server"),
96 "plProvidedAcls"=> array(
97 "goFaxAdmin" => _("Login name"),
98 "goFaxPassword" => _("Password"))
99 ));
100 }
101 }
102 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
103 ?>