Code

1e5e04976ea4b87560afc9d2f448bfb402e805a2
[gosa.git] / gosa-plugins / gofax / admin / systems / services / gofax / class_goFaxServer.inc
1 <?php
3 class goFaxServer extends goService {
4         
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";
13  
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;
26  
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[]= _("The attribute user is empty or contains invalid characters.");
69     }
70     if (empty($this->goFaxPassword)){
71       $message[]= _("The attribute password is empty or contains invalid characters.");
72     }
73     return($message);
74   }
75   
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   }
102 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
103 ?>