Code

Updated logging
[gosa.git] / plugins / admin / systems / class_gosaLogServer.inc
1 <?php
2 require_once("class_goService.inc");
4 class gosaLogServer extends goService{
5         
6   /* This plugin only writes its objectClass */
7   var $objectclasses    = array("gosaLogServer");
8   var $attributes       = array("cn","goLogDB","goLogDBUser","goLogDBPassword");
9   var $StatusFlag       = "";
11   /* This class can't be assigned twice so it conflicts with itsself */
12   var $conflicts        = array("gosaLogServer");
14   var $DisplayName      = "";
15   var $dn               = NULL;
16   var $acl;
17   var $cn                 = "";
18   var $goLogDBServerStatus= "";
19   var $goLogDBUser        = "";
20   var $goLogDBPassword    = "";  
21   var $goLogDB            = "";  
24   function gosaLogServer($config,$dn)
25   {
26     goService::goService($config,$dn);
27     $this->DisplayName = _("GOsa logging service");
28   }
31   function execute()
32   { 
33     $smarty = get_smarty(); 
35     $tmp = $this->plInfo();
36     foreach($tmp['plProvidedAcls'] as $name => $translation){
37       $smarty->assign($name."ACL",$this->getacl($name));
38     }
40     foreach($this->attributes as $attr){
41       $smarty->assign($attr,$this->$attr);
42     }
43     return($smarty->fetch(get_template_path("gosaLogServer.tpl",TRUE,dirname(__FILE__))));
44   }
47   function getListEntry()
48   {
49     $fields = goService::getListEntry();
50     $fields['Message']      = _("GOsa logging service");
51     $fields['AllowEdit']    = true;
52     $fields['AllowStart']   = FALSE;
53     $fields['AllowStop']    = FALSE;
54     $fields['AllowRestart'] = FALSE;
55     return($fields);
56   }
59   function check()
60   { 
61     $message = plugin::check();
62     if (empty($this->goLogDBUser)){
63       $message[]= sprintf_("The attribute user is empty or contains invalid characters.");
64     }
65     if (empty($this->goLogDBPassword)){
66       $message[]= sprintf_("The attribute password is empty or contains invalid characters.");
67     }
68     if (empty($this->goLogDB)){
69       $message[]= sprintf_("The attribute database is empty or contains invalid characters.");
70     }
71     return($message);
72   }
75   function save_object()
76   {
77     if(isset($_POST['gosaLogServerPosted'])){
78       plugin::save_object();
79     }
80   } 
82   /* Return plugin informations for acl handling */
83   function plInfo()
84   {
85     return (array(
86           "plShortName"   => _("GOsa logging service"),
87           "plDescription" => _("GOsa logging service")." ("._("Services").")",
88           "plSelfModify"  => FALSE,
89           "plDepends"     => array(),
90           "plPriority"    => 98,
91           "plSection"     => array("administration"),
92           "plCategory"    => array("server"),
94           "plProvidedAcls"=> array(
95             "goLogDB"         => _("Database"),
96             "goLogDBUser"     => _("User"),
97             "goLogDBPassword" => _("Password")) 
98           ));
99   }
101 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
102 ?>