1 <?php
3 require_once("class_goService.inc");
5 class goFaxServer extends goService {
7 var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports fax informations.";
8 var $cli_description = "Some longer text\nfor help";
9 var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
11 /* This plugin only writes its objectClass */
12 var $objectclasses = array("goFaxServer");
13 var $attributes = array("goFaxAdmin", "goFaxPassword");
14 var $StatusFlag = "goFaxServerStatus";
16 /* This class can't be assigned twice so it conflicts with itsself */
17 var $conflicts = array("goFaxServer");
19 var $DisplayName = "";
20 var $dn = NULL;
21 var $acl;
23 var $goFaxAdmin = "";
24 var $goFaxPassword = "";
25 var $goFaxServerStatus = "";
26 var $cn = "";
28 function goFaxServer($config,$dn)
29 {
30 plugin::plugin($config,$dn);
31 $this->DisplayName = _("FAX database");
32 }
35 function execute()
36 {
37 $smarty = get_smarty();
39 /* Assign acls */
40 $tmp = $this->plInfo();
41 foreach($tmp['plProvidedAcls'] as $name => $translation ){
42 $smarty->assign($name."ACL",$this->getacl($name));
43 }
45 foreach($this->attributes as $attr){
46 $smarty->assign($attr,$this->$attr);
47 }
48 return($smarty->fetch(get_template_path("goFaxServer.tpl",TRUE,dirname(__FILE__))));
49 }
52 function getListEntry()
53 {
54 $fields = goService::getListEntry();
55 $fields['Message'] = _("FAX database configuration");
56 $fields['AllowEdit'] = true;
57 return($fields);
58 }
60 function check()
61 {
62 $message = plugin::check();
63 if (empty($this->goFaxAdmin)){
64 $message[]= _("The attribute user is empty or contains invalid characters.");
65 }
66 if (empty($this->goFaxPassword)){
67 $message[]= _("The attribute password is empty or contains invalid characters.");
68 }
69 return($message);
70 }
73 function save_object()
74 {
75 if(isset($_POST['goFaxServerPosted'])){
76 plugin::save_object();
77 }
78 }
80 /* Return plugin informations for acl handling */
81 function plInfo()
82 {
83 return (array(
84 "plShortName" => _("Fax database"),
85 "plDescription" => _("Fax database")." ("._("Services").")",
86 "plSelfModify" => FALSE,
87 "plDepends" => array(),
88 "plPriority" => 99,
89 "plSection" => array("administration"),
90 "plCategory" => array("server"),
92 "plProvidedAcls"=> array(
93 "goFaxAdmin" => _("Login name"),
94 "goFaxPassword" => _("Password"))
95 ));
96 }
97 }
98 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
99 ?>