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 = "";
24 var $view_logged =FALSE;
26 function goLdapServer($config,$dn)
27 {
28 goService::goService($config,$dn);
29 $this->DisplayName = _("LDAP service");
30 }
33 function execute()
34 {
36 if($this->is_account && !$this->view_logged){
37 $this->view_logged = TRUE;
38 @log::log("view","server/".get_class($this),$this->dn);
39 }
41 $smarty = get_smarty();
42 foreach($this->attributes as $attr){
43 $smarty->assign($attr,$this->$attr);
44 }
45 $tmp = $this->plInfo();
46 foreach($tmp['plProvidedAcls'] as $name => $translated){
47 $smarty->assign($name."ACL",$this->getacl($name));
48 }
49 return($smarty->fetch(get_template_path("goLdapServer.tpl",TRUE,dirname(__FILE__))));
50 }
53 function getListEntry()
54 {
55 $fields = goService::getListEntry();
56 $fields['Message'] = _("LDAP Service");
57 $fields['AllowEdit'] = true;
58 return($fields);
59 }
63 function check()
64 {
65 $message = plugin::check();
66 if(empty($this->goLdapBase)){
67 $message[] = _("The given base is empty or contains invalid characters.");
68 }
69 return($message);
70 }
73 function save_object()
74 {
75 if(isset($_POST['goLdapServerPosted'])){
76 plugin::save_object();
77 }
78 }
81 /* Return plugin informations for acl handling */
82 function plInfo()
83 {
84 return (array(
85 "plShortName" => _("Ldap"),
86 "plDescription" => _("Ldap")." ("._("Services").")",
87 "plSelfModify" => FALSE,
88 "plDepends" => array(),
89 "plPriority" => 96,
90 "plSection" => array("administration"),
91 "plCategory" => array("server"),
93 "plProvidedAcls"=> array(
94 "goLdapBase" => _("Ldap base"))
95 ));
96 }
97 }
98 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
99 ?>