• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilObjLdapGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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"]))  // formular sent
00060                 {
00061                         //init checking var
00062                         $form_valid = true;
00063                         
00064                         // do checks here!!!!
00065 
00066                         if (!$form_valid)       //required fields not satisfied. Set formular to already fill in values
00067                         {
00068                                 // ldap
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 // all required fields ok
00075                         {
00076 
00078                 // write new settings
00079 
00080                                 // ldap
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                                 // feedback
00089                                 sendInfo($this->lng->txt("saved_successfully"));
00090                         }
00091                 }
00092 
00094                 // setting language vars
00095 
00096                 // ldap
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                 // display formula data
00106 
00107                 // ldap
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 } // END class.ilObjLdapGUI
00120 ?>

Generated on Fri Dec 13 2013 09:06:34 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1