4require_once 
"./setup/classes/class.ilSetup.php";
 
   47                include_once(
"./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php");
 
   49                $this->tabs->setSetupMode(
true);
 
   51                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
   53                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
   56                $tpl->addJavaScript(
"./Services/JavaScript/js/Basic.js", 0);
 
   58                include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
 
   62                $this->revision = 
'$Revision$';
 
   63                $this->version = 
"2 ".substr(substr($this->revision,1),0,-2);
 
   64                $this->lang = $this->lng->lang_key;
 
   71                if (
$_POST[
"client_id"] != 
"")
 
   91                $this->setup->ini_client_exists = $this->setup->newClient(
$client_id);
 
   92                if (is_object($this->setup->getClient()))
 
   94                        $this->setup->getClient()->status = $this->setup->getStatus(
$client_id);
 
   98                if (($this->cmd = 
$_GET[
"cmd"]) == 
"gateway")
 
  101                        @$this->cmd = key(
$_POST[
"cmd"]);
 
  107                if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status[
"finish"][
"status"] and $this->cmd != 
"clientlist" and $this->cmd != 
"")
 
  120                if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled())
 
  123                        if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable(
"clients",
"path")))
 
  129                                if ($this->cmd == 
"performLogin" || $this->cmd == 
"performMLogin")
 
  142                        if ($this->setup->isAdmin())
 
  157                        echo 
"cmd: ".$this->cmd.
" | access: ".$this->setup->access_mode.
" | display: ".
$this->display_mode;
 
  158                        var_dump($this->setup->getClient()->status);
 
  179                        case "preliminaries":
 
  180                                $this->setup->checkPreliminaries();
 
  188                        case "determineToolsPathInstall":
 
  192                        case "saveBasicSettings":
 
  197                                $this->
displayError($this->lng->txt(
"unknown_command"));
 
  215                                $this->active_tab = 
"clientlist";
 
  218                        case "changepassword":
 
  221                                $this->active_tab = 
"password";
 
  224                        case "mastersettings":
 
  227                                $this->active_tab = 
"basicsettings";
 
  230                        case "determineToolsPath":
 
  235                        case "changedefault":
 
  240                                $this->cmd = 
"selectdb";
 
  242                                $this->setup->ini_client_exists = $this->setup->newClient();
 
  256                                $this->setup->ini_client_exists = $this->setup->newClient();
 
  270                        case "preliminaries":
 
  271                                $this->setup->checkPreliminaries();
 
  273                                $this->active_tab = 
"preliminaries";
 
  276                        case "updateBasicSettings":
 
  278                        case "performMLogin":
 
  298                                if ($this->setup->getClient()->db_installed)
 
  332                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"sess" and $this->setup->error === 
true)
 
  343                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"lang" and $this->setup->error === 
true)
 
  354                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"contact")
 
  365                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"proxy")
 
  376                                $this->displayCache();
 
  381                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"nic")
 
  392                                if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and 
$_GET[
"cmd"] == 
"finish")
 
  412                                ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
 
  416                                if ($this->setup->getClient()->ini->readVariable(
"client",
"access") != 
"1")
 
  418                                        $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
 
  419                                        $this->setup->getClient()->ini->write();
 
  423                                ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
 
  430                        case "reloadStructure":
 
  438                        case "saveClientIni":
 
  439                        case "installDatabase":
 
  440                        case "displayDatabase":
 
  441                        case "updateDatabase":
 
  442                        case "showUpdateSteps":
 
  443                        case "saveLanguages":
 
  445                        case "displayContactData":
 
  447                        case "saveRegistration":
 
  449                        case "showHotfixSteps":
 
  450                        case "applyCustomUpdates":
 
  451                        case "changeSettingsType":
 
  452                        case "showLongerSettings":
 
  453                        case "cloneSelectSource":
 
  454                        case "cloneSaveSource":
 
  456                        case "displayPassword":
 
  464                                $this->
displayError($this->lng->txt(
"unknown_command"));
 
  486                if ($a_mode != 
"view" and $a_mode != 
"setup")
 
  491                $this->display_mode = $a_mode;
 
  502                $languages = $this->lng->getLanguages();
 
  504                $count = (int) round(count($languages) / 2);
 
  507                foreach ($languages as $lang_key)
 
  515                        $this->tpl->setCurrentBlock(
"languages");
 
  516                        $this->tpl->setVariable(
"LINK_LANG", 
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
 
  517                        $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
 
  518                        $this->tpl->setVariable(
"LANG_ICON", $lang_key);
 
  519                        $this->tpl->setVariable(
"LANG_KEY", $lang_key);
 
  520                        $this->tpl->setVariable(
"BORDER", 0);
 
  521                        $this->tpl->setVariable(
"VSPACE", 0);
 
  522                        $this->tpl->parseCurrentBlock();
 
  527                if (count($languages) % 2)
 
  529                        $this->tpl->touchBlock(
"lng_empty_cell");
 
  532                if ($this->cmd != 
"logout" and $this->setup->isInstalled() and $this->setup->isAuthenticated())
 
  535                        if ($this->setup->isAdmin())
 
  537                                if ($this->display_mode == 
"view" or $this->cmd == 
"clientlist" or $this->cmd == 
"changepassword" or $this->cmd == 
"mastersettings")
 
  539                                        $this->tpl->setCurrentBlock(
"add_client");
 
  540                                        $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
 
  541                                        $this->tpl->parseCurrentBlock();
 
  545                                $class = ($this->active_tab == 
"clientlist")
 
  548                                $this->tpl->setCurrentBlock(
"display_list");
 
  549                                $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
 
  550                                $this->tpl->setVariable(
"TAB_CLASS", $class);
 
  551                                $this->tpl->parseCurrentBlock();
 
  554                                $class = ($this->active_tab == 
"basicsettings")
 
  557                                $this->tpl->setCurrentBlock(
"edit_pathes");
 
  558                                $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
 
  559                                $this->tpl->setVariable(
"TAB_CLASS", $class);
 
  560                                $this->tpl->parseCurrentBlock();
 
  563                                $class = ($this->active_tab == 
"preliminaries")
 
  566                                $this->tpl->setCurrentBlock(
"preliminaries");
 
  567                                $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
 
  568                                $this->tpl->setVariable(
"TAB_CLASS", $class);
 
  569                                $this->tpl->parseCurrentBlock();
 
  572                                $class = ($this->active_tab == 
"password")
 
  575                                $this->tpl->setCurrentBlock(
"change_password");
 
  576                                $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
 
  577                                $this->tpl->setVariable(
"TAB_CLASS", $class);
 
  578                                $this->tpl->parseCurrentBlock();
 
  582                        if ($this->setup->isAuthenticated())
 
  584                                $this->tpl->setCurrentBlock(
"logout");
 
  585                                $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
 
  586                                $this->tpl->parseCurrentBlock();
 
  590                $this->tpl->setVariable(
"VAL_CMD", 
$_GET[
"cmd"]);
 
  591                $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
 
  592                $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
 
  593                $this->tpl->setVariable(
"PAGETITLE",
"Setup");
 
  595                $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
 
  596                $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
 
  597                $this->tpl->setVariable(
"TXT_ILIAS_VERSION", 
"ILIAS ".
ILIAS_VERSION);
 
  598                $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
 
  599                $this->tpl->setVariable(
"VERSION", $this->version);
 
  600                $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
 
  601                $this->tpl->setVariable(
"LANG", $this->lang);
 
  610                if ($this->cmd != 
"logout")
 
  612                        if ($this->setup->ini_ilias_exists and $this->display_mode == 
"setup" and $this->setup->getClient()->getId() != 
"")
 
  614                                $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
 
  616                        elseif ($this->setup->isAdmin())
 
  618                                $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
 
  634                if (!$this->btn_prev_on and !$this->btn_next_on)
 
  639                $ntpl = 
new ilTemplate(
"tpl.navbuttons.html", 
true, 
true, 
"setup");
 
  642                $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
 
  644                if ($this->btn_prev_on)
 
  646                        $ntpl->setCurrentBlock(
"btn_back");
 
  647                        $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
 
  648                        $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
 
  649                        $ntpl->parseCurrentBlock();
 
  652                if ($this->btn_next_on)
 
  654                        $ntpl->setCurrentBlock(
"btn_forward");
 
  655                        $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
 
  656                        $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
 
  657                        $ntpl->parseCurrentBlock();
 
  660                $nav_html = $ntpl->get();
 
  661                $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
 
  662                if (!$this->no_second_nav)
 
  664                        $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
 
  677                $this->btn_prev_on = 
true;
 
  678                $this->btn_prev_cmd = ($a_cmd) ? $a_cmd : 
"gateway";
 
  679                $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
 
  690                $this->btn_next_on = 
true;
 
  691                $this->btn_next_cmd = ($a_cmd) ? $a_cmd : 
"gateway";
 
  692                $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
 
  707                $btpl = 
new ilTemplate(
"tpl.buttons.html", 
true, 
true, 
"setup");
 
  708                $btpl->setCurrentBlock(
"btn");
 
  709                $btpl->setVariable(
"CMD", 
"changeaccess");
 
  710                $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ? 
"disable" : 
"enable";
 
  711                $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
 
  712                $btpl->setVariable(
"FORMACTION", 
"setup.php?cmd=gateway");
 
  713                $btpl->parseCurrentBlock();
 
  714                $this->tpl->setVariable(
"BUTTONS", $btpl->get());
 
  717                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
  729                $settings = $this->setup->getClient()->getAllSettings();
 
  731                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  734                $this->form->setTitle(
$lng->txt(
"client_info"));
 
  738                $ne->setValue(($this->setup->getClient()->getName())
 
  739                        ? $this->setup->getClient()->getName()
 
  740                        : 
"<".$this->lng->txt(
"no_client_name").
">");
 
  741                $ne->setInfo($this->setup->getClient()->getDescription());
 
  742                $this->form->addItem($ne);
 
  746                $ne->setValue($this->setup->getClient()->getId());
 
  747                $this->form->addItem($ne);
 
  751                $ne->setValue(($this->setup->getClient()->db_installed)
 
  752                        ? $settings[
"inst_id"]
 
  754                $this->form->addItem($ne);
 
  758                $ne->setValue(($this->setup->getClient()->db_installed)
 
  759                        ? $settings[
"db_version"]
 
  761                $this->form->addItem($ne);
 
  766                $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ? 
"online" : 
"disabled";
 
  767                $ne->setValue($this->lng->txt($access_status).$access_link);
 
  768                $this->form->addItem($ne);
 
  772                $sh->setTitle($this->lng->txt(
"server_info"));
 
  773                $this->form->addItem($sh);
 
  778                $this->form->addItem($ne);
 
  782                $ne->setValue($_SERVER[
"SERVER_NAME"]);
 
  783                $this->form->addItem($ne);
 
  788                $ne->setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
 
  789                $this->form->addItem($ne);
 
  793                $ne->setValue($_SERVER[
"SERVER_SOFTWARE"]);
 
  794                $this->form->addItem($ne);
 
  798                $ne->setValue(ILIAS_HTTP_PATH);
 
  799                $this->form->addItem($ne);
 
  804                $this->form->addItem($ne);
 
  808                $sh->setTitle($this->lng->txt(
"3rd_party_software"));
 
  809                $this->form->addItem($sh);
 
  811                $tools = array(
"convert", 
"zip", 
"unzip", 
"ghostscript", 
"java", 
"htmldoc", 
"ffmpeg");
 
  813                foreach ($tools as $tool)
 
  817                        $p = $this->setup->ini->readVariable(
"tools", $tool);
 
  818                        $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
 
  819                        $this->form->addItem($ne);
 
  824                $p = $this->setup->ini->readVariable(
"tools", 
"latex"); 
 
  825                $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
 
  826                $this->form->addItem($ne);
 
  830                $ne->setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
 
  831                $this->form->addItem($ne);
 
  835                $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
 
  836                $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
 
  837                $this->form->addItem($ne);
 
  841                $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
 
  842                $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
 
  843                $this->form->addItem($ne);
 
  845                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
  857                $OK = 
"<font color=\"green\"><strong>OK</strong></font>";
 
  858                $FAILED = 
"<strong><font color=\"red\">FAILED</font></strong>";
 
  860                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html", 
"setup");
 
  862                $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
 
  863                $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
 
  864                $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
 
  865                $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
 
  866                $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
 
  867                $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
 
  868                $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
 
  870                $server_os = php_uname();
 
  871                $server_web = $_SERVER[
"SERVER_SOFTWARE"];
 
  872                $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
 
  874                if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
 
  876                        $env_comment = $this->lng->txt(
"env_ok");
 
  880                        $env_comment = 
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
 
  883                $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
 
  884                $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
 
  885                $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
 
  887                $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
 
  888                $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
 
  890                $preliminaries = array(
"php", 
"root", 
"folder_create",
 
  891                        "cookies_enabled", 
"dom", 
"xsl", 
"gd", 
"memory");
 
  892                if ($this->setup->hasOpCacheEnabled()) {
 
  893                        $preliminaries[] = 
'load_comments';
 
  896                foreach ($preliminaries as $preliminary)
 
  898                        $this->tpl->setCurrentBlock(
"preliminary");
 
  899                        $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
 
  900                        if ($this->setup->preliminaries_result[$preliminary][
"status"] == 
true)
 
  902                                $this->tpl->setVariable(
"STATUS_PRE", $OK);
 
  906                                $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
 
  908                        $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
 
  909                        $this->tpl->parseCurrentBlock();
 
  913                if ($this->setup->preliminaries === 
true)
 
  915                        if ($this->setup->isInstalled())
 
  917                                $cmd = 
"mastersettings";
 
  923                        $btn_text = ($this->cmd == 
"preliminaries") ? 
"" : 
"installation";
 
  925                        $this->setButtonNext(
$cmd,$btn_text);
 
  929                        $this->tpl->setCurrentBlock(
"premessage");
 
  930                        $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
 
  931                                "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
 
  932                        $this->tpl->parseCurrentBlock();
 
  945                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html", 
"setup");
 
  946                $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
 
  947                $this->tpl->setVariable(
"TXT_INFO",
 
  948                        $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
 
  950                $this->setButtonPrev(
"preliminaries");
 
  952                if ($this->setup->isInstalled())
 
  954                        $this->setButtonNext(
"list");
 
  961                $this->tpl->setVariable(
"SETUP_CONTENT", 
"<br>".$this->form->getHTML().
"<br>");
 
  969                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html", 
"setup");
 
  970                $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
 
  971                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
 
  973                $this->btn_next_on = 
true;
 
  974                $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
 
  975                $this->btn_next_cmd = 
"newclient";
 
  982                $this->tpl->setVariable(
"SETUP_CONTENT", 
"<br>".$this->form->getHTML().
"<br>");
 
  992                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  999                        $ne->setInfo($this->lng->txt(
"data_directory_in_ws_info"));
 
 1002                        ? str_replace(
"\\", 
"/", getcwd())
 
 1005                $ne->setValue($cwd.
"/data");
 
 1006                $this->form->addItem($ne);
 
 1012                        $ti->setInfo(
$lng->txt(
"data_directory_info"));
 
 1013                        $ti->setRequired(
true);
 
 1014                        $this->form->addItem($ti);
 
 1019                        $this->form->addItem($ne);
 
 1029                $sh->setTitle(
$lng->txt(
"logging"));
 
 1030                $this->form->addItem($sh);
 
 1034                $ti->setInfo(
$lng->txt(
"log_path_comment".$lvext));
 
 1035                $this->form->addItem($ti);
 
 1039                $this->form->addItem($cb);
 
 1043                $sh->setTitle(
$lng->txt(
"server_settings"));
 
 1044                $this->form->addItem($sh);
 
 1047                include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
 
 1049                $si->setOptions(array_merge(
 
 1050                        array(
"" => 
"-- ".
$lng->txt(
"please_select").
" --"),
 
 1052                $si->setRequired(
true);
 
 1053                $this->form->addItem(
$si);
 
 1057                $sh->setTitle(
$lng->txt(
"https_settings"));
 
 1058                $this->form->addItem($sh);
 
 1061                $check->setOptionTitle(
$lng->txt(
'ps_auto_https_description'));
 
 1062                $check->setValue(1);
 
 1064                $text = 
new ilTextInputGUI(
$lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
 
 1066                $text->setMaxLength(64);
 
 1067                $text->setRequired(
true);
 
 1068                $check->addSubItem($text);
 
 1070                $text = 
new ilTextInputGUI(
$lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
 
 1072                $text->setMaxLength(64);
 
 1073                $text->setRequired(
true);
 
 1074                $check->addSubItem($text);
 
 1076                $this->form->addItem($check);
 
 1080                $sh->setTitle(
$lng->txt(
"3rd_party_software_req"));
 
 1081                $this->form->addItem($sh);
 
 1085                $ti->setInfo(
$lng->txt(
"convert_path_comment".$lvext));
 
 1086                $ti->setRequired(
true);
 
 1087                $this->form->addItem($ti);
 
 1091                $ti->setInfo(
$lng->txt(
"zip_path_comment".$lvext));
 
 1092                $ti->setRequired(
true);
 
 1093                $this->form->addItem($ti);
 
 1097                $ti->setInfo(
$lng->txt(
"unzip_path_comment".$lvext));
 
 1098                $ti->setRequired(
true);
 
 1099                $this->form->addItem($ti);
 
 1103                $sh->setTitle(
$lng->txt(
"3rd_party_software_opt"));
 
 1104                $this->form->addItem($sh);
 
 1108                $ti->setInfo(
$lng->txt(
"ghostscript_path_comment".$lvext));
 
 1109                $this->form->addItem($ti);
 
 1113                $ti->setInfo(
$lng->txt(
"java_path_comment".$lvext));
 
 1114                $this->form->addItem($ti);
 
 1118                $ti->setInfo(
$lng->txt(
"htmldoc_path_comment".$lvext));
 
 1119                $this->form->addItem($ti);
 
 1123                $ti->setInfo(
$lng->txt(
"ffmpeg_path_comment"));
 
 1124                $this->form->addItem($ti);
 
 1128                $ti->setInfo(
$lng->txt(
"latex_url_comment"));
 
 1129                $this->form->addItem($ti);
 
 1133                        "none" => 
$lng->txt(
"none"),
 
 1134                        "sophos" => 
$lng->txt(
"sophos"),
 
 1135                        "antivir" => 
$lng->txt(
"antivir"),
 
 1136                        "clamav" => 
$lng->txt(
"clamav")
 
 1140                $this->form->addItem(
$si);
 
 1144                $this->form->addItem($ti);
 
 1148                $this->form->addItem($ti);
 
 1153                        $sh->setTitle(
$lng->txt(
"master_password"));
 
 1154                        $this->form->addItem($sh);
 
 1158                        $pi->setRequired(
true);
 
 1159                        $pi->setSkipSyntaxCheck(
true);
 
 1160                        $pi->setInfo(
$lng->txt(
"password_info"));
 
 1161                        $this->form->addItem($pi);
 
 1166                        $this->form->addCommandButton(
"saveBasicSettings", 
$lng->txt(
"save"));
 
 1170                        $this->form->addCommandButton(
"updateBasicSettings", 
$lng->txt(
"save"));
 
 1171                        $this->form->addCommandButton(
"determineToolsPath", 
$lng->txt(
"determine_tools_paths"));
 
 1174                $this->form->setTitle(
$lng->txt(
"data_directories"));
 
 1175                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 1180                        $this->form->setValuesByArray($det);
 
 1192                $values[
"webspace_dir"] = getcwd().
"/data";
 
 1193                $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
 
 1194                $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
 
 1195                $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
 
 1196                $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
 
 1197                $values[
"ghostscript_path"] = $this->setup->ini->readVariable(
"tools",
"ghostscript");
 
 1198                $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
 
 1199                $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
 
 1201                $values[
"ffmpeg_path"] = $this->setup->ini->readVariable(
"tools",
"ffmpeg");
 
 1202                $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
 
 1203                $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
 
 1204                $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools", 
"vscantype");
 
 1205                $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools", 
"scancommand");
 
 1206                $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools", 
"cleancommand");
 
 1207                $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
 
 1208                        $this->setup->ini->readVariable(
"log",
"file");
 
 1209                $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
 
 1210                $values[
"time_zone"] = $this->setup->ini->readVariable(
"server", 
"timezone");
 
 1213                $values[
"auto_https_detect_enabled"] = $this->setup->ini->readVariable(
"https", 
"auto_https_detect_enabled");
 
 1214                $values[
"auto_https_detect_header_name"] = $this->setup->ini->readVariable(
"https", 
"auto_https_detect_header_name");
 
 1215                $values[
"auto_https_detect_header_value"] = $this->setup->ini->readVariable(
"https", 
"auto_https_detect_header_value");
 
 1217                $this->form->setValuesByArray($values);
 
 1229                if ($this->form->checkInput())
 
 1234                                $fs = array(
"datadir_path", 
"log_path", 
"convert_path", 
"zip_path",
 
 1235                                        "unzip_path", 
"ghostscript_path", 
"java_path", 
"htmldoc_path", 
"ffmpeg_path");
 
 1244                        if (!$this->setup->checkDataDirSetup(
$_POST))
 
 1246                                $i = $this->form->getItemByPostVar(
"datadir_path");
 
 1247                                $i->setAlert($this->lng->txt($this->setup->getError()));
 
 1250                        else if (!$this->setup->checkLogSetup(
$_POST))
 
 1252                                $i = $this->form->getItemByPostVar(
"log_path");
 
 1253                                $i->setAlert($this->lng->txt($this->setup->getError()));
 
 1256                        else if (!$this->setup->checkPasswordSetup(
$_POST))
 
 1260                        else if (!$this->setup->saveMasterSetup(
$_POST))
 
 1271                $this->form->setValuesByPost();
 
 1284                if ($this->form->checkInput())
 
 1288                                $fs = array(
"datadir_path", 
"log_path", 
"convert_path", 
"zip_path",
 
 1289                                        "unzip_path", 
"ghostscript_path", 
"java_path", 
"htmldoc_path", 
"ffmpeg_path");
 
 1296                        if (!$this->setup->checkLogSetup(
$_POST))
 
 1298                                $i = $this->form->getItemByPostVar(
"log_path");
 
 1299                                $i->setAlert($this->lng->txt($this->setup->getError()));
 
 1302                        else if (!$this->setup->updateMasterSettings(
$_POST))
 
 1313                $this->form->setValuesByPost();
 
 1328                ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
 
 1337                $this->tpl->setVariable(
"SETUP_LOGIN_CLASS", 
" ilSetupLogin");
 
 1338                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html", 
"setup");
 
 1342                        $m_form = $this->form->getHTML();
 
 1348                $cl_form = $this->form->getHTML();
 
 1352                        $m_form = $this->form->getHTML();
 
 1354                $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
 
 1355                $this->tpl->setVariable(
"TXT_HEADER", 
$lng->txt(
"login"));
 
 1364                if ($this->form->checkInput())
 
 1366                        $i = $this->form->getItemByPostVar(
"mpassword");
 
 1367                        if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
 
 1369                                $i->setAlert($this->lng->txt(
"login_invalid"));
 
 1379                $this->form->setValuesByPost();
 
 1389                if ($this->form->checkInput())
 
 1391                        $i = $this->form->getItemByPostVar(
"password");
 
 1392                        if (!$this->setup->loginAsClient(
 
 1393                                array(
"client_id" => 
$_POST[
"client_id"],
 
 1394                                "username" => 
$_POST[
"username"], 
"password" => 
$_POST[
"password"])))
 
 1396                                $i->setAlert($this->setup->getError());
 
 1406                $this->form->setValuesByPost();
 
 1417                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1419                $this->form->setId(
"client_login");
 
 1423                $ti->setMaxLength(32);
 
 1425                $this->form->addItem($ti);
 
 1430                $this->form->addItem($ti);
 
 1435                $pi->setRetype(
false);
 
 1436                $pi->setSkipSyntaxCheck(
true);
 
 1437                $this->form->addItem($pi);
 
 1439                $this->form->addCommandButton(
"performLogin", 
$lng->txt(
"login"));
 
 1441                $this->form->setTitle(
$lng->txt(
"client_login"));
 
 1442                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 1452                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1454                $this->form->setId(
"master_login");             
 
 1458                $pi->setRetype(
false);
 
 1459                $pi->setSkipSyntaxCheck(
true);
 
 1460                $this->form->addItem($pi);
 
 1462                $this->form->addCommandButton(
"performMLogin", 
$lng->txt(
"login"));
 
 1464                $this->form->setTitle(
$lng->txt(
"admin_login"));
 
 1465                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 1480                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html", 
"setup");
 
 1481                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
 
 1485                $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
 
 1486                $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
 
 1487                $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
 
 1489                include_once(
"./setup/classes/class.ilClientListTableGUI.php");
 
 1491                $this->tpl->setVariable(
"CLIENT_LIST", 
$tab->getHTML());
 
 1494                $this->btn_next_on = 
true;
 
 1495                $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
 
 1496                $this->btn_next_cmd = 
"newclient";
 
 1522                        ? str_replace(
"\\", 
"/", getcwd())
 
 1526                        $tools = array(
"convert" => 
"convert",
 
 1527                                "zip" => 
"zip", 
"unzip" => 
"unzip", 
"ghostscript" => 
"gs",
 
 1528                                "java" => 
"java",  
"htmldoc" => 
"htmldoc", 
"ffmpeg" => 
"ffmpeg");
 
 1529                        $dirs = array(
"/usr/local", 
"/usr/local/bin", 
"/usr/bin", 
"/bin", 
"/sw/bin", 
"/usr/bin");
 
 1533                        $tools = array(
"convert" => 
"convert.exe",
 
 1534                                "zip" => 
"zip.exe", 
"unzip" => 
"unzip.exe");
 
 1535                        $dirs = array($cwd.
"/Services/Windows/bin32/zip",
 
 1536                                $cwd.
"/Services/Windows/bin32/unzip",
 
 1537                                $cwd.
"/Services/Windows/bin32/convert");
 
 1539                foreach($tools as $k => $tool)
 
 1543                        @exec(
"which ".$tool, 
$ret);
 
 1544                        if (substr(
$ret[0], 0, 3) != 
"no " && substr(
$ret[0], 0, 1) == 
"/")
 
 1546                                $a_tools[$k.
"_path"] = 
$ret[0];
 
 1551                        foreach(
$dirs as $dir)
 
 1553                                if (@is_file($dir.
"/".$tool))
 
 1555                                        $a_tools[$k.
"_path"] = $dir.
"/".$tool;
 
 1580                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 1586                $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html", 
"setup");
 
 1588                $this->tpl->setVariable(
"FORMACTION", 
"setup.php?cmd=gateway");
 
 1589                $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
 
 1591                $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
 
 1592                $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
 
 1594                if ($this->setup->getClient()->status[
"ini"][
"status"])
 
 1596                        $this->setButtonNext(
"db");
 
 1609                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1614                        "mysql" => 
"MySQL 5.0.x or higher (MyISAM engine)",
 
 1615                        "innodb" => 
"MySQL 5.0.x or higher (InnoDB engine)",
 
 1616                        "oracle" => 
"Oracle 10g or higher",
 
 1617                        "postgres" => 
"Postgres (experimental)" 
 1622                $this->form->addItem(
$si);
 
 1624                $this->form->addCommandButton(
"selectdbtype", 
$lng->txt(
"save"));
 
 1626                $this->form->setTitle(
$lng->txt(
"db_selection"));
 
 1627                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 1641                if (
$_POST[
"db_type"] != 
"")
 
 1650                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
 
 1651                if (!$a_omit_form_init)
 
 1656                $this->tpl->setVariable(
"SETUP_CONTENT",
 
 1657                        $this->form->getHTML());
 
 1659                if ($this->setup->getClient()->status[
"ini"][
"status"])
 
 1661                        $this->setButtonNext(
"db");
 
 1674                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1678                if ($this->setup->ini_client_exists)
 
 1681                        $hi->setValue($this->client_id);
 
 1682                        $this->form->addItem($hi);
 
 1685                        $ne->setValue($this->client_id);
 
 1686                        $this->form->addItem($ne);
 
 1691                        $ti->setMaxLength(32);
 
 1692                        $ti->setRequired(
true);
 
 1693                        $this->form->addItem($ti);
 
 1698                $sh->setTitle(
$lng->txt(
"db_conn"));
 
 1699                $this->form->addItem($sh);
 
 1703                $ne->setValue(
$lng->txt(
"db_".$_SESSION[
"db_type"]));
 
 1704                $this->form->addItem($ne);
 
 1708                $ti->setMaxLength(120);
 
 1709                $ti->setRequired(
true);
 
 1710                $this->form->addItem($ti);
 
 1713                if (in_array(
$_SESSION[
"db_type"], array(
"mysql", 
"postgres", 
"innodb")))
 
 1716                        $ti->setRequired(
true);
 
 1722                $ti->setMaxLength(40);
 
 1723                $this->form->addItem($ti);
 
 1727                $ti->setMaxLength(40);
 
 1728                $ti->setRequired(
true);
 
 1729                $this->form->addItem($ti);
 
 1733                $ti->setMaxLength(8);
 
 1734                $this->form->addItem($ti);
 
 1738                $ti->setMaxLength(40);
 
 1739                $this->form->addItem($ti);
 
 1741                $this->form->addCommandButton(
"saveClientIni", 
$lng->txt(
"save"));
 
 1743                $this->form->setTitle(
$lng->txt(
"inst_identification"));
 
 1744                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 1754                $values[
"db_host"] = $this->setup->getClient()->getDbHost();
 
 1755                $values[
"db_user"] = $this->setup->getClient()->getDbUser();
 
 1756                $values[
"db_port"] = $this->setup->getClient()->getDbPort();
 
 1757                $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
 
 1758                $values[
"db_name"] = $this->setup->getClient()->getDbName();
 
 1759                $values[
"client_id"] = $this->setup->getClient()->getId();
 
 1761                $this->form->setValuesByArray($values);
 
 1772                if ($this->form->checkInput())
 
 1774                        if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"])))
 
 1775                                || is_int(strpos(
$_POST[
"client_id"], 
"_")))
 
 1777                                $i = $this->form->getItemByPostVar(
"client_id");
 
 1778                                $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
 
 1781                        else if (strlen(
$_POST[
"client_id"]) < 4)
 
 1783                                $i = $this->form->getItemByPostVar(
"client_id");
 
 1784                                $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
 
 1787                        else if (strlen(
$_POST[
"client_id"]) > 32)
 
 1789                                $i = $this->form->getItemByPostVar(
"client_id");
 
 1790                                $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
 
 1795                                $i = $this->form->getItemByPostVar(
"client_id");
 
 1796                                $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
 
 1803                                $old_db_name = $this->setup->getClient()->getDbName();
 
 1804                                $old_db_type = $this->setup->getClient()->getDbType();
 
 1805                                $old_client_id = $this->setup->getClient()->getId();
 
 1808                                if (!$this->setup->ini_client_exists)
 
 1815                                $this->setup->getClient()->setId(
$_POST[
"client_id"]);
 
 1816                                $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
 
 1817                                $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
 
 1818                                $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
 
 1819                                $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
 
 1820                                $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
 
 1821                                $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
 
 1822                                $this->setup->getClient()->setDSN();
 
 1825                                if (!$this->setup->getClient()->checkDatabaseHost())
 
 1827                                        $i = $this->form->getItemByPostVar(
"db_host");
 
 1828                                        $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
 
 1834                                        $db_installed = $this->setup->getClient()->checkDatabaseExists();
 
 1836                                        if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
 
 1838                                                $_POST[
"db_name"] = $old_db_name;
 
 1839                                                $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
 
 1840                                                $i = $this->form->getItemByPostVar(
"db_name");
 
 1841                                                $i->setAlert($message);
 
 1847                                                if (!$this->setup->ini_client_exists)
 
 1849                                                        if ($this->setup->saveNewClient())
 
 1852                                                                $this->setup->getClient()->status[
"ini"][
"status"] = 
true;
 
 1858                                                                $err = $this->setup->getError();
 
 1860                                                                $this->setup->getClient()->status[
"ini"][
"status"] = 
false;
 
 1861                                                                $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
 
 1866                                                        if ($this->setup->getClient()->ini->write())
 
 1869                                                                $this->setup->getClient()->status[
"ini"][
"status"] = 
true;
 
 1874                                                                $err = $this->setup->getClient()->ini->getError();
 
 1876                                                                $this->setup->getClient()->status[
"ini"][
"status"] = 
false;
 
 1877                                                                $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
 
 1885                $this->form->setValuesByPost();
 
 1896                $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.error.html", 
"setup");
 
 1898                $this->tpl->setCurrentBlock(
"content");
 
 1899                $this->tpl->setVariable(
"FORMACTION", 
$_SESSION[
"referer"]);
 
 1900                $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
 
 1901                $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
 
 1902                $this->tpl->parseCurrentBlock();
 
 1913                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html", 
"setup");
 
 1917                $this->logged_out = 
true;
 
 1918                $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
 
 1919                $this->tpl->setCurrentBlock(
"home_link");
 
 1920                $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
 
 1921                $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
 
 1922                $this->tpl->parseCurrentBlock();
 
 1930                include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
 
 1932                $checklist->setHeading($this->lng->txt(
"setup_process_status"));
 
 1935                $OK = 
"<font color=\"green\"><strong>OK</strong></font>";
 
 1938                $steps = $this->setup->getStatus();
 
 1943                $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
 
 1944                $steps[
"db"][
"text"]  = $this->lng->txt(
"setup_process_step_db");
 
 1946                $steps[
"lang"][
"text"]    = $this->lng->txt(
"setup_process_step_lang");
 
 1947                $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
 
 1948                $steps[
"proxy"][
"text"]   = $this->lng->txt(
"setup_process_step_proxy");
 
 1949                $steps[
"nic"][
"text"]     = $this->lng->txt(
"setup_process_step_nic");
 
 1950                $steps[
"finish"][
"text"]  = $this->lng->txt(
"setup_process_step_finish");
 
 1952                $stpl = 
new ilTemplate(
"tpl.process_panel.html", 
true, 
true, 
"setup");
 
 1956                foreach (
$steps as $key => $val)
 
 1958                        $stpl->setCurrentBlock(
"menu_row");
 
 1959                        $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
":  ");
 
 1960                        $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
 
 1961                        $stpl->setVariable(
"IMG_ARROW", 
"spacer.png");
 
 1963                        if ($this->cmd == $key and isset($this->cmd))
 
 1965                                $stpl->setVariable(
"HIGHLIGHT", 
" style=\"font-weight:bold;\"");
 
 1968                        $status = ($val[
"status"]) ? $OK : 
"";
 
 1970                        $stpl->setVariable(
"TXT_STATUS",$status);
 
 1971                        $stpl->parseCurrentBlock();
 
 1973                        $checklist->addEntry($num.
". ".$val[
"text"], 
"",
 
 1976                                ($this->cmd == $key and isset($this->cmd)),
 
 1982                $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
 
 1984                $this->tpl->setVariable(
"PROCESS_MENU", $checklist->getHTML());
 
 1992                include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
 
 1994                $checklist->setHeading($this->lng->txt(
"overall_status"));
 
 1996                $OK = 
"<font color=\"green\"><strong>OK</strong></font>";
 
 2000                $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
 
 2002                if ($this->setup->getClient()->status)
 
 2004                        foreach ($this->setup->getClient()->status as $key => $val)
 
 2006                                $status = ($val[
"status"]) ? $OK : 
" ";
 
 2015                                $checklist->addEntry($this->lng->txt(
"step_".$key), 
"",
 
 2020                $this->tpl->setVariable(
"STATUS_PANEL", $checklist->getHTML());
 
 2030                switch ($this->display_mode)
 
 2033                                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html", 
"setup");
 
 2035                                include 
"./setup/include/inc.client_tabs.php";
 
 2036                                $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
 
 2037                                $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
 
 2041                                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html", 
"setup");
 
 2042                                $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
 
 2046                                $this->
displayError($this->lng->txt(
"unknown_display_mode"));
 
 2060                $sub_tab_html = $this->tabs->getSubTabHTML();
 
 2061                if ($sub_tab_html != 
"")
 
 2063                        $this->tpl->setVariable(
"SUBTABS", $sub_tab_html);
 
 2074                switch ($this->display_mode)
 
 2091                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html", 
"setup");
 
 2093                $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
 
 2094                $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
 
 2098                $this->setButtonNext(
"ini");
 
 2117                if ($this->setup->getClient()->db_installed)
 
 2119                        $this->setDbSubTabs(
"db");
 
 2121                        $ilDB = $this->setup->getClient()->db;
 
 2122                        $this->lng->setDbHandler(
$ilDB);
 
 2123                        include_once 
"./Services/Database/classes/class.ilDBUpdate.php";
 
 2125                        $db_status = $dbupdate->getDBVersionStatus();
 
 2126                        $hotfix_available = $dbupdate->hotfixAvailable();
 
 2127                        $custom_updates_available = $dbupdate->customUpdatesAvailable();
 
 2128                        $this->
initClientDbForm(
false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
 
 2130                        $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 2134                                $this->setButtonNext(
"lang");
 
 2139                        $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
 
 2140                                "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
 
 2141                                "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
 
 2145                        $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 2146                        $this->setButtonPrev(
"ini");
 
 2155        public function displayCache() {
 
 2156                require_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
 
 2157                require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
 
 2163                $ini = $this->setup->getClient()->ini;
 
 2166                $cache_form->setTitle($this->lng->txt(
'global_cache_configuration'));
 
 2167                $cache_form->addCommandButton(
'saveCache', $this->lng->txt(
'save'));
 
 2168                $cache_form->setFormAction(
'setup.php?cmd=gateway');
 
 2170                $activate_global_cache = 
'activate_global_cache';
 
 2171                $global_cache_service_type = 
'global_cache_service_type';
 
 2173                $activate_cache = 
new ilCheckboxInputGUI($this->lng->txt($activate_global_cache), $activate_global_cache);
 
 2174                $activate_cache->setChecked(
$ini->readVariable(
'cache', $activate_global_cache));
 
 2176                $service_type = 
new ilRadioGroupInputGUI($this->lng->txt($global_cache_service_type), $global_cache_service_type);
 
 2177                $some_inactive = 
false;
 
 2180                        $option = 
new ilRadioOption($this->lng->txt($global_cache_service_type . 
'_' . $type->getServiceType()), $type->getServiceType());
 
 2181                        $option->setInfo($this->lng->txt(
'global_cache_install_info_' . $type->getServiceType()));
 
 2182                        if (! $type->isCacheServiceInstallable()) {
 
 2183                                $option->setDisabled(
true);
 
 2184                                $message .= $this->lng->txt($global_cache_service_type . 
'_' . $type->getServiceType()) . 
': ' 
 2185                                        . $type->getInstallationFailureReason() . 
'; ';
 
 2186                                $some_inactive = 
true;
 
 2188                        $service_type->addOption($option);
 
 2191                if ($some_inactive) {
 
 2192                        $service_type->setAlert($message);
 
 2195                $service_type->setValue(
$ini->readVariable(
'cache', $global_cache_service_type));
 
 2196                $activate_cache->addSubItem($service_type);
 
 2198                $cache_form->addItem($activate_cache);
 
 2200                $this->tpl->setVariable(
'SETUP_CONTENT', $cache_form->getHTML());
 
 2204        public function saveCache(){
 
 2208                require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
 
 2209                ilGlobalCache::flushAll();
 
 2210                $ini = $this->setup->getClient()->ini;
 
 2212                if(!
$ini->readGroup(
'cache')) {
 
 2213                        $ini->addGroup(
'cache');
 
 2216                $activate_global_cache = 
'activate_global_cache';
 
 2217                $global_cache_service_type = 
'global_cache_service_type';
 
 2219                $ini->setVariable(
'cache', $activate_global_cache, 
$_POST[$activate_global_cache]);
 
 2220                $ini->setVariable(
'cache', $global_cache_service_type, 
$_POST[$global_cache_service_type]);
 
 2241                if (!$this->setup->getClient()->db_installed)
 
 2246                $this->setDbSubTabs(
"repl");
 
 2250                        $ilDB = $this->setup->getClient()->db;
 
 2251                        $this->lng->setDbHandler(
$ilDB);
 
 2261                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 2275                $client = $this->setup->getClient();
 
 2277                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2282                $ne->setValue(
$lng->txt(
"db_".$ilDB->getDbType()));
 
 2283                $this->form->addItem($ne);
 
 2287                $act->setChecked(
$client->getDbSlaveActive());
 
 2288                $this->form->addItem($act);
 
 2292                $ti->setValue(
$client->getDbSlaveHost());
 
 2293                $ti->setMaxLength(120);
 
 2294                $ti->setRequired(
true);
 
 2295                $act->addSubItem($ti);
 
 2299                $ti->setValue(
$client->getDbSlaveName());
 
 2300                $ti->setRequired(
true);
 
 2301                $ti->setMaxLength(40);
 
 2302                $act->addSubItem($ti);
 
 2306                $ti->setValue(
$client->getDbSlaveUser());
 
 2307                $ti->setMaxLength(40);
 
 2308                $ti->setRequired(
true);
 
 2309                $act->addSubItem($ti);
 
 2313                $ti->setValue(
$client->getDbSlavePort());
 
 2314                $ti->setMaxLength(8);
 
 2315                $act->addSubItem($ti);
 
 2318                $set_pw = 
new ilCheckboxInputGUI($this->lng->txt(
"db_set_password"), 
"set_slave_password");
 
 2319                $act->addSubItem($set_pw);
 
 2323                $ti->setMaxLength(40);
 
 2324                $set_pw->addSubItem($ti);
 
 2326                $this->form->addCommandButton(
"saveDbSlave", 
$lng->txt(
"save"));
 
 2328                $this->form->setTitle(
$lng->txt(
"db_slave_settings"));
 
 2329                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 2339                $client = $this->setup->getClient();
 
 2341                $ilDB = $this->setup->getClient()->db;
 
 2342                $this->lng->setDbHandler(
$ilDB);
 
 2345                if ($this->form->checkInput())
 
 2347                        $client->setDbSlaveActive($this->form->getInput(
"slave_active"));
 
 2348                        if ($this->form->getInput(
"slave_active"))
 
 2350                                $client->setDbSlaveHost($this->form->getInput(
"slave_host"));
 
 2351                                $client->setDbSlaveUser($this->form->getInput(
"slave_user"));
 
 2352                                $client->setDbSlavePort($this->form->getInput(
"slave_port"));
 
 2353                                $client->setDbSlaveName($this->form->getInput(
"slave_name"));
 
 2354                                if ($this->form->getInput(
"set_slave_password"))
 
 2356                                        $client->setDbSlavePass($this->form->getInput(
"slave_pass"));
 
 2366                        $this->form->setValuesByPost();
 
 2382                if (
$ilDB->getDbType() == 
"mysql")
 
 2384                        $this->tabs->addSubTab(
"db", $this->lng->txt(
"db_master"), 
"setup.php?client_id=".$this->client_id.
"&cmd=db");
 
 2385                        $this->tabs->addSubTab(
"repl", $this->lng->txt(
"db_slave"), 
"setup.php?client_id=".$this->client_id.
"&cmd=dbslave");
 
 2388                $this->tabs->activateSubTab($a_subtab_id);
 
 2396        public function initClientDbForm($a_install = 
true, $dbupdate = 
null, $db_status = 
false, $hotfix_available = 
false, $custom_updates_available = 
false)
 
 2400                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2405                $this->form->addItem($ne);
 
 2408                if ($this->setup->getClient()->getDBType() == 
"mysql" ||
 
 2409                        $this->setup->getClient()->getDBType() == 
"innodb")
 
 2412                        $ilDB = $this->setup->getClient()->db;
 
 2413                        $ne->setValue(
$ilDB->getDBVersion());
 
 2414                        $this->form->addItem($ne);
 
 2419                $this->form->addItem($ne);
 
 2423                $this->form->addItem($ne);
 
 2427                $this->form->addItem($ne);
 
 2431                $this->form->addItem($ne);
 
 2434                if (($this->setup->getClient()->getDBType() == 
"mysql" ||
 
 2435                        $this->setup->getClient()->getDBType() == 
"innodb") && $a_install)
 
 2448                                        "utf8_icelandic_ci",
 
 2450                                        "utf8_lithuanian_ci",
 
 2456                                        "utf8_slovenian_ci",
 
 2462                                foreach($collations as $collation)
 
 2468                                $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
 
 2469                                        "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
 
 2470                                        " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
 
 2471                                $cb->addSubItem(
$si);
 
 2473                        $this->form->addItem($cb);
 
 2478                        $this->form->addCommandButton(
"installDatabase", 
$lng->txt(
"database_install"));
 
 2482                        $ilDB = $this->setup->getClient()->db;
 
 2483                        $this->lng->setDbHandler(
$ilDB);
 
 2488                        $ne->setValue($dbupdate->currentVersion);
 
 2489                        $this->form->addItem($ne);
 
 2493                        $ne->setValue($dbupdate->fileVersion);
 
 2494                        $this->form->addItem($ne);
 
 2496                        if (!$db_status = $dbupdate->getDBVersionStatus())
 
 2500                                for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
 
 2508                                        $si->setInfo(
$lng->txt(
"next_update_break_info"));
 
 2509                                        $this->form->addItem(
$si);
 
 2512                                if ($dbupdate->getRunningStatus() > 0)
 
 2515                                                $this->lng->txt(
"db_update_interrupted_avoid"));
 
 2521                                $this->form->addCommandButton(
"updateDatabase", 
$lng->txt(
"database_update"));
 
 2522                                $this->form->addCommandButton(
"showUpdateSteps", 
$lng->txt(
"show_update_steps"));
 
 2524                        else if ($hotfix_available)
 
 2528                                $ne->setValue($dbupdate->getHotfixCurrentVersion());
 
 2529                                $this->form->addItem($ne);
 
 2533                                $ne->setValue($dbupdate->getHotfixFileVersion());
 
 2534                                $this->form->addItem($ne);
 
 2536                                $this->form->addCommandButton(
"applyHotfix", 
$lng->txt(
"apply_hotfixes"));
 
 2537                                $this->form->addCommandButton(
"showHotfixSteps", 
$lng->txt(
"show_update_steps"));
 
 2540                        elseif($custom_updates_available)
 
 2544                                $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
 
 2545                                $this->form->addItem($ne);
 
 2549                                $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
 
 2550                                $this->form->addItem($ne);
 
 2552                                $this->form->addCommandButton(
"applyCustomUpdates", 
$lng->txt(
"apply_custom_updates"));
 
 2557                                if ($dbupdate->getHotfixFileVersion() > 0)
 
 2561                                        $ne->setValue($dbupdate->getHotfixCurrentVersion());
 
 2562                                        $this->form->addItem($ne);
 
 2566                                        $ne->setValue($dbupdate->getHotfixFileVersion());
 
 2567                                        $this->form->addItem($ne);
 
 2569                                if ($dbupdate->getCustomUpdatesFileVersion() > 0)
 
 2573                                        $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
 
 2574                                        $this->form->addItem($ne);
 
 2578                                        $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
 
 2579                                        $this->form->addItem($ne);
 
 2585                $this->form->setTitle(
$lng->txt(
"database"));
 
 2586                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 2599                $values[
"db_host"] = $this->setup->getClient()->getDbHost();
 
 2600                $values[
"db_name"] = $this->setup->getClient()->getDbName();
 
 2601                $values[
"db_user"] = $this->setup->getClient()->getDbUser();
 
 2602                $values[
"db_port"] = $this->setup->getClient()->getDbPort();
 
 2603                $values[
"db_type"] = 
$lng->txt(
"db_".$this->setup->getClient()->getDbType());
 
 2604                if (is_object($dbupdate))
 
 2606                        $values[
"update_break"] = $dbupdate->fileVersion;
 
 2607                        if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
 
 2609                                $values[
"update_break"] = $dbupdate->currentVersion + 200 -
 
 2610                                        ($dbupdate->currentVersion % 100);
 
 2614                $this->form->setValuesByArray($values);
 
 2629                if (!$this->setup->getClient()->db_exists)
 
 2631                        if (
$_POST[
"chk_db_create"])
 
 2633                                if (!$this->setup->createDatabase(
$_POST[
"collation"]))
 
 2645                if (!$this->setup->installDatabase())
 
 2669                include_once 
"./Services/Database/classes/class.ilDBUpdate.php";
 
 2670                include_once 
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
 
 2671                include_once 
"./Services/AccessControl/classes/class.ilRbacReview.php";
 
 2672                include_once 
"./Services/AccessControl/classes/class.ilRbacSystem.php";
 
 2673                include_once 
"./Services/Tree/classes/class.ilTree.php";
 
 2674                include_once 
"./Services/Xml/classes/class.ilSaxParser.php";
 
 2675                include_once 
"./Services/Object/classes/class.ilObjectDefinition.php";
 
 2678                $tz = $this->setup->ini->readVariable(
"server",
"timezone");
 
 2681                        if (function_exists(
'date_default_timezone_set'))
 
 2683                                date_default_timezone_set($tz);
 
 2685                        define (
"IL_TIMEZONE", $tz);
 
 2689                $ilDB = $this->setup->getClient()->db;
 
 2690                $this->lng->setDbHandler(
$ilDB);
 
 2694                $dbupdate->applyUpdate((
int) 
$_POST[
"update_break"]);
 
 2696                if ($dbupdate->updateMsg == 
"no_changes")
 
 2698                        $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
 
 2703                        foreach ($dbupdate->updateMsg as 
$row)
 
 2705                                if (
$row[
"msg"] == 
"update_applied")
 
 2707                                        $a_message.= $sep.$row[
"nr"];
 
 2712                                        $e_message.= 
"<br/>".$this->lng->txt(
$row[
"msg"]).
": ".
$row[
"nr"];
 
 2715                        if ($a_message != 
"")
 
 2717                                $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
 
 2753                if ($this->setup->getClient()->db_installed)
 
 2755                        $ilDB = $this->setup->getClient()->db;
 
 2756                        $this->lng->setDbHandler(
$ilDB);
 
 2758                        $db_status = $dbupdate->getDBVersionStatus();
 
 2759                        $hotfix_available = $dbupdate->hotfixAvailable();
 
 2760                        $custom_updates_available = $dbupdate->customUpdatesAvailable();
 
 2764                        $ntpl = 
new ilTemplate(
"tpl.setup_steps.html", 
true, 
true, 
"setup");
 
 2767                                $ntpl->setVariable(
"CONTENT", $dbupdate->getHotfixSteps());
 
 2771                                $ntpl->setVariable(
"CONTENT", $dbupdate->getUpdateSteps(
$_POST[
"update_break"]));
 
 2773                        $ntpl->setVariable(
"BACK", $this->lng->txt(
"back"));
 
 2774                        $ntpl->setVariable(
"HREF_BACK", 
"./setup.php?client_id=&cmd=db");
 
 2775                        $this->tpl->setVariable(
"SETUP_CONTENT", $ntpl->get());
 
 2793                include_once 
"./Services/Database/classes/class.ilDBUpdate.php";
 
 2794                include_once 
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
 
 2795                include_once 
"./Services/AccessControl/classes/class.ilRbacReview.php";
 
 2796                include_once 
"./Services/AccessControl/classes/class.ilRbacSystem.php";
 
 2797                include_once 
"./Services/Tree/classes/class.ilTree.php";
 
 2798                include_once 
"./Services/Xml/classes/class.ilSaxParser.php";
 
 2799                include_once 
"./Services/Object/classes/class.ilObjectDefinition.php";
 
 2802                $ilDB = $this->setup->getClient()->db;
 
 2803                $this->lng->setDbHandler(
$ilDB);
 
 2807                $dbupdate->applyHotfix();
 
 2809                if ($dbupdate->updateMsg == 
"no_changes")
 
 2811                        $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
 
 2816                        foreach ($dbupdate->updateMsg as 
$row)
 
 2818                                if (
$row[
"msg"] == 
"update_applied")
 
 2820                                        $a_message.= $sep.$row[
"nr"];
 
 2825                                        $e_message.= 
"<br/>".$this->lng->txt(
$row[
"msg"]).
": ".
$row[
"nr"];
 
 2828                        if ($a_message != 
"")
 
 2830                                $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
 
 2847                require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
 
 2851                if (!$this->setup->getClient()->db_installed)
 
 2854                        $message = 
"No database found! Please install database first.";
 
 2861                $settings = array();
 
 2863                foreach( $setting_fields as $field )
 
 2865                        if( $field == 
'session_allow_client_maintenance' )
 
 2868                                else                                                    $_POST[$field] = 
'0';
 
 2873                                $settings[$field] = 
$_POST[$field];
 
 2883                if(
$valid) $this->setup->setSessionSettings($settings);
 
 2885                $settings = $this->setup->getSessionSettings();
 
 2887                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2890                include_once 
'Services/Authentication/classes/class.ilSession.php';
 
 2901                $ssettings->addOption($fixed);
 
 2908                $ti = 
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'), 
"session_max_count");
 
 2909                $ti->setInfo($this->lng->txt(
'sess_max_session_count_info'));
 
 2910                $ti->setMaxLength(5);
 
 2912                $ti->setValue($settings[
'session_max_count']);
 
 2913                $ldsh->addSubItem($ti);
 
 2918                $ti = 
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'), 
"session_min_idle");
 
 2919                $ti->setInfo($this->lng->txt(
'sess_min_session_idle_info'));
 
 2920                $ti->setMaxLength(5);
 
 2922                $ti->setValue($settings[
'session_min_idle']);
 
 2923                $ldsh->addSubItem($ti);
 
 2928                $ti = 
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'), 
"session_max_idle");
 
 2929                $ti->setInfo($this->lng->txt(
'sess_max_session_idle_info'));
 
 2930                $ti->setMaxLength(5);
 
 2932                $ti->setValue($settings[
'session_max_idle']);
 
 2933                $ldsh->addSubItem($ti);
 
 2937                $ti = 
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'), 
"session_max_idle_after_first_request");
 
 2938                $ti->setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
 
 2939                $ti->setMaxLength(5);
 
 2941                $ti->setValue($settings[
'session_max_idle_after_first_request']);
 
 2942                $ldsh->addSubItem($ti);
 
 2945                $ssettings->addOption($ldsh);
 
 2947                $form->addItem($ssettings);
 
 2951                $chkb = 
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'), 
"session_allow_client_maintenance");
 
 2952                $chkb->setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
 
 2953                $chkb->setChecked($settings[
'session_allow_client_maintenance'] ? 
true : 
false);
 
 2954                $form->addItem($chkb);
 
 2958                $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
 
 2960                $form->setTitle($this->lng->txt(
"sess_sessions"));
 
 2961                $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
 
 2963                $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
 
 2964                $this->tpl->setVariable(
"TXT_INFO", 
'');
 
 2965                $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
 
 2988                if (!$this->setup->getClient()->db_installed)
 
 2991                        $message = 
"No database found! Please install database first.";
 
 2995                include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
 
 2997                $this->tpl->setVariable(
"SETUP_CONTENT", 
$tab->getHTML());
 
 2999                $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
 
 3000                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
 
 3002                $installed_langs = $this->lng->getInstalledLanguages();
 
 3003                $lang_count = count($installed_langs);
 
 3004                if ($lang_count > 0)
 
 3006                        $this->setup->getClient()->status[
"lang"][
"status"] = 
true;
 
 3007                        $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
 
 3011                        $this->setup->getClient()->status[
"lang"][
"status"] = 
false;
 
 3012                        $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
 
 3015                $this->setButtonPrev(
"lang");
 
 3017                if ($lang_count > 0)
 
 3019                        $this->setButtonNext(
"contact");
 
 3033                if (empty(
$_POST[
"form"][
"lang_id"]))
 
 3039                if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
 
 3045                $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"], 
$_POST[
"form"][
"lang_local"]);
 
 3052                        foreach (
$result as $key => $lang_key)
 
 3054                                $list .= $this->lng->txt(
"lang_".$lang_key);
 
 3056                                if ($count > $key + 1)
 
 3063                $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
 
 3064                $message = $this->lng->txt(
"languages_installed");
 
 3068                        $message .= 
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
 
 3084                $settings = $this->setup->getClient()->getAllSettings();
 
 3091                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 3092                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
 
 3093                $this->setButtonPrev(
"lang");
 
 3095                $check = $this->setup->checkClientContact($this->setup->client);
 
 3097                $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
 
 3098                $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
 
 3100                if ($check[
"status"])
 
 3102                        $this->setButtonNext(
"proxy");
 
 3117                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3122                $ti->setMaxLength(64);
 
 3124                $ti->setRequired(
true);
 
 3125                $this->form->addItem($ti);
 
 3129                $ti->setMaxLength(64);
 
 3131                $this->form->addItem($ti);
 
 3135                $ti->setMaxLength(64);
 
 3137                $this->form->addItem($ti);
 
 3141                $sh->setTitle(
$lng->txt(
"contact_data"));
 
 3142                $this->form->addItem($sh);
 
 3146                $ti->setMaxLength(64);
 
 3148                $ti->setRequired(
true);
 
 3149                $this->form->addItem($ti);
 
 3153                $ti->setMaxLength(64);
 
 3155                $ti->setRequired(
true);
 
 3156                $this->form->addItem($ti);
 
 3159                        "title" => array(
"max" => 64, 
"size" => 30),
 
 3160                        "position" => array(
"max" => 64, 
"size" => 30),
 
 3161                        "institution" => array(
"max" => 200, 
"size" => 30),
 
 3162                        "street" => array(
"max" => 64, 
"size" => 30),
 
 3163                        "zipcode" => array(
"max" => 10, 
"size" => 5),
 
 3164                        "city" => array(
"max" => 64, 
"size" => 30),
 
 3165                        "country" => array(
"max" => 64, 
"size" => 30),
 
 3166                        "phone" => array(
"max" => 64, 
"size" => 30)
 
 3168                foreach ($fs as $f => $op)
 
 3172                        $ti->setMaxLength($op[
"max"]);
 
 3173                        $ti->setSize($op[
"size"]);
 
 3174                        $ti->setInfo(
$lng->txt(
""));
 
 3175                        $this->form->addItem($ti);
 
 3179                $ti = 
new ilEmailInputGUI(
$lng->txt(
"email"), 
"admin_email");
 
 3180                $ti->setRequired(
true);
 
 3181                $ti->allowRFC822(
true);
 
 3182                $this->form->addItem($ti);
 
 3185                $ti = 
new ilEmailInputGUI(
$lng->txt(
"feedback_recipient"), 
"feedback_recipient");
 
 3186                $ti->setInfo(
$lng->txt(
"feedback_recipient_info"));
 
 3187                $ti->setRequired(
true);
 
 3188                $ti->allowRFC822(
true);
 
 3189                $this->form->addItem($ti);
 
 3192                $ti = 
new ilEmailInputGUI(
$lng->txt(
"error_recipient"), 
"error_recipient");
 
 3193                $ti->allowRFC822(
true);
 
 3194                $this->form->addItem($ti);
 
 3196                $this->form->addCommandButton(
"saveContact", 
$lng->txt(
"save"));
 
 3198                $this->form->setTitle(
$lng->txt(
"client_data"));
 
 3199                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 3208                $settings = $this->setup->getClient()->getAllSettings();
 
 3210                $values = $settings;
 
 3212                $values[
"inst_name"] = ($this->setup->getClient()->getName())
 
 3213                        ? $this->setup->getClient()->getName()
 
 3214                        : $this->setup->getClient()->getId();
 
 3215                $values[
"inst_info"] = $this->setup->getClient()->getDescription();
 
 3217                $this->form->setValuesByArray($values);
 
 3228                if ($this->form->checkInput())
 
 3230                        $this->setup->getClient()->setSetting(
"admin_firstname", 
$_POST[
"admin_firstname"]);
 
 3231                        $this->setup->getClient()->setSetting(
"admin_lastname", 
$_POST[
"admin_lastname"]);
 
 3232                        $this->setup->getClient()->setSetting(
"admin_title", 
$_POST[
"admin_title"]);
 
 3233                        $this->setup->getClient()->setSetting(
"admin_position", 
$_POST[
"admin_position"]);
 
 3234                        $this->setup->getClient()->setSetting(
"admin_institution", 
$_POST[
"admin_institution"]);
 
 3235                        $this->setup->getClient()->setSetting(
"admin_street", 
$_POST[
"admin_street"]);
 
 3236                        $this->setup->getClient()->setSetting(
"admin_zipcode", 
$_POST[
"admin_zipcode"]);
 
 3237                        $this->setup->getClient()->setSetting(
"admin_city", 
$_POST[
"admin_city"]);
 
 3238                        $this->setup->getClient()->setSetting(
"admin_country", 
$_POST[
"admin_country"]);
 
 3239                        $this->setup->getClient()->setSetting(
"admin_phone", 
$_POST[
"admin_phone"]);
 
 3240                        $this->setup->getClient()->setSetting(
"admin_email", 
$_POST[
"admin_email"]);
 
 3241                        $this->setup->getClient()->setSetting(
"inst_institution", 
$_POST[
"inst_institution"]);
 
 3242                        $this->setup->getClient()->setSetting(
"inst_name", 
$_POST[
"inst_name"]);
 
 3243                        $this->setup->getClient()->setSetting(
"feedback_recipient", 
$_POST[
"feedback_recipient"]);
 
 3244                        $this->setup->getClient()->setSetting(
"error_recipient", 
$_POST[
"error_recipient"]);
 
 3247                        $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
 
 3248                        $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
 
 3249                        $this->setup->getClient()->ini->write();
 
 3255                $this->form->setValuesByPost();
 
 3269                $settings = $this->setup->getClient()->getAllSettings();
 
 3270                $nic_key = $this->setup->getClient()->getNICkey();
 
 3273                $settings = $this->setup->getClient()->getAllSettings();
 
 3275                if ($settings[
"nic_enabled"] == 
"1" && $settings[
"inst_id"] > 0)
 
 3277                        $this->no_second_nav = 
true;
 
 3278                        $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
 
 3283                        $settings = $this->setup->getClient()->getAllSettings();
 
 3285                        $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
 
 3291                        $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 3293                        if (isset($settings[
"nic_enabled"]))
 
 3295                                $this->setup->getClient()->status[
"nic"][
"status"] = 
true;
 
 3300                $this->setButtonPrev(
"proxy");
 
 3302                if ($this->setup->getClient()->status[
"nic"][
"status"])
 
 3304                        $this->setButtonNext(
"finish",
"finish");
 
 3319                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3326                $radg->addOption($op1);
 
 3328                $radg->addOption($op1);
 
 3329                $this->form->addItem($radg);
 
 3331                $this->form->addCommandButton(
"saveRegistration", 
$lng->txt(
"save"));
 
 3332                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 3340                $settings = $this->setup->getClient()->getAllSettings();
 
 3341                $nic_key = $this->setup->getClient()->getNICkey();
 
 3346                if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] == 
"1")
 
 3348                        $values[
"register"] = 1;
 
 3356                        $values[
"register"] = 0;
 
 3359                $this->form->setValuesByArray($values);
 
 3370                if ($this->form->checkInput())
 
 3373                        if (
$_POST[
"register"] == 1)
 
 3376                                $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
 
 3379                                if (empty($this->setup->getClient()->nic_status[2]))
 
 3381                                        $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
 
 3387                                        $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
 
 3388                                        $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
 
 3389                                        $this->setup->getClient()->status[
"nic"][
"status"] = 
true;
 
 3413                                $this->setup->getClient()->setSetting(
"inst_id",
"0");
 
 3414                                $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
 
 3420                $this->form->setValuesByPost();
 
 3443                $this->tpl->setVariable(
"SETUP_CONTENT",
 
 3444                        $ctrl_structure_form->getHTML() . 
"<br />" .
 
 3445                        $settings_type_form->getHTML().
'<br />'.
 
 3446                        $mp_ns_form->getHTML());
 
 3452                include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3455                $form->setId(
'tree_impl');
 
 3456                $form->setTitle($this->lng->txt(
'tree_implementation'));
 
 3457                $form->setFormAction(
'setup.php?cmd=gateway');
 
 3461                #$options->setRequired(true); 
 3464                $type = ($set->get(
'main_tree_impl',
'ns') == 
'ns' ? 
'ns' : 
'mp');
 
 3469                $ns = 
new ilRadioOption($this->lng->txt(
'tree_implementation_ns'), 
'ns');
 
 3472                $mp = 
new ilRadioOption($this->lng->txt(
'tree_implementation_mp'),
'mp');
 
 3476                $form->addCommandButton(
'switchTree', $this->lng->txt(
'tree_implementation_switch_btn'));
 
 3477                $form->setShowTopButtons(
false);
 
 3486                $type = ($set->get(
'main_tree_impl',
'ns') == 
'ns' ? 
'ns' : 
'mp');
 
 3488                if($type == 
'ns' and 
$_POST[
'tree_impl_type'] == 
'mp')
 
 3491                        include_once 
'./Services/Tree/classes/class.ilMaterializedPathTree.php';
 
 3494                        $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
 
 3495                        $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
 
 3496                        $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'path'),
'i4');
 
 3498                        $set->set(
'main_tree_impl', 
'mp');
 
 3501                elseif($type == 
'mp' and 
$_POST[
'tree_impl_type'] == 
'ns')
 
 3503                        include_once 
'./Services/Tree/classes/class.ilTree.php';
 
 3508                        $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
 
 3509                        $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
 
 3510                        $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'lft'),
'i4');
 
 3512                        $set->set(
'main_tree_impl', 
'ns');
 
 3526                include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3529                $form->setId(
"control_structure");
 
 3530                $form->setTitle($this->lng->txt(
"ctrl_structure"));
 
 3531                $form->setFormAction(
"setup.php?cmd=gateway");
 
 3533                $ilDB = $this->setup->getClient()->db;
 
 3534                $cset = 
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
 
 3535                $crec = 
$ilDB->fetchAssoc($cset);
 
 3538                if ($crec[
"cnt"] == 0)
 
 3540                        $item->setInfo($this->lng->txt(
"ctrl_missing_desc"));
 
 3544                        $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
 
 3546                $form->addItem($item);
 
 3548                $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
 
 3560                if (!$this->setup->getClient()->db_installed)
 
 3568                $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
 
 3571                require_once 
"./setup/classes/class.ilModuleReader.php";
 
 3572                require_once 
"./setup/classes/class.ilServiceReader.php";
 
 3573                require_once 
"./setup/classes/class.ilCtrlStructureReader.php";
 
 3575                require_once 
"./Services/Component/classes/class.ilModule.php";
 
 3576                require_once 
"./Services/Component/classes/class.ilService.php";
 
 3583                foreach($modules as $module)
 
 3586                                $module[
"subdir"], 
"Modules");
 
 3594                foreach($services as $service)
 
 3597                                $service[
"subdir"], 
"Services");
 
 3615                include_once(
"./Services/Administration/classes/class.ilSetting.php");
 
 3618                include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3621                $form->setId(
"settings_type");
 
 3622                $form->setTitle($this->lng->txt(
"settings_type"));
 
 3623                $form->setFormAction(
"setup.php?cmd=gateway");
 
 3626                $item->setValue(strtoupper($type));
 
 3628                if ($type == 
"clob")
 
 3630                        $item->setInfo($this->lng->txt(
'settings_info_clob'));
 
 3631            $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
 
 3632            $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
 
 3636                        $item->setInfo($this->lng->txt(
'settings_info_text'));
 
 3637                $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
 
 3639                $form->addItem($item);
 
 3641                if (is_array($this->longer_settings))
 
 3645                        if (count($this->longer_settings))
 
 3647                    foreach ($this->longer_settings as 
$row)
 
 3650                                        $subitem->setInfo(
$row[
'value']);
 
 3651                                        $item->addSubItem($subitem);
 
 3656                    $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
 
 3658                        $form->addItem($item);
 
 3670                include_once(
"./Services/Administration/classes/class.ilSetting.php");
 
 3673                if ($old_type == 
"clob")
 
 3676                        if (count($longer_settings))
 
 3678                    $this->longer_settings = $longer_settings;
 
 3706                include_once(
"./Services/Administration/classes/class.ilSetting.php");
 
 3716                $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html", 
"setup");
 
 3718                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
 
 3723                        $pass_old = $this->setup->getPassword();
 
 3725                        if (empty(
$_POST[
"form"][
"pass_old"]))
 
 3727                                $message = $this->lng->txt(
"password_enter_old");
 
 3728                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3731                        if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
 
 3733                                $message = $this->lng->txt(
"password_old_wrong");
 
 3734                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3737                        if (empty(
$_POST[
"form"][
"pass"]))
 
 3739                                $message = $this->lng->txt(
"password_empty");
 
 3740                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3745                                $message = $this->lng->txt(
"password_not_match");
 
 3746                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3749                        if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
 
 3751                                $message = $this->lng->txt(
"password_same");
 
 3752                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3755                        if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
 
 3757                                $message = $this->lng->txt(
"save_error");
 
 3758                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 3766                $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html", 
"setup");
 
 3768                $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
 
 3771                $this->tpl->setVariable(
"FORMACTION", 
"setup.php?cmd=gateway");
 
 3772                $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
 
 3773                $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
 
 3774                $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
 
 3775                $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
 
 3776                $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
 
 3777                $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
 
 3786                $this->no_second_nav = 
true;
 
 3790                        $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
 
 3791                                "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
 
 3792                                $this->lng->txt(
"password").
": <b>homer</b></p>";
 
 3793                        $this->setButtonNext(
"login_new",
"login");
 
 3795                        $this->setup->getClient()->reconnect();         
 
 3798                        $this->setup->getClient()->setSetting(
"setup_ok",1);
 
 3801                        $this->setup->getClient()->status[
"finish"][
"status"] = 
true;
 
 3806                        $txt_info = $this->lng->txt(
"info_text_finish2");
 
 3811                $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html", 
"setup");
 
 3812                $this->tpl->setVariable(
"TXT_INFO",$txt_info);
 
 3814                $this->setButtonPrev(
"nic");
 
 3828                if (
$_POST[
"form"][
"delete"])
 
 3854                        $msg = $this->setup->getClient()->delete(
$ini,$db,$files);
 
 3860                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
 
 3863                $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html", 
"setup");
 
 3866                $this->tpl->setVariable(
"FORMACTION", 
"setup.php?cmd=gateway");
 
 3867                $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
 
 3868                $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
 
 3869                $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
 
 3881                if ($this->setup->getClient()->status[
"finish"][
"status"])
 
 3883                        $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ? 
"0" : 
true;
 
 3884                        $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
 
 3885                        $this->setup->getClient()->ini->write();
 
 3886                        $message = 
"client_access_mode_changed";
 
 3890                        $message = 
"client_setup_not_finished";
 
 3909                                $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
 
 3912                        $status = $this->setup->getStatus(
$client);
 
 3914                        if ($status[
"finish"][
"status"])
 
 3916                                $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
 
 3917                                $this->setup->ini->write();
 
 3918                                $message = 
"default_client_changed";
 
 3922                                $message = 
"client_setup_not_finished";
 
 3937                foreach ($this->setup->getClient()->status as $key => $val)
 
 3939                        if ($key != 
"finish" and $key != 
"access")
 
 3941                                if ($val[
"status"] != 
true)
 
 3949                $clientlist = 
new ilClientList($this->setup->db_connections);
 
 3951                $list = $clientlist->getClients();
 
 3953                if (count($list) == 1)
 
 3955                        $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
 
 3956                        $this->setup->ini->write();
 
 3958                        $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
 
 3959                        $this->setup->getClient()->ini->write();
 
 3970                if (!$this->setup->getClient()->status[
"db"][
"status"])
 
 3976                elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
 
 3978                        $this->cmd = 
"lang";
 
 3982                elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
 
 3984                        $this->cmd = 
"contact";
 
 3988                elseif(!$this->setup->getClient()->status[
'proxy'][
'status'])
 
 3990                        $this->cmd = 
"proxy";
 
 3994                elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
 
 4000                elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
 
 4002                        $this->cmd = 
"finish";
 
 4017                if ($this->setup->ini->readVariable(
"clients",
"list"))
 
 4019                        $this->setup->ini->setVariable(
"clients",
"list",
"0");
 
 4020                        $this->setup->ini->write();
 
 4025                        $this->setup->ini->setVariable(
"clients",
"list",
"1");
 
 4026                        $this->setup->ini->write();
 
 4043                include_once 
"./Services/Database/classes/class.ilDBUpdate.php";
 
 4044                include_once 
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
 
 4045                include_once 
"./Services/AccessControl/classes/class.ilRbacReview.php";
 
 4046                include_once 
"./Services/AccessControl/classes/class.ilRbacSystem.php";
 
 4047                include_once 
"./Services/Tree/classes/class.ilTree.php";
 
 4048                include_once 
"./Services/Xml/classes/class.ilSaxParser.php";
 
 4049                include_once 
"./Services/Object/classes/class.ilObjectDefinition.php";
 
 4052                $ilDB = $this->setup->getClient()->db;
 
 4053                $this->lng->setDbHandler(
$ilDB);
 
 4057                $dbupdate->applyCustomUpdates();
 
 4059                if ($dbupdate->updateMsg == 
"no_changes")
 
 4061                        $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
 
 4066                        foreach ($dbupdate->updateMsg as 
$row)
 
 4068                                if (
$row[
"msg"] == 
"update_applied")
 
 4070                                        $a_message.= $sep.$row[
"nr"];
 
 4075                                        $e_message.= 
"<br/>".$this->lng->txt(
$row[
"msg"]).
": ".
$row[
"nr"];
 
 4078                        if ($a_message != 
"")
 
 4080                                $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
 
 4097                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 4100                $this->form->setId(
"clone_form");
 
 4101                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 4103                if ($this->setup->getClient()->status[
"access"][
"status"] === 
false and stripos($this->setup->getClient()->getName(),
"master") === 
false and $this->setup->getClient()->getdbType() == 
"mysql" and $this->setup->getClient()->db_exists )
 
 4105                        $this->form->setTitle($this->lng->txt(
"clone_source"));
 
 4107                        $clientlist = 
new ilClientList($this->setup->db_connections);
 
 4108                        $list = $clientlist->getClients();
 
 4109                        $clientlistarray = array();
 
 4111                        foreach ($list as $key => 
$client){
 
 4112                                if ((strcmp($key, $this->setup->getClient()->getId()) != 
'0') && (
$client->getDbType() == 
'mysql')) {  
 
 4119                        $si->setOptions(array_merge(
 
 4120                                array(
"" => 
"-- ".
$lng->txt(
"please_select").
" --"),
 
 4122                        $si->setRequired(
true);
 
 4123                        $this->form->addItem(
$si);
 
 4126                        $cb->setRequired(
true);
 
 4127                        $this->form->addItem($cb);
 
 4129                        $this->form->addCommandButton(
"cloneSaveSource", 
$lng->txt(
"cloneit"));
 
 4131                        $disabledmessage = 
"<h1>" . $this->lng->txt(
"clone_disabledmessage") .
"</h1><br>";
 
 4132                        if (!$this->setup->getClient()->status[
"access"][
"status"] === 
false) {
 
 4133                                $disabledmessage .= $this->lng->txt(
"clone_clientnotdisabled") . 
"<br>";
 
 4135                        if (!stripos($this->setup->getClient()->getName(),
"aster") === 
false) {
 
 4136                                $disabledmessage .= $this->lng->txt(
"clone_clientismaster") . 
"<br>";
 
 4138                        if ($this->setup->getClient()->getdbType() != 
"mysql") {
 
 4139                                $disabledmessage .= $this->lng->txt(
"clone_clientisnotmysql") . 
"<br>";
 
 4141                        if (!$this->setup->getClient()->db_exists) {
 
 4142                                $disabledmessage .= $this->lng->txt(
"clone_clientnodatabase") . 
"<br>";
 
 4144                        $this->form->setTitle($disabledmessage);
 
 4150                if (!$this->setup->isAdmin())
 
 4156                $this->form->setValuesByPost();
 
 4157                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
 
 4158                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 4165                if (!$this->setup->isAdmin())
 
 4172                if ($this->form->checkInput())
 
 4174                        if ($this->form->getInput(
"iamsure") != 
"1")
 
 4176                                $message = $this->lng->txt(
"clone_youmustcheckiamsure");
 
 4177                                $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
 
 4179                        if (!$this->setup->cloneFromSource($this->form->getInput(
"source")))
 
 4181                                $message = $this->lng->txt(
"clone_error");
 
 4182                                $this->setup->raiseError($message . 
" -> " . $this->setup->error,$this->setup->error_obj->MESSAGE);
 
 4188                $this->form->setValuesByPost();
 
 4189                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
 
 4190                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 4196                $settings = $this->setup->getClient()->getAllSettings();
 
 4200                        include_once(
"./Services/Administration/classes/class.ilSetting.php");
 
 4202                        $this->form->setValuesByArray(array(
 
 4203                                'proxy_status' => (
bool)$settings[
'proxy_status'],
 
 4204                                'proxy_host' => $settings[
'proxy_host'],
 
 4205                                'proxy_port' => $settings[
'proxy_port']
 
 4207                        if((
bool)$settings[
'proxy_status'])
 
 4209                                $this->setup->printProxyStatus($this->setup->client);
 
 4212                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
 4213                $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_proxy"));
 
 4216                $check = $this->setup->checkClientProxySettings($this->setup->client);
 
 4218                $this->setup->getClient()->status[
"proxy"][
"status"] = $check[
"status"];
 
 4219                $this->setup->getClient()->status[
"proxy"][
"comment"] = $check[
"comment"];
 
 4220                $this->setup->getClient()->status[
"proxy"][
"text"] = $check[
"comment"];
 
 4222                if ($check[
"status"])
 
 4224                        $this->setButtonNext(
"nic");
 
 4227                $this->setButtonPrev(
"contact");
 
 4234                include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
 
 4236                $this->form->setFormAction(
"setup.php?cmd=gateway");
 
 4240                $proxs->setInfo(
$lng->txt(
'proxy_status_info'));
 
 4241                $proxs->setValue(1);
 
 4242                $this->form->addItem($proxs);
 
 4246                $proxs->addSubItem($proxa);
 
 4250                $prox->setInfo(
$lng->txt(
'proxy_host_info'));
 
 4251                $proxs->addSubItem($prox);
 
 4255                $proxp->setInfo(
$lng->txt(
'proxy_port_info'));
 
 4256                $proxp->setSize(10);
 
 4257                $proxp->setMaxLength(10);
 
 4258                $proxs->addSubItem($proxp);
 
 4261                $this->form->addCommandButton(
'saveProxy', 
$lng->txt(
'save'));
 
 4276                $isFormValid = $this->form->checkInput();
 
 4278                $new_settings[
'proxy_status'] = (int)$this->form->getInput(
'proxy_status');
 
 4279                $new_settings[
'proxy_host'] = trim($this->form->getInput(
'proxy_host'));
 
 4280                $new_settings[
'proxy_port'] = trim($this->form->getInput(
'proxy_port'));
 
 4284                        if($new_settings[
'proxy_status'] == 
true)
 
 4286                                if(!strlen($new_settings[
'proxy_host']))
 
 4288                                        $isFormValid = 
false;
 
 4289                                        $this->form->getItemByPostVar(
'proxy_host')->setAlert(
$lng->txt(
'msg_input_is_required'));
 
 4291                                if(!strlen($new_settings[
'proxy_port']))
 
 4293                                        $isFormValid = 
false;
 
 4294                                        $this->form->getItemByPostVar(
'proxy_port')->setAlert(
$lng->txt(
'msg_input_is_required'));
 
 4296                                if(!preg_match(
'/[0-9]{1,}/', $new_settings[
'proxy_port']) ||
 
 4297                                        $new_settings[
'proxy_port'] < 0 ||
 
 4298                                        $new_settings[
'proxy_port'] > 65535)
 
 4300                                        $isFormValid = 
false;
 
 4301                                        $this->form->getItemByPostVar(
'proxy_port')->setAlert(
$lng->txt(
'proxy_port_numeric'));
 
 4307                                $this->setup->saveProxySettings($new_settings);
 
 4310                                $settings = $this->setup->getClient()->getAllSettings();
 
 4311                                if($settings[
'proxy_status'] == 
true)
 
 4313                                        $this->setup->printProxyStatus($this->setup->client);
 
 4322                $this->form->setValuesByPost();
 
 4323                $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
 
static _getShortTimeZoneList()
get short timezone list
static createFromParentReleation()
static getAvailableCoreModules()
Get all available core modules.
This class represents a non editable value in a property form.
This class represents an option in a radio group.
static getAvailableCoreServices()
Get all available core services.
static getSettingFields()
returns the array of setting fields
const SESSION_HANDLING_LOAD_DEPENDENT
const SESSION_HANDLING_FIXED
static _getLongerSettings($a_limit='4000')
get a list of setting records with values loger than a limit
static _getValueType()
get the type of the value column in the database
static _changeValueType($a_new_type='text')
change the type of the value column in the database
checkDisplayMode($a_title="")
determine display mode and load according html layout
displayMasterSetup($a_omit_init=false)
display master setup form & process form input
applyHotfix()
Apply hotfixes.
initControlStructureForm()
Init the form to reload the control structure.
displayClientList()
display client list and process form input
initSettingsTypeForm()
Init the form to change the settings value type.
cmdInstall()
process valid commands for pre-installation status
changeMasterPassword()
display change password form and process form input
displayError($a_message)
display error page
displayContactData($a_omit_init=false)
display contact data form and process form input
installDatabase()
Install the database.
initTreeImplementationForm()
displayClientOverview()
display client overview panel
loginClient()
login to a client
displayFinishSetup()
display finish setup page
initMasterLoginForm()
Init master login form.
saveProxy()
Save proxy settings.
setDisplayMode($a_mode)
set display mode to 'view' or 'setup' 'setup' -> show status panel and (prev/next) navigation buttons...
showUpdateSteps($a_hotfix=false)
Update database.
reloadControlStructure()
reload control structure
displayDeleteConfirmation()
display delete client confirmation form and process form input
getContactValues()
Get current values for contact from.
displayNavButtons()
display navigation buttons
getBasicSettingsValues()
Get current values for basic settings from.
displayTools()
display tools
displaySubTabs()
Show subtabs.
displayIni($a_omit_form_init=false)
display setup in step
displayHeader()
display header with admin links and language flags
updateDatabase()
Update database.
performMLogin()
Master Login.
displayProcessPanel()
display process panel
validateSetup()
validatesetup status again and set access mode of the first client to online
initDBSelectionForm()
Init db selection form.
displayStartup()
display intro page for the first client installation
jumpToFirstUnfinishedSetupStep()
if setting up a client was not finished, jump back to the first uncompleted setup step
initRegistrationForm($a_mode="edit")
Init registration form.
setDbSubtabs($a_subtab_id="db")
Set db subtabs.
saveLanguages()
Save languages.
initDbSlaveForm()
Init db slave form.
saveRegistration()
Save registration form.
determineTools($a_tools="")
Determine Tools.
initClientLoginForm()
Init client login form.
initContactDataForm()
Init contact data form.
SetButtonPrev($a_cmd=0, $a_lng=0)
set previous navigation button
displayPreliminaries()
display preliminaries page
changeSettingsType()
change the type of the value field in settings table
showHotfixSteps()
Show hotfix steps.
getClientIniValues()
Get current values for client ini from.
selectDBType()
Select database type.
saveContact()
Save contact form.
getRegistrationValues()
Get current values for registration from.
displayStatusPanel()
display status panel
determineToolsPathInstall()
Determine tools paths.
changeAccessMode($a_back)
enable/disable access to a client
saveBasicSettings()
Save basic settings form.
saveDbSlave()
Save db slave form.
changeDefaultClient()
set defualt client
saveClientIni()
Save client ini form.
SetButtonNext($a_cmd, $a_lng=0)
set next navigation button
updateBasicSettings()
Update basic settings form.
initClientDbForm($a_install=true, $dbupdate=null, $db_status=false, $hotfix_available=false, $custom_updates_available=false)
Init client db form.
displayNIC($a_omit_init=false)
display nic registration form and process form input
initClientIniForm()
Init client ini form.
determineToolsPath()
Determine tools paths.
displaySessions()
display sessions form and process form input
initBasicSettingsForm($a_install=false)
Init basic settings form.
displayDatabase()
display database form and process form input
displayLanguages()
display language form and process form input
toggleClientList()
enable/disable client list on index page
showLongerSettings()
show a list of setting values that are loger than 4000 characters
cloneInitForm()
Initialize clone form.
displayLogin($a_omit_minit=false, $a_omit_cinit=false)
display login form and process form
cmdClient()
process valid commands for all clients
displayLogout()
display logout page
displayDatabaseSlave($a_from_save=false)
Display database slave.
initClientOverviewForm()
Init client overview form.
checkPanelMode()
determine display mode and load correct panel
displayProxy($a_omit_init=false)
getClientDbFormValues($dbupdate=null)
Get current values for client db from.
cmdAdmin()
process valid commands for admins
changeMasterSettings($a_omit_init=false)
display master settings and process form input
displayFooter()
page output and set title
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static isWindows()
check wether the current client system is a windows system
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static initDomEvent()
Init YUI DomEvent.
static initjQuery($a_tpl=null)
Init jQuery.
if(!is_array($argv)) $options
const ILIAS_ABSOLUTE_PATH