4 require_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: 58551 $';
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 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"passwd")
387 $this->displayCache();
392 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic")
403 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish")
423 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
427 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1")
429 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
430 $this->setup->getClient()->ini->write();
434 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
441 case "reloadStructure":
449 case "saveClientIni":
450 case "installDatabase":
451 case "displayDatabase":
452 case "updateDatabase":
453 case "showUpdateSteps":
454 case "saveLanguages":
456 case "displayContactData":
458 case "saveRegistration":
460 case "showHotfixSteps":
461 case "applyCustomUpdates":
462 case "changeSettingsType":
463 case "showLongerSettings":
464 case "cloneSelectSource":
465 case "cloneSaveSource":
467 case "displayPassword":
475 $this->
displayError($this->lng->txt(
"unknown_command"));
497 if ($a_mode !=
"view" and $a_mode !=
"setup")
502 $this->display_mode = $a_mode;
513 $languages = $this->lng->getLanguages();
515 $count = (int) round(count($languages) / 2);
518 foreach ($languages as $lang_key)
526 $this->tpl->setCurrentBlock(
"languages");
527 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
528 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
529 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
530 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
531 $this->tpl->setVariable(
"BORDER", 0);
532 $this->tpl->setVariable(
"VSPACE", 0);
533 $this->tpl->parseCurrentBlock();
538 if (count($languages) % 2)
540 $this->tpl->touchBlock(
"lng_empty_cell");
543 if ($this->cmd !=
"logout" and $this->setup->isInstalled() and $this->setup->isAuthenticated())
546 if ($this->setup->isAdmin())
548 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
550 $this->tpl->setCurrentBlock(
"add_client");
551 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
552 $this->tpl->parseCurrentBlock();
556 $class = ($this->active_tab ==
"clientlist")
559 $this->tpl->setCurrentBlock(
"display_list");
560 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
561 $this->tpl->setVariable(
"TAB_CLASS", $class);
562 $this->tpl->parseCurrentBlock();
565 $class = ($this->active_tab ==
"basicsettings")
568 $this->tpl->setCurrentBlock(
"edit_pathes");
569 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
570 $this->tpl->setVariable(
"TAB_CLASS", $class);
571 $this->tpl->parseCurrentBlock();
574 $class = ($this->active_tab ==
"preliminaries")
577 $this->tpl->setCurrentBlock(
"preliminaries");
578 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
579 $this->tpl->setVariable(
"TAB_CLASS", $class);
580 $this->tpl->parseCurrentBlock();
583 $class = ($this->active_tab ==
"password")
586 $this->tpl->setCurrentBlock(
"change_password");
587 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
588 $this->tpl->setVariable(
"TAB_CLASS", $class);
589 $this->tpl->parseCurrentBlock();
593 if ($this->setup->isAuthenticated())
595 $this->tpl->setCurrentBlock(
"logout");
596 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
597 $this->tpl->parseCurrentBlock();
601 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
602 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
603 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
604 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
606 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
607 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
608 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
609 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
610 $this->tpl->setVariable(
"VERSION", $this->version);
611 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
612 $this->tpl->setVariable(
"LANG", $this->lang);
621 if ($this->cmd !=
"logout")
623 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
625 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
627 elseif ($this->setup->isAdmin())
629 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
645 if (!$this->btn_prev_on and !$this->btn_next_on)
650 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
653 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
655 if ($this->btn_prev_on)
657 $ntpl->setCurrentBlock(
"btn_back");
658 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
659 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
660 $ntpl->parseCurrentBlock();
663 if ($this->btn_next_on)
665 $ntpl->setCurrentBlock(
"btn_forward");
666 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
667 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
668 $ntpl->parseCurrentBlock();
671 $nav_html = $ntpl->get();
672 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
673 if (!$this->no_second_nav)
675 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
688 $this->btn_prev_on =
true;
689 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
690 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
701 $this->btn_next_on =
true;
702 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
703 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
718 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
719 $btpl->setCurrentBlock(
"btn");
720 $btpl->setVariable(
"CMD",
"changeaccess");
721 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
722 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
723 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
724 $btpl->parseCurrentBlock();
725 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
728 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
740 $settings = $this->setup->getClient()->getAllSettings();
742 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
745 $this->form->setTitle($lng->txt(
"client_info"));
749 $ne->
setValue(($this->setup->getClient()->getName())
750 ? $this->setup->getClient()->getName()
751 :
"<".$this->lng->txt(
"no_client_name").
">");
752 $ne->setInfo($this->setup->getClient()->getDescription());
753 $this->form->addItem($ne);
757 $ne->
setValue($this->setup->getClient()->getId());
758 $this->form->addItem($ne);
762 $ne->
setValue(($this->setup->getClient()->db_installed)
763 ? $settings[
"inst_id"]
765 $this->form->addItem($ne);
769 $ne->
setValue(($this->setup->getClient()->db_installed)
770 ? $settings[
"db_version"]
772 $this->form->addItem($ne);
777 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
778 $ne->
setValue($this->lng->txt($access_status).$access_link);
779 $this->form->addItem($ne);
783 $sh->setTitle($this->lng->txt(
"server_info"));
784 $this->form->addItem($sh);
789 $this->form->addItem($ne);
793 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
794 $this->form->addItem($ne);
799 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
800 $this->form->addItem($ne);
804 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
805 $this->form->addItem($ne);
810 $this->form->addItem($ne);
815 $this->form->addItem($ne);
819 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
820 $this->form->addItem($sh);
822 $tools = array(
"convert",
"zip",
"unzip",
"ghostscript",
"java",
"htmldoc",
"ffmpeg");
824 foreach ($tools as $tool)
828 $p = $this->setup->ini->readVariable(
"tools", $tool);
829 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
830 $this->form->addItem($ne);
835 $p = $this->setup->ini->readVariable(
"tools",
"latex");
836 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
837 $this->form->addItem($ne);
841 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
842 $this->form->addItem($ne);
846 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
847 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
848 $this->form->addItem($ne);
852 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
853 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
854 $this->form->addItem($ne);
856 $this->form->setFormAction(
"setup.php?cmd=gateway");
868 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
869 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
871 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
873 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
874 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
875 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
876 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
877 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
878 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
879 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
881 $server_os = php_uname();
882 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
883 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
885 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
887 $env_comment = $this->lng->txt(
"env_ok");
891 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
894 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
895 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
896 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
898 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
899 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
901 $preliminaries = array(
"php",
"root",
"folder_create",
902 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
903 if ($this->setup->hasOpCacheEnabled()) {
904 $preliminaries[] =
'load_comments';
907 foreach ($preliminaries as $preliminary)
909 $this->tpl->setCurrentBlock(
"preliminary");
910 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
911 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
913 $this->tpl->setVariable(
"STATUS_PRE", $OK);
917 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
919 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
920 $this->tpl->parseCurrentBlock();
924 if ($this->setup->preliminaries ===
true)
926 if ($this->setup->isInstalled())
928 $cmd =
"mastersettings";
934 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
936 $this->setButtonNext(
$cmd,$btn_text);
940 $this->tpl->setCurrentBlock(
"premessage");
941 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
942 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
943 $this->tpl->parseCurrentBlock();
956 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
957 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
958 $this->tpl->setVariable(
"TXT_INFO",
959 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
961 $this->setButtonPrev(
"preliminaries");
963 if ($this->setup->isInstalled())
965 $this->setButtonNext(
"list");
972 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
980 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
981 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
982 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
984 $this->btn_next_on =
true;
985 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
986 $this->btn_next_cmd =
"newclient";
993 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
1003 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1010 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
1013 ? str_replace(
"\\",
"/", getcwd())
1016 $ne->setValue($cwd.
"/data");
1017 $this->form->addItem($ne);
1022 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
1023 $ti->
setInfo($lng->txt(
"data_directory_info"));
1024 $ti->setRequired(
true);
1025 $this->form->addItem($ti);
1030 $this->form->addItem($ne);
1040 $sh->setTitle($lng->txt(
"logging"));
1041 $this->form->addItem($sh);
1045 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
1046 $this->form->addItem($ti);
1050 $this->form->addItem($cb);
1054 $sh->setTitle($lng->txt(
"server_settings"));
1055 $this->form->addItem($sh);
1058 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
1060 $si->setOptions(array_merge(
1061 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
1063 $si->setRequired(
true);
1064 $this->form->addItem(
$si);
1068 $sh->setTitle($lng->txt(
"https_settings"));
1069 $this->form->addItem($sh);
1071 $check =
new ilCheckboxInputGUI($lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
1073 $check->setValue(1);
1075 $text =
new ilTextInputGUI($lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
1077 $text->setMaxLength(64);
1078 $text->setRequired(
true);
1079 $check->addSubItem($text);
1081 $text =
new ilTextInputGUI($lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
1083 $text->setMaxLength(64);
1084 $text->setRequired(
true);
1085 $check->addSubItem($text);
1087 $this->form->addItem($check);
1091 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
1092 $this->form->addItem($sh);
1095 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1096 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
1097 $ti->setRequired(
true);
1098 $this->form->addItem($ti);
1102 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
1103 $ti->setRequired(
true);
1104 $this->form->addItem($ti);
1108 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1109 $ti->setRequired(
true);
1110 $this->form->addItem($ti);
1114 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1115 $this->form->addItem($sh);
1118 $ti =
new ilTextInputGUI($lng->txt(
"ghostscript_path"),
"ghostscript_path");
1119 $ti->
setInfo($lng->txt(
"ghostscript_path_comment".$lvext));
1120 $this->form->addItem($ti);
1124 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1125 $this->form->addItem($ti);
1128 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1129 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1130 $this->form->addItem($ti);
1133 $ti =
new ilTextInputGUI($lng->txt(
"ffmpeg_path"),
"ffmpeg_path");
1134 $ti->
setInfo($lng->txt(
"ffmpeg_path_comment"));
1135 $this->form->addItem($ti);
1138 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1139 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1140 $this->form->addItem($ti);
1144 "none" => $lng->txt(
"none"),
1145 "sophos" => $lng->txt(
"sophos"),
1146 "antivir" => $lng->txt(
"antivir"),
1147 "clamav" => $lng->txt(
"clamav")
1151 $this->form->addItem($si);
1154 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1155 $this->form->addItem($ti);
1158 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1159 $this->form->addItem($ti);
1164 $sh->setTitle($lng->txt(
"master_password"));
1165 $this->form->addItem($sh);
1170 $pi->setSkipSyntaxCheck(
true);
1171 $pi->setInfo($lng->txt(
"password_info"));
1172 $this->form->addItem($pi);
1177 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1181 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1182 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1185 $this->form->setTitle($lng->txt(
"data_directories"));
1186 $this->form->setFormAction(
"setup.php?cmd=gateway");
1191 $this->form->setValuesByArray($det);
1203 $values[
"webspace_dir"] = getcwd().
"/data";
1204 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1205 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1206 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1207 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1208 $values[
"ghostscript_path"] = $this->setup->ini->readVariable(
"tools",
"ghostscript");
1209 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1210 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1212 $values[
"ffmpeg_path"] = $this->setup->ini->readVariable(
"tools",
"ffmpeg");
1213 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1214 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1215 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1216 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1217 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1218 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1219 $this->setup->ini->readVariable(
"log",
"file");
1220 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1221 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1224 $values[
"auto_https_detect_enabled"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_enabled");
1225 $values[
"auto_https_detect_header_name"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_header_name");
1226 $values[
"auto_https_detect_header_value"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_header_value");
1228 $this->form->setValuesByArray($values);
1240 if ($this->form->checkInput())
1245 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1246 "unzip_path",
"ghostscript_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1255 if (!$this->setup->checkDataDirSetup(
$_POST))
1257 $i = $this->form->getItemByPostVar(
"datadir_path");
1258 $i->setAlert($this->lng->txt($this->setup->getError()));
1261 else if (!$this->setup->checkLogSetup(
$_POST))
1263 $i = $this->form->getItemByPostVar(
"log_path");
1264 $i->setAlert($this->lng->txt($this->setup->getError()));
1267 else if (!$this->setup->checkPasswordSetup(
$_POST))
1271 else if (!$this->setup->saveMasterSetup(
$_POST))
1282 $this->form->setValuesByPost();
1295 if ($this->form->checkInput())
1299 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1300 "unzip_path",
"ghostscript_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1307 if (!$this->setup->checkLogSetup(
$_POST))
1309 $i = $this->form->getItemByPostVar(
"log_path");
1310 $i->setAlert($this->lng->txt($this->setup->getError()));
1313 else if (!$this->setup->updateMasterSettings(
$_POST))
1324 $this->form->setValuesByPost();
1339 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1348 $this->tpl->setVariable(
"SETUP_LOGIN_CLASS",
" ilSetupLogin");
1349 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1353 $m_form = $this->form->getHTML();
1359 $cl_form = $this->form->getHTML();
1363 $m_form = $this->form->getHTML();
1365 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1366 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1375 if ($this->form->checkInput())
1377 $i = $this->form->getItemByPostVar(
"mpassword");
1378 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1380 $i->setAlert($this->lng->txt(
"login_invalid"));
1390 $this->form->setValuesByPost();
1400 if ($this->form->checkInput())
1402 $i = $this->form->getItemByPostVar(
"password");
1403 if (!$this->setup->loginAsClient(
1404 array(
"client_id" =>
$_POST[
"client_id"],
1405 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1407 $i->setAlert($this->setup->getError());
1417 $this->form->setValuesByPost();
1428 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1430 $this->form->setId(
"client_login");
1436 $this->form->addItem($ti);
1441 $this->form->addItem($ti);
1446 $pi->setRetype(
false);
1447 $pi->setSkipSyntaxCheck(
true);
1448 $this->form->addItem($pi);
1450 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1452 $this->form->setTitle($lng->txt(
"client_login"));
1453 $this->form->setFormAction(
"setup.php?cmd=gateway");
1463 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1465 $this->form->setId(
"master_login");
1469 $pi->setRetype(
false);
1470 $pi->setSkipSyntaxCheck(
true);
1471 $this->form->addItem($pi);
1473 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1475 $this->form->setTitle($lng->txt(
"admin_login"));
1476 $this->form->setFormAction(
"setup.php?cmd=gateway");
1491 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1492 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1496 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1497 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1498 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1500 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1502 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1505 $this->btn_next_on =
true;
1506 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1507 $this->btn_next_cmd =
"newclient";
1533 ? str_replace(
"\\",
"/", getcwd())
1537 $tools = array(
"convert" =>
"convert",
1538 "zip" =>
"zip",
"unzip" =>
"unzip",
"ghostscript" =>
"gs",
1539 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"ffmpeg" =>
"ffmpeg");
1540 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1544 $tools = array(
"convert" =>
"convert.exe",
1545 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1546 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1547 $cwd.
"/Services/Windows/bin32/unzip",
1548 $cwd.
"/Services/Windows/bin32/convert");
1550 foreach($tools as $k => $tool)
1554 @exec(
"which ".$tool,
$ret);
1555 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1557 $a_tools[$k.
"_path"] =
$ret[0];
1562 foreach(
$dirs as $dir)
1564 if (@is_file($dir.
"/".$tool))
1566 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1591 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1597 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1599 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1600 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1602 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1603 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1605 if ($this->setup->getClient()->status[
"ini"][
"status"])
1607 $this->setButtonNext(
"db");
1620 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1625 "mysql" =>
"MySQL 5.0.x or higher (MyISAM engine)",
1626 "innodb" =>
"MySQL 5.0.x or higher (InnoDB engine)",
1627 "oracle" =>
"Oracle 10g or higher",
1628 "postgres" =>
"Postgres (experimental)"
1632 $si->setInfo($lng->txt(
""));
1633 $this->form->addItem(
$si);
1635 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1637 $this->form->setTitle($lng->txt(
"db_selection"));
1638 $this->form->setFormAction(
"setup.php?cmd=gateway");
1652 if (
$_POST[
"db_type"] !=
"")
1661 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1662 if (!$a_omit_form_init)
1667 $this->tpl->setVariable(
"SETUP_CONTENT",
1668 $this->form->getHTML());
1670 if ($this->setup->getClient()->status[
"ini"][
"status"])
1672 $this->setButtonNext(
"db");
1685 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1689 if ($this->setup->ini_client_exists)
1692 $hi->setValue($this->client_id);
1693 $this->form->addItem($hi);
1697 $this->form->addItem($ne);
1703 $ti->setRequired(
true);
1704 $this->form->addItem($ti);
1709 $sh->setTitle($lng->txt(
"db_conn"));
1710 $this->form->addItem($sh);
1714 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1715 $this->form->addItem($ne);
1720 $ti->setRequired(
true);
1721 $this->form->addItem($ti);
1724 if (in_array(
$_SESSION[
"db_type"], array(
"mysql",
"postgres",
"innodb")))
1731 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1734 $this->form->addItem($ti);
1739 $ti->setRequired(
true);
1740 $this->form->addItem($ti);
1745 $this->form->addItem($ti);
1750 $this->form->addItem($ti);
1752 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1754 $this->form->setTitle($lng->txt(
"inst_identification"));
1755 $this->form->setFormAction(
"setup.php?cmd=gateway");
1765 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1766 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1767 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1768 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1769 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1770 $values[
"client_id"] = $this->setup->getClient()->getId();
1772 $this->form->setValuesByArray($values);
1783 if ($this->form->checkInput())
1785 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"])))
1786 || is_int(strpos(
$_POST[
"client_id"],
"_")))
1788 $i = $this->form->getItemByPostVar(
"client_id");
1789 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1792 else if (strlen(
$_POST[
"client_id"]) < 4)
1794 $i = $this->form->getItemByPostVar(
"client_id");
1795 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1798 else if (strlen(
$_POST[
"client_id"]) > 32)
1800 $i = $this->form->getItemByPostVar(
"client_id");
1801 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1806 $i = $this->form->getItemByPostVar(
"client_id");
1807 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1814 $old_db_name = $this->setup->getClient()->getDbName();
1815 $old_db_type = $this->setup->getClient()->getDbType();
1816 $old_client_id = $this->setup->getClient()->getId();
1819 if (!$this->setup->ini_client_exists)
1826 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1827 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1828 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1829 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1830 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1831 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1832 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1833 $this->setup->getClient()->setDSN();
1836 if (!$this->setup->getClient()->checkDatabaseHost())
1838 $i = $this->form->getItemByPostVar(
"db_host");
1839 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1845 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1847 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1849 $_POST[
"db_name"] = $old_db_name;
1850 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1851 $i = $this->form->getItemByPostVar(
"db_name");
1852 $i->setAlert($message);
1858 if (!$this->setup->ini_client_exists)
1860 if ($this->setup->saveNewClient())
1863 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1869 $err = $this->setup->getError();
1871 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1872 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1877 if ($this->setup->getClient()->ini->write())
1880 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1885 $err = $this->setup->getClient()->ini->getError();
1887 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1888 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1896 $this->form->setValuesByPost();
1907 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1909 $this->tpl->setCurrentBlock(
"content");
1910 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1911 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1912 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1913 $this->tpl->parseCurrentBlock();
1924 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1928 $this->logged_out =
true;
1929 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1930 $this->tpl->setCurrentBlock(
"home_link");
1931 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1932 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1933 $this->tpl->parseCurrentBlock();
1941 include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1943 $checklist->setHeading($this->lng->txt(
"setup_process_status"));
1946 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1949 $steps = $this->setup->getStatus();
1954 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1955 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1957 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1958 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1959 $steps[
"proxy"][
"text"] = $this->lng->txt(
"setup_process_step_proxy");
1960 $steps[
"passwd"][
"text"] = $this->lng->txt(
"setup_process_step_passwd");
1961 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1962 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1964 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1968 foreach (
$steps as $key => $val)
1970 $stpl->setCurrentBlock(
"menu_row");
1971 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1972 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1973 $stpl->setVariable(
"IMG_ARROW",
"spacer.png");
1975 if ($this->cmd == $key and isset($this->cmd))
1977 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1980 $status = ($val[
"status"]) ? $OK :
"";
1982 $stpl->setVariable(
"TXT_STATUS",$status);
1983 $stpl->parseCurrentBlock();
1985 $checklist->addEntry($num.
". ".$val[
"text"],
"",
1988 ($this->cmd == $key and isset($this->cmd)),
1994 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1996 $this->tpl->setVariable(
"PROCESS_MENU", $checklist->getHTML());
2004 include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
2006 $checklist->setHeading($this->lng->txt(
"overall_status"));
2008 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
2012 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
2014 if ($this->setup->getClient()->status)
2016 foreach ($this->setup->getClient()->status as $key => $val)
2018 $status = ($val[
"status"]) ? $OK :
" ";
2027 $checklist->addEntry($this->lng->txt(
"step_".$key),
"",
2032 $this->tpl->setVariable(
"STATUS_PANEL", $checklist->getHTML());
2042 switch ($this->display_mode)
2045 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
2047 include
"./setup/include/inc.client_tabs.php";
2048 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
2049 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
2053 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
2054 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
2058 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
2072 $sub_tab_html = $this->tabs->getSubTabHTML();
2073 if ($sub_tab_html !=
"")
2075 $this->tpl->setVariable(
"SUBTABS", $sub_tab_html);
2086 switch ($this->display_mode)
2103 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
2105 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
2106 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
2110 $this->setButtonNext(
"ini");
2129 if ($this->setup->getClient()->db_installed)
2131 $this->setDbSubTabs(
"db");
2133 $ilDB = $this->setup->getClient()->db;
2134 $this->lng->setDbHandler($ilDB);
2135 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2137 $db_status = $dbupdate->getDBVersionStatus();
2138 $hotfix_available = $dbupdate->hotfixAvailable();
2139 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2140 $this->
initClientDbForm(
false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2142 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2146 $this->setButtonNext(
"lang");
2151 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
2152 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
2153 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
2157 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2158 $this->setButtonPrev(
"ini");
2167 public function displayCache() {
2168 require_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
2169 require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
2175 $ini = $this->setup->getClient()->ini;
2178 $cache_form->setTitle($this->lng->txt(
'global_cache_configuration'));
2179 $cache_form->addCommandButton(
'saveCache', $this->lng->txt(
'save'));
2180 $cache_form->setFormAction(
'setup.php?cmd=gateway');
2182 $activate_global_cache =
'activate_global_cache';
2183 $global_cache_service_type =
'global_cache_service_type';
2185 $activate_cache =
new ilCheckboxInputGUI($this->lng->txt($activate_global_cache), $activate_global_cache);
2186 $activate_cache->
setChecked(
$ini->readVariable(
'cache', $activate_global_cache));
2188 $service_type =
new ilRadioGroupInputGUI($this->lng->txt($global_cache_service_type), $global_cache_service_type);
2189 $some_inactive =
false;
2192 $option =
new ilRadioOption($this->lng->txt($global_cache_service_type .
'_' . $type->getServiceType()), $type->getServiceType());
2193 $option->
setInfo($this->lng->txt(
'global_cache_install_info_' . $type->getServiceType()));
2194 if (! $type->isCacheServiceInstallable()) {
2195 $option->setDisabled(
true);
2196 $message .= $this->lng->txt($global_cache_service_type .
'_' . $type->getServiceType()) .
': '
2197 . $type->getInstallationFailureReason() .
'; ';
2198 $some_inactive =
true;
2203 if ($some_inactive) {
2204 $service_type->setAlert($message);
2207 $service_type->setValue(
$ini->readVariable(
'cache', $global_cache_service_type));
2208 $activate_cache->addSubItem($service_type);
2210 $cache_form->addItem($activate_cache);
2212 $this->tpl->setVariable(
'SETUP_CONTENT', $cache_form->getHTML());
2216 public function saveCache(){
2220 require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
2221 ilGlobalCache::flushAll();
2222 $ini = $this->setup->getClient()->ini;
2224 if(!
$ini->readGroup(
'cache')) {
2225 $ini->addGroup(
'cache');
2228 $activate_global_cache =
'activate_global_cache';
2229 $global_cache_service_type =
'global_cache_service_type';
2231 $ini->setVariable(
'cache', $activate_global_cache,
$_POST[$activate_global_cache]);
2232 $ini->setVariable(
'cache', $global_cache_service_type,
$_POST[$global_cache_service_type]);
2253 if (!$this->setup->getClient()->db_installed)
2258 $this->setDbSubTabs(
"repl");
2262 $ilDB = $this->setup->getClient()->db;
2263 $this->lng->setDbHandler($ilDB);
2273 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2287 $client = $this->setup->getClient();
2289 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2294 $ne->
setValue($lng->txt(
"db_".$ilDB->getDbType()));
2295 $this->form->addItem($ne);
2300 $this->form->addItem($act);
2305 $ti->setMaxLength(120);
2306 $ti->setRequired(
true);
2307 $act->addSubItem($ti);
2312 $ti->setRequired(
true);
2313 $ti->setMaxLength(40);
2314 $act->addSubItem($ti);
2319 $ti->setMaxLength(40);
2320 $ti->setRequired(
true);
2321 $act->addSubItem($ti);
2326 $ti->setMaxLength(8);
2327 $act->addSubItem($ti);
2330 $set_pw =
new ilCheckboxInputGUI($this->lng->txt(
"db_set_password"),
"set_slave_password");
2336 $set_pw->addSubItem($ti);
2338 $this->form->addCommandButton(
"saveDbSlave", $lng->txt(
"save"));
2340 $this->form->setTitle($lng->txt(
"db_slave_settings"));
2341 $this->form->setFormAction(
"setup.php?cmd=gateway");
2351 $client = $this->setup->getClient();
2353 $ilDB = $this->setup->getClient()->db;
2354 $this->lng->setDbHandler($ilDB);
2357 if ($this->form->checkInput())
2359 $client->setDbSlaveActive($this->form->getInput(
"slave_active"));
2360 if ($this->form->getInput(
"slave_active"))
2362 $client->setDbSlaveHost($this->form->getInput(
"slave_host"));
2363 $client->setDbSlaveUser($this->form->getInput(
"slave_user"));
2364 $client->setDbSlavePort($this->form->getInput(
"slave_port"));
2365 $client->setDbSlaveName($this->form->getInput(
"slave_name"));
2366 if ($this->form->getInput(
"set_slave_password"))
2368 $client->setDbSlavePass($this->form->getInput(
"slave_pass"));
2378 $this->form->setValuesByPost();
2394 if ($ilDB->getDbType() ==
"mysql")
2396 $this->tabs->addSubTab(
"db", $this->lng->txt(
"db_master"),
"setup.php?client_id=".$this->client_id.
"&cmd=db");
2397 $this->tabs->addSubTab(
"repl", $this->lng->txt(
"db_slave"),
"setup.php?client_id=".$this->client_id.
"&cmd=dbslave");
2400 $this->tabs->activateSubTab($a_subtab_id);
2408 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false, $custom_updates_available =
false)
2412 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2417 $this->form->addItem($ne);
2420 if ($this->setup->getClient()->getDBType() ==
"mysql" ||
2421 $this->setup->getClient()->getDBType() ==
"innodb")
2424 $ilDB = $this->setup->getClient()->db;
2425 $ne->setValue($ilDB->getDBVersion());
2426 $this->form->addItem($ne);
2431 $this->form->addItem($ne);
2435 $this->form->addItem($ne);
2439 $this->form->addItem($ne);
2443 $this->form->addItem($ne);
2446 if (($this->setup->getClient()->getDBType() ==
"mysql" ||
2447 $this->setup->getClient()->getDBType() ==
"innodb") && $a_install)
2460 "utf8_icelandic_ci",
2462 "utf8_lithuanian_ci",
2468 "utf8_slovenian_ci",
2474 foreach($collations as $collation)
2480 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2481 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2482 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2483 $cb->addSubItem(
$si);
2485 $this->form->addItem($cb);
2490 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2494 $ilDB = $this->setup->getClient()->db;
2495 $this->lng->setDbHandler(
$ilDB);
2500 $ne->
setValue($dbupdate->currentVersion);
2501 $this->form->addItem($ne);
2505 $ne->
setValue($dbupdate->fileVersion);
2506 $this->form->addItem($ne);
2508 if (!$db_status = $dbupdate->getDBVersionStatus())
2512 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2520 $si->setInfo($lng->txt(
"next_update_break_info"));
2521 $this->form->addItem(
$si);
2524 if ($dbupdate->getRunningStatus() > 0)
2527 $this->lng->txt(
"db_update_interrupted_avoid"));
2533 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2534 $this->form->addCommandButton(
"showUpdateSteps", $lng->txt(
"show_update_steps"));
2536 else if ($hotfix_available)
2540 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2541 $this->form->addItem($ne);
2545 $ne->
setValue($dbupdate->getHotfixFileVersion());
2546 $this->form->addItem($ne);
2548 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2549 $this->form->addCommandButton(
"showHotfixSteps", $lng->txt(
"show_update_steps"));
2552 elseif($custom_updates_available)
2556 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2557 $this->form->addItem($ne);
2561 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2562 $this->form->addItem($ne);
2564 $this->form->addCommandButton(
"applyCustomUpdates", $lng->txt(
"apply_custom_updates"));
2569 if ($dbupdate->getHotfixFileVersion() > 0)
2573 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2574 $this->form->addItem($ne);
2578 $ne->
setValue($dbupdate->getHotfixFileVersion());
2579 $this->form->addItem($ne);
2581 if ($dbupdate->getCustomUpdatesFileVersion() > 0)
2585 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2586 $this->form->addItem($ne);
2590 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2591 $this->form->addItem($ne);
2597 $this->form->setTitle($lng->txt(
"database"));
2598 $this->form->setFormAction(
"setup.php?cmd=gateway");
2611 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2612 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2613 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2614 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2615 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2616 if (is_object($dbupdate))
2618 $values[
"update_break"] = $dbupdate->fileVersion;
2619 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2621 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2622 ($dbupdate->currentVersion % 100);
2626 $this->form->setValuesByArray($values);
2641 if (!$this->setup->getClient()->db_exists)
2643 if (
$_POST[
"chk_db_create"])
2645 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2657 if (!$this->setup->installDatabase())
2679 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2681 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2682 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2683 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2684 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2685 include_once
"./Services/Tree/classes/class.ilTree.php";
2686 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2687 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2690 $tz = $this->setup->ini->readVariable(
"server",
"timezone");
2693 if (function_exists(
'date_default_timezone_set'))
2695 date_default_timezone_set($tz);
2697 define (
"IL_TIMEZONE", $tz);
2701 $ilDB = $this->setup->getClient()->db;
2702 $this->lng->setDbHandler(
$ilDB);
2706 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2708 if ($dbupdate->updateMsg ==
"no_changes")
2710 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2715 foreach ($dbupdate->updateMsg as
$row)
2717 if ($row[
"msg"] ==
"update_applied")
2719 $a_message.= $sep.$row[
"nr"];
2724 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2727 if ($a_message !=
"")
2729 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2765 if ($this->setup->getClient()->db_installed)
2767 $ilDB = $this->setup->getClient()->db;
2768 $this->lng->setDbHandler(
$ilDB);
2770 $db_status = $dbupdate->getDBVersionStatus();
2771 $hotfix_available = $dbupdate->hotfixAvailable();
2772 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2776 $ntpl =
new ilTemplate(
"tpl.setup_steps.html",
true,
true,
"setup");
2779 $ntpl->setVariable(
"CONTENT", $dbupdate->getHotfixSteps());
2783 $ntpl->setVariable(
"CONTENT", $dbupdate->getUpdateSteps(
$_POST[
"update_break"]));
2785 $ntpl->setVariable(
"BACK", $this->lng->txt(
"back"));
2786 $ntpl->setVariable(
"HREF_BACK",
"./setup.php?client_id=&cmd=db");
2787 $this->tpl->setVariable(
"SETUP_CONTENT", $ntpl->get());
2803 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2805 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2806 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2807 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2808 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2809 include_once
"./Services/Tree/classes/class.ilTree.php";
2810 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2811 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2814 $ilDB = $this->setup->getClient()->db;
2815 $this->lng->setDbHandler(
$ilDB);
2819 $dbupdate->applyHotfix();
2821 if ($dbupdate->updateMsg ==
"no_changes")
2823 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2828 foreach ($dbupdate->updateMsg as
$row)
2830 if ($row[
"msg"] ==
"update_applied")
2832 $a_message.= $sep.$row[
"nr"];
2837 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2840 if ($a_message !=
"")
2842 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2859 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2863 if (!$this->setup->getClient()->db_installed)
2866 $message =
"No database found! Please install database first.";
2873 $settings = array();
2875 foreach( $setting_fields as $field )
2877 if( $field ==
'session_allow_client_maintenance' )
2880 else $_POST[$field] =
'0';
2885 $settings[$field] =
$_POST[$field];
2895 if(
$valid) $this->setup->setSessionSettings($settings);
2897 $settings = $this->setup->getSessionSettings();
2899 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2902 include_once
'Services/Authentication/classes/class.ilSession.php';
2913 $ssettings->addOption($fixed);
2920 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2921 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2922 $ti->setMaxLength(5);
2924 $ti->
setValue($settings[
'session_max_count']);
2925 $ldsh->addSubItem($ti);
2930 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2931 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2932 $ti->setMaxLength(5);
2934 $ti->
setValue($settings[
'session_min_idle']);
2935 $ldsh->addSubItem($ti);
2940 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2941 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2942 $ti->setMaxLength(5);
2944 $ti->
setValue($settings[
'session_max_idle']);
2945 $ldsh->addSubItem($ti);
2949 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2950 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2951 $ti->setMaxLength(5);
2953 $ti->
setValue($settings[
'session_max_idle_after_first_request']);
2954 $ldsh->addSubItem($ti);
2957 $ssettings->addOption($ldsh);
2959 $form->addItem($ssettings);
2963 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2964 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2965 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2966 $form->addItem($chkb);
2970 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2972 $form->setTitle($this->lng->txt(
"sess_sessions"));
2973 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2975 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2976 $this->tpl->setVariable(
"TXT_INFO",
'');
2977 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
3000 if (!$this->setup->getClient()->db_installed)
3003 $message =
"No database found! Please install database first.";
3007 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
3009 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
3011 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
3012 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
3014 $installed_langs = $this->lng->getInstalledLanguages();
3015 $lang_count = count($installed_langs);
3016 if ($lang_count > 0)
3018 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
3019 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
3023 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
3024 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
3027 $this->setButtonPrev(
"lang");
3029 if ($lang_count > 0)
3031 $this->setButtonNext(
"contact");
3045 if (empty(
$_POST[
"form"][
"lang_id"]))
3051 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
3057 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
3064 foreach (
$result as $key => $lang_key)
3066 $list .= $this->lng->txt(
"lang_".$lang_key);
3068 if ($count > $key + 1)
3075 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
3076 $message = $this->lng->txt(
"languages_installed");
3080 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
3096 $settings = $this->setup->getClient()->getAllSettings();
3103 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3104 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
3105 $this->setButtonPrev(
"lang");
3107 $check = $this->setup->checkClientContact($this->setup->client);
3109 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
3110 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
3112 if ($check[
"status"])
3114 $this->setButtonNext(
"proxy");
3129 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3136 $ti->setRequired(
true);
3137 $this->form->addItem($ti);
3143 $this->form->addItem($ti);
3146 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
3149 $this->form->addItem($ti);
3153 $sh->setTitle($lng->txt(
"contact_data"));
3154 $this->form->addItem($sh);
3157 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
3160 $ti->setRequired(
true);
3161 $this->form->addItem($ti);
3164 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
3167 $ti->setRequired(
true);
3168 $this->form->addItem($ti);
3171 "title" => array(
"max" => 64,
"size" => 30),
3172 "position" => array(
"max" => 64,
"size" => 30),
3173 "institution" => array(
"max" => 200,
"size" => 30),
3174 "street" => array(
"max" => 64,
"size" => 30),
3175 "zipcode" => array(
"max" => 10,
"size" => 5),
3176 "city" => array(
"max" => 64,
"size" => 30),
3177 "country" => array(
"max" => 64,
"size" => 30),
3178 "phone" => array(
"max" => 64,
"size" => 30)
3180 foreach ($fs as $f => $op)
3185 $ti->setSize($op[
"size"]);
3186 $ti->setInfo($lng->txt(
""));
3187 $this->form->addItem($ti);
3191 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
3192 $ti->setRequired(
true);
3193 $ti->allowRFC822(
true);
3194 $this->form->addItem($ti);
3197 $ti =
new ilEmailInputGUI($lng->txt(
"feedback_recipient"),
"feedback_recipient");
3198 $ti->setInfo($lng->txt(
"feedback_recipient_info"));
3199 $ti->setRequired(
true);
3200 $ti->allowRFC822(
true);
3201 $this->form->addItem($ti);
3204 $ti =
new ilEmailInputGUI($lng->txt(
"error_recipient"),
"error_recipient");
3205 $ti->allowRFC822(
true);
3206 $this->form->addItem($ti);
3208 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
3210 $this->form->setTitle($lng->txt(
"client_data"));
3211 $this->form->setFormAction(
"setup.php?cmd=gateway");
3220 $settings = $this->setup->getClient()->getAllSettings();
3222 $values = $settings;
3224 $values[
"inst_name"] = ($this->setup->getClient()->getName())
3225 ? $this->setup->getClient()->getName()
3226 : $this->setup->getClient()->getId();
3227 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
3229 $this->form->setValuesByArray($values);
3240 if ($this->form->checkInput())
3242 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
3243 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
3244 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
3245 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
3246 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
3247 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
3248 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
3249 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
3250 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
3251 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
3252 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
3253 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
3254 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
3255 $this->setup->getClient()->setSetting(
"feedback_recipient",
$_POST[
"feedback_recipient"]);
3256 $this->setup->getClient()->setSetting(
"error_recipient",
$_POST[
"error_recipient"]);
3259 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
3260 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
3261 $this->setup->getClient()->ini->write();
3267 $this->form->setValuesByPost();
3281 $settings = $this->setup->getClient()->getAllSettings();
3282 $nic_key = $this->setup->getClient()->getNICkey();
3285 $settings = $this->setup->getClient()->getAllSettings();
3287 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
3289 $this->no_second_nav =
true;
3290 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
3295 $settings = $this->setup->getClient()->getAllSettings();
3297 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
3303 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3305 if (isset($settings[
"nic_enabled"]))
3307 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3312 $this->setButtonPrev(
"proxy");
3314 if ($this->setup->getClient()->status[
"nic"][
"status"])
3316 $this->setButtonNext(
"finish",
"finish");
3331 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3338 $radg->addOption($op1);
3339 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
3340 $radg->addOption($op1);
3341 $this->form->addItem($radg);
3343 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
3344 $this->form->setFormAction(
"setup.php?cmd=gateway");
3352 $settings = $this->setup->getClient()->getAllSettings();
3353 $nic_key = $this->setup->getClient()->getNICkey();
3358 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
3360 $values[
"register"] = 1;
3368 $values[
"register"] = 0;
3371 $this->form->setValuesByArray($values);
3382 if ($this->form->checkInput())
3385 if (
$_POST[
"register"] == 1)
3388 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
3391 if (empty($this->setup->getClient()->nic_status[2]))
3393 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
3399 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
3400 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
3401 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3425 $this->setup->getClient()->setSetting(
"inst_id",
"0");
3426 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
3432 $this->form->setValuesByPost();
3455 $this->tpl->setVariable(
"SETUP_CONTENT",
3456 $ctrl_structure_form->getHTML() .
"<br />" .
3457 $settings_type_form->getHTML().
'<br />'.
3458 $mp_ns_form->getHTML());
3464 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3467 $form->setId(
'tree_impl');
3468 $form->setTitle($this->lng->txt(
'tree_implementation'));
3469 $form->setFormAction(
'setup.php?cmd=gateway');
3473 #$options->setRequired(true);
3476 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3481 $ns =
new ilRadioOption($this->lng->txt(
'tree_implementation_ns'),
'ns');
3484 $mp =
new ilRadioOption($this->lng->txt(
'tree_implementation_mp'),
'mp');
3488 $form->addCommandButton(
'switchTree', $this->lng->txt(
'tree_implementation_switch_btn'));
3489 $form->setShowTopButtons(
false);
3498 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3500 if($type ==
'ns' and
$_POST[
'tree_impl_type'] ==
'mp')
3503 include_once
'./Services/Tree/classes/class.ilMaterializedPathTree.php';
3506 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
3507 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
3508 $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'path'),
'i4');
3510 $set->set(
'main_tree_impl',
'mp');
3513 elseif($type ==
'mp' and
$_POST[
'tree_impl_type'] ==
'ns')
3515 include_once
'./Services/Tree/classes/class.ilTree.php';
3520 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
3521 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
3522 $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'lft'),
'i4');
3524 $set->set(
'main_tree_impl',
'ns');
3538 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3541 $form->setId(
"control_structure");
3542 $form->setTitle($this->lng->txt(
"ctrl_structure"));
3543 $form->setFormAction(
"setup.php?cmd=gateway");
3545 $ilDB = $this->setup->getClient()->db;
3546 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
3547 $crec =
$ilDB->fetchAssoc($cset);
3550 if ($crec[
"cnt"] == 0)
3552 $item->
setInfo($this->lng->txt(
"ctrl_missing_desc"));
3556 $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
3558 $form->addItem($item);
3560 $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
3572 if (!$this->setup->getClient()->db_installed)
3580 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
3583 require_once
"./setup/classes/class.ilModuleReader.php";
3584 require_once
"./setup/classes/class.ilServiceReader.php";
3585 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
3587 require_once
"./Services/Component/classes/class.ilModule.php";
3588 require_once
"./Services/Component/classes/class.ilService.php";
3595 foreach($modules as $module)
3598 $module[
"subdir"],
"Modules");
3606 foreach($services as $service)
3609 $service[
"subdir"],
"Services");
3615 $ilCtrlStructureReader->readStructure(
true);
3627 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3630 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3633 $form->setId(
"settings_type");
3634 $form->setTitle($this->lng->txt(
"settings_type"));
3635 $form->setFormAction(
"setup.php?cmd=gateway");
3638 $item->
setValue(strtoupper($type));
3640 if ($type ==
"clob")
3642 $item->setInfo($this->lng->txt(
'settings_info_clob'));
3643 $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
3644 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
3648 $item->setInfo($this->lng->txt(
'settings_info_text'));
3649 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
3651 $form->addItem($item);
3653 if (is_array($this->longer_settings))
3657 if (count($this->longer_settings))
3659 foreach ($this->longer_settings as
$row)
3661 $subitem =
new ilCustomInputGUI(sprintf($this->lng->txt(
'settings_key_info'), $row[
'module'], $row[
'keyword']));
3662 $subitem->setInfo($row[
'value']);
3663 $item->addSubItem($subitem);
3668 $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
3670 $form->addItem($item);
3682 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3685 if ($old_type ==
"clob")
3688 if (count($longer_settings))
3690 $this->longer_settings = $longer_settings;
3718 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3728 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3730 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3735 $pass_old = $this->setup->getPassword();
3737 if (empty(
$_POST[
"form"][
"pass_old"]))
3739 $message = $this->lng->txt(
"password_enter_old");
3740 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3743 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3745 $message = $this->lng->txt(
"password_old_wrong");
3746 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3749 if (empty(
$_POST[
"form"][
"pass"]))
3751 $message = $this->lng->txt(
"password_empty");
3752 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3757 $message = $this->lng->txt(
"password_not_match");
3758 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3761 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3763 $message = $this->lng->txt(
"password_same");
3764 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3767 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3769 $message = $this->lng->txt(
"save_error");
3770 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3778 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3780 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3783 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3784 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3785 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3786 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3787 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3788 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3789 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3798 $this->no_second_nav =
true;
3802 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3803 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3804 $this->lng->txt(
"password").
": <b>homer</b></p>";
3805 $this->setButtonNext(
"login_new",
"login");
3807 $this->setup->getClient()->reconnect();
3810 $this->setup->getClient()->setSetting(
"setup_ok",1);
3813 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3818 $txt_info = $this->lng->txt(
"info_text_finish2");
3823 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3824 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3826 $this->setButtonPrev(
"nic");
3840 if (
$_POST[
"form"][
"delete"])
3866 $msg = $this->setup->getClient()->delete(
$ini,$db,$files);
3872 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3875 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3878 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3879 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3880 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3881 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3893 if ($this->setup->getClient()->status[
"finish"][
"status"])
3895 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3896 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3897 $this->setup->getClient()->ini->write();
3898 $message =
"client_access_mode_changed";
3902 $message =
"client_setup_not_finished";
3921 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3924 $status = $this->setup->getStatus(
$client);
3926 if ($status[
"finish"][
"status"])
3928 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3929 $this->setup->ini->write();
3930 $message =
"default_client_changed";
3934 $message =
"client_setup_not_finished";
3949 foreach ($this->setup->getClient()->status as $key => $val)
3951 if ($key !=
"finish" and $key !=
"access")
3953 if ($val[
"status"] !=
true)
3961 $clientlist =
new ilClientList($this->setup->db_connections);
3963 $list = $clientlist->getClients();
3965 if (count($list) == 1)
3967 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3968 $this->setup->ini->write();
3970 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3971 $this->setup->getClient()->ini->write();
3982 if (!$this->setup->getClient()->status[
"db"][
"status"])
3988 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3990 $this->cmd =
"lang";
3994 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3996 $this->cmd =
"contact";
4000 elseif(!$this->setup->getClient()->status[
'proxy'][
'status'])
4002 $this->cmd =
"proxy";
4006 elseif(!$this->setup->getClient()->status[
'passwd'][
'status'])
4008 $this->cmd =
"passwd";
4012 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
4018 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
4020 $this->cmd =
"finish";
4035 if ($this->setup->ini->readVariable(
"clients",
"list"))
4037 $this->setup->ini->setVariable(
"clients",
"list",
"0");
4038 $this->setup->ini->write();
4043 $this->setup->ini->setVariable(
"clients",
"list",
"1");
4044 $this->setup->ini->write();
4059 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
4061 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
4062 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
4063 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
4064 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
4065 include_once
"./Services/Tree/classes/class.ilTree.php";
4066 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
4067 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
4070 $ilDB = $this->setup->getClient()->db;
4071 $this->lng->setDbHandler(
$ilDB);
4075 $dbupdate->applyCustomUpdates();
4077 if ($dbupdate->updateMsg ==
"no_changes")
4079 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
4084 foreach ($dbupdate->updateMsg as
$row)
4086 if ($row[
"msg"] ==
"update_applied")
4088 $a_message.= $sep.$row[
"nr"];
4093 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
4096 if ($a_message !=
"")
4098 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
4115 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
4118 $this->form->setId(
"clone_form");
4119 $this->form->setFormAction(
"setup.php?cmd=gateway");
4121 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 )
4123 $this->form->setTitle($this->lng->txt(
"clone_source"));
4125 $clientlist =
new ilClientList($this->setup->db_connections);
4126 $list = $clientlist->getClients();
4127 $clientlistarray = array();
4129 foreach ($list as $key =>
$client){
4130 if ((strcmp($key, $this->setup->getClient()->getId()) !=
'0') && (
$client->getDbType() ==
'mysql')) {
4137 $si->setOptions(array_merge(
4138 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
4140 $si->setRequired(
true);
4141 $this->form->addItem(
$si);
4145 $this->form->addItem($cb);
4147 $this->form->addCommandButton(
"cloneSaveSource", $lng->txt(
"cloneit"));
4149 $disabledmessage =
"<h1>" . $this->lng->txt(
"clone_disabledmessage") .
"</h1><br>";
4150 if (!$this->setup->getClient()->status[
"access"][
"status"] ===
false) {
4151 $disabledmessage .= $this->lng->txt(
"clone_clientnotdisabled") .
"<br>";
4153 if (!stripos($this->setup->getClient()->getName(),
"aster") ===
false) {
4154 $disabledmessage .= $this->lng->txt(
"clone_clientismaster") .
"<br>";
4156 if ($this->setup->getClient()->getdbType() !=
"mysql") {
4157 $disabledmessage .= $this->lng->txt(
"clone_clientisnotmysql") .
"<br>";
4159 if (!$this->setup->getClient()->db_exists) {
4160 $disabledmessage .= $this->lng->txt(
"clone_clientnodatabase") .
"<br>";
4162 $this->form->setTitle($disabledmessage);
4168 if (!$this->setup->isAdmin())
4174 $this->form->setValuesByPost();
4175 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4176 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4183 if (!$this->setup->isAdmin())
4190 if ($this->form->checkInput())
4192 if ($this->form->getInput(
"iamsure") !=
"1")
4194 $message = $this->lng->txt(
"clone_youmustcheckiamsure");
4195 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
4197 if (!$this->setup->cloneFromSource($this->form->getInput(
"source")))
4199 $message = $this->lng->txt(
"clone_error");
4200 $this->setup->raiseError($message .
" -> " . $this->setup->error,$this->setup->error_obj->MESSAGE);
4206 $this->form->setValuesByPost();
4207 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4208 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4214 $settings = $this->setup->getClient()->getAllSettings();
4218 include_once(
"./Services/Administration/classes/class.ilSetting.php");
4220 $this->form->setValuesByArray(array(
4221 'proxy_status' => (
bool)$settings[
'proxy_status'],
4222 'proxy_host' => $settings[
'proxy_host'],
4223 'proxy_port' => $settings[
'proxy_port']
4225 if((
bool)$settings[
'proxy_status'])
4227 $this->setup->printProxyStatus($this->setup->client);
4230 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4231 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_proxy"));
4234 $check = $this->setup->checkClientProxySettings($this->setup->client);
4236 $this->setup->getClient()->status[
"proxy"][
"status"] = $check[
"status"];
4237 $this->setup->getClient()->status[
"proxy"][
"comment"] = $check[
"comment"];
4238 $this->setup->getClient()->status[
"proxy"][
"text"] = $check[
"comment"];
4240 if ($check[
"status"])
4242 $this->setButtonNext(
"passwd");
4245 $this->setButtonPrev(
"contact");
4252 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
4254 $this->form->setFormAction(
"setup.php?cmd=gateway");
4258 $proxs->
setInfo($lng->txt(
'proxy_status_info'));
4259 $proxs->setValue(1);
4260 $this->form->addItem($proxs);
4264 $proxs->addSubItem($proxa);
4267 $prox =
new ilTextInputGUI($lng->txt(
'proxy_host'),
'proxy_host');
4268 $prox->
setInfo($lng->txt(
'proxy_host_info'));
4269 $proxs->addSubItem($prox);
4272 $proxp =
new ilTextInputGUI($lng->txt(
'proxy_port'),
'proxy_port');
4273 $proxp->
setInfo($lng->txt(
'proxy_port_info'));
4274 $proxp->setSize(10);
4275 $proxp->setMaxLength(10);
4276 $proxs->addSubItem($proxp);
4279 $this->form->addCommandButton(
'saveProxy', $lng->txt(
'save'));
4294 $isFormValid = $this->form->checkInput();
4296 $new_settings[
'proxy_status'] = (int)$this->form->getInput(
'proxy_status');
4297 $new_settings[
'proxy_host'] = trim($this->form->getInput(
'proxy_host'));
4298 $new_settings[
'proxy_port'] = trim($this->form->getInput(
'proxy_port'));
4302 if($new_settings[
'proxy_status'] ==
true)
4304 if(!strlen($new_settings[
'proxy_host']))
4306 $isFormValid =
false;
4307 $this->form->getItemByPostVar(
'proxy_host')->setAlert($lng->txt(
'msg_input_is_required'));
4309 if(!strlen($new_settings[
'proxy_port']))
4311 $isFormValid =
false;
4312 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'msg_input_is_required'));
4314 if(!preg_match(
'/[0-9]{1,}/', $new_settings[
'proxy_port']) ||
4315 $new_settings[
'proxy_port'] < 0 ||
4316 $new_settings[
'proxy_port'] > 65535)
4318 $isFormValid =
false;
4319 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'proxy_port_numeric'));
4325 $this->setup->saveProxySettings($new_settings);
4328 $settings = $this->setup->getClient()->getAllSettings();
4329 if($settings[
'proxy_status'] ==
true)
4331 $this->setup->printProxyStatus($this->setup->client);
4340 $this->form->setValuesByPost();
4341 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4353 $settings = $this->setup->getClient()->getAllSettings();
4357 require_once
'Services/Administration/classes/class.ilSetting.php';
4358 $this->buildPasswordForm();
4359 $this->form->setValuesByArray($this->setup->getPasswordSettings());
4360 if((
bool)$settings[
'passwd_status'])
4362 $this->setup->printPasswordStatus($this->setup->client);
4365 $this->tpl->setVariable(
'SETUP_CONTENT', $this->form->getHTML());
4366 $this->tpl->setVariable(
'TXT_INFO', $this->lng->txt(
'info_text_passwd'));
4368 $check = $this->setup->checkClientPasswordSettings($this->setup->client);
4370 $this->setup->getClient()->status[
'passwd'][
'status'] = $check[
'status'];
4371 $this->setup->getClient()->status[
'passwd'][
'comment'] = $check[
'comment'];
4372 if($check[
'status'])
4374 $this->setButtonNext(
'nic');
4377 $this->setButtonPrev(
'proxy');
4384 protected function buildPasswordForm()
4391 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
4393 $this->form->setFormAction(
"setup.php?cmd=gateway");
4395 require_once
'Services/User/classes/class.ilUserPasswordEncoderFactory.php';
4398 $default_encoder =
new ilSelectInputGUI($lng->txt(
'passwd_default_encoder'),
'default_encoder');
4399 $default_encoder->
setInfo($lng->txt(
'passwd_default_encoder_info'));
4400 $default_encoder->setRequired(
true);
4402 foreach($factory->getEncoders() as $encoder)
4404 $options[$encoder->getName()] = $lng->txt(
'passwd_encoder_' . $encoder->getName());
4406 $default_encoder->setOptions(
$options);
4407 $this->form->addItem($default_encoder);
4409 foreach($factory->getEncoders() as $encoder)
4413 $encoder->buildForm($this->form);
4417 $this->form->addCommandButton(
'savePassword', $lng->txt(
'save'));
4423 protected function savePassword()
4430 $this->buildPasswordForm();
4431 if($this->form->checkInput())
4433 require_once
'Services/User/classes/class.ilUserPasswordEncoderFactory.php';
4435 $default_encoder = $factory->getEncoderByName(trim($this->form->getInput(
'default_encoder')));
4436 $default_encoder->onSelection();
4437 if($default_encoder->validateForm($this->form))
4439 $this->setup->savePasswordSettings(array(
4440 'default_encoder' => $default_encoder->getName()
4452 $this->form->setValuesByPost();
4453 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());