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 ="";
27 function goKrbServer($config,$dn)
28 {
29 plugin::plugin($config,$dn);
30 $this->DisplayName = _("Kerberos service");
31 }
34 function execute()
35 {
36 $smarty = get_smarty();
38 $tmp = $this->plinfo();
39 foreach($tmp['plProvidedAcls'] as $name => $translation){
40 $smarty->assign($name."ACL",$this->getacl($name));
41 }
43 foreach($this->attributes as $attr){
44 $smarty->assign($attr,$this->$attr);
45 }
46 return($smarty->fetch(get_template_path("goKrbServer.tpl",TRUE,dirname(__FILE__))));
47 }
50 function getListEntry()
51 {
52 $fields = goService::getListEntry();
53 $fields['Message'] = _("Kerberos service (kadmin access informations)");
54 $fields['AllowEdit'] = true;
55 return($fields);
56 }
58 function check()
59 {
60 $message = plugin::check();
61 /* goKrbPassword is a must field, if goKrbServer is used as objectClass */
62 if (empty($this->goKrbPassword)){
63 $message[]= sprintf(_("The specified kerberos password is empty."), $attr);
64 }
65 if (empty($this->goKrbAdmin)){
66 $message[]= sprintf(_("The specified kerberos admin is empty."), $attr);
67 }
68 if (empty($this->goKrbRealm)){
69 $message[]= sprintf(_("The specified kerberos realm is empty."), $attr);
70 }
72 return($message);
73 }
76 function save_object()
77 {
78 if(isset($_POST['goKrbServerPosted'])){
79 plugin::save_object();
80 }
81 }
83 /* Return plugin informations for acl handling */
84 function plInfo()
85 {
86 return (array(
87 "plShortName" => _("Kerberos"),
88 "plDescription" => _("Kerberos access information")." ("._("Services").")",
89 "plSelfModify" => FALSE,
90 "plDepends" => array(),
91 "plPriority" => 95,
92 "plSection" => array("administration"),
93 "plCategory" => array("server"),
95 "plProvidedAcls"=> array(
96 "goKrbRealm" => _("Realm"),
97 "goKrbAdmin" => _("Admin"),
98 "goKrbPassword" => _("Password"))
99 ));
100 }
101 }
102 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
103 ?>