1 <?php
3 require_once("class_goService.inc");
5 class goLdapServer extends goService{
7 var $cli_summary = "This plugin is used within the ServerService Pluign \nand indicates that this server has goLdapServer defined.";
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("goLdapServer");
13 var $attributes = array("goLdapBase");
14 var $StatusFlag = "goLdapServerStatus";
16 /* This class can't be assigned twice so it conflicts with itsself */
17 var $conflicts = array("goLdapServer");
19 var $DisplayName = "";
20 var $dn = NULL;
21 var $cn = "";
22 var $goLdapServerStatus = "";
23 var $goLdapBase = "";
25 function goLdapServer($config,$dn)
26 {
27 plugin::plugin($config,$dn);
28 $this->DisplayName = _("LDAP service");
29 }
32 function execute()
33 {
34 $smarty = get_smarty();
35 foreach($this->attributes as $attr){
36 $smarty->assign($attr,$this->$attr);
37 }
38 $tmp = $this->plInfo();
39 foreach($tmp['plProvidedAcls'] as $name => $translated){
40 $smarty->assign($name."ACL",$this->getacl($name));
41 }
42 return($smarty->fetch(get_template_path("goLdapServer.tpl",TRUE,dirname(__FILE__))));
43 }
46 function getListEntry()
47 {
48 $fields = goService::getListEntry();
49 $fields['Message'] = _("LDAP Service");
50 $fields['AllowEdit'] = true;
51 return($fields);
52 }
56 function check()
57 {
58 $message = plugin::check();
59 if(empty($this->goLdapBase)){
60 $message[] = _("The given base is empty or contains invalid characters.");
61 }
62 return($message);
63 }
66 function save_object()
67 {
68 if(isset($_POST['goLdapServerPosted'])){
69 plugin::save_object();
70 }
71 }
74 /* Return plugin informations for acl handling */
75 function plInfo()
76 {
77 return (array(
78 "plShortName" => _("Ldap"),
79 "plDescription" => _("Ldap")." ("._("Services").")",
80 "plSelfModify" => FALSE,
81 "plDepends" => array(),
82 "plPriority" => 96,
83 "plSection" => array("administration"),
84 "plCategory" => array("server"),
86 "plProvidedAcls"=> array(
87 "goLdapBase" => _("Ldap base"))
88 ));
89 }
90 }
91 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
92 ?>