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

setup/classes/class.ilSetupGUI.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 
00034 require_once "class.ilSetup.php";
00035 
00036 class ilSetupGUI extends ilSetup
00037 {
00038         var $tpl;       // template object
00039         var $lng;       // language objet
00040         var $log;       // log object
00041         
00042         var $btn_prev_on = false;   // toggle previous button on/off
00043         var $btn_prev_cmd;          // command processed when previous button was clicked
00044         var $btn_prev_lng;          // previous button label
00045 
00046         var $btn_next_on = false;   // toggle NEXT button on/off
00047         var $btn_next_cmd;          // command processed when next button was clicked
00048         var $btn_next_lng;          // next button label
00049 
00050         var $revision;              // cvs revision of this script
00051         var $version;               // cvs version of this script
00052         var $lang;                  // current language (lang_key)
00053 
00054         var $cmd;                       // command variable
00055         var $display_mode = "view";     // view mode (setup or details)
00056 
00061         function ilSetupGUI()
00062         {
00063                 global $tpl, $lng;
00064 
00065                 $this->tpl =& $tpl;
00066                 $this->lng =& $lng;
00067 
00068                 // CVS - REVISION - DO NOT MODIFY
00069                 $this->revision = '$Revision: 14351 $';
00070                 $this->version = "2 ".substr(substr($this->revision,1),0,-2);
00071                 $this->lang = $this->lng->lang_key;
00072 
00073                 // init setup
00074                 $this->ilSetup($_SESSION["auth"],$_SESSION["access_mode"]);
00075 
00076                 // init client object if exists
00077                 $client_id = ($_GET["client_id"]) ? $_GET["client_id"] : $_SESSION["ClientId"];
00078 
00079                 // for security
00080                 if (!$this->isAdmin() and $client_id != $_SESSION["ClientId"])
00081                 {
00082                         $client_id = $_SESSION["ClientId"];
00083                 }
00084 
00085                 $this->ini_client_exists = $this->newClient($client_id);
00086                 $this->client->status = $this->getStatus();
00087 
00088                 // determine command
00089                 if (($this->cmd = $_GET["cmd"]) == "gateway")
00090                 {
00091                         // surpress warning if POST is not set
00092                         @$this->cmd = key($_POST["cmd"]);
00093                 }
00094 
00095                 // determine display mode here
00096                 // TODO: depending on previous setting (session)
00097                 // OR switch to 'setup'-mode if someone logs in as client and client's setup wasn't finished (-> entry in settings table does not exist)
00098                 if ($this->isAuthenticated() and !$this->client->status["finish"]["status"] and $this->cmd != "clientlist" and $this->cmd != "")
00099                 {
00100                         $this->setDisplayMode("setup");
00101                 }
00102                 else
00103                 {
00104                         $this->setDisplayMode($_SESSION["display_mode"]);
00105                 }
00106 
00107                 // output starts here
00108 
00109                 // display header
00110                 $this->displayHeader();
00111 
00112                 // main cmd handling
00113                 if (!$this->isAuthenticated() or !$this->isInstalled())
00114                 {
00115                         // check for first time installation or migrate an old one first
00116                         if (!$this->isInstalled() or !($this->ini->readVariable("clients","path")))
00117                         {
00118                                 $this->cmdInstall();
00119                         }
00120                         else
00121                         {
00122                                 $this->displayLogin();
00123                         }
00124                 }
00125                 else
00126                 {
00127                         if ($this->isAdmin())
00128                         {
00129                                 $this->cmdAdmin();
00130                         }
00131                         else
00132                         {
00133                                 $this->cmdClient();
00134                         }
00135                 }
00136 
00137                 if (DEBUG)
00138                 {
00139                         echo "cmd: ".$this->cmd." | access: ".$this->access_mode." | display: ".$this->display_mode;
00140                         var_dump($this->client->status);
00141                 }
00142 
00143                 // display footer
00144                 $this->displayFooter();
00145 
00146                 // end output
00147 
00148         }  // end constructor
00149 
00150         // cmd subsets
00151 
00155         function cmdInstall()
00156         {
00157                 switch ($this->cmd)
00158                 {
00159                         case NULL:
00160                         case "preliminaries":
00161                                 $this->checkPreliminaries();
00162                                 $this->displayPreliminaries();
00163                                 break;
00164 
00165                         case "install":
00166                                 $this->displayMasterSetup();
00167                                 break;
00168 
00169                         default:
00170                                 $this->displayError($this->lng->txt("unknown_command"));
00171                                 break;
00172                 }
00173         }
00174 
00178         function cmdAdmin()
00179         {
00180                 switch ($this->cmd)
00181                 {
00182                         case NULL:
00183                         case "clientlist":
00184                                 $this->setDisplayMode("view");
00185                                 $this->displayClientList();
00186                                 break;
00187 
00188                         case "changepassword":
00189                                 $this->setDisplayMode("view");
00190                                 $this->changeMasterPassword();
00191                                 break;
00192 
00193                         case "mastersettings":
00194                                 $this->setDisplayMode("view");
00195                                 $this->changeMasterSettings();
00196                                 break;
00197 
00198                         case "changedefault":
00199                                 $this->changeDefaultClient();
00200                                 break;  
00201 
00202                         case "newclient":
00203                                 $this->cmd = "ini";
00204                                 $this->setDisplayMode("setup");
00205                                 $this->ini_client_exists = $this->newClient();
00206                                 $this->displayIni();
00207                                 break;  
00208 
00209                         case "startup":
00210                                 $this->setDisplayMode("setup");
00211                                 $this->ini_client_exists = $this->newClient();
00212                                 $this->displayStartup();
00213                                 break;
00214 
00215                         case "delete":
00216                                 $this->setDisplayMode("view");
00217                                 $this->displayDeleteConfirmation();
00218                                 break;
00219 
00220                         case "togglelist":
00221                                 $this->setDisplayMode("view");
00222                                 $this->toggleClientList();
00223                                 break;
00224 
00225                         default:
00226                                 $this->cmdClient();
00227                                 break;
00228                 }
00229         }
00230         
00234         function cmdClient()
00235         {
00236                 switch ($this->cmd)
00237                 {
00238                         case NULL:
00239                         case "view":
00240                                 if ($this->client->db_installed)
00241                                 {
00242                                         $this->setDisplayMode("view"); 
00243                                         $this->displayClientOverview();
00244                                 }
00245                                 else
00246                                 {
00247                                         $this->cmd = "db";
00248                                         $this->displayDatabase();
00249                                 }
00250                                 break;
00251                                 
00252                         case "ini":
00253                                 // only allow access to ini if db does not exist yet
00254                                 if ($this->client->db_installed)
00255                                 {
00256                                         $this->cmd = "db";
00257                                         $this->displayDatabase();
00258                                 }
00259                                 else
00260                                 {
00261                                         $this->displayIni();
00262                                 }
00263                                 break;
00264                                 
00265                         case "db":
00266                                 $this->displayDatabase();
00267                                 break;
00268         
00269                         case "lang":
00270                                 if (!isset($_GET["lang"]) and !$this->client->status["finish"]["status"] and $_GET["cmd"] == "lang" and $this->error === true)
00271                                 {
00272                                         $this->jumpToFirstUnfinishedSetupStep();
00273                                 }
00274                                 else
00275                                 {
00276                                         $this->displayLanguages();
00277                                 }
00278                                 break;
00279 
00280                         case "contact":
00281                                 if (!isset($_GET["lang"]) and !$this->client->status["finish"]["status"] and $_GET["cmd"] == "contact")
00282                                 {
00283                                         $this->jumpToFirstUnfinishedSetupStep();
00284                                 }
00285                                 else
00286                                 {
00287                                         $this->displayContactData();
00288                                 }
00289                                 break;
00290         
00291                         case "nic":
00292                                 if (!isset($_GET["lang"]) and !$this->client->status["finish"]["status"] and $_GET["cmd"] == "nic")
00293                                 {
00294                                         $this->jumpToFirstUnfinishedSetupStep();
00295                                 }
00296                                 else
00297                                 {
00298                                         $this->displayNIC();
00299                                 }
00300                                 break;
00301         
00302                         case "finish":
00303                                 if (!isset($_GET["lang"]) and !$this->client->status["finish"]["status"] and $_GET["cmd"] == "finish")
00304                                 {
00305                                         $this->jumpToFirstUnfinishedSetupStep();
00306                                 }
00307                                 else
00308                                 {
00309                                         $this->displayFinishSetup();
00310                                 }
00311                                 break;
00312 
00313                         case "changeaccess":
00314                                 $this->changeAccessMode($_GET["back"]);
00315                                 break;
00316 
00317                         case "logout":
00318                                 $this->displayLogout();
00319                                 break;
00320 
00321                         case "login":
00322                                 session_destroy();
00323                                 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->client->getId());
00324                                 break;
00325 
00326                         case "login_new":
00327                                 if ($this->client->ini->readVariable("client","access") != "1")
00328                                 {
00329                                         $this->client->ini->setVariable("client","access","1");
00330                                         $this->client->ini->write();
00331                                 }
00332 
00333                                 session_destroy();
00334                                 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->client->getId());
00335                                 break;
00336 
00337                         case "tools":
00338                                 $this->displayTools();
00339                                 break;
00340                                 
00341                         case "reloadStructure":
00342                                 $this->reloadControlStructure();
00343                                 break;
00344 
00345                         default:
00346                                 $this->displayError($this->lng->txt("unknown_command"));
00347                                 break;
00348                 }
00349         }
00350 
00351         // end cmd subsets 
00352 
00356         function displayClientOverview()
00357         {       
00358                 $this->checkDisplayMode();
00359         
00360                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.client_overview.html");
00361 
00362                 if ($this->client->db_installed)
00363                 {
00364                         $settings = $this->client->getAllSettings();
00365                 }
00366                 
00367                 $txt_no_database = $this->lng->txt("no_database");
00368 
00369                 $access_status = ($this->client->status["access"]["status"]) ? "online" : "disabled";
00370                 $access_button = ($this->client->status["access"]["status"]) ? "disable" : "enable";
00371                 $access_link = "&nbsp;&nbsp;[<a href=\"setup.php?cmd=changeaccess&client_id=".$this->client->getId()."&back=view\">".$this->lng->txt($access_button)."</a>]";
00372                 
00373                 // basic data
00374                 $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("client_info"));
00375                 $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
00376                 $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("ilias_nic_id"));
00377                 $this->tpl->setVariable("TXT_CLIENT_ID2", $this->lng->txt("client_id"));
00378                 $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
00379                 $this->tpl->setVariable("TXT_ACCESS_STATUS", $this->lng->txt("access_status"));
00380                 
00381                 $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_info"));
00382                 $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
00383                 $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
00384                 $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
00385                 $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
00386                 $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
00387                 $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
00388                 $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
00389                 $this->tpl->setVariable("TXT_DEFAULT_LANGUAGE", $this->lng->txt("default_language"));
00390                 $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
00391                 $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
00392 
00393                 // paths
00394                 $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
00395                 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
00396                 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
00397                 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
00398                 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
00399                 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
00400                 $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
00401                 $this->tpl->setVariable("TXT_VIRUS_SCANNER", $this->lng->txt("virus_scanner"));
00402                 $this->tpl->setVariable("TXT_SCAN_COMMAND", $this->lng->txt("scan_command"));
00403                 $this->tpl->setVariable("TXT_CLEAN_COMMAND", $this->lng->txt("clean_command"));
00404 
00405                 // display formula data
00406 
00407                 // client data
00408                 $this->tpl->setVariable("INST_ID",($this->client->db_installed) ? $settings["inst_id"] : $txt_no_database);
00409                 $this->tpl->setVariable("CLIENT_ID2",$this->client->getId());
00410                 $this->tpl->setVariable("INST_NAME",($this->client->getName()) ? $this->client->getName() : "&lt;".$this->lng->txt("no_client_name")."&gt;");
00411                 $this->tpl->setVariable("INST_INFO",$this->client->getDescription());
00412                 $this->tpl->setVariable("DB_VERSION",($this->client->db_installed) ? $settings["db_version"] : $txt_no_database);
00413                 $this->tpl->setVariable("ACCESS_STATUS",$this->lng->txt($access_status).$access_link);
00414 
00415                 // server data
00416                 $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
00417                 $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
00418                 $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
00419                 $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
00420                 $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]);  // not used
00421                 $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
00422                 $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
00423                 $this->tpl->setVariable("ILIAS_VERSION", ILIAS_VERSION);
00424 
00425                 $this->tpl->setVariable("FEEDBACK_RECIPIENT",($this->client->db_installed) ? $settings["feedback_recipient"] : $txt_no_database);
00426                 $this->tpl->setVariable("ERROR_RECIPIENT",($this->client->db_installed) ? $settings["error_recipient"] : $txt_no_database);
00427 
00428                 // paths to tools
00429                 $not_set = $this->lng->txt("path_not_set");
00430                                 
00431                 $convert = $this->ini->readVariable("tools","convert");
00432                 $zip = $this->ini->readVariable("tools","zip");
00433                 $unzip = $this->ini->readVariable("tools","unzip");
00434                 $java = $this->ini->readVariable("tools","java");
00435                 $htmldoc = $this->ini->readVariable("tools","htmldoc");
00436                 $latex = $this->ini->readVariable("tools", "latex");
00437                 $vscan = $this->ini->readVariable("tools","vscantype");
00438                 $scancomm = $this->ini->readVariable("tools","scancommand");
00439                 $cleancomm = $this->ini->readVariable("tools","cleancommand");
00440                 
00441                 $this->tpl->setVariable("CONVERT_PATH",($convert) ? $convert : $not_set);
00442                 $this->tpl->setVariable("ZIP_PATH",($zip) ? $zip : $not_set);
00443                 $this->tpl->setVariable("UNZIP_PATH",($unzip) ? $unzip : $not_set);
00444                 $this->tpl->setVariable("JAVA_PATH",($java) ? $java : $not_set);
00445                 $this->tpl->setVariable("HTMLDOC_PATH",($htmldoc) ? $htmldoc : $not_set);
00446                 $this->tpl->setVariable("LATEX_URL",($latex) ? $latex : $not_set);
00447                 $this->tpl->setVariable("VAL_SCAN_COMMAND",($scancomm) ? $scancomm : $not_set);
00448                 $this->tpl->setVariable("VAL_CLEAN_COMMAND",($cleancomm) ? $cleancomm : $not_set);
00449                 $this->tpl->setVariable("VAL_VIRUS_SCANNER",($vscan) ? $vscan : $not_set);
00450 
00451                 $this->tpl->parseCurrentBlock();
00452 
00453                 $this->displayStatusPanel();
00454         }
00455 
00464         function setDisplayMode($a_mode)
00465         {
00466                 // security
00467                 if ($a_mode != "view" and $a_mode != "setup")
00468                 {
00469                         return false;
00470                 }
00471 
00472                 $this->display_mode = $a_mode;
00473                 $_SESSION["display_mode"] = $this->display_mode;
00474                 
00475                 return true;
00476         }
00477         
00481         function displayHeader()
00482         {
00483                 $languages = $this->lng->getLanguages();
00484 
00485                 $count = (int) round(count($languages) / 2);
00486                 $num = 1;
00487 
00488                 foreach ($languages as $lang_key)
00489                 {
00490                         if ($num === $count)
00491                         {
00492                                 $this->tpl->touchBlock("lng_new_row");
00493                         }
00494 
00495                         $this->tpl->setCurrentBlock("languages");
00496                         $this->tpl->setVariable("LINK_LANG", "./setup.php?cmd=".$this->cmd."&amp;lang=".$lang_key);
00497                         $this->tpl->setVariable("LANG_NAME", $this->lng->txt("meta_l_".$lang_key));
00498                         $this->tpl->setVariable("LANG_ICON", $lang_key);
00499                         $this->tpl->setVariable("LANG_KEY", $lang_key);
00500                         $this->tpl->setVariable("BORDER", 0);
00501                         $this->tpl->setVariable("VSPACE", 0);
00502                         $this->tpl->parseCurrentBlock();
00503 
00504                         $num++;
00505                 }
00506 
00507                 if (count($languages) % 2)
00508                 {
00509                         $this->tpl->touchBlock("lng_empty_cell");
00510                 }
00511 
00512                 if ($this->cmd != "logout" and $this->isInstalled())
00513                 {
00514                         // add client link
00515                         if ($this->isAdmin())
00516                         {
00517                                 if ($this->display_mode == "view" or $this->cmd == "clientlist" or $this->cmd == "changepassword" or $this->cmd == "mastersettings")
00518                                 {
00519                                         $this->tpl->setCurrentBlock("add_client");
00520                                         $this->tpl->setVariable("TXT_ADD_CLIENT",ucfirst($this->lng->txt("new")));
00521                                         $this->tpl->parseCurrentBlock();
00522                                 }
00523 
00524                                 // client list link
00525                                 $this->tpl->setCurrentBlock("display_list");
00526                                 $this->tpl->setVariable("TXT_LIST",ucfirst($this->lng->txt("list")));
00527                                 $this->tpl->parseCurrentBlock();
00528 
00529                                 // edit paths link
00530                                 $this->tpl->setCurrentBlock("edit_pathes");
00531                                 $this->tpl->setVariable("TXT_EDIT_PATHES",$this->lng->txt("pathes"));
00532                                 $this->tpl->parseCurrentBlock();
00533 
00534                                 // change password link
00535                                 $this->tpl->setCurrentBlock("change_password");
00536                                 $this->tpl->setVariable("TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt("password")));
00537                                 $this->tpl->parseCurrentBlock();
00538                         }
00539 
00540                         // logout link
00541                         if ($this->isAuthenticated())
00542                         {
00543                                 $this->tpl->setCurrentBlock("logout");
00544                                 $this->tpl->setVariable("TXT_LOGOUT",$this->lng->txt("logout"));
00545                                 $this->tpl->parseCurrentBlock();
00546                         }
00547                 }
00548 
00549                 $this->tpl->setVariable("VAL_CMD", $_GET["cmd"]);
00550                 $this->tpl->setVariable("TXT_OK",$this->lng->txt("change"));
00551                 $this->tpl->setVariable("TXT_CHOOSE_LANGUAGE",$this->lng->txt("choose_language"));
00552                 $this->tpl->setVariable("PAGETITLE","Setup");
00553                 $this->tpl->setVariable("LOCATION_STYLESHEET","./templates/blueshadow.css");
00554                 $this->tpl->setVariable("LOCATION_JAVASCRIPT","../templates/default");
00555                 $this->tpl->setVariable("TXT_ILIAS_VERSION", "ILIAS ".ILIAS_VERSION);
00556                 $this->tpl->setVariable("TXT_SETUP",$this->lng->txt("setup"));
00557                 $this->tpl->setVariable("VERSION", $this->version);
00558                 $this->tpl->setVariable("TXT_VERSION", $this->lng->txt("version"));
00559                 $this->tpl->setVariable("LANG", $this->lang);
00560         }
00561 
00565         function displayFooter()
00566         {
00567                 // footer (not really)
00568                 if ($this->cmd != "logout")
00569                 {
00570                         if ($this->ini_ilias_exists and $this->display_mode == "setup" and $this->client->getId() != "")
00571                         {
00572                                 $this->tpl->setVariable("TXT_ACCESS_MODE","(".$this->lng->txt("client_id").": ".$this->client->getId().")");
00573                         }
00574                         elseif ($this->isAdmin())
00575                         {
00576                                 $this->tpl->setVariable("TXT_ACCESS_MODE","(".$this->lng->txt("root_access").")");
00577                         }
00578                 
00579                         $this->displayNavButtons();
00580                 }
00581                 
00582                 $this->tpl->show();
00583         }
00584 
00590         function displayNavButtons()
00591         {
00592                 if (!$this->btn_prev_on and !$this->btn_next_on)
00593                 {
00594                         return false;
00595                 }
00596                 
00597                 $this->tpl->addBlockFile("NAVBUTTONS","navbuttons","tpl.navbuttons.html");
00598 
00599                 $this->tpl->setVariable("FORMACTION_BUTTONS","setup.php?cmd=gateway");
00600 
00601                 if ($this->btn_prev_on)
00602                 {
00603                         $this->tpl->setCurrentBlock("btn_back");
00604                         $this->tpl->setVariable("TXT_PREV", $this->btn_prev_lng);   
00605                         $this->tpl->setVariable("CMD_PREV", $this->btn_prev_cmd);   
00606                         $this->tpl->parseCurrentBlock();
00607                 }
00608                 
00609                 if ($this->btn_next_on)
00610                 {
00611                         $this->tpl->setCurrentBlock("btn_forward");
00612                         $this->tpl->setVariable("TXT_NEXT", $this->btn_next_lng);
00613                         $this->tpl->setVariable("CMD_NEXT", $this->btn_next_cmd);   
00614                         $this->tpl->parseCurrentBlock();
00615                 }
00616                 
00617                 return true;
00618         }
00619 
00626         function SetButtonPrev($a_cmd = 0,$a_lng = 0)
00627         {
00628                 $this->btn_prev_on = true;
00629                 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd : "gateway";
00630                 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : "<<&nbsp;&nbsp;&nbsp;".$this->lng->txt("prev");
00631         }
00632 
00639         function SetButtonNext($a_cmd,$a_lng = 0)
00640         {
00641                 $this->btn_next_on = true;
00642                 $this->btn_next_cmd = ($a_cmd) ? $a_cmd : "gateway";
00643                 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt("next")."&nbsp;&nbsp;&nbsp;>>";
00644         }
00645 
00649         function displayPreliminaries()
00650         {
00651                 $OK = "<font color=\"green\"><strong>OK</strong></font>";
00652                 $FAILED = "<strong><font color=\"red\">FAILED</font></strong>";
00653                 
00654                 $this->tpl->addBlockFile("CONTENT","content","tpl.preliminaries.html");
00655                 
00656                 $this->tpl->setVariable("TXT_SETUP_TITLE",$this->lng->txt("ilias_setup"));
00657                 $this->tpl->setVariable("TXT_SETUP_WELCOME", $this->lng->txt("setup_welcome"));
00658                 $this->tpl->setVariable("TXT_SETUP_INIFILE_DESC", $this->lng->txt("setup_inifile_desc"));
00659                 $this->tpl->setVariable("TXT_SETUP_DATABASE_DESC", $this->lng->txt("setup_database_desc"));
00660                 $this->tpl->setVariable("TXT_SETUP_LANGUAGES_DESC", $this->lng->txt("setup_languages_desc"));
00661                 $this->tpl->setVariable("TXT_SETUP_PASSWORD_DESC", $this->lng->txt("setup_password_desc"));     
00662                 $this->tpl->setVariable("TXT_SETUP_NIC_DESC", $this->lng->txt("setup_nic_desc"));   
00663         
00664                 $server_os = php_uname();
00665                 $server_web = $_SERVER["SERVER_SOFTWARE"];
00666                 $environment = $this->lng->txt("env_using")." ".$server_os." <br/>".$this->lng->txt("with")." ".$server_web;
00667                 
00668                 if ((stristr($server_os,"linux") || stristr($server_os,"windows")) && stristr($server_web,"apache"))
00669                 {
00670                         $env_comment = $this->lng->txt("env_ok");       
00671                 }
00672                 else
00673                 {
00674                         $env_comment = "<font color=\"red\">".$this->lng->txt("env_warning")."</font>";
00675                 }
00676                         
00677                 $this->tpl->setVariable("TXT_ENV_TITLE", $this->lng->txt("environment"));
00678                 $this->tpl->setVariable("TXT_ENV_INTRO", $environment);
00679                 $this->tpl->setVariable("TXT_ENV_COMMENT", $env_comment);   
00680                 
00681                 $this->tpl->setVariable("TXT_PRE_TITLE", $this->lng->txt("preliminaries"));
00682                 $this->tpl->setVariable("TXT_PRE_INTRO", $this->lng->txt("pre_intro"));
00683 
00684                 // display phpversion
00685                 $this->tpl->setCurrentBlock("preliminary");
00686                 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_php_version").": ".$arCheck["php"]["version"]);
00687 
00688                 if ($this->preliminaries_result["php"]["status"] == true)
00689                 {
00690                         $this->tpl->setVariable("STATUS_PRE", $OK);
00691                 }
00692                 else
00693                 {
00694                         $this->tpl->setVariable("STATUS_PRE", $FAILED);
00695                         $this->tpl->setVariable("COMMENT_PRE", $this->preliminaries_result["php"]["comment"]);
00696                 }
00697 
00698                 $this->tpl->parseCurrentBlock();
00699         
00700                 // check if ilias3 folder is writable
00701                 $this->tpl->setCurrentBlock("preliminary");
00702                 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_folder_write"));
00703 
00704                 if ($this->preliminaries_result["root"]["status"] == true)
00705                 {
00706                         $this->tpl->setVariable("STATUS_PRE", $OK);
00707                 }
00708                 else
00709                 {
00710                         $this->tpl->setVariable("STATUS_PRE", $FAILED);
00711                         $this->tpl->setVariable("COMMENT_PRE", $this->preliminaries_result["root"]["comment"]);
00712                 }
00713                 $this->tpl->parseCurrentBlock();
00714                 
00715                 // check if ilias3 can create new folders
00716                 $this->tpl->setCurrentBlock("preliminary");
00717                 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_folder_create"));
00718 
00719                 if ($this->preliminaries_result["create"]["status"] == true)
00720                 {
00721                         $this->tpl->setVariable("STATUS_PRE", $OK);
00722                 }
00723                 else
00724                 {
00725                         $this->tpl->setVariable("STATUS_PRE", $FAILED);
00726                         $this->tpl->setVariable("COMMENT_PRE", $this->preliminaries_result["create"]["comment"]);
00727                 }
00728 
00729                 $this->tpl->parseCurrentBlock();
00730 
00731                 // check cookies
00732                 $this->tpl->setCurrentBlock("preliminary");
00733                 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_cookies_enabled"));
00734 
00735                 if ($this->preliminaries_result["cookies"]["status"] == true)
00736                 {
00737                         $this->tpl->setVariable("STATUS_PRE", $OK);
00738                 }
00739                 else
00740                 {
00741                         $this->tpl->setVariable("STATUS_PRE", $FAILED);
00742                         $this->tpl->setVariable("COMMENT_PRE", $this->preliminaries_result["cookies"]["comment"]);
00743                 }
00744 
00745                 $this->tpl->parseCurrentBlock();
00746 
00747                 // check javascript
00748                 $this->tpl->setCurrentBlock("preliminary_js");
00749                 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_javascript_enabled"));
00750                 $this->tpl->setVariable("STATUS_PRE", $FAILED);
00751                 $this->tpl->setVariable("COMMENT_PRE", $this->lng->txt("pre_javascript_comment"));
00752                 $this->tpl->parseCurrentBlock();
00753 
00754                 // summary
00755                 if ($this->preliminaries === true)
00756                 {
00757                         $cmd = "install";
00758 
00759                         $btn_text = ($this->cmd == "preliminaries") ? "" : "installation";
00760                         $this->setButtonNext($cmd,$btn_text);
00761                 }
00762                 else
00763                 {
00764                         $this->tpl->setCurrentBlock("premessage");
00765                         $this->tpl->setVariable("TXT_PRE_ERR", $this->lng->txt("pre_error"));
00766                         $this->tpl->parseCurrentBlock();
00767                 }
00768         }
00769         
00773         function displayMasterSetup()
00774         {
00775                 if ($_POST["form"])
00776                 {
00777                         if (!$this->checkDataDirSetup($_POST["form"]))
00778                         {
00779                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
00780                         }
00781         
00782                         if (!$this->checkLogSetup($_POST["form"]))
00783                         {
00784                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
00785                         }
00786 
00787                         if (!$this->checkToolsSetup($_POST["form"]))
00788                         {
00789                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
00790                         }
00791                         
00792                         if (!$this->checkPasswordSetup($_POST["form"]))
00793                         {
00794                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
00795                         }
00796 
00797                         if (!$this->saveMasterSetup($_POST["form"]))
00798                         {
00799                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
00800                         }           
00801                         
00802                         sendInfo($this->lng->txt("settings_saved"),true);
00803                         
00804                         ilUtil::redirect("setup.php?cmd=startup");
00805                 }
00806 
00807                 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html");
00808 
00809                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_mastersetup.html");
00810 
00811                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
00812                 
00813                 // for checkboxes & radio buttons
00814                 $checked = "checked=\"checked\"";
00815 
00816                 // general
00817                 $this->tpl->setVariable("TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt("dsfsdave"));
00818                 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("setup_basic_settings"));
00819                 $this->tpl->setVariable("SUBMIT_CMD", "install");
00820                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00821                 $this->tpl->setVariable("TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt("enter_dir_and_filename"));
00822                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_first_install")."<br/>".$this->lng->txt("info_text_pathes"));
00823                 
00824                 if ($this->safe_mode)
00825                 {
00826                         $this->tpl->setVariable("SAFE_MODE_STYLE", " class=\"message\" ");
00827                         $this->tpl->setVariable("TXT_SAFE_MODE_INFO", $this->lng->txt("safe_mode_enabled"));
00828                 }
00829                 else
00830                 {
00831                         $this->tpl->setVariable("TXT_SAFE_MODE_INFO", "");
00832                 }
00833 
00834                 // datadir
00835                 $this->tpl->setCurrentBlock("setup_datadir");
00836                 $this->tpl->setVariable("TXT_DATADIR_TITLE", $this->lng->txt("main_datadir_outside_webspace"));
00837                 $this->tpl->setVariable("TXT_DATADIR_PATH", $this->lng->txt("datadir_path"));
00838                 $this->tpl->setVariable("TXT_DATADIR_COMMENT1", $this->lng->txt("datadir_path_comment1"));
00839                 $this->tpl->setVariable("TXT_CREATE", $this->lng->txt("create"));
00840                 // values
00841                 //echo $this->ini->readVariable($this->ini->readVariable("server","presetting"),"data_dir");
00842                 if ($_SESSION["error_post_vars"]["form"])
00843                 {
00844                         $this->tpl->setVariable("DATADIR_PATH", $_SESSION["error_post_vars"]["form"]["datadir_path"]);
00845                 }
00846                 elseif ($this->ini->readVariable("server","presetting") != "")
00847                 {
00848                         $this->tpl->setVariable("DATADIR_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"data_dir"));
00849                 }
00850 
00851 
00852                         
00853                 //$chk_datadir_path = ($_SESSION["error_post_vars"]["form"]["chk_datadir_path"]) ? "CHK_DATADIR_PATH_TARGET" : "CHK_DATADIR_PATH_CREATE";
00854                 $chk_datadir_path = ($_SESSION["error_post_vars"]["form"]["chk_datadir_path"]) ? $checked : "";
00855                 $this->tpl->setVariable("CHK_DATADIR_PATH",$chk_datadir_path);
00856                 $this->tpl->parseCurrentBlock();
00857                 
00858                 // logging
00859                 $this->tpl->setCurrentBlock("setup_log");
00860                 $this->tpl->setVariable("TXT_LOG_TITLE", $this->lng->txt("logging"));
00861                 $this->tpl->setVariable("TXT_LOG_PATH", $this->lng->txt("log_path"));
00862                 $this->tpl->setVariable("TXT_LOG_COMMENT", $this->lng->txt("log_path_comment"));
00863                 $this->tpl->setVariable("TXT_DISABLE_LOGGING", $this->lng->txt("disable_logging"));
00864 
00865                 // values
00866                 if ($_SESSION["error_post_vars"]["form"])
00867                 {
00868                         $this->tpl->setVariable("LOG_PATH", $_SESSION["error_post_vars"]["form"]["log_path"]);
00869                 }
00870                 elseif ($this->ini->readVariable("server","presetting") != "")
00871                 {
00872                         $this->tpl->setVariable("LOG_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"log"));
00873                 }
00874 
00875                 $chk_log_path = ($_SESSION["error_post_vars"]["form"]["chk_log_status"]) ? $checked : "";
00876                 $this->tpl->setVariable("CHK_LOG_STATUS",$chk_log_path);
00877                 $this->tpl->parseCurrentBlock();
00878 
00879                 // tools
00880                 $this->tpl->setCurrentBlock("setup_tools");
00881                 $this->tpl->setVariable("TXT_DISABLE_CHECK", $this->lng->txt("disable_check"));
00882                 $this->tpl->setVariable("TXT_TOOLS_TITLE", $this->lng->txt("3rd_party_software"));
00883                 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("convert_path"));
00884                 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("zip_path"));
00885                 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("unzip_path"));
00886                 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("java_path"));
00887                 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("htmldoc_path"));
00888                 $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
00889 
00890                 $this->tpl->setVariable("TXT_CONVERT_COMMENT", $this->lng->txt("convert_path_comment"));
00891                 $this->tpl->setVariable("TXT_ZIP_COMMENT", $this->lng->txt("zip_path_comment"));
00892                 $this->tpl->setVariable("TXT_UNZIP_COMMENT", $this->lng->txt("unzip_path_comment"));
00893                 $this->tpl->setVariable("TXT_JAVA_COMMENT", $this->lng->txt("java_path_comment"));
00894                 $this->tpl->setVariable("TXT_HTMLDOC_COMMENT", $this->lng->txt("htmldoc_path_comment"));
00895                 $this->tpl->setVariable("TXT_LATEX_URL_COMMENT", $this->lng->txt("latex_url_comment"));
00896 
00897                 // values
00898                 if ($_SESSION["error_post_vars"]["form"])
00899                 {
00900                         $this->tpl->setVariable("CONVERT_PATH", $_SESSION["error_post_vars"]["form"]["convert_path"]);
00901                         $this->tpl->setVariable("ZIP_PATH", $_SESSION["error_post_vars"]["form"]["zip_path"]);
00902                         $this->tpl->setVariable("UNZIP_PATH", $_SESSION["error_post_vars"]["form"]["unzip_path"]);
00903                         $this->tpl->setVariable("JAVA_PATH", $_SESSION["error_post_vars"]["form"]["java_path"]);
00904                         $this->tpl->setVariable("HTMLDOC_PATH", $_SESSION["error_post_vars"]["form"]["htmldoc_path"]);
00905                         $this->tpl->setVariable("LATEX_URL", $_SESSION["error_post_vars"]["form"]["latex_url"]);
00906                 }
00907                 elseif ($this->ini->readVariable("server","presetting") != "")
00908                 {
00909                         $this->tpl->setVariable("CONVERT_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"convert"));
00910                         $this->tpl->setVariable("ZIP_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"zip"));
00911                         $this->tpl->setVariable("UNZIP_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"unzip"));
00912                         $this->tpl->setVariable("JAVA_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"java"));
00913                         $this->tpl->setVariable("HTMLDOC_PATH", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"htmldoc"));
00914                         $this->tpl->setVariable("LATEX_URL", $this->ini->readVariable($this->ini->readVariable("server","presetting"),"latex"));
00915                 }
00916                                                                 
00917                 $this->tpl->setVariable("TXT_VIRUS_SCANNER", $this->lng->txt("virus_scanner"));
00918                 $this->tpl->setVariable("TXT_NONE", $this->lng->txt("none"));
00919                 $this->tpl->setVariable("TXT_SOPHOS", $this->lng->txt("sophos"));
00920                 $this->tpl->setVariable("TXT_ANTIVIR", $this->lng->txt("antivir"));
00921                 $this->tpl->setVariable("TXT_SCAN_COMMAND", $this->lng->txt("scan_command"));
00922                 $this->tpl->setVariable("TXT_CLEAN_COMMAND", $this->lng->txt("clean_command"));
00923 
00924 
00925                 $chk_convert_path = ($_SESSION["error_post_vars"]["form"]["chk_convert_path"]) ? $checked : "";
00926                 $chk_zip_path = ($_SESSION["error_post_vars"]["form"]["chk_zip_path"]) ? $checked : "";
00927                 $chk_unzip_path = ($_SESSION["error_post_vars"]["form"]["chk_unzip_path"]) ? $checked : "";
00928                 $chk_java_path = ($_SESSION["error_post_vars"]["form"]["chk_java_path"]) ? $checked : "";
00929                 $chk_htmldoc_path = ($_SESSION["error_post_vars"]["form"]["chk_htmldoc_path"]) ? $checked : "";
00930                 $chk_latex_url = ($_SESSION["error_post_vars"]["form"]["chk_latex_url"]) ? $checked : "";
00931 
00932                 $this->tpl->setVariable("CHK_CONVERT_PATH", $chk_convert_path);
00933                 $this->tpl->setVariable("CHK_ZIP_PATH", $chk_zip_path);
00934                 $this->tpl->setVariable("CHK_UNZIP_PATH", $chk_unzip_path);
00935                 $this->tpl->setVariable("CHK_JAVA_PATH", $chk_java_path);
00936                 $this->tpl->setVariable("CHK_HTMLDOC_PATH", $chk_htmldoc_path);
00937                 $this->tpl->setVariable("CHK_LATEX_URL", $chk_latex_url);
00938                 $this->tpl->parseCurrentBlock();
00939                 
00940                 // setup password
00941                 $this->tpl->setCurrentBlock("setup_pass");
00942                 $this->tpl->setVariable("TXT_SETUP_PASS_TITLE", $this->lng->txt("setup_pass_title"));
00943                 $this->tpl->setVariable("TXT_SETUP_PASS_COMMENT", $this->lng->txt("password_info"));
00944                 $this->tpl->setVariable("TXT_SETUP_PASS", $this->lng->txt("setup_pass"));
00945                 $this->tpl->setVariable("TXT_SETUP_PASS2", $this->lng->txt("setup_pass2"));
00946                 // values
00947                 $this->tpl->setVariable("SETUP_PASS", $_SESSION["error_post_vars"]["form"]["setup_pass"]);
00948                 $this->tpl->setVariable("SETUP_PASS2", $_SESSION["error_post_vars"]["form"]["setup_pass2"]);
00949                 $this->tpl->parseCurrentBlock();
00950                 
00951                 $this->setButtonPrev("preliminaries");
00952 
00953                 if ($this->isInstalled())
00954                 {
00955                         $this->setButtonNext("list");
00956                 }
00957         }
00958         
00962         function loginClient()
00963         {
00964                 session_destroy();
00965                 
00966                 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->client->getId());
00967         }
00968         
00972         function displayLogin()
00973         {
00974                 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html");
00975 
00976                 if ($_POST["form"])
00977                 {
00978                         // first check client login
00979                         if (empty($_POST["form"]["admin_password"]))
00980                         {
00981                                 if (!$this->loginAsClient($_POST["form"]))
00982                                 {
00983                                         if ($error_msg = $this->getError())
00984                                         {
00985                                                 $this->raiseError($this->lng->txt($error_msg),$this->error_obj->MESSAGE);
00986                                         }
00987                                 }
00988                         }
00989                         else
00990                         {
00991                                 if (!$this->loginAsAdmin($_POST["form"]["admin_password"]))
00992                                 {
00993                                         $this->raiseError($this->lng->txt("login_invalid"),$this->error_obj->MESSAGE);
00994                                 }
00995                         }
00996 
00997                         ilUtil::redirect("setup.php");
00998                 }
00999 
01000                 // output
01001                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_login.html");
01002                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
01003                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("setup_login"));
01004 
01005                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_login"));
01006 
01007                 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
01008                 $this->tpl->setVariable("TXT_CLIENT_LOGIN",$this->lng->txt("client_login"));
01009                 $this->tpl->setVariable("TXT_CLIENT_ID",$this->lng->txt("client_id"));
01010                 $this->tpl->setVariable("TXT_USERNAME",ucfirst($this->lng->txt("username")));
01011                 $this->tpl->setVariable("TXT_PASSWORD",ucfirst($this->lng->txt("password")));
01012                 $this->tpl->setVariable("TXT_OR",strtoupper($this->lng->txt("or")));
01013                 $this->tpl->setVariable("TXT_ADMIN_LOGIN",$this->lng->txt("admin_login"));
01014                 $this->tpl->setVariable("TXT_ADMIN_PASSWORD",ucfirst($this->lng->txt("password")));
01015                 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("submit"));
01016         }
01017 
01021         function displayClientList()
01022         {
01023                 $_SESSION["ClientId"] = "";
01024                 
01025                 $_GET["sort_by"] = ($_GET["sort_by"]) ? $_GET["sort_by"] : "name";
01026 
01027                 $clientlist = new ilClientList();
01028                 $list = $clientlist->getClients();
01029 
01030                 if (count($list) == 0)
01031                 {
01032                         sendInfo($this->lng->txt("no_clients_available"),true);
01033                 }
01034                 
01035                 // prepare clientlist
01036                 $data = array();
01037                 $data["data"] = array();
01038                 $data["ctrl"] = array();
01039                 $data["cols"] = array("","name","id","login","details","status","access");
01040 
01041                 foreach ($list as $key => $client)
01042                 {
01043                         // check status 
01044                         $status_arr = $this->getStatus($client);
01045 
01046                         if (!$status_arr["db"]["status"])
01047                         {
01048                                 $status = $status_arr["db"]["comment"];
01049                         }
01050                         elseif (!$status_arr["finish"]["status"])
01051                         {
01052                                 $status = $this->lng->txt("setup_not_finished");
01053                         }
01054                         else
01055                         {
01056                                 $status = "<font color=\"green\"><strong>OK</strong></font>";
01057                         }
01058                         
01059                         if ($status_arr["access"]["status"])
01060                         {
01061                                 $access = "online";
01062                         }
01063                         else
01064                         {
01065                                 $access = "disabled";
01066                         }
01067                         
01068                         if ($key == $this->default_client)
01069                         {
01070                                 $default = " checked=\"checked\"";
01071                         }
01072                         else
01073                         {
01074                                 $default = "";
01075                         }
01076                         
01077                         if ($status_arr["finish"]["status"] and $status_arr["access"]["status"])
01078                         {
01079                                 $login = "<a href=\"../login.php?client_id=".$key."\">Login</a>";
01080                         }
01081                         else
01082                         {
01083                                 $login = "&nbsp;";
01084                         }
01085 
01086                         $access_html = "<a href=\"setup.php?cmd=changeaccess&client_id=".$key."&back=clientlist\">".$this->lng->txt($access)."</a>";
01087                         
01088                         $client_name = ($client->getName()) ? $client->getName() : "&lt;".$this->lng->txt("no_client_name")."&gt;";
01089                         
01090                         // visible data part
01091                         $data["data"][] = array(
01092                                                         "default"       => "<input type=\"radio\" name=\"form[default]\" value=\"".$key."\"".$default."/>",
01093                                                         "name"          => $client_name."#separator#".$client->getDescription(),
01094                                                         "id"            => $key,
01095                                                         "login"         => $login,
01096                                                         "details"       => "<a href=\"setup.php?cmd=view&client_id=".$key."\">Details</a>",
01097                                                         "status"        => $status,
01098                                                         "access_html"   => $access_html
01099                                                         );
01100 
01101                 }
01102 
01103                 $this->maxcount = count($data["data"]);
01104 
01105                 // sorting array
01106                 $data["data"] = ilUtil::sortArray($data["data"],$_GET["sort_by"],$_GET["sort_order"]);
01107 
01108                 $this->tpl->addBlockFile("CONTENT","content","tpl.clientlist.html");
01109                 
01110                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_list"));
01111                 
01112                 sendInfo();
01113 
01114                 // load template for table
01115                 $this->tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
01116                 // load template for table content data
01117                 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
01118 
01119                 // common
01120                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("available_clients"));
01121                 $this->tpl->setVariable("TXT_LISTSTATUS",($this->ini->readVariable("clients","list")) ? $this->lng->txt("display_clientlist") : $this->lng->txt("hide_clientlist"));
01122                 $this->tpl->setVariable("TXT_TOGGLELIST",($this->ini->readVariable("clients","list")) ? $this->lng->txt("disable") : $this->lng->txt("enable"));
01123 
01124                 $this->tpl->setVariable("FORMACTION","setup.php?cmd=gateway");
01125 
01126                 // build table
01127                 include_once "../classes/class.ilTableGUI.php";
01128                 $tbl = new ilTableGUI();
01129 
01130                 $num = 0;
01131 
01132                 // title & header columns
01133                 $tbl->setTitle(ucfirst($this->lng->txt("select_client")));
01134 
01135                 foreach ($data["cols"] as $val)
01136                 {
01137                         $header_names[] = ucfirst($this->lng->txt($val));
01138                 }
01139                 $tbl->setHeaderNames($header_names);
01140                 $tbl->setHeaderVars($data["cols"],$header_params);
01141                 $tbl->setColumnWidth(array("5%","30%","10%","10%","10%","20%","15%"));
01142                 
01143                 // control
01144                 $tbl->setOrderColumn($_GET["sort_by"],"name");
01145                 $tbl->setOrderDirection($_GET["sort_order"],"asc");
01146                 $tbl->setLimit(0);
01147                 $tbl->setOffset(0);
01148                 $tbl->setMaxCount($maxcount);
01149                 
01150                 // show valid actions
01151                 $this->tpl->setVariable("COLUMN_COUNTS",count($data["cols"]));
01152                 
01153                 // footer
01154                 //$tbl->setFooter("tbl_footer");
01155                 
01156                 $tbl->disable("footer");
01157                 $tbl->disable("icon");
01158                 $tbl->disable("numinfo");
01159                 
01160                 // render table
01161                 $tbl->render();
01162 
01163                 if (is_array($data["data"][0]))
01164                 {
01165                         // table cell
01166                         for ($i=0; $i < count($data["data"]); $i++)
01167                         {
01168                                 $data2 = $data["data"][$i];
01169                                 $ctrl = $data["ctrl"][$i];
01170 
01171                                 // color changing
01172                                 $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
01173 
01174                                 $this->tpl->setCurrentBlock("table_cell");
01175                                 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
01176                                 $this->tpl->parseCurrentBlock();
01177 
01178                                 foreach ($data2 as $key => $val)
01179                                 {
01180                                         $this->tpl->setCurrentBlock("text");
01181                                         
01182                                         if ($key == "name")
01183                                         {
01184                                                 $name_field = explode("#separator#",$val);
01185                                                 $val = $name_field[0]."<br/><span class=\"subtitle\">".$name_field[1]."</span>";
01186                                         }
01187 
01188                                         $this->tpl->setVariable("TEXT_CONTENT", $val);                  
01189                                         $this->tpl->parseCurrentBlock();
01190 
01191                                         $this->tpl->setCurrentBlock("table_cell");
01192                                         $this->tpl->parseCurrentBlock();
01193 
01194                                 } //end foreach
01195 
01196                                 $this->tpl->setCurrentBlock("tbl_content");
01197                                 $this->tpl->setVariable("CSS_ROW", $css_row);
01198                                 $this->tpl->parseCurrentBlock();
01199                         }
01200 
01201                         $this->tpl->setCurrentBlock("tbl_action_btn");
01202                         $this->tpl->setVariable("TPLPATH",TPLPATH);         
01203                         $this->tpl->setVariable("BTN_NAME","changedefault");
01204                         $this->tpl->setVariable("BTN_VALUE",$this->lng->txt("set_default_client"));
01205                         $this->tpl->parseCurrentBlock();
01206 
01207                         $this->tpl->setCurrentBlock("tbl_action_row");
01208                         $this->tpl->setVariable("TPLPATH",TPLPATH);         
01209                         $this->tpl->setVariable("COLUMN_COUNTS","7");
01210                         $this->tpl->parseCurrentBlock();
01211 
01212                 }
01213         }
01214 
01218         function changeMasterSettings()
01219         {
01220                 if ($_POST["form"])
01221                 {
01222                         if (!$this->checkLogSetup($_POST["form"]))
01223                         {
01224                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
01225                         }
01226 
01227                         if (!$this->checkToolsSetup($_POST["form"]))
01228                         {
01229                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
01230                         }
01231 
01232                         if (!$this->updateMasterSettings($_POST["form"]))
01233                         {
01234                                 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
01235                         }
01236 
01237                         sendInfo($this->lng->txt("settings_saved"),true);
01238                         ilUtil::redirect("setup.php");
01239                 }
01240 
01241                 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html");
01242 
01243                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_mastersetup.html");
01244 
01245                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
01246 
01247                 // for checkboxes & radio buttons
01248                 $checked = "checked=\"checked\"";
01249 
01250                 // general
01251                 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_basic_settings"));
01252                 $this->tpl->setVariable("SUBMIT_CMD", "mastersettings");
01253                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
01254                 $this->tpl->setVariable("TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt("enter_dir_and_filename"));
01255                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_pathes"));
01256                 
01257                 if ($this->safe_mode)
01258                 {
01259                         $this->tpl->setVariable("SAFE_MODE_STYLE", " class=\"message\" ");
01260                         $this->tpl->setVariable("TXT_SAFE_MODE_INFO", $this->lng->txt("safe_mode_enabled"));
01261                 }
01262                 else
01263                 {
01264                         $this->tpl->setVariable("TXT_SAFE_MODE_INFO", "");
01265                 }
01266                 // datadir
01267                 $this->tpl->setCurrentBlock("display_datadir");
01268                 $this->tpl->setVariable("TXT_DATADIR_TITLE", $this->lng->txt("main_datadir_outside_webspace"));
01269                 $this->tpl->setVariable("TXT_DATADIR_PATH", $this->lng->txt("datadir_path"));
01270                 $this->tpl->setVariable("DATADIR_PATH", $this->ini->readVariable("clients","datadir"));
01271                 $this->tpl->setVariable("TXT_DATADIR_COMMENT2", $this->lng->txt("datadir_path_comment2"));
01272                 $this->tpl->parseCurrentBlock();
01273 
01274                 // logging
01275                 $this->tpl->setCurrentBlock("setup_log");
01276                 $this->tpl->setVariable("TXT_LOG_TITLE", $this->lng->txt("logging"));
01277                 $this->tpl->setVariable("TXT_LOG_PATH", $this->lng->txt("log_path"));
01278                 $this->tpl->setVariable("TXT_LOG_COMMENT", $this->lng->txt("log_path_comment"));
01279                 $this->tpl->setVariable("TXT_DISABLE_LOGGING", $this->lng->txt("disable_logging"));
01280                 // values
01281                 if ($_SESSION["error_post_vars"])
01282                 {
01283                         $this->tpl->setVariable("LOG_PATH", $_SESSION["error_post_vars"]["form"]["log_path"]);
01284                         $chk_log_status = ($_SESSION["error_post_vars"]["form"]["chk_log_status"]) ? $checked : "";
01285                 }
01286                 else
01287                 {
01288                         $this->tpl->setVariable("LOG_PATH",$this->ini->readVariable("log","path")."/".$this->ini->readVariable("log","file"));
01289                         $chk_log_status = ($this->ini->readVariable("log","enabled")) ? "" : $checked;
01290 
01291                 }
01292 
01293                 $this->tpl->setVariable("CHK_LOG_STATUS",$chk_log_status);
01294                 $this->tpl->parseCurrentBlock();
01295 
01296                 // tools
01297                 $this->tpl->setCurrentBlock("setup_tools");
01298                 $this->tpl->setVariable("TXT_DISABLE_CHECK", $this->lng->txt("disable_check"));
01299                 $this->tpl->setVariable("TXT_TOOLS_TITLE", $this->lng->txt("3rd_party_software"));
01300                 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("convert_path"));
01301                 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("zip_path"));
01302                 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("unzip_path"));
01303                 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("java_path"));
01304                 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("htmldoc_path"));
01305                 $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
01306                 $this->tpl->setVariable("TXT_FOP_PATH", $this->lng->txt("fop_path"));
01307                 
01308                 $this->tpl->setVariable("TXT_VIRUS_SCANNER", $this->lng->txt("virus_scanner"));
01309                 $this->tpl->setVariable("TXT_NONE", $this->lng->txt("none"));
01310                 $this->tpl->setVariable("TXT_SOPHOS", $this->lng->txt("sophos"));
01311                 $this->tpl->setVariable("TXT_ANTIVIR", $this->lng->txt("antivir"));
01312                 $this->tpl->setVariable("TXT_SCAN_COMMAND", $this->lng->txt("scan_command"));
01313                 $this->tpl->setVariable("TXT_CLEAN_COMMAND", $this->lng->txt("clean_command"));
01314 
01315                 $this->tpl->setVariable("TXT_CONVERT_COMMENT", $this->lng->txt("convert_path_comment"));
01316                 $this->tpl->setVariable("TXT_ZIP_COMMENT", $this->lng->txt("zip_path_comment"));
01317                 $this->tpl->setVariable("TXT_UNZIP_COMMENT", $this->lng->txt("unzip_path_comment"));
01318                 $this->tpl->setVariable("TXT_JAVA_COMMENT", $this->lng->txt("java_path_comment"));
01319                 $this->tpl->setVariable("TXT_HTMLDOC_COMMENT", $this->lng->txt("htmldoc_path_comment"));
01320                 $this->tpl->setVariable("TXT_LATEX_URL_COMMENT", $this->lng->txt("latex_url_comment"));
01321                 $this->tpl->setVariable("TXT_FOP_COMMENT", $this->lng->txt("fop_path_comment"));
01322                 // values
01323                 if ($_SESSION["error_post_vars"])
01324                 {
01325                         $this->tpl->setVariable("CONVERT_PATH", $_SESSION["error_post_vars"]["form"]["convert_path"]);
01326                         $this->tpl->setVariable("ZIP_PATH", $_SESSION["error_post_vars"]["form"]["zip_path"]);
01327                         $this->tpl->setVariable("UNZIP_PATH", $_SESSION["error_post_vars"]["form"]["unzip_path"]);
01328                         $this->tpl->setVariable("JAVA_PATH", $_SESSION["error_post_vars"]["form"]["java_path"]);
01329                         $this->tpl->setVariable("HTMLDOC_PATH", $_SESSION["error_post_vars"]["form"]["htmldoc_path"]);
01330                         $this->tpl->setVariable("LATEX_URL", $_SESSION["error_post_vars"]["form"]["latex_url"]);
01331                         $this->tpl->setVariable("FOP_PATH", $_SESSION["error_post_vars"]["form"]["fop_path"]);
01332                         $this->tpl->setVariable("STYPE_".
01333                                 strtoupper($_SESSION["error_post_vars"]["form"]["vscanner_type"]), " selected=\"1\" ");
01334                         $this->tpl->setVariable("SCAN_COMMAND", $_SESSION["error_post_vars"]["form"]["scan_command"]);
01335                         $this->tpl->setVariable("CLEAN_COMMAND", $_SESSION["error_post_vars"]["form"]["clean_command"]);
01336                 }
01337                 else
01338                 {
01339                         $this->tpl->setVariable("CONVERT_PATH", $this->ini->readVariable("tools","convert"));
01340                         $this->tpl->setVariable("ZIP_PATH", $this->ini->readVariable("tools","zip"));
01341                         $this->tpl->setVariable("UNZIP_PATH",$this->ini->readVariable("tools","unzip"));
01342                         $this->tpl->setVariable("JAVA_PATH",$this->ini->readVariable("tools","java"));
01343                         $this->tpl->setVariable("HTMLDOC_PATH",$this->ini->readVariable("tools","htmldoc"));
01344                         $this->tpl->setVariable("LATEX_URL",$this->ini->readVariable("tools","latex"));
01345                         $this->tpl->setVariable("FOP_PATH",$this->ini->readVariable("tools","fop"));
01346                         $this->tpl->setVariable("STYPE_".
01347                                 strtoupper($this->ini->readVariable("tools", "vscantype")), " selected=\"1\" ");
01348                         $this->tpl->setVariable("SCAN_COMMAND", $this->ini->readVariable("tools", "scancommand"));
01349                         $this->tpl->setVariable("CLEAN_COMMAND", $this->ini->readVariable("tools", "cleancommand"));
01350                 }
01351 
01352                 $chk_convert_path = ($_SESSION["error_post_vars"]["form"]["chk_convert_path"]) ? $checked : "";
01353                 $chk_zip_path = ($_SESSION["error_post_vars"]["form"]["chk_zip_path"]) ? $checked : "";
01354                 $chk_unzip_path = ($_SESSION["error_post_vars"]["form"]["chk_unzip_path"]) ? $checked : "";
01355                 $chk_java_path = ($_SESSION["error_post_vars"]["form"]["chk_java_path"]) ? $checked : "";
01356                 $chk_htmldoc_path = ($_SESSION["error_post_vars"]["form"]["chk_htmldoc_path"]) ? $checked : "";
01357                 $chk_latex_url = ($_SESSION["error_post_vars"]["form"]["chk_latex_url"]) ? $checked : "";
01358                 $chk_fop_path = ($_SESSION["error_post_vars"]["form"]["chk_fop_path"]) ? $checked : "";
01359 
01360                 $this->tpl->setVariable("CHK_LOG_STATUS", $chk_log_stauts);
01361                 $this->tpl->setVariable("CHK_CONVERT_PATH", $chk_convert_path);
01362                 $this->tpl->setVariable("CHK_ZIP_PATH", $chk_zip_path);
01363                 $this->tpl->setVariable("CHK_UNZIP_PATH", $chk_unzip_path);
01364                 $this->tpl->setVariable("CHK_JAVA_PATH", $chk_java_path);
01365                 $this->tpl->setVariable("CHK_HTMLDOC_PATH", $chk_htmldoc_path);
01366                 $this->tpl->setVariable("CHK_LATEX_URL", $chk_latex_url);
01367                 $this->tpl->setVariable("CHK_FOP_PATH", $chk_fop_path);
01368                 $this->tpl->parseCurrentBlock();
01369         }
01370 
01374         function displayIni()
01375         {
01376                 $this->checkDisplayMode("create_new_client");
01377                 
01378                 // checkings
01379                 if ($_POST["form"])
01380                 {
01381                         // check client name
01382                         if (!$_POST["form"]["client_id"])
01383                         {
01384                                 $this->raiseError($this->lng->txt("ini_no_client_id"),$this->error_obj->MESSAGE);
01385                         }
01386 
01387                         if (strlen($_POST["form"]["client_id"]) != strlen(urlencode(($_POST["form"]["client_id"]))))
01388                         {
01389                                 $this->raiseError($this->lng->txt("ini_client_id_invalid"),$this->error_obj->MESSAGE);
01390                         }           
01391 
01392                         if (strlen($_POST["form"]["client_id"]) < 4)
01393                         {
01394                                 $this->raiseError($this->lng->txt("ini_client_id_too_short"),$this->error_obj->MESSAGE);
01395                         }
01396 
01397                         if (strlen($_POST["form"]["client_id"]) > 32)
01398                         {
01399                                 $this->raiseError($this->lng->txt("ini_client_id_too_long"),$this->error_obj->MESSAGE);
01400                         }
01401 
01402                         // check database
01403                         if (!$_POST["form"]["db_host"])
01404                         {
01405                                 $this->raiseError($this->lng->txt("ini_no_db_host"),$this->error_obj->MESSAGE);
01406                         }
01407 
01408                         if (!$_POST["form"]["db_name"])
01409                         {
01410                                 $this->raiseError($this->lng->txt("ini_no_db_name"),$this->error_obj->MESSAGE);
01411                         }
01412                         
01413                         if (!$_POST["form"]["db_user"])
01414                         {
01415                                 $this->raiseError($this->lng->txt("ini_no_db_user"),$this->error_obj->MESSAGE);
01416                         }
01417 
01418                         // create new client object if it does not exist
01419                         if (!$this->ini_client_exists)
01420                         {
01421                                 $client_id = $_POST["form"]["client_id"];
01422                                 
01423                                 // check for existing client dir (only for newly created clients not renaming)
01424                                 if (!$this->ini_client_exists and file_exists(ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".$client_id))
01425                                 {
01426                                         $this->raiseError($this->lng->txt("ini_client_id_exists"),$this->error_obj->MESSAGE);
01427                                 }
01428 
01429                                 $this->newClient($client_id);
01430                         }
01431 
01432                         // save some old values
01433                         $old_db_name = $this->client->getDbName();
01434                         $old_client_id = $this->client->getId();            
01435                         // set client data 
01436                         $this->client->setId($_POST["form"]["client_id"]);
01437                         $this->client->setDbHost($_POST["form"]["db_host"]);
01438                         $this->client->setDbName($_POST["form"]["db_name"]);
01439                         $this->client->setDbUser($_POST["form"]["db_user"]);
01440                         $this->client->setDbPass($_POST["form"]["db_pass"]);
01441                         $this->client->setDSN();
01442                         
01443                         // try to connect to database
01444                         if (!$this->client->checkDatabaseHost())
01445                         {
01446                                 $this->raiseError($this->lng->txt($this->client->getError()),$this->error_obj->MESSAGE);
01447                         }
01448                         
01449                         // check if db exists
01450                         $db_installed = $this->client->checkDatabaseExists();
01451 
01452                         if ($db_installed and (!$this->ini_ilias_exists or ($this->client->getDbName() != $old_db_name)))
01453                         {
01454                                 $_POST["form"]["db_name"] = $old_db_name;
01455                                 $message = ucfirst($this->lng->txt("database"))." \"".$this->client->getDbName()."\" ".$this->lng->txt("ini_db_name_exists");
01456                                 $this->raiseError($message,$this->error_obj->MESSAGE);
01457                         }
01458                         
01459                         if ($this->ini_client_exists and $old_client_id != $this->client->getId())
01460                         {
01461                                 $message = $this->lng->txt("ini_client_id_no_change");
01462                                 $this->raiseError($message,$this->error_obj->MESSAGE);
01463                         }
01464 
01465                         // all ok. create client.ini and save posted data
01466                         if (!$this->ini_client_exists)
01467                         {
01468                                 if ($this->saveNewClient())
01469                                 {
01470                                         sendInfo($this->lng->txt("settings_saved"));
01471                                         $this->client->status["ini"]["status"] = true;
01472                                 }
01473                                 else
01474                                 {
01475                                         $err = $this->getError();
01476                                         sendInfo($this->lng->txt("save_error").": ".$err);
01477                                         $this->client->status["ini"]["status"] = false;
01478                                         $this->client->status["ini"]["comment"] = $err;
01479                                 }
01480                         }
01481                         else
01482                         {
01483                                 if ($this->client->ini->write())
01484                                 {
01485                                         sendInfo($this->lng->txt("settings_changed"));
01486                                         $this->client->status["ini"]["status"] = true;
01487                                 }
01488                                 else
01489                                 {
01490                                         $err = $this->client->ini->getError();
01491                                         sendInfo($this->lng->txt("save_error").": ".$err);
01492                                         $this->client->status["ini"]["status"] = false;
01493                                         $this->client->status["ini"]["comment"] = $err;
01494                                 }
01495                         }
01496                 }
01497 
01498                 // output
01499                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_ini.html");
01500                 
01501                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
01502                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
01503                 
01504                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_ini"));
01505                 
01506                 // display default values, loaded valus or saved error values
01507                 if ($_SESSION["error_post_vars"]["form"])
01508                 {
01509                         $this->tpl->setVariable("CLIENT_ID", $_SESSION["error_post_vars"]["form"]["client_id"]);
01510                         $this->tpl->setVariable("DB_HOST", $_SESSION["error_post_vars"]["form"]["db_host"]);    
01511                         $this->tpl->setVariable("DB_NAME", $_SESSION["error_post_vars"]["form"]["db_name"]);        
01512                         $this->tpl->setVariable("DB_USER", $_SESSION["error_post_vars"]["form"]["db_user"]);        
01513                         $this->tpl->setVariable("DB_PASS", $_SESSION["error_post_vars"]["form"]["db_pass"]);
01514                 }
01515                 else
01516                 {
01517                         $this->tpl->setVariable("CLIENT_ID", $this->client->getId());
01518                         $this->tpl->setVariable("DB_HOST", $this->client->getDbHost()); 
01519                         $this->tpl->setVariable("DB_NAME", $this->client->getDbName());     
01520                         $this->tpl->setVariable("DB_USER", $this->client->getDbUser());     
01521                         $this->tpl->setVariable("DB_PASS", $this->client->getDbPass());     
01522                 }
01523 
01524                 $this->tpl->setVariable("TXT_CLIENT_HEADER", $this->lng->txt("inst_identification"));
01525                 $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
01526                 $this->tpl->setVariable("TXT_DB_HEADER", $this->lng->txt("db_conn"));
01527                 $this->tpl->setVariable("TXT_DB_TYPE", $this->lng->txt("db_type"));
01528                 $this->tpl->setVariable("TXT_DB_HOST", $this->lng->txt("db_host"));
01529                 $this->tpl->setVariable("TXT_DB_NAME", $this->lng->txt("db_name")); 
01530                 $this->tpl->setVariable("TXT_DB_USER", $this->lng->txt("db_user"));
01531                 $this->tpl->setVariable("TXT_DB_PASS", $this->lng->txt("db_pass"));
01532 
01533                 if ($this->client->status["ini"]["status"])
01534                 {
01535                         $this->setButtonNext("db");
01536                 }
01537                 
01538                 $this->checkPanelMode();
01539         }
01540         
01546         function displayError($a_message)
01547         {
01548                 $this->tpl->addBlockFile("CONTENT", "content", "tpl.error.html");
01549                 
01550                 $this->tpl->setCurrentBlock("content");
01551                 $this->tpl->setVariable("FORMACTION", $_SESSION["referer"]);
01552                 $this->tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
01553                 $this->tpl->setVariable("ERROR_MESSAGE",($a_message));
01554                 $this->tpl->parseCurrentBlock();
01555                 
01556                 $this->tpl->show();
01557                 exit();
01558         }
01559 
01563         function displayLogout()
01564         {
01565                 $this->tpl->addBlockFile("CONTENT","content","tpl.logout.html");
01566 
01567                 session_destroy();
01568 
01569                 $this->logged_out = true;
01570                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("logged_out"));        
01571                 $this->tpl->setCurrentBlock("home_link");
01572                 $this->tpl->setVariable("TXT_INDEX",$this->lng->txt("ilias_homepage"));
01573                 $this->tpl->setVariable("LNK_INDEX",ILIAS_HTTP_PATH."/index.php");
01574                 $this->tpl->parseCurrentBlock();
01575         }
01576 
01580         function displayProcessPanel()
01581         {
01582                 $OK = "<font color=\"green\"><strong>OK</strong></font>";
01583                 
01584                 $steps = array();
01585                 $steps = $this->getStatus();
01586                 
01587                 // remove access step
01588                 unset($steps["access"]);
01589                 
01590                 $steps["ini"]["text"]       = $this->lng->txt("setup_process_step_ini");
01591                 $steps["db"]["text"]        = $this->lng->txt("setup_process_step_db");
01592                 $steps["lang"]["text"]      = $this->lng->txt("setup_process_step_lang");
01593                 $steps["contact"]["text"]   = $this->lng->txt("setup_process_step_contact");
01594                 $steps["nic"]["text"]       = $this->lng->txt("setup_process_step_nic");
01595                 $steps["finish"]["text"]    = $this->lng->txt("setup_process_step_finish");
01596                 
01597                 $this->tpl->addBlockFile("PROCESS_MENU","process_menu","tpl.process_panel.html");
01598 
01599                 $this->tpl->setVariable("TXT_SETUP_PROCESS_STATUS",$this->lng->txt("setup_process_status"));
01600 
01601                 $num = 1;
01602 
01603                 foreach ($steps as $key => $val)
01604                 {
01605                         $this->tpl->setCurrentBlock("menu_row");
01606                         $this->tpl->setVariable("TXT_STEP",$this->lng->txt("step")." ".$num.": &nbsp;");
01607                         $this->tpl->setVariable("TXT_ACTION",$val["text"]);
01608                         $this->tpl->setVariable("IMG_ARROW", "spacer.gif");
01609                         
01610                         $num++;
01611 
01612                         if ($this->cmd == $key and isset($this->cmd))
01613                         {
01614                                 $this->tpl->setVariable("HIGHLIGHT", " style=\"font-weight:bold;\"");
01615                                 $this->tpl->setVariable("IMG_ARROW", "arrow_right.png");
01616                         }
01617                         
01618                         $status = ($val["status"]) ? $OK : "";          
01619                         
01620                         $this->tpl->setVariable("TXT_STATUS",$status);
01621                         $this->tpl->parseCurrentBlock();
01622                 }
01623         }
01624 
01628         function displayStatusPanel()
01629         {
01630                 $OK = "<font color=\"green\"><strong>OK</strong></font>";
01631 
01632                 $this->tpl->addBlockFile("STATUS_PANEL","status_panel","tpl.status_panel.html");
01633 
01634                 $this->tpl->setVariable("TXT_OVERALL_STATUS",$this->lng->txt("overall_status"));
01635                 // display status
01636                 if ($this->client->status)
01637                 {
01638                         foreach ($this->client->status as $key => $val)
01639                         {
01640                                 $status = ($val["status"]) ? $OK : "&nbsp;";
01641                                 $this->tpl->setCurrentBlock("status_row");
01642                                 $this->tpl->setVariable("TXT_STEP",$key.":&nbsp;");
01643                                 $this->tpl->setVariable("TXT_STATUS",$status);
01644                                 $this->tpl->setVariable("TXT_COMMENT",$val["comment"]);
01645                                 $this->tpl->parseCurrentBlock();
01646                         }
01647                 }
01648         }
01649         
01655         function checkDisplayMode($a_title = "")
01656         {
01657                 switch ($this->display_mode)
01658                 {
01659                         case "view":
01660                                 $this->tpl->addBlockFile("CONTENT","content","tpl.clientview.html");
01661                                 // display tabs
01662                                 include "./include/inc.client_tabs.php";
01663                                 $client_name = ($this->client->getName()) ? $this->client->getName() : $this->lng->txt("no_client_name");
01664                                 $this->tpl->setVariable("TXT_HEADER",$client_name." (".$this->lng->txt("client_id").": ".$this->client->getId().")");       
01665                                 break;
01666                         
01667                         case "setup":
01668                                 $this->tpl->addBlockFile("CONTENT","content","tpl.clientsetup.html");
01669                                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt($a_title));        
01670                                 break;
01671 
01672                         default:
01673                                 $this->displayError($this->lng->txt("unknown_display_mode"));
01674                                 exit();
01675                                 break;
01676                 }
01677         }
01678 
01682         function checkPanelMode()
01683         {
01684                 switch ($this->display_mode)
01685                 {
01686                         case "view":
01687                                 $this->displayStatusPanel();                
01688                                 break;
01689                         
01690                         case "setup":
01691                                 $this->displayProcessPanel();
01692                                 break;
01693                 }
01694         }
01695 
01699         function displayStartup()
01700         {
01701                 $this->tpl->addBlockFile("CONTENT","content","tpl.clientsetup.html");
01702                 
01703                 $this->tpl->setVariable("TXT_INFO",$this->lng->txt("info_text_first_client"));
01704                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("setup_first_client"));
01705                 
01706                 $this->displayProcessPanel();
01707                 
01708                 $this->setButtonNext("ini");
01709         }
01710 
01714         function displayDatabase()
01715         {
01716                 global $ilErr,$ilDB,$ilLog;
01717 
01718                 $this->checkDisplayMode("setup_database");
01719 
01720                 // checkings
01721                 if ($_POST["form"]["db_flag"] == 1)
01722                 {
01723                         $message = "";
01724                         
01725                         if (!$this->client->db_installed)
01726                         {
01727                                 if (!$this->client->db_exists)
01728                                 {
01729                                         if ($_POST["form"]["chk_db_create"])
01730                                         {
01731                                                 if (!$this->createDatabase($_POST["collation"]))
01732                                                 {
01733                                                         $message = $this->lng->txt($this->getError());
01734                                                         $this->raiseError($message,$this->error_obj->MESSAGE);
01735                                                 }
01736                                         }
01737                                         else
01738                                         {
01739                                                 $message = $this->lng->txt("database_not_exists_create_first");
01740                                                 $this->raiseError($message,$this->error_obj->MESSAGE);                  
01741                                         }
01742                                 }
01743                                 
01744                                 if (!$this->installDatabase())
01745                                 {
01746                                         $message = $this->lng->txt($this->getError());
01747                                         $this->client->status["db"]["status"] = false;
01748                                         $this->client->status["db"]["comment"] = "install_error";
01749                                 }
01750                                 else
01751                                 {
01752                                         $message = $this->lng->txt("database_installed");
01753                                 }
01754                         }
01755                         else
01756                         {
01757                                 include_once "../classes/class.ilDBUpdate.php";
01758                                 include_once "../classes/class.ilRbacAdmin.php";
01759                                 include_once "../classes/class.ilRbacReview.php";
01760                                 include_once "../classes/class.ilRbacSystem.php";
01761                                 include_once "../classes/class.ilTree.php";
01762                                 include_once "../classes/class.ilSaxParser.php";
01763                                 include_once "../classes/class.ilObjectDefinition.php";
01764 
01765                                 // referencing db handler in language class
01766                                 $this->lng->setDbHandler($this->client->db);
01767 
01768                                 // referencing does not work in dbupdate-script
01769                                 $ilDB = new ilDbx($this->client->dsn);
01770 
01771                                 // run dbupdate
01772                                 $dbupdate = new ilDBUpdate($ilDB);
01773                                 $dbupdate->applyUpdate();
01774                         
01775                                 if ($dbupdate->updateMsg == "no_changes")
01776                                 {
01777                                         $message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
01778                                 }
01779                                 else
01780                                 {
01781                                         foreach ($dbupdate->updateMsg as $row)
01782                                         {
01783                                                 $message .= $this->lng->txt($row["msg"]).": ".$row["nr"]."<br/>";
01784                                         }
01785                                 }
01786                         }
01787                 }
01788 
01789                 sendInfo($message);
01790 
01791                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_db.html");
01792                 
01793                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
01794                 $this->tpl->setVariable("DB_HOST", $this->client->getDbHost());
01795                 $this->tpl->setVariable("DB_NAME", $this->client->getDbName());     
01796                 $this->tpl->setVariable("DB_USER", $this->client->getDbUser());     
01797                 $this->tpl->setVariable("DB_PASS", $this->client->getDbPass());
01798 
01799                 if ($this->client->db_installed)
01800                 {
01801                         // referencing db handler in language class
01802                         $this->lng->setDbHandler($this->client->db);
01803 
01804                         include_once "../classes/class.ilDBUpdate.php";
01805                         $ilDB = new ilDbx($this->client->dsn);
01806                         $dbupdate = new ilDBUpdate($ilDB);
01807 
01808                         if (!$db_status = $dbupdate->getDBVersionStatus())
01809                         {
01810                                 $remark = "<font color=\"red\">".$this->lng->txt("database_needs_update").
01811                                                                   " (".$this->lng->txt("database_version").": ".$dbupdate->currentVersion.
01812                                                                   " ; ".$this->lng->txt("file_version").": ".$dbupdate->fileVersion.")</font>";
01813                                 $this->tpl->setVariable("TXT_INFO", $remark);
01814                                 
01815                                 $this->tpl->setCurrentBlock("btn_submit");
01816                                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("database_update"));
01817                                 $this->tpl->parseCurrentBlock();
01818                         }
01819                         else
01820                         {
01821                                 $this->tpl->setVariable("TXT_INFO",$this->lng->txt("database_is_uptodate"));
01822                                 $this->client->status["db"]["status"] = true;
01823                                 $this->client->status["db"]["comment"] = "version ".$dbupdate->getCurrentVersion();
01824                         }
01825                         
01826                         $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("version"));
01827                         $this->tpl->setVariable("VAL_DB_VERSION", $ilDB->getMySQLVersion());
01828                         $this->tpl->setVariable("TXT_DB_MODE", $this->lng->txt("ilias_db_mode"));
01829                         
01830                         if ($ilDB->isMySQL4_1OrHigher())
01831                         {
01832                                 $this->tpl->setVariable("VAL_DB_MODE", $this->lng->txt("mysql_4_1_x_or_higher_mode"));
01833                         }
01834                         else
01835                         {
01836                                 $this->tpl->setVariable("VAL_DB_MODE", $this->lng->txt("mysql_4_0_x_or_lower_mode"));
01837                         }
01838                         $this->tpl->setVariable("TXT_CHECK_VERSIONS", $this->lng->txt("check_db_versions"));
01839                 }
01840                 else
01841                 {
01842                         $checked = "";
01843 
01844                         if ($_SESSION["error_post_vars"]["form"]["chk_db_create"])
01845                         {
01846                                 $checked = "checked=\"checked\"";
01847                         }
01848 
01849                         $this->tpl->setCurrentBlock("option_db_create");
01850                         $this->tpl->setVariable("TXT_DB_CREATE", $this->lng->txt("database_create"));
01851                         $this->tpl->setVariable("DB_CREATE_CHECK",$checked);
01852                         $this->tpl->parseCurrentBlock();
01853 
01854                         $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("database_install"));
01855                         $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_db"));
01856                         
01857                         // output version
01858                         $ilDB = new ilDbx($this->client->dsn_host);
01859                         $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("version"));
01860                         $this->tpl->setVariable("VAL_DB_VERSION", $ilDB->getMySQLVersion());
01861                         $this->tpl->setVariable("TXT_DB_MODE", $this->lng->txt("ilias_db_mode"));
01862                         
01863                         if ($ilDB->isMySQL4_1OrHigher())
01864                         {
01865                                 $this->tpl->setVariable("VAL_DB_MODE", $this->lng->txt("mysql_4_1_x_or_higher_mode"));
01866                         }
01867                         else
01868                         {
01869                                 $this->tpl->setVariable("VAL_DB_MODE", $this->lng->txt("mysql_4_0_x_or_lower_mode"));
01870                         }
01871                         $this->tpl->setVariable("TXT_CHECK_VERSIONS", $this->lng->txt("check_db_versions"));
01872                         
01873                         // collation selection ( see utf8 collations at
01874                         // http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html )
01875                         if ($ilDB->isMySQL4_1OrHigher())
01876                         {
01877                                 $collations = array
01878                                 (
01879                                         "utf8_unicode_ci",
01880                                         "utf8_general_ci",
01881                                         "utf8_czech_ci",
01882                                         "utf8_danish_ci",
01883                                         "utf8_estonian_ci",
01884                                         "utf8_icelandic_ci",
01885                                         "utf8_latvian_ci",
01886                                         "utf8_lithuanian_ci",
01887                                         "utf8_persian_ci",
01888                                         "utf8_polish_ci",
01889                                         "utf8_roman_ci",
01890                                         "utf8_romanian_ci",
01891                                         "utf8_slovak_ci",
01892                                         "utf8_slovenian_ci",
01893                                         "utf8_spanish2_ci",
01894                                         "utf8_spanish_ci",
01895                                         "utf8_swedish_ci",
01896                                         "utf8_turkish_ci"
01897                                 );
01898                                 foreach($collations as $collation)
01899                                 {
01900                                         $this->tpl->setCurrentBlock("collation_item");
01901                                         $this->tpl->setVariable("VAL_COLLATION_ITEM", $collation);
01902                                         $this->tpl->setVariable("TXT_COLLATION_ITEM", $collation);
01903                                         $this->tpl->parseCurrentBlock();
01904                                 }
01905                                 $this->tpl->setCurrentBlock("collation_selection");
01906                                 $this->tpl->setVariable("TXT_COLLATION", $this->lng->txt("collation"));
01907                                 $this->tpl->parseCurrentBlock();
01908                                 //$this->tpl->setCurrentBlock("setup_content");
01909                                 $this->tpl->setVariable("COLLATION_INFO1", $this->lng->txt("info_text_db_collation1"));
01910                                 $this->tpl->setVariable("COLLATION_EXAMPLE",
01911                                         "<br /><br />".$this->lng->txt("example").": CREATE DATABASE ilias3 CHARACTER SET utf8 COLLATE utf8_unicode_ci");
01912                                 $this->tpl->setVariable("COLLATION_INFO2", "<br /><br />".$this->lng->txt("info_text_db_collation2")." ".
01913                                         "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
01914                                         " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
01915                         }
01916                 }
01917                 
01918                 $this->tpl->parseCurrentBlock();
01919                 
01920                 $this->tpl->setVariable("TXT_SETUP_TITLE", $this->lng->txt("setup_database"));
01921                 $this->tpl->setVariable("TXT_DB_HEADER", $this->lng->txt("db_conn"));
01922                 $this->tpl->setVariable("TXT_DB_TYPE", $this->lng->txt("db_type"));
01923                 $this->tpl->setVariable("TXT_DB_HOST", $this->lng->txt("db_host"));
01924                 $this->tpl->setVariable("TXT_DB_NAME", $this->lng->txt("db_name")); 
01925                 $this->tpl->setVariable("TXT_DB_USER", $this->lng->txt("db_user"));
01926                 $this->tpl->setVariable("TXT_DB_PASS", $this->lng->txt("db_pass"));
01927                 
01928                 // only allow to return to ini if db does not exist yet
01929                 if (!$this->client->db_installed)
01930                 {
01931                         $this->setButtonPrev("ini");
01932                 }
01933                 
01934                 if ($this->client->db_installed and $db_status)
01935                 {
01936                         $this->setButtonNext("lang");
01937                 }
01938                 
01939                 $this->checkPanelMode();
01940         }
01941         
01945         function displayLanguages()
01946         {
01947                 $this->checkDisplayMode("setup_languages");
01948 
01949                 if (!$this->client->db_installed)
01950                 {
01951                         // program should never come to this place
01952                         $message = "No database found! Please install database first.";
01953                         sendInfo($message);
01954                 }
01955         
01956                 // checkings
01957                 if ($_POST["form"])
01958                 {
01959                         if (empty($_POST["form"]["lang_id"]))
01960                         {
01961                                 $message = $this->lng->txt("lang_min_one_language");
01962                                 $this->raiseError($message,$this->error_obj->MESSAGE);
01963                         }
01964                         
01965                         if (!in_array($_POST["form"]["lang_default"],$_POST["form"]["lang_id"]))
01966                         {
01967                                 $message = $this->lng->txt("lang_not_installed_default");
01968                                 $this->error = true;
01969                                 $this->raiseError($message,$this->error_obj->MESSAGE);
01970 
01971                         }
01972                         
01973                         $result = $this->lng->installLanguages($_POST["form"]["lang_id"], $_POST["form"]["lang_local"]);
01974                         
01975                         if (is_array($result))
01976                         {
01977                                 $count = count($result);
01978                                 $txt = "tet";
01979                                 
01980                                 foreach ($result as $key => $lang_key)
01981                                 {
01982                                         $list .= $this->lng->txt("lang_".$lang_key);
01983                                         
01984                                         if ($count > $key + 1)
01985                                         {
01986                                                 $list .= ", ";
01987                                         }
01988                                 }
01989                         }
01990 
01991                         $this->client->setDefaultLanguage($_POST["form"]["lang_default"]);
01992                         $message = $this->lng->txt("languages_installed");
01993                         
01994                         if ($result !== true)
01995                         {
01996                                 $message .= "<br/>(".$this->lng->txt("langs_not_valid_not_installed").": ".$list.")";
01997                         }
01998                         sendInfo($message);
01999                 }
02000 
02001                 // output
02002                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_lang.html");
02003 
02004                 $languages = $this->lng->getInstallableLanguages();
02005                 $installed_langs = $this->lng->getInstalledLanguages();
02006                 $installed_local_langs = $this->lng->getInstalledLocalLanguages();
02007                 $local_langs = $this->lng->getLocalLanguages();
02008                 $default_lang = $this->client->getDefaultLanguage();
02009                 
02010                 $lang_count = count($installed_langs);
02011                 
02012                 $this->tpl->setVariable("TXT_LANG_HEADER", ucwords($this->lng->txt("available_languages")));
02013                 $this->tpl->setVariable("TXT_LANGUAGE", ucwords($this->lng->txt("language")));
02014                 $this->tpl->setVariable("TXT_INSTALLED", ucwords($this->lng->txt("installed")));
02015                 $this->tpl->setVariable("TXT_INCLUDE_LOCAL", ucwords($this->lng->txt("include_local")));
02016                 $this->tpl->setVariable("TXT_DEFAULT", ucwords($this->lng->txt("default")));
02017 
02018                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
02019                 
02020                 $this->tpl->setVariable("TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt("setup_languages"))));
02021                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_lang"));
02022                 
02023                 if ($lang_count > 0)
02024                 {
02025                         $this->client->status["lang"]["status"] = true;
02026                         $this->client->status["lang"]["comment"] = $lang_count." ".$this->lng->txt("languages_installed");
02027                 }
02028                 else
02029                 {
02030                         $this->client->status["lang"]["status"] = false;
02031                         $this->client->status["lang"]["comment"] = $this->lng->txt("lang_none_installed");
02032                 }
02033 
02034                 foreach ($languages as $lang_key)
02035                 {
02036                         $this->tpl->setCurrentBlock("language_row");
02037                         $this->tpl->setVariable("LANG_KEY", $lang_key);
02038                         $this->tpl->setVariable("TXT_LANG", $this->lng->txt("lang_".$lang_key));
02039                         $this->tpl->setVariable("BORDER", 0);
02040                         $this->tpl->setVariable("VSPACE", 0);
02041 
02042                         if (in_array($lang_key,$installed_langs))
02043                         {
02044                                 $this->tpl->setVariable("CHECKED", ("checked=\"checked\""));
02045                         }
02046 
02047                         if (!in_array($lang_key,$local_langs))
02048                         {
02049                                 $this->tpl->setVariable("LOCAL", ("disabled=\"disabled\""));        
02050                         }
02051                         else if (in_array($lang_key,$installed_local_langs))
02052                         {
02053                                 $this->tpl->setVariable("LOCAL", ("checked=\"checked\""));
02054                         }
02055 
02056                         if ($lang_key == $default_lang)
02057                         {
02058                                 $this->tpl->setVariable("DEFAULT", ("checked=\"checked\""));
02059                         }
02060 
02061                         $this->tpl->parseCurrentBlock();
02062                 }
02063                 
02064                 $this->setButtonPrev("db");
02065                 
02066                 if ($lang_count > 0)
02067                 {
02068                         $this->setButtonNext("contact");
02069                 }
02070                 
02071                 $this->checkPanelMode();
02072         }
02073         
02077         function displayContactData()
02078         {
02079                 $this->checkDisplayMode("setup_contact_data");
02080         
02081                 $settings = $this->client->getAllSettings();
02082 
02083                 // formular sent
02084                 if ($_POST["form"])
02085                 {
02086                         // init checking var
02087                         $form_valid = true;
02088 
02089                         // check required fields
02090                         if (empty($_POST["form"]["admin_firstname"]) or empty($_POST["form"]["admin_lastname"])
02091                                 or empty($_POST["form"]["admin_street"]) or empty($_POST["form"]["admin_zipcode"])
02092                                 or empty($_POST["form"]["admin_country"]) or empty($_POST["form"]["admin_city"])
02093                                 or empty($_POST["form"]["admin_phone"]) or empty($_POST["form"]["admin_email"])
02094                                 or empty($_POST["form"]["inst_name"]) or empty($_POST["form"]["inst_info"]))
02095                         {
02096                                 $form_valid = false;
02097                                 $message = $this->lng->txt("fill_out_required_fields");
02098                                 //$this->raiseError($message,$this->error_obj->MESSAGE);
02099                                 sendInfo($message);
02100                         }
02101                         
02102                         // admin email
02103                         if (!ilUtil::is_email($_POST["form"]["admin_email"]) and $form_valid)
02104                         {
02105                                 $form_valid = false;
02106                                 $message = $this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid");
02107                                 sendInfo($message);
02108                                 //$this->raiseError($message,$this->error_obj->MESSAGE);
02109                         }
02110 
02111                         if (!$form_valid)   //required fields not satisfied. Set formular to already fill in values
02112                         {
02113                                 // load user modified settings again
02114                                 // contact
02115                                 $settings["admin_firstname"] = ilUtil::prepareFormOutput($_POST["form"]["admin_firstname"],true);
02116                                 $settings["admin_lastname"] = ilUtil::prepareFormOutput($_POST["form"]["admin_lastname"],true);
02117                                 $settings["admin_title"] = ilUtil::prepareFormOutput($_POST["form"]["admin_title"],true);
02118                                 $settings["admin_position"] = ilUtil::prepareFormOutput($_POST["form"]["admin_position"],true);
02119                                 $settings["admin_institution"] = ilUtil::prepareFormOutput($_POST["form"]["admin_institution"],true);
02120                                 $settings["admin_street"] = ilUtil::prepareFormOutput($_POST["form"]["admin_street"],true);
02121                                 $settings["admin_zipcode"] = ilUtil::prepareFormOutput($_POST["form"]["admin_zipcode"],true);
02122                                 $settings["admin_city"] = ilUtil::prepareFormOutput($_POST["form"]["admin_city"],true);
02123                                 $settings["admin_country"] = ilUtil::prepareFormOutput($_POST["form"]["admin_country"],true);
02124                                 $settings["admin_phone"] = ilUtil::prepareFormOutput($_POST["form"]["admin_phone"],true);
02125                                 $settings["admin_email"] = ilUtil::prepareFormOutput($_POST["form"]["admin_email"],true);
02126 
02127                                 // client
02128                                 $settings["inst_name"] = ilUtil::prepareFormOutput($_POST["form"]["inst_name"],true);
02129                                 $settings["inst_info"] = ilUtil::prepareFormOutput($_POST["form"]["inst_info"],true);
02130                                 $settings["inst_institution"] = ilUtil::prepareFormOutput($_POST["form"]["inst_institution"],true);
02131                         }
02132                         else // all required fields ok
02133                         {
02134 
02135                                 // write new settings
02136                                 // contact
02137                                 $this->client->setSetting("admin_firstname",ilUtil::stripSlashes($_POST["form"]["admin_firstname"]));
02138                                 $this->client->setSetting("admin_lastname",ilUtil::stripSlashes($_POST["form"]["admin_lastname"]));
02139                                 $this->client->setSetting("admin_title",ilUtil::stripSlashes($_POST["form"]["admin_title"]));
02140                                 $this->client->setSetting("admin_position",ilUtil::stripSlashes($_POST["form"]["admin_position"]));
02141                                 $this->client->setSetting("admin_institution",ilUtil::stripSlashes($_POST["form"]["admin_institution"]));
02142                                 $this->client->setSetting("admin_street",ilUtil::stripSlashes($_POST["form"]["admin_street"]));
02143                                 $this->client->setSetting("admin_zipcode",ilUtil::stripSlashes($_POST["form"]["admin_zipcode"]));
02144                                 $this->client->setSetting("admin_city",ilUtil::stripSlashes($_POST["form"]["admin_city"]));
02145                                 $this->client->setSetting("admin_country",ilUtil::stripSlashes($_POST["form"]["admin_country"]));
02146                                 $this->client->setSetting("admin_phone",ilUtil::stripSlashes($_POST["form"]["admin_phone"]));
02147                                 $this->client->setSetting("admin_email",ilUtil::stripSlashes($_POST["form"]["admin_email"]));
02148                                 $this->client->setSetting("inst_institution",ilUtil::stripSlashes($_POST["form"]["inst_institution"]));
02149                                 $this->client->setSetting("inst_name",ilUtil::stripSlashes($_POST["form"]["inst_name"]));
02150 
02151                                 // update client.ini
02152                                 $this->client->setName(ilUtil::stripSlashes($_POST["form"]["inst_name"]));
02153                                 $this->client->setDescription(ilUtil::stripSlashes($_POST["form"]["inst_info"]));
02154                                 $this->client->ini->write();
02155 
02156                                 // reload settings
02157                                 $settings = $this->client->getAllSettings();
02158                                 // feedback
02159                                 sendInfo($this->lng->txt("saved_successfully"));
02160                         }
02161                 }
02162 
02163                 // output
02164                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_contact.html");
02165 
02166                 // client values
02167                 $this->tpl->setVariable("INST_NAME",ilUtil::prepareFormOutput(($this->client->getName()) ? $this->client->getName() : $this->client->getId()));
02168                 $this->tpl->setVariable("INST_INFO",ilUtil::prepareFormOutput($this->client->getDescription()));
02169                 $this->tpl->setVariable("INST_INSTITUTION",ilUtil::prepareFormOutput($settings["inst_institution"]));
02170 
02171                 // contact values
02172                 $this->tpl->setVariable("ADMIN_FIRSTNAME",ilUtil::prepareFormOutput($settings["admin_firstname"]));
02173                 $this->tpl->setVariable("ADMIN_LASTNAME",ilUtil::prepareFormOutput($settings["admin_lastname"]));
02174                 $this->tpl->setVariable("ADMIN_TITLE",ilUtil::prepareFormOutput($settings["admin_title"]));
02175                 $this->tpl->setVariable("ADMIN_POSITION",ilUtil::prepareFormOutput($settings["admin_position"]));
02176                 $this->tpl->setVariable("ADMIN_INSTITUTION",ilUtil::prepareFormOutput($settings["admin_institution"]));
02177                 $this->tpl->setVariable("ADMIN_STREET",ilUtil::prepareFormOutput($settings["admin_street"]));
02178                 $this->tpl->setVariable("ADMIN_ZIPCODE",ilUtil::prepareFormOutput($settings["admin_zipcode"]));
02179                 $this->tpl->setVariable("ADMIN_CITY",ilUtil::prepareFormOutput($settings["admin_city"]));
02180                 $this->tpl->setVariable("ADMIN_COUNTRY",ilUtil::prepareFormOutput($settings["admin_country"]));
02181                 $this->tpl->setVariable("ADMIN_PHONE",ilUtil::prepareFormOutput($settings["admin_phone"]));
02182                 $this->tpl->setVariable("ADMIN_EMAIL",ilUtil::prepareFormOutput($settings["admin_email"]));
02183                 
02184                 // client text
02185                 $this->tpl->setVariable("TXT_INST_DATA", $this->lng->txt("client_data"));
02186                 $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("client_name"));
02187                 $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("client_info"));
02188                 $this->tpl->setVariable("TXT_INST_INSTITUTION", $this->lng->txt("client_institution"));
02189 
02190                 // contact text
02191                 $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
02192                 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
02193                 $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
02194                 $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
02195                 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
02196                 $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
02197                 $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
02198                 $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
02199                 $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
02200                 $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
02201                 $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
02202                 $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
02203                 $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
02204                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
02205                 
02206                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
02207                 $this->tpl->setVariable("TXT_SETUP_TITLE","contact information & client data");
02208                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_contact"));
02209                 
02210                 $this->setButtonPrev("lang");
02211                 
02212                 $check = $this->checkClientContact($this->client);
02213 
02214                 $this->client->status["contact"]["status"] = $check["status"];
02215                 $this->client->status["contact"]["comment"] = $check["comment"];
02216 
02217                 if ($check["status"])
02218                 {
02219                         $this->setButtonNext("nic");
02220                 }
02221                 
02222                 $this->checkPanelMode();
02223         }
02224 
02228         function displayNIC()
02229         {
02230                 $this->checkDisplayMode("nic_registration");
02231                 $settings = $this->client->getAllSettings();
02232                 $nic_key = $this->client->getNICkey();
02233                 
02234                 // formular sent
02235                 if ($_POST["form"])
02236                 {
02237                         // check register option
02238                         if ($_POST["form"]["register"] == 1)
02239                         {
02240                                 // update nic
02241                                 $this->client->updateNIC($this->ilias_nic_server);
02242                                 
02243                                 // online registration failed
02244                                 if (empty($this->client->nic_status[2]))
02245                                 {
02246                                         $this->client->setSetting("nic_enabled","-1");
02247                                         $message = $this->lng->txt("nic_reg_failed");               
02248                                 }
02249                                 else
02250                                 {
02251                                         $this->client->setSetting("inst_id",$this->client->nic_status[2]);
02252                                         $this->client->setSetting("nic_enabled","1");
02253                                         $this->client->status["nic"]["status"] = true;
02254                                         $message = $this->lng->txt("nic_reg_enabled");      
02255                                 }
02256                         }
02257                         elseif ($_POST["form"]["register"] == 2)
02258                         {
02259                                 $nic_by_email = (int) $_POST["form"]["nic_id"];
02260                                 
02261                                 $checksum = md5($nic_key.$nic_by_email);
02262                                 
02263                                 if (!$nic_by_email or $_POST["form"]["nic_checksum"] != $checksum)
02264                                 {
02265                                         $message = $this->lng->txt("nic_reg_enter_correct_id");     
02266                                 }
02267                                 else
02268                                 {
02269                                         $this->client->setSetting("inst_id",$nic_by_email);
02270                                         $this->client->setSetting("nic_enabled","1");
02271                                         $message = $this->lng->txt("nic_reg_enabled");      
02272                                 }
02273                         }
02274                         else
02275                         {
02276                                 $this->client->setSetting("inst_id","0");
02277                                 $this->client->setSetting("nic_enabled","0");
02278                                 $message = $this->lng->txt("nic_reg_disabled");
02279                         }
02280 
02281                         sendInfo($message);
02282                 }
02283                 
02284                 // reload settings
02285                 $settings = $this->client->getAllSettings();
02286                 
02287                 if ($settings["nic_enabled"] == "1" && $settings["inst_id"] > 0)
02288                 {
02289                         $this->tpl->setVariable("TXT_INFO",$this->lng->txt("info_text_nic3")." ".$settings["inst_id"].".");
02290                 }
02291                 else
02292                 {
02293                         // reload settings
02294                         $settings = $this->client->getAllSettings();
02295                         
02296                         $email_subject = rawurlencode("NIC registration request");
02297                         $email_body = base64_encode($this->client->getURLStringForNIC($this->ilias_nic_server));
02298                         $email_link = "<a href=\"mailto:ilias-nic@uni-koeln.de?subject=".$email_subject."&body=".$email_body."\">".$this->lng->txt("email")."</a>";
02299 
02300                         $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_nic1")." ".$email_link." ".$this->lng->txt("info_text_nic2"));
02301 
02302                         // output
02303                         $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_nic.html");
02304         
02305                         $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
02306         
02307                         // register form
02308                         $this->tpl->setVariable("TXT_NIC_ENTER_ID",$this->lng->txt("nic_reg_enter_id"));
02309                         $this->tpl->setVariable("TXT_NIC_ENTER_CHECKSUM",$this->lng->txt("nic_reg_enter_checksum"));
02310                         $this->tpl->setVariable("TXT_NIC_REGISTER",$this->lng->txt("nic_registration"));
02311                         $this->tpl->setVariable("TXT_NIC_ENABLE",$this->lng->txt("nic_reg_online"));
02312                         $this->tpl->setVariable("TXT_NIC_EMAIL",$this->lng->txt("nic_reg_email"));
02313                         $this->tpl->setVariable("TXT_NIC_DISABLE",$this->lng->txt("nic_reg_disable")." <span class=\"subtitle\">".$this->lng->txt("nic_reg_disable_comment")."</span>");
02314         
02315                         $checked = "checked=\"checked\"";
02316                         
02317                         if (!isset($settings["nic_enabled"]) or $settings["nic_enabled"] == "1")
02318                         {
02319                                 $this->tpl->setVariable("ENABLED",$checked);
02320                         }
02321                         elseif ($settings["nic_enabled"] == "2")
02322                         {
02323                                 $this->tpl->setVariable("EMAIL",$checked);
02324                         }
02325                         else
02326                         {
02327                                 $this->tpl->setVariable("DISABLED",$checked);
02328                         }
02329         
02330                         if (isset($settings["nic_enabled"]))
02331                         {
02332                                 $this->client->status["nic"]["status"] = true;
02333                         }
02334                 }
02335 
02336                 $this->setButtonPrev("contact");
02337                 
02338                 if ($this->client->status["nic"]["status"])
02339                 {
02340                         $this->setButtonNext("finish","finish");
02341                 }
02342                 
02343                 $this->checkPanelMode();
02344         }
02345         
02349         function displayTools()
02350         {
02351                 $this->checkDisplayMode();
02352                 
02353                 // output
02354                 sendInfo();
02355                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_tools.html");
02356                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
02357                 $this->tpl->setVariable("TXT_TOOLS", $this->lng->txt("tools"));
02358                 $this->tpl->setVariable("TXT_CTRL_STRUCTURE", $this->lng->txt("ctrl_structure"));
02359                 $this->tpl->setVariable("TXT_RELOAD", $this->lng->txt("reload"));
02360 
02361                 $q = "SELECT count(*) as cnt FROM ctrl_calls";
02362                 $cset = $this->client->db->query($q);
02363                 $crec = $cset->fetchRow(DB_FETCHMODE_ASSOC);
02364                 if ($crec["cnt"] == 0)
02365                 {
02366                         $this->tpl->setVariable("TXT_CTRL_STRUCTURE_DESC",
02367                                 $this->lng->txt("ctrl_missing_desc"));
02368                 }
02369                 else
02370                 {
02371                         $this->tpl->setVariable("TXT_CTRL_STRUCTURE_DESC",
02372                                 $this->lng->txt("ctrl_structure_desc"));
02373                 }
02374 
02375                 $this->tpl->parseCurrentBlock();
02376                 
02377                 //$this->checkPanelMode();
02378         }
02379 
02383         function reloadControlStructure()
02384         {
02385                 global $ilCtrlStructureReader;
02386                 
02387                 if (!$this->client->db_installed)
02388                 {
02389                         sendInfo($this->lng->txt("no_db"), true);
02390                         $this->displayTools();
02391                         return;
02392                 }
02393                 
02394                 // referencing does not work in dbupdate-script
02395                 $GLOBALS["ilDB"] = new ilDbx($this->client->dsn);
02396                 $ilCtrlStructureReader->readStructure(true);
02397                 sendInfo($this->lng->txt("ctrl_structure_reloaded"), true);
02398                 $this->displayTools();
02399         }
02400 
02401 
02402         
02406         function changeMasterPassword()
02407         {
02408                 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html");
02409                 
02410                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_password"));
02411 
02412                 // formular sent
02413                 if ($_POST["form"])
02414                 {
02415                         $pass_old = $this->getPassword();
02416 
02417                         if (empty($_POST["form"]["pass_old"]))
02418                         {
02419                                 $message = $this->lng->txt("password_enter_old");
02420                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02421                         }
02422                                 
02423                         if (md5($_POST["form"]["pass_old"]) != $pass_old)
02424                         {
02425                                 $message = $this->lng->txt("password_old_wrong");
02426                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02427                         }
02428                         
02429                         if (empty($_POST["form"]["pass"]))
02430                         {
02431                                 $message = $this->lng->txt("password_empty");
02432                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02433                         }
02434                         
02435                         if ($_POST["form"]["pass"] != $_POST["form"]["pass2"])
02436                         {
02437                                 $message = $this->lng->txt("password_not_match");
02438                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02439                         }
02440                         
02441                         if (md5($_POST["form"]["pass"]) == $pass_old)
02442                         {
02443                                 $message = $this->lng->txt("password_same");
02444                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02445                         }
02446                         
02447                         if (!$this->setPassword($_POST["form"]["pass"]))
02448                         {
02449                                 $message = $this->lng->txt("save_error");
02450                                 $this->raiseError($message,$this->error_obj->MESSAGE);
02451                         }
02452 
02453                         sendInfo($this->lng->txt("password_changed"),true);
02454                         ilUtil::redirect("setup.php");
02455                 }
02456                 
02457                 // output
02458                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_change_admin_password.html");
02459 
02460                 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("password_new_master"));
02461 
02462                 // pass form
02463                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
02464                 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
02465                 $this->tpl->setVariable("TXT_PASS_TITLE",$this->lng->txt("change_password"));
02466                 $this->tpl->setVariable("TXT_PASS_OLD",$this->lng->txt("set_oldpasswd"));
02467                 $this->tpl->setVariable("TXT_PASS",$this->lng->txt("set_newpasswd"));
02468                 $this->tpl->setVariable("TXT_PASS2",$this->lng->txt("password_retype"));
02469                 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
02470         }
02471 
02475         function displayFinishSetup()
02476         {
02477                 $this->checkDisplayMode("finish_setup");
02478 
02479                 if ($this->validateSetup())
02480                 {
02481                         $txt_info = $this->lng->txt("info_text_finish1");
02482                         $this->setButtonNext("login_new","login");
02483                         $this->client->setSetting("setup_ok",1);
02484                         $this->client->status["finish"]["status"] = true;
02485                 }
02486                 else
02487                 {
02488                         $txt_info = $this->lng->txt("info_text_finish2");
02489                 }
02490                 
02491                 // output
02492                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_finish.html");
02493                 $this->tpl->setVariable("TXT_INFO",$txt_info);
02494                 
02495                 $this->setButtonPrev("nic");
02496                 
02497                 $this->checkPanelMode();
02498         }
02499         
02503         function displayDeleteConfirmation()
02504         {
02505                 $this->checkDisplayMode();
02506 
02507                 // formular sent
02508                 if ($_POST["form"]["delete"])
02509                 {
02510                         $ini = true;
02511                         $db = false;
02512                         $files = false;
02513                 
02514                         /* disabled
02515                         switch ($_POST["form"]["delete"])
02516                         {
02517                                 case 1:
02518                                         $ini = true;
02519                                         break;
02520                         
02521                                 case 2:
02522                                         $ini = true;
02523                                         $db = true;
02524                                         break;
02525 
02526                                 case 3:
02527                                         $ini = true;
02528                                         $db = true;
02529                                         $files = true;
02530                                         break;      
02531                         }
02532                         */
02533                         
02534                         $msg = $this->client->delete($ini,$db,$files);
02535 
02536                         sendInfo($this->lng->txt("client_deleted"),true);
02537                         ilUtil::redirect("setup.php");
02538                 }
02539 
02540                 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_delete"));
02541                 
02542                 // output
02543                 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_delete_client.html");
02544 
02545                 // delete panel
02546                 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
02547                 $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
02548                 $this->tpl->setVariable("TXT_DELETE_CONFIRM", $this->lng->txt("delete_confirm"));
02549                 $this->tpl->setVariable("TXT_DELETE_INFO", $this->lng->txt("delete_info"));
02550 
02551                 $this->checkPanelMode();
02552         }
02553         
02559         function changeAccessMode($a_back)
02560         {
02561                 if ($this->client->status["finish"]["status"])
02562                 {
02563                         $val = ($this->client->ini->readVariable("client","access")) ? "0" : true;
02564                         $this->client->ini->setVariable("client","access",$val);
02565                         $this->client->ini->write();
02566                         $message = "client_access_mode_changed";
02567                 }
02568                 else
02569                 {
02570                         $message = "client_setup_not_finished";
02571                 }
02572                 
02573                 sendInfo($this->lng->txt($message),true);
02574                 
02575                 ilUtil::redirect("setup.php?cmd=".$a_back);
02576         }
02577         
02581         function changeDefaultClient()
02582         {
02583                 if ($_POST["form"])
02584                 {
02585                         $client = new ilClient($_POST["form"]["default"]);
02586 
02587                         if (!$client->init())
02588                         {
02589                                 $this->raiseError($this->lng->txt("no_valid_client_id"),$this->error_obj->MESSAGE);
02590                         }
02591                         
02592                         $status = $this->getStatus($client);
02593                 
02594                         if ($status["finish"]["status"])
02595                         {
02596                                 $this->ini->setVariable("clients","default",$client->getId());
02597                                 $this->ini->write();
02598                                 $message = "default_client_changed";
02599                         }
02600                         else
02601                         {
02602                                 $message = "client_setup_not_finished";
02603                         }
02604                 }
02605                 
02606                 sendInfo($this->lng->txt($message),true);
02607                 
02608                 ilUtil::redirect("setup.php");
02609         }
02610 
02615         function validateSetup()
02616         {
02617                 foreach ($this->client->status as $key => $val)
02618                 {
02619                         if ($key != "finish" and $key != "access")
02620                         {
02621                                 if ($val["status"] != true)
02622                                 {
02623                                         return false;
02624                                 }
02625                         }
02626                 }
02627                 
02628                 $clientlist = new ilClientList();
02629                 $list = $clientlist->getClients();
02630                 
02631                 if (count($list) == 1)
02632                 {
02633                         $this->ini->setVariable("clients","default",$this->client->getId());
02634                         $this->ini->write();
02635 
02636                         $this->client->ini->setVariable("client","access",1);
02637                         $this->client->ini->write();
02638                 }
02639 
02640                 return true;
02641         }
02642         
02646         function jumpToFirstUnfinishedSetupStep()
02647         {
02648                 if (!$this->client->status["db"]["status"])
02649                 {
02650                         $this->cmd = "db";
02651                         sendInfo($this->lng->txt("finish_initial_setup_first"),true);
02652                         $this->displayDatabase();
02653                 }
02654                 elseif (!$this->client->status["lang"]["status"])
02655                 {
02656                         $this->cmd = "lang";
02657                         sendInfo($this->lng->txt("finish_initial_setup_first"),true);
02658                         $this->displayLanguages();      
02659                 }
02660                 elseif (!$this->client->status["contact"]["status"])
02661                 {
02662                         $this->cmd = "contact";
02663                         sendInfo($this->lng->txt("finish_initial_setup_first"),true);
02664                         $this->displayContactData();        
02665                 }
02666                 elseif (!$this->client->status["nic"]["status"])
02667                 {
02668                         $this->cmd = "nic";
02669                         sendInfo($this->lng->txt("finish_initial_setup_first"),true);
02670                         $this->displayNIC();        
02671                 }
02672                 elseif (!$this->client->status["finish"]["status"])
02673                 {
02674                         $this->cmd = "finish";
02675                         sendInfo($this->lng->txt("finish_initial_setup_first"),true);
02676                         $this->displayFinishSetup();        
02677                 }
02678                 else
02679                 {
02680                         return false;
02681                 }
02682         }
02683 
02687         function toggleClientList()
02688         {
02689                 if ($this->ini->readVariable("clients","list"))
02690                 {
02691                         $this->ini->setVariable("clients","list","0");
02692                         $this->ini->write();
02693                         sendInfo($this->lng->txt("list_disabled"),true);
02694                 }
02695                 else
02696                 {
02697                         $this->ini->setVariable("clients","list","1");
02698                         $this->ini->write();
02699                         sendInfo($this->lng->txt("list_enabled"),true);             
02700                 }
02701                 
02702                 ilUtil::redirect("setup.php");
02703         }
02704 } // END class.ilSetupGUI
02705 ?>

Generated on Fri Dec 13 2013 13:52:13 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1