Code

Added a first set of reference changes - nearly untested
[gosa.git] / plugins / admin / systems / class_goFaxServer.inc
1 <?php
3 require_once("class_goService.inc");
5 class goFaxServer extends goService {
6         
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";
15  
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                 = "";
27   var $view_logged  =FALSE;
28  
29   function goFaxServer(&$config,$dn)
30   {
31     goService::goService($config,$dn);
32     $this->DisplayName = _("FAX database");
33   }
36   function execute()
37   { 
38     $smarty = get_smarty(); 
40     if($this->is_account && !$this->view_logged){
41       $this->view_logged = TRUE;
42       new log("view","server/".get_class($this),$this->dn);
43     }
45     /* Assign acls */
46     $tmp = $this->plInfo();
47     foreach($tmp['plProvidedAcls'] as $name => $translation ){
48       $smarty->assign($name."ACL",$this->getacl($name));
49     }
51     foreach($this->attributes as $attr){
52       $smarty->assign($attr,$this->$attr);
53     }
54     return($smarty->fetch(get_template_path("goFaxServer.tpl",TRUE,dirname(__FILE__))));
55   }
58   function getListEntry()
59   {
60     $fields               = goService::getListEntry();
61     $fields['Message']    = _("FAX database configuration");
62     $fields['AllowEdit']  = true;
63     return($fields);
64   }
66   function check()
67   { 
68     $message = plugin::check();
69     if (empty($this->goFaxAdmin)){
70       $message[]= _("The attribute user is empty or contains invalid characters.");
71     }
72     if (empty($this->goFaxPassword)){
73       $message[]= _("The attribute password is empty or contains invalid characters.");
74     }
75     return($message);
76   }
77   
79   function save_object()
80   {
81     if(isset($_POST['goFaxServerPosted'])){
82       plugin::save_object();
83     }
84   } 
86   /* Return plugin informations for acl handling */
87   function plInfo()
88   {
89     return (array(
90           "plShortName"   => _("Fax database"),
91           "plDescription" => _("Fax database")." ("._("Services").")",
92           "plSelfModify"  => FALSE,
93           "plDepends"     => array(),
94           "plPriority"    => 99,
95           "plSection"     => array("administration"),
96           "plCategory"    => array("server"),
98           "plProvidedAcls"=> array(
99              "goFaxAdmin"     => _("Login name"),
100              "goFaxPassword"  => _("Password"))
101           ));
102   }
104 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
105 ?>