1 <?php
3 require_once("class_goService.inc");
5 class goKrbServer extends goService{
7 var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports NTP service.";
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("goKrbServer");
13 var $attributes = array("goKrbRealm", "goKrbAdmin","goKrbPassword");
14 var $StatusFlag = "goKrbServerStatus";
16 /* This class can't be assigned twice so it conflicts with itsself */
17 var $conflicts = array("goKrbServer");
19 var $DisplayName = "";
20 var $dn = NULL;
21 var $goKrbServerStatus= "";
22 var $cn ="";
23 var $goKrbRealm = "";
24 var $goKrbAdmin = "";
25 var $goKrbPassword ="";
26 var $view_logged =FALSE;
28 function goKrbServer($config,$dn)
29 {
30 goService::goService($config,$dn);
31 $this->DisplayName = _("Kerberos service");
32 }
35 function execute()
36 {
37 $smarty = get_smarty();
39 if($this->is_account && !$this->view_logged){
40 $this->view_logged = TRUE;
41 new log("view","server/".get_class($this),$this->dn);
42 }
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("goKrbServer.tpl",TRUE,dirname(__FILE__))));
53 }
56 function getListEntry()
57 {
58 $fields = goService::getListEntry();
59 $fields['Message'] = _("Kerberos service (kadmin access informations)");
60 $fields['AllowEdit'] = true;
61 return($fields);
62 }
64 function check()
65 {
66 $message = plugin::check();
67 /* goKrbPassword is a must field, if goKrbServer is used as objectClass */
68 if (empty($this->goKrbPassword)){
69 $message[]= sprintf(_("The specified kerberos password is empty."), $attr);
70 }
71 if (empty($this->goKrbAdmin)){
72 $message[]= sprintf(_("The specified kerberos admin is empty."), $attr);
73 }
74 if (empty($this->goKrbRealm)){
75 $message[]= sprintf(_("The specified kerberos realm is empty."), $attr);
76 }
78 return($message);
79 }
82 function save_object()
83 {
84 if(isset($_POST['goKrbServerPosted'])){
85 plugin::save_object();
86 }
87 }
89 /* Return plugin informations for acl handling */
90 function plInfo()
91 {
92 return (array(
93 "plShortName" => _("Kerberos"),
94 "plDescription" => _("Kerberos access information")." ("._("Services").")",
95 "plSelfModify" => FALSE,
96 "plDepends" => array(),
97 "plPriority" => 95,
98 "plSection" => array("administration"),
99 "plCategory" => array("server"),
101 "plProvidedAcls"=> array(
102 "goKrbRealm" => _("Realm"),
103 "goKrbAdmin" => _("Admin"),
104 "goKrbPassword" => _("Password"))
105 ));
106 }
107 }
108 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
109 ?>