Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00036 require_once "class.ilObjectGUI.php";
00037
00038 class ilObjLdapGUI extends ilObjectGUI
00039 {
00044 function ilObjLdapGUI($a_data,$a_id,$a_call_by_reference)
00045 {
00046 $this->type = "ldap";
00047 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference);
00048 }
00049
00050 function viewObject()
00051 {
00052 $this->lng->loadLanguageModule("ldap");
00053
00054 $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.ldap_basicdata.html");
00055 $this->tpl->setCurrentBlock("systemsettings");
00056
00057 $settings = $this->ilias->getAllSettings();
00058
00059 if (isset($_POST["save_settings"]))
00060 {
00061
00062 $form_valid = true;
00063
00064
00065
00066 if (!$form_valid)
00067 {
00068
00069 $settings["ldap_enable"] = $_POST["ldap_enable"];
00070 $settings["ldap_server"] = $_POST["ldap_server"];
00071 $settings["ldap_port"] = $_POST["ldap_port"];
00072 $settings["ldap_basedn"] = $_POST["ldap_basedn"];
00073 }
00074 else
00075 {
00076
00078
00079
00080
00081 $this->ilias->setSetting("ldap_enable",$_POST["ldap_enable"]);
00082 $this->ilias->setSetting("ldap_server",$_POST["ldap_server"]);
00083 $this->ilias->setSetting("ldap_port",$_POST["ldap_port"]);
00084 $this->ilias->setSetting("ldap_basedn",$_POST["ldap_basedn"]);
00085
00086 $settings = $this->ilias->getAllSettings();
00087
00088
00089 sendInfo($this->lng->txt("saved_successfully"));
00090 }
00091 }
00092
00094
00095
00096
00097 $this->tpl->setVariable("TXT_LDAP", $this->lng->txt("ldap"));
00098 $this->tpl->setVariable("TXT_LDAP_ENABLE", $this->lng->txt("enable"));
00099 $this->tpl->setVariable("TXT_LDAP_SERVER", $this->lng->txt("server"));
00100 $this->tpl->setVariable("TXT_LDAP_PORT", $this->lng->txt("port"));
00101 $this->tpl->setVariable("TXT_LDAP_BASEDN", $this->lng->txt("basedn"));
00102 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00103
00105
00106
00107
00108 if ($settings["ldap_enable"])
00109 {
00110 $this->tpl->setVariable("LDAP_ENABLE","checked=\"checked\"");
00111 }
00112
00113 $this->tpl->setVariable("LDAP_SERVER",$settings["ldap_server"]);
00114 $this->tpl->setVariable("LDAP_PORT",$settings["ldap_port"]);
00115 $this->tpl->setVariable("LDAP_BASEDN",$settings["ldap_basedn"]);
00116
00117 $this->tpl->parseCurrentBlock();
00118 }
00119 }
00120 ?>