Code

Added glpi service
[gosa.git] / plugins / admin / systems / class_goGlpiServer.inc
1 <?php
3 require_once("class_goService.inc");
5 class goGlpiServer extends goService {
6         
7   var $cli_summary      = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
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("goGlpiServer");
13   var $attributes       = array("goGlpiAdmin","goGlpiDatabase","goGlpiPassword");
14   var $StatusFlag       = "goGlpiServerStatus";
15  
16   /* This class can't be assigned twice so it conflicts with itsself */
17   var $conflicts        = array("goGlpiServer");
19   var $DisplayName      = "";
20   var $dn               = NULL;
21   var $cn               = "";
22   var $acl;
24   var $goGlpiServerStatus ="";
25   var $goGlpiAdmin        ="";
26   var $goGlpiDatabase     ="";
27   var $goGlpiPassword     ="";
28  
29  
30   function goGlpiServer($config,$dn)
31   {
32     plugin::plugin($config,$dn);
33     $this->DisplayName = _("Inventory database");
34   }
37   function execute()
38   { 
39     $smarty = get_smarty(); 
40     foreach($this->attributes as $attr){
41       $smarty->assign($attr,$this->$attr);
42     }
43     $tmp = $this->plInfo();
44     foreach($tmp['plProvidedAcls'] as $name => $translation ){
45       $smarty->assign($name."ACL",$this->getacl($name));
46     }
47     return($smarty->fetch(get_template_path("goGlpiServer.tpl",TRUE,dirname(__FILE__))));
48   }
51   function getListEntry()
52   {
53     $fields               = goService::getListEntry();
54     $fields['Message']    = _("Inventory database service");
55     $fields['AllowRemove']= true;
56     $fields['AllowEdit']  = true;
57     return($fields);
58   }
60   function check()
61   { 
62     $message = plugin::check();
63     if(empty($this->goGlpiAdmin)){
64       $message[]= _("The attribute user is empty or contains invalid characters.");
65     }
66     if(empty($this->goGlpiDatabase)){
67       $message[]= _("The attribute database is empty or contains invalid characters.");
68     }
69     return($message);
70   }
71   
73   function save_object()
74   {
75     if(isset($_POST['goLogDBServerPosted'])){
76       plugin::save_object();
77     }
78   } 
80   /* Return plugin informations for acl handling */
81   function plInfo()
82   {
83     return (array(
84           "plShortName"   => _("Glpi server"),
85           "plDescription" => _("Glpi server service"),
86           "plSelfModify"  => FALSE,
87           "plDepends"     => array(),
88           "plPriority"    => 0,
89           "plSection"     => array("administration"),
90           "plCategory"    => array("server"),
92           "plProvidedAcls"=> array(
93             "start"         => _("Start"),
94             "stop"          => _("Stop"),
95             "restart"       => _("Restart"),
97             "goGlpiAdmin"    => _("Admin"), 
98             "goGlpiDatabase" => _("Database"),
99             "goGlpiPassword" => _("Password"))
100           ));
101   }
103  
105 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
106 ?>