Code

Updated trunk, introduced gosa-core
[gosa.git] / plugins / admin / systems / services / kerberos / class_goKrbServer.inc
1 <?php
3 class goKrbServer extends goService{
4         
5   var $cli_summary      = "This pluign is used within the ServerService Pluign \nand indicates that this server supports NTP service.";
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("goKrbServer");
11   var $attributes       = array("goKrbRealm", "goKrbAdmin","goKrbPassword");
12   var $StatusFlag       = "goKrbServerStatus";
13  
14   /* This class can't be assigned twice so it conflicts with itsself */
15   var $conflicts        = array("goKrbServer");
17   var $DisplayName      = "";
18   var $dn               = NULL;
19   var $goKrbServerStatus= "";
20   var $cn               ="";
21   var $goKrbRealm     = "";
22   var $goKrbAdmin     = "";
23   var $goKrbPassword  ="";  
24   var $view_logged  =FALSE;
25  
26   function goKrbServer(&$config,$dn)
27   {
28     goService::goService($config,$dn);
29     $this->DisplayName = _("Kerberos service");
30   }
33   function execute()
34   { 
35     $smarty = get_smarty(); 
37     if($this->is_account && !$this->view_logged){
38       $this->view_logged = TRUE;
39       new log("view","server/".get_class($this),$this->dn);
40     }
42     $tmp = $this->plinfo();
43     foreach($tmp['plProvidedAcls'] as $name => $translation){
44       $smarty->assign($name."ACL",$this->getacl($name));
45     }
47     foreach($this->attributes as $attr){
48       $smarty->assign($attr,$this->$attr);
49     }
50     return($smarty->fetch(get_template_path("goKrbServer.tpl",TRUE,dirname(__FILE__))));
51   }
54   function getListEntry()
55   {
56     $fields               = goService::getListEntry();
57     $fields['Message']    = _("Kerberos service (kadmin access informations)");
58     $fields['AllowEdit']  = true;
59     return($fields);
60   }
62   function check()
63   { 
64     $message = plugin::check();
65     /* goKrbPassword is a must field, if goKrbServer is used as objectClass */
66     if (empty($this->goKrbPassword)){
67       $message[]= sprintf(_("The specified kerberos password is empty."), $attr);
68     }
69     if (empty($this->goKrbAdmin)){
70       $message[]= sprintf(_("The specified kerberos admin is empty."), $attr);
71     }
72     if (empty($this->goKrbRealm)){
73       $message[]= sprintf(_("The specified kerberos realm is empty."), $attr);
74     }
76     return($message);
77   }
78   
80   function save_object()
81   {
82     if(isset($_POST['goKrbServerPosted'])){
83       plugin::save_object();
84     }
85   } 
87     /* Return plugin informations for acl handling */
88   static function plInfo()
89   {
90     return (array(
91           "plShortName"   => _("Kerberos"),
92           "plDescription" => _("Kerberos access information")." ("._("Services").")",
93           "plSelfModify"  => FALSE,
94           "plDepends"     => array(),
95           "plPriority"    => 95,
96           "plSection"     => array("administration"),
97           "plCategory"    => array("server"),
99           "plProvidedAcls"=> array(
100             "goKrbRealm"    => _("Realm"), 
101             "goKrbAdmin"    => _("Admin"),
102             "goKrbPassword" => _("Password"))
103           ));
104   }
106 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
107 ?>