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