7 require_once
"./setup/classes/class.ilSetup.php";
52 include_once(
"./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php");
54 $this->tabs->setSetupMode(
true);
56 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
58 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
61 $tpl->addJavaScript(
"./Services/JavaScript/js/Basic.js", 0);
63 include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
67 $this->revision =
'$Revision$';
68 $this->version =
"2 " . substr(substr($this->revision, 1), 0, -2);
69 $this->lang = $this->lng->lang_key;
72 require_once
'setup/classes/class.ilSetupPasswordManager.php';
73 require_once
'setup/classes/class.ilSetupPasswordEncoderFactory.php';
76 'password_encoder' =>
'bcryptphp',
78 'default_password_encoder' =>
'bcryptphp' 87 if (
$_POST[
"client_id"] !=
"") {
98 $this->setup->ini_client_exists = $this->setup->newClient(
$client_id);
99 if (is_object($this->setup->getClient())) {
100 $this->setup->getClient()->status = $this->setup->getStatus(
$client_id);
104 if (($this->cmd =
$_GET[
"cmd"]) ==
"gateway") {
106 @$this->cmd = key(
$_POST[
"cmd"]);
112 if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status[
"finish"][
"status"] and $this->cmd !=
"clientlist" and $this->cmd !=
"") {
122 if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled()) {
124 if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable(
"clients",
"path"))) {
127 if ($this->cmd ==
"performLogin" || $this->cmd ==
"performMLogin") {
135 if ($this->setup->isAdmin()) {
146 echo
"cmd: " . $this->cmd .
" | access: " . $this->setup->access_mode .
" | display: " .
$this->display_mode;
147 var_dump($this->setup->getClient()->status);
164 switch ($this->cmd) {
166 case "preliminaries":
167 $this->setup->checkPreliminaries();
175 case "determineToolsPathInstall":
179 case "saveBasicSettings":
184 $this->
displayError($this->lng->txt(
"unknown_command") .
": '" . $this->cmd .
"'");
195 switch ($this->cmd) {
201 $this->active_tab =
"clientlist";
204 case "savemasterpassword":
207 $this->active_tab =
"password";
210 case "changemasterpassword":
213 $this->active_tab =
"password";
216 case "mastersettings":
219 $this->active_tab =
"basicsettings";
222 case "determineToolsPath":
227 case "changedefault":
232 $this->cmd =
"selectdb";
234 $this->setup->ini_client_exists = $this->setup->newClient();
248 $this->setup->ini_client_exists = $this->setup->newClient();
262 case "preliminaries":
263 $this->setup->checkPreliminaries();
265 $this->active_tab =
"preliminaries";
268 case "updateBasicSettings":
270 case "performMLogin":
286 switch ($this->cmd) {
289 if ($this->setup->getClient()->db_installed) {
320 if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"sess" and $this->setup->error ===
true) {
328 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"lang" and $this->setup->error ===
true) {
336 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"contact") {
344 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"proxy") {
352 $this->displayCache();
357 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic") {
365 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish") {
386 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1") {
387 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
388 $this->setup->getClient()->ini->write();
399 case "reloadStructure":
407 case "saveClientIni":
408 case "installDatabase":
409 case "displayDatabase":
410 case "updateDatabase":
411 case "showUpdateSteps":
412 case "saveLanguages":
414 case "displayContactData":
416 case "saveRegistration":
418 case "showHotfixSteps":
419 case "applyCustomUpdates":
420 case "changeSettingsType":
421 case "showLongerSettings":
422 case "cloneSelectSource":
423 case "cloneSaveSource":
425 case "displayPassword":
429 case "addMemcacheServer":
430 case "deleteMemcacheServer":
431 case "editMemcacheServer":
432 case "createMemcacheServer":
433 case "updateMemcacheServer":
435 case "background_tasks":
436 case "edit_background_tasks":
437 case "save_background_tasks":
438 case "kill_waiting_tasks":
444 $this->
displayError($this->lng->txt(
"unknown_command") .
": '" . $this->cmd .
"'");
466 if ($a_mode !=
"view" and $a_mode !=
"setup") {
470 $this->display_mode = $a_mode;
481 $languages = $this->lng->getLanguages();
483 $count = (int) round(count($languages) / 2);
487 foreach ($languages as $lang_key) {
494 $this->tpl->setCurrentBlock(
"languages");
495 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=" . $this->cmd .
"&lang=" . $lang_key);
496 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_" . $lang_key));
497 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
498 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
499 $this->tpl->setVariable(
"BORDER", 0);
500 $this->tpl->setVariable(
"VSPACE", 0);
501 $this->tpl->parseCurrentBlock();
506 if ($this->cmd !=
"logout" and $this->setup->isInstalled() and $this->setup->isAuthenticated()) {
508 if ($this->setup->isAdmin()) {
509 if ($this->display_mode ==
"view" ||
510 $this->cmd ==
"clientlist" ||
511 $this->cmd ==
"changemasterpassword" ||
512 $this->cmd ==
'savemasterpassword' ||
513 $this->cmd ==
"mastersettings") {
514 $this->tpl->setCurrentBlock(
"add_client");
515 $this->tpl->setVariable(
"TXT_ADD_CLIENT", ucfirst($this->lng->txt(
"new_client")));
516 $this->tpl->parseCurrentBlock();
520 $class = ($this->active_tab ==
"clientlist")
523 $this->tpl->setCurrentBlock(
"display_list");
524 $this->tpl->setVariable(
"TXT_LIST", ucfirst($this->lng->txt(
"list_clients")));
525 $this->tpl->setVariable(
"TAB_CLASS", $class);
526 $this->tpl->parseCurrentBlock();
529 $class = ($this->active_tab ==
"background_tasks")
532 $this->tpl->setCurrentBlock(
"display_list");
533 $this->tpl->setVariable(
"TXT_BACKGROUND_TASKS", ucfirst($this->lng->txt(
"background_tasks")));
534 $this->tpl->setVariable(
"BACKGROUND_TASKS_CLASS", $class);
535 $this->tpl->parseCurrentBlock();
538 $class = ($this->active_tab ==
"basicsettings")
541 $this->tpl->setCurrentBlock(
"edit_pathes");
542 $this->tpl->setVariable(
"TXT_EDIT_PATHES", $this->lng->txt(
"basic_settings"));
543 $this->tpl->setVariable(
"TAB_CLASS", $class);
544 $this->tpl->parseCurrentBlock();
547 $class = ($this->active_tab ==
"preliminaries")
550 $this->tpl->setCurrentBlock(
"preliminaries");
551 $this->tpl->setVariable(
"TXT_PRELIMINARIES", $this->lng->txt(
"preliminaries"));
552 $this->tpl->setVariable(
"TAB_CLASS", $class);
553 $this->tpl->parseCurrentBlock();
556 $class = ($this->active_tab ==
"password")
559 $this->tpl->setCurrentBlock(
"change_password");
560 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", ucfirst($this->lng->txt(
"password")));
561 $this->tpl->setVariable(
"TAB_CLASS", $class);
562 $this->tpl->parseCurrentBlock();
566 if ($this->setup->isAuthenticated()) {
567 $this->tpl->setCurrentBlock(
"logout");
568 $this->tpl->setVariable(
"TXT_LOGOUT", $this->lng->txt(
"logout"));
569 $this->tpl->parseCurrentBlock();
573 $this->tpl->setVariable(
"VAL_CMD", htmlspecialchars(
$_GET[
"cmd"]));
574 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE", $this->lng->txt(
"choose_language"));
575 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
577 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
578 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
579 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS " .
ILIAS_VERSION);
580 $this->tpl->setVariable(
"TXT_SETUP", $this->lng->txt(
"setup"));
581 $this->tpl->setVariable(
"VERSION", $this->version);
582 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
583 $this->tpl->setVariable(
"LANG", $this->lang);
592 if ($this->cmd !=
"logout") {
593 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"") {
594 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(" . $this->lng->txt(
"client_id") .
": " . $this->setup->getClient()->getId() .
")");
595 } elseif ($this->setup->isAdmin()) {
596 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(" . $this->lng->txt(
"root_access") .
")");
612 if (!$this->btn_prev_on and !$this->btn_next_on) {
616 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
619 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
621 if ($this->btn_prev_on) {
622 $ntpl->setCurrentBlock(
"btn_back");
623 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
624 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
625 $ntpl->parseCurrentBlock();
628 if ($this->btn_next_on) {
629 $ntpl->setCurrentBlock(
"btn_forward");
630 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
631 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
632 $ntpl->parseCurrentBlock();
635 $nav_html = $ntpl->get();
636 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
637 if (!$this->no_second_nav) {
638 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
651 $this->btn_prev_on =
true;
652 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
653 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
664 $this->btn_next_on =
true;
665 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
666 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
681 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
682 $btpl->setCurrentBlock(
"btn");
683 $btpl->setVariable(
"CMD",
"changeaccess");
684 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
685 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
686 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
687 $btpl->parseCurrentBlock();
688 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
691 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
703 $settings = $this->setup->getClient()->getAllSettings();
705 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
708 $this->form->setTitle($lng->txt(
"client_info"));
712 $ne->
setValue(($this->setup->getClient()->getName())
713 ? $this->setup->getClient()->getName()
714 :
"<" . $this->lng->txt(
"no_client_name") .
">");
715 $ne->setInfo($this->setup->getClient()->getDescription());
716 $this->form->addItem($ne);
720 $ne->
setValue($this->setup->getClient()->getId());
721 $this->form->addItem($ne);
725 $ne->
setValue(($this->setup->getClient()->db_installed)
726 ? $settings[
"inst_id"]
728 $this->form->addItem($ne);
732 $ne->
setValue(($this->setup->getClient()->db_installed)
733 ? $settings[
"db_version"]
735 $this->form->addItem($ne);
740 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
741 $ne->
setValue($this->lng->txt($access_status) . $access_link);
742 $this->form->addItem($ne);
746 $sh->setTitle($this->lng->txt(
"server_info"));
747 $this->form->addItem($sh);
752 $this->form->addItem($ne);
757 $this->form->addItem($ne);
763 $this->form->addItem($ne);
767 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
768 $this->form->addItem($ne);
773 $this->form->addItem($ne);
778 $this->form->addItem($ne);
782 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
783 $this->form->addItem($sh);
785 $tools = array(
"convert",
"zip",
"unzip",
"ghostscript",
"java",
"ffmpeg",
"phantomjs");
787 foreach ($tools as $tool) {
790 $p = $this->setup->ini->readVariable(
"tools", $tool);
791 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
792 $this->form->addItem($ne);
797 $p = $this->setup->ini->readVariable(
"tools",
"latex");
798 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
799 $this->form->addItem($ne);
803 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
804 $this->form->addItem($ne);
808 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
809 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
810 $this->form->addItem($ne);
814 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
815 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
816 $this->form->addItem($ne);
821 $sh->setTitle($this->lng->txt(
"system_styles"));
822 $this->form->addItem($sh);
825 $ne =
new ilNonEditableValueGUI($lng->txt(
"enable_system_styles_management"),
"enable_system_styles_management");
826 $p = $this->setup->ini->readVariable(
"tools",
"enable_system_styles_management");
827 $ne->
setValue($p ? $this->lng->txt(
"enabled") : $this->lng->txt(
"not_enabled"));
828 $this->form->addItem($ne);
832 $p = $this->setup->ini->readVariable(
"tools",
"lessc");
833 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
834 $this->form->addItem($ne);
837 $this->form->setFormAction(
"setup.php?cmd=gateway");
849 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
850 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
852 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
854 $this->tpl->setVariable(
"TXT_SETUP_TITLE", $this->lng->txt(
"ilias_setup"));
855 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
856 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
857 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
858 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
859 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
860 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
862 $server_os = php_uname();
863 $server_web =
$_SERVER[
"SERVER_SOFTWARE"];
864 $environment = $this->lng->txt(
"env_using") .
" " . $server_os .
" <br/>" . $this->lng->txt(
"with") .
" " . $server_web;
866 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache")) {
867 $env_comment = $this->lng->txt(
"env_ok");
869 $env_comment =
"<font color=\"red\">" . $this->lng->txt(
"env_warning") .
"</font>";
872 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
873 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
874 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
876 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
877 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
879 $preliminaries = array(
"php",
"root",
"folder_create",
880 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
882 foreach ($preliminaries as $preliminary) {
883 $this->tpl->setCurrentBlock(
"preliminary");
884 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_" . $preliminary));
885 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true) {
886 $this->tpl->setVariable(
"STATUS_PRE", $OK);
888 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
890 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
891 $this->tpl->parseCurrentBlock();
895 if ($this->setup->preliminaries ===
true) {
896 if ($this->setup->isInstalled()) {
897 $cmd =
"mastersettings";
901 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
903 $this->setButtonNext(
$cmd, $btn_text);
905 $this->tpl->setCurrentBlock(
"premessage");
906 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf(
907 $this->lng->txt(
"pre_error"),
908 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu" 910 $this->tpl->parseCurrentBlock();
923 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
924 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
925 $this->tpl->setVariable(
927 $this->lng->txt(
"info_text_first_install") .
"<br/>" . $this->lng->txt(
"info_text_pathes")
930 $this->setButtonPrev(
"preliminaries");
932 if ($this->setup->isInstalled()) {
933 $this->setButtonNext(
"list");
939 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>" . $this->form->getHTML() .
"<br>");
947 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
948 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
949 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
951 $this->btn_next_on =
true;
952 $this->btn_next_lng = $this->lng->txt(
"create_new_client") .
"...";
953 $this->btn_next_cmd =
"newclient";
959 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>" . $this->form->getHTML() .
"<br>");
969 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
975 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
978 ? str_replace(
"\\",
"/", getcwd())
981 $ne->setValue($cwd .
"/data");
982 $this->form->addItem($ne);
986 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
987 $ti->setInfo($lng->txt(
"data_directory_info"));
988 $ti->setRequired(
true);
989 $this->form->addItem($ti);
992 $this->form->addItem($ne);
1002 $sh->setTitle($lng->txt(
"logging"));
1003 $this->form->addItem($sh);
1007 $ti->setInfo($lng->txt(
"log_path_comment" . $lvext));
1008 $this->form->addItem($ti);
1012 $this->form->addItem($cb);
1015 $ti =
new ilTextInputGUI($lng->txt(
"error_log_path"),
"error_log_path");
1016 $ti->setInfo($lng->txt(
"error_log_path_comment" . $lvext));
1017 $this->form->addItem($ti);
1021 $sh->setTitle($lng->txt(
"server_settings"));
1022 $this->form->addItem($sh);
1025 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
1027 $si->setOptions(array_merge(
1028 array(
"" =>
"-- " . $lng->txt(
"please_select") .
" --"),
1031 $si->setRequired(
true);
1032 $this->form->addItem(
$si);
1036 $sh->setTitle($lng->txt(
"https_settings"));
1037 $this->form->addItem($sh);
1039 $check =
new ilCheckboxInputGUI($lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
1041 $check->setValue(1);
1043 $text =
new ilTextInputGUI($lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
1045 $text->setMaxLength(64);
1046 $text->setRequired(
true);
1047 $check->addSubItem($text);
1049 $text =
new ilTextInputGUI($lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
1051 $text->setMaxLength(64);
1052 $text->setRequired(
true);
1053 $check->addSubItem($text);
1055 $this->form->addItem($check);
1059 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
1060 $this->form->addItem($sh);
1063 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1064 $ti->setInfo($lng->txt(
"convert_path_comment" . $lvext));
1065 $ti->setRequired(
true);
1066 $this->form->addItem($ti);
1070 $ti->setInfo($lng->txt(
"zip_path_comment" . $lvext));
1071 $ti->setRequired(
true);
1072 $this->form->addItem($ti);
1076 $ti->setInfo($lng->txt(
"unzip_path_comment" . $lvext));
1077 $ti->setRequired(
true);
1078 $this->form->addItem($ti);
1082 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1083 $this->form->addItem($sh);
1086 $ti =
new ilTextInputGUI($lng->txt(
"ghostscript_path"),
"ghostscript_path");
1087 $ti->setInfo($lng->txt(
"ghostscript_path_comment" . $lvext));
1088 $this->form->addItem($ti);
1091 $ti =
new ilTextInputGUI($lng->txt(
"ffmpeg_path"),
"ffmpeg_path");
1092 $ti->setInfo($lng->txt(
"ffmpeg_path_comment"));
1093 $this->form->addItem($ti);
1096 $pj =
new ilTextInputGUI($lng->txt(
"phantomjs_path"),
"phantomjs_path");
1097 $pj->setInfo($lng->txt(
"phantomjs_path_comment"));
1098 $this->form->addItem($pj);
1101 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1102 $ti->setInfo($lng->txt(
"latex_url_comment"));
1103 $this->form->addItem($ti);
1107 "none" => $lng->txt(
"none"),
1108 "sophos" => $lng->txt(
"sophos"),
1109 "antivir" => $lng->txt(
"antivir"),
1110 "clamav" => $lng->txt(
"clamav")
1113 $si->setOptions($options);
1114 $this->form->addItem($si);
1117 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1118 $this->form->addItem($ti);
1121 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1122 $this->form->addItem($ti);
1126 $sh->setTitle($this->lng->txt(
"system_styles"));
1127 $this->form->addItem($sh);
1130 $check =
new ilCheckboxInputGUI($lng->txt(
'enable_system_styles_management'),
'enable_system_styles_management');
1131 $check->
setInfo($lng->txt(
'enable_system_styles_management_info'));
1132 $check->setValue(1);
1135 $lessc =
new ilTextInputGUI($lng->txt(
"lessc_path"),
"lessc_path");
1136 $lessc->setInfo($lng->txt(
"lessc_path_comment"));
1137 $check->addSubItem($lessc);
1139 $this->form->addItem($check);
1144 $sh->setTitle($lng->txt(
"master_password"));
1145 $this->form->addItem($sh);
1150 $pi->setSkipSyntaxCheck(
true);
1151 $pi->setInfo($lng->txt(
"password_info"));
1152 $this->form->addItem($pi);
1156 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1158 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1159 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1162 $this->form->setTitle($lng->txt(
"data_directories"));
1163 $this->form->setFormAction(
"setup.php?cmd=gateway");
1167 $this->form->setValuesByArray($det);
1178 $values[
"webspace_dir"] = getcwd() .
"/data";
1179 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1180 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1181 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1182 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1183 $values[
"ghostscript_path"] = $this->setup->ini->readVariable(
"tools",
"ghostscript");
1185 $values[
"ffmpeg_path"] = $this->setup->ini->readVariable(
"tools",
"ffmpeg");
1186 $values[
"phantomjs_path"] = $this->setup->ini->readVariable(
"tools",
"phantomjs");
1187 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1188 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1189 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1190 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1191 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1192 $values[
"enable_system_styles_management"] = $this->setup->ini->readVariable(
"tools",
"enable_system_styles_management");
1193 $values[
"lessc_path"] = $this->setup->ini->readVariable(
"tools",
"lessc");
1194 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path") .
"/" .
1195 $this->setup->ini->readVariable(
"log",
"file");
1196 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1197 $values[
"error_log_path"] = $this->setup->ini->readVariable(
"log",
"error_path");
1198 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1201 $values[
"auto_https_detect_enabled"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_enabled");
1202 $values[
"auto_https_detect_header_name"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_header_name");
1203 $values[
"auto_https_detect_header_value"] = $this->setup->ini->readVariable(
"https",
"auto_https_detect_header_value");
1205 $this->form->setValuesByArray($values);
1217 if ($this->form->checkInput()) {
1220 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1221 "unzip_path",
"ghostscript_path",
"ffmpeg_path",
"lessc_path",
"phantomjs_path");
1222 foreach ($fs as
$f) {
1228 if (!$this->setup->checkDataDirSetup(
$_POST)) {
1229 $i = $this->form->getItemByPostVar(
"datadir_path");
1230 $i->setAlert($this->lng->txt($this->setup->getError()));
1232 } elseif (!$this->setup->checkLogSetup(
$_POST)) {
1233 $i = $this->form->getItemByPostVar(
"log_path");
1234 $i->setAlert($this->lng->txt($this->setup->getError()));
1236 } elseif (!$this->setup->checkErrorLogSetup(
$_POST[
"error_log_path"])) {
1237 $i = $this->form->getItemByPostVar(
"error_log_path");
1238 $i->setAlert($this->lng->txt($this->setup->getError()));
1240 } elseif (!$this->setup->checkPasswordSetup(
$_POST)) {
1242 } elseif (!$this->setup->saveMasterSetup(
$_POST)) {
1245 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
1250 $this->form->setValuesByPost();
1263 if ($this->form->checkInput()) {
1265 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1266 "unzip_path",
"ghostscript_path",
"ffmpeg_path",
"lessc_path",
"phantomjs_path");
1267 foreach ($fs as
$f) {
1272 if (!$this->setup->checkLogSetup(
$_POST)) {
1273 $i = $this->form->getItemByPostVar(
"log_path");
1274 $i->setAlert($this->lng->txt($this->setup->getError()));
1276 } elseif (!$this->setup->checkErrorLogSetup(
$_POST[
"error_log_path"])) {
1277 $i = $this->form->getItemByPostVar(
"error_log_path");
1278 $i->setAlert($this->lng->txt($this->setup->getError()));
1280 } elseif (!$this->setup->updateMasterSettings(
$_POST)) {
1283 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
1288 $this->form->setValuesByPost();
1312 $this->tpl->setVariable(
"SETUP_LOGIN_CLASS",
" ilSetupLogin");
1313 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1315 if ($a_omit_minit) {
1316 $m_form = $this->form->getHTML();
1318 if (!$a_omit_cinit) {
1321 $cl_form = $this->form->getHTML();
1322 if (!$a_omit_minit) {
1324 $m_form = $this->form->getHTML();
1326 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form .
"<br>" . $m_form);
1327 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1336 if ($this->form->checkInput()) {
1337 $i = $this->form->getItemByPostVar(
'mpassword');
1338 if (!$this->setup->loginAsAdmin(
$_POST[
'mpassword'])) {
1339 $i->setAlert($this->lng->txt(
'login_invalid'));
1347 $this->form->setValuesByPost();
1357 if ($this->form->checkInput()) {
1358 $i = $this->form->getItemByPostVar(
"password");
1359 if (!$this->setup->loginAsClient(
1360 array(
"client_id" =>
$_POST[
"client_id"],
1361 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])
1363 $i->setAlert($this->setup->getError());
1371 $this->form->setValuesByPost();
1382 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1384 $this->form->setId(
"client_login");
1388 $ti->setMaxLength(32);
1390 $this->form->addItem($ti);
1395 $this->form->addItem($ti);
1400 $pi->setRetype(
false);
1401 $pi->setSkipSyntaxCheck(
true);
1402 $this->form->addItem($pi);
1404 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1406 $this->form->setTitle($lng->txt(
"client_login"));
1407 $this->form->setFormAction(
"setup.php?cmd=gateway");
1417 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1419 $this->form->setId(
"master_login");
1423 $pi->setRetype(
false);
1424 $pi->setSkipSyntaxCheck(
true);
1425 $this->form->addItem($pi);
1427 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1429 $this->form->setTitle($lng->txt(
"admin_login"));
1430 $this->form->setFormAction(
"setup.php?cmd=gateway");
1444 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1445 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1449 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"list_clients"));
1450 $this->tpl->setVariable(
"TXT_LISTSTATUS", ($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1451 $this->tpl->setVariable(
"TXT_TOGGLELIST", ($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1453 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1455 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1458 $this->btn_next_on =
true;
1459 $this->btn_next_lng = $this->lng->txt(
"create_new_client") .
"...";
1460 $this->btn_next_cmd =
"newclient";
1486 ? str_replace(
"\\",
"/", getcwd())
1489 $tools = array(
"convert" =>
"convert",
1490 "zip" =>
"zip",
"unzip" =>
"unzip",
"ghostscript" =>
"gs",
1491 "java" =>
"java",
"ffmpeg" =>
"ffmpeg",
"lessc" =>
"lessc",
"phantomjs" =>
"phantomjs");
1492 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1494 $tools = array(
"convert" =>
"convert.exe",
1495 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1498 foreach ($tools as $k => $tool) {
1501 @exec(
"which " . $tool,
$ret);
1502 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/") {
1503 $a_tools[$k .
"_path"] =
$ret[0];
1508 foreach ($dirs as $dir) {
1509 if (@is_file($dir .
"/" . $tool)) {
1510 $a_tools[$k .
"_path"] = $dir .
"/" . $tool;
1533 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1535 if ($this->setup->getClient()->status[
"ini"][
"status"]) {
1536 $this->setButtonNext(
"db");
1549 require_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1555 $si->setOptions($options);
1556 $si->setInfo($lng->txt(
""));
1557 $this->form->addItem(
$si);
1559 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1561 $this->form->setTitle($lng->txt(
"db_selection"));
1562 $this->form->setFormAction(
"setup.php?cmd=gateway");
1576 if (
$_POST[
"db_type"] !=
"") {
1582 $has_ini = $this->setup->getClient()->status[
"ini"][
"status"];
1585 if (!
$_SESSION[
"db_type"] && $has_ini) {
1586 $_SESSION[
"db_type"] = $this->setup->getClient()->getDbType();
1589 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1590 if (!$a_omit_form_init) {
1594 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1597 $this->setButtonNext(
"db");
1610 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1614 if ($this->setup->ini_client_exists) {
1616 $hi->setValue($this->client_id);
1617 $this->form->addItem($hi);
1621 $this->form->addItem($ne);
1624 $ti->setMaxLength(32);
1625 $ti->setRequired(
true);
1626 $this->form->addItem($ti);
1631 $sh->setTitle($lng->txt(
"db_conn"));
1632 $this->form->addItem($sh);
1637 $ne->setValue($at[
$_SESSION[
"db_type"]]);
1638 $this->form->addItem($ne);
1642 $ti->setMaxLength(120);
1643 $ti->setRequired(
true);
1644 $this->form->addItem($ti);
1648 $ti->setRequired(
true);
1649 $ti->setMaxLength(40);
1650 $this->form->addItem($ti);
1654 $ti->setMaxLength(40);
1655 $ti->setRequired(
true);
1656 $this->form->addItem($ti);
1660 $ti->setMaxLength(8);
1661 $this->form->addItem($ti);
1663 $sqlPassword = new \ilPasswordInputGUI($lng->txt(
'db_pass'),
'db_pass');
1664 $sqlPassword->setDisableHtmlAutoComplete(
true);
1665 $sqlPassword->setValidateAuthPost(
false);
1666 $sqlPassword->setSkipSyntaxCheck(
true);
1667 $sqlPassword->setRequired(
false);
1668 $sqlPassword->setMaxLength(40);
1669 $sqlPassword->setRetype(
false);
1670 $this->form->addItem($sqlPassword);
1672 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1674 $this->form->setTitle($lng->txt(
"inst_identification"));
1675 $this->form->setFormAction(
"setup.php?cmd=gateway");
1685 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1686 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1687 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1689 if (is_string($this->setup->getClient()->getDbPass()) && strlen($this->setup->getClient()->getDbPass())) {
1690 $password = self::UI_PASSWORD_PLACEHOLDER;
1693 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1694 $values[
"client_id"] = $this->setup->getClient()->getId();
1696 $this->form->setValuesByArray($values);
1705 if ($this->form->checkInput()) {
1706 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"])))
1707 || !$this->setup->isValidClientId(
$_POST[
"client_id"])
1709 $i = $this->form->getItemByPostVar(
"client_id");
1710 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1713 if (strlen(
$_POST[
"client_id"]) < 4) {
1714 $i = $this->form->getItemByPostVar(
"client_id");
1715 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1718 if (strlen(
$_POST[
"client_id"]) > 32) {
1719 $i = $this->form->getItemByPostVar(
"client_id");
1720 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1723 if (!$this->setup->ini_client_exists && file_exists(ILIAS_ABSOLUTE_PATH .
"/" . ILIAS_WEB_DIR .
"/" .
$_POST[
"client_id"])) {
1724 $i = $this->form->getItemByPostVar(
"client_id");
1725 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1730 $old_db_name = $this->setup->getClient()->getDbName();
1731 $old_db_type = $this->setup->getClient()->getDbType();
1732 $old_client_id = $this->setup->getClient()->getId();
1735 if (!$this->setup->ini_client_exists) {
1741 $this->setup->getClient()->setId($_POST[
"client_id"]);
1742 $this->setup->getClient()->setDbHost($_POST[
"db_host"]);
1743 $this->setup->getClient()->setDbName($_POST[
"db_name"]);
1744 $this->setup->getClient()->setDbUser($_POST[
"db_user"]);
1745 $this->setup->getClient()->setDbPort($_POST[
"db_port"]);
1746 $dbPassword = (string) ($_POST[
"db_pass"] ??
'');
1747 if (
'' === $dbPassword || $dbPassword !== self::UI_PASSWORD_PLACEHOLDER) {
1748 $this->setup->getClient()->setDbPass($dbPassword);
1750 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1751 $this->setup->getClient()->setDSN();
1754 if (!$this->setup->getClient()->getDBSetup(
false)->isConnectable()) {
1755 $i = $this->form->getItemByPostVar(
"db_host");
1756 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1760 $db_installed = $this->setup->getClient()->getDBSetup(
false)->isDatabaseInstalled();
1762 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name))) {
1763 $_POST[
"db_name"] = $old_db_name;
1764 $message = ucfirst($this->lng->txt(
"database")) .
" \"" . $this->setup->getClient()->getDbName() .
"\" " 1765 . $this->lng->txt(
"ini_db_name_exists");
1766 $i = $this->form->getItemByPostVar(
"db_name");
1771 if (!$this->setup->ini_client_exists) {
1772 if ($this->setup->saveNewClient()) {
1773 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
1774 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1778 $err = $this->setup->getError();
1780 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1781 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1784 if ($this->setup->getClient()->ini->write()) {
1785 ilUtil::sendSuccess($this->lng->txt(
"settings_changed"));
1786 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1789 $err = $this->setup->getClient()->ini->getError();
1791 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1792 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1803 $this->form->setValuesByPost();
1816 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1818 $this->tpl->setCurrentBlock(
"content");
1819 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1820 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1821 $this->tpl->setVariable(
"ERROR_MESSAGE", ($a_message));
1822 $this->tpl->parseCurrentBlock();
1833 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1837 $this->logged_out =
true;
1838 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"logged_out"));
1839 $this->tpl->setCurrentBlock(
"home_link");
1840 $this->tpl->setVariable(
"TXT_INDEX", $this->lng->txt(
"ilias_homepage"));
1842 $this->tpl->parseCurrentBlock();
1850 include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1852 $checklist->setHeading($this->lng->txt(
"setup_process_status"));
1855 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1857 $steps = $this->setup->getStatus();
1860 $first = array(
"selectdb" => array(
1861 "status" => ((
bool)
$_SESSION[
"db_type"] || (
bool)
$steps[
"ini"][
"status"]),
1862 "text" => $this->lng->txt(
"db_selection"),
1866 $steps = $first +
$steps;
1869 unset($steps[
"access"]);
1871 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1872 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1874 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1875 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1876 $steps[
"proxy"][
"text"] = $this->lng->txt(
"setup_process_step_proxy");
1877 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1878 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1880 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1884 foreach ($steps as $key => $val) {
1885 $stpl->setCurrentBlock(
"menu_row");
1886 $stpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step") .
" " . $num .
": ");
1887 $stpl->setVariable(
"TXT_ACTION", $val[
"text"]);
1888 $stpl->setVariable(
"IMG_ARROW",
"spacer.png");
1890 if ($this->cmd == $key and isset($this->cmd)) {
1891 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1894 $status = ($val[
"status"]) ? $OK :
"";
1896 $stpl->setVariable(
"TXT_STATUS", $status);
1897 $stpl->parseCurrentBlock();
1899 $checklist->addEntry(
1900 $num .
". " . $val[
"text"],
1904 ($this->cmd == $key and isset($this->cmd)),
1911 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS", $this->lng->txt(
"setup_process_status"));
1913 $this->tpl->setVariable(
"PROCESS_MENU", $checklist->getHTML());
1921 include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1923 $checklist->setHeading($this->lng->txt(
"overall_status"));
1925 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1929 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1931 if ($this->setup->getClient()->status) {
1932 foreach ($this->setup->getClient()->status as $key => $val) {
1933 $status = ($val[
"status"]) ? $OK :
" ";
1942 $checklist->addEntry(
1943 $this->lng->txt(
"step_" . $key),
1952 $this->tpl->setVariable(
"STATUS_PANEL", $checklist->getHTML());
1962 switch ($this->display_mode) {
1964 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1966 include
"./setup/include/inc.client_tabs.php";
1967 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1968 $this->tpl->setVariable(
"TXT_HEADER", $client_name .
" (" . $this->lng->txt(
"client_id") .
": " . $this->setup->getClient()->getId() .
")");
1972 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1973 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($a_title));
1977 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1991 $sub_tab_html = $this->tabs->getSubTabHTML();
1992 if ($sub_tab_html !=
"") {
1993 $this->tpl->setVariable(
"SUBTABS", $sub_tab_html);
2003 switch ($this->display_mode) {
2019 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
2021 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_first_client"));
2022 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"setup_first_client"));
2026 $this->setButtonNext(
"ini");
2043 if ($this->setup->getClient()->getDBSetup()->isDatabaseInstalled()) {
2044 $this->setDbSubTabs(
"db");
2046 $ilDB = $this->setup->getClient()->getDB();
2047 $this->lng->setDbHandler($ilDB);
2049 $db_status = $dbupdate->getDBVersionStatus();
2050 $hotfix_available = $dbupdate->hotfixAvailable();
2051 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2052 $this->
initClientDbForm(
false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2054 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2057 $this->setButtonNext(
"lang");
2060 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db") .
"<br />" .
2061 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>" .
2062 "<p><b>" . $this->lng->txt(
"info_text_db2") .
"</b></p><br/>");
2066 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2067 $this->setButtonPrev(
"ini");
2079 $tabs =
new ilTemplate(
"tpl.tabs.html",
true,
true,
"Services/UIComponent/Tabs");
2081 $tabs->setCurrentBlock(
"tab");
2082 $tabs->setVariable(
"TAB_TYPE", !$edit?
"active" :
"");
2083 $tabs->setVariable(
"TAB_TEXT", $this->lng->txt(
'overview'));
2084 $tabs->setVariable(
"TAB_LINK",
"setup.php?cmd=background_tasks");
2085 $tabs->parseCurrentBlock();
2087 $tabs->setCurrentBlock(
"tab");
2088 $tabs->setVariable(
"TAB_TYPE", $edit?
"active" :
"");
2089 $tabs->setVariable(
"TAB_TEXT", $this->lng->txt(
'settings'));
2090 $tabs->setVariable(
"TAB_LINK",
"setup.php?cmd=edit_background_tasks");
2091 $tabs->parseCurrentBlock();
2096 protected function displayCache()
2098 require_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
2099 require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
2100 require_once(
'./Services/GlobalCache/classes/Settings/class.ilGlobalCacheSettings.php');
2107 $ilGlobalCacheSettings->readFromIniFile($this->setup->getClient()->ini);
2110 $cache_form->setTitle($this->lng->txt(
'global_cache_configuration'));
2111 $cache_form->addCommandButton(
'saveCache', $this->lng->txt(
'save'));
2112 $cache_form->setFormAction(
'setup.php?cmd=gateway');
2114 $some_inactive =
false;
2116 $service_type =
new ilRadioGroupInputGUI($this->lng->txt(
'global_cache_service_type'),
'global_cache_service_type');
2119 $service_type->addOption($option);
2122 $option =
new ilRadioOption($this->lng->txt(
'global_cache_service_type_' . $type->getServiceType()), $type->getServiceType());
2123 $option->
setInfo($this->lng->txt(
'global_cache_install_info_' . $type->getServiceType()));
2124 if (!$type->isCacheServiceInstallable()) {
2126 $message .= $this->lng->txt(
'global_cache_service_type_' . $type->getServiceType()) .
': ' . $type->getInstallationFailureReason()
2128 $some_inactive =
true;
2130 $service_type->addOption($option);
2133 if ($some_inactive) {
2138 $service_type->setValue($ilGlobalCacheSettings->isActive() ? $ilGlobalCacheSettings->getService() : -1);
2139 $cache_form->addItem($service_type);
2140 if ($ilGlobalCacheSettings->isActive()) {
2142 $h->setTitle($this->lng->txt(
'cache_activated_components'));
2143 $cache_form->addItem($h);
2146 $cc =
new ilCheckboxInputGUI($this->lng->txt(
'cache_activate_' . $comp),
'activate[' . $comp .
']');
2147 $cc->
setChecked($ilGlobalCacheSettings->isComponentActivated($comp));
2148 $cache_form->addItem($cc);
2151 $cc =
new ilCheckboxInputGUI($this->lng->txt(
'cache_activate_all'),
'activate[all]');
2152 $cc->
setChecked($ilGlobalCacheSettings->areAllComponentActivated());
2153 $cache_form->addItem($cc);
2157 require_once(
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php');
2158 require_once(
'./Services/UIComponent/Button/classes/class.ilLinkButton.php');
2160 if ($ilGlobalCacheSettings->isActive()) {
2162 $b->setCaption(
'cache_flush');
2163 $b->setUrl(
'setup.php?cmd=flushCache');
2164 $ilToolbarGUI->addButtonInstance(
$b);
2168 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServerTableGUI.php');
2170 $b->setCaption(
'memcache_add');
2171 $b->setUrl(
'setup.php?cmd=addMemcacheServer');
2172 $ilToolbarGUI->addButtonInstance(
$b);
2174 $table_html = $ilMemcacheServerTableGUI->getHTML();
2177 $this->tpl->setVariable(
'SETUP_CONTENT', $ilToolbarGUI->getHTML() . $cache_form->getHTML() . $table_html);
2183 require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
2184 ilGlobalCache::flushAll();
2191 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServerFormGUI.php');
2194 $this->tpl->setVariable(
'SETUP_CONTENT', $ilMemcacheServerFormGUI->getHTML());
2200 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServerFormGUI.php');
2203 $ilMemcacheServerFormGUI->setValuesByPost();
2204 if ($ilMemcacheServerFormGUI->saveObject()) {
2207 $this->tpl->setVariable(
'SETUP_CONTENT', $ilMemcacheServerFormGUI->getHTML());
2213 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServerFormGUI.php');
2216 $ilMemcacheServerFormGUI->fillForm();
2217 $this->tpl->setVariable(
'SETUP_CONTENT', $ilMemcacheServerFormGUI->getHTML());
2223 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServerFormGUI.php');
2227 $ilMemcacheServerFormGUI->setValuesByPost();
2228 if ($ilMemcacheServerFormGUI->saveObject()) {
2231 $this->tpl->setVariable(
'SETUP_CONTENT', $ilMemcacheServerFormGUI->getHTML());
2237 require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcacheServer.php');
2238 $ilMemcacheServer = ilMemcacheServer::find(
$_GET[
'mcsid']);
2239 $ilMemcacheServer->delete();
2244 public function saveCache()
2249 require_once(
'Services/GlobalCache/classes/class.ilGlobalCache.php');
2250 require_once(
'./Services/GlobalCache/classes/Settings/class.ilGlobalCacheSettings.php');
2251 ilGlobalCache::flushAll();
2252 $ini = $this->setup->getClient()->ini;
2255 $ilGlobalCacheSettings->readFromIniFile(
$ini);
2256 $service_type =
$_POST[
'global_cache_service_type'];
2257 $ilGlobalCacheSettings->setActive(($service_type >= 0) ?
true :
false);
2258 $ilGlobalCacheSettings->setService($service_type);
2259 $ilGlobalCacheSettings->resetActivatedComponents();
2260 if (is_array(
$_POST[
'activate']) && count(
$_POST[
'activate']) > 0) {
2261 foreach (
$_POST[
'activate'] as $comp =>
$a) {
2262 if ($comp ==
'all') {
2263 $ilGlobalCacheSettings->activateAll();
2266 $ilGlobalCacheSettings->addActivatedComponent($comp);
2270 $ilGlobalCacheSettings->writeToIniFile(
$ini);
2272 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
2289 if (!$this->setup->getClient()->db_installed) {
2293 $this->setDbSubTabs(
"repl");
2295 if (!$a_from_save) {
2296 $ilDB = $this->setup->getClient()->db;
2297 $this->lng->setDbHandler($ilDB);
2302 if (!$a_from_save) {
2306 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2320 $client = $this->setup->getClient();
2322 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2327 $ne->
setValue($lng->txt(
"db_" . $ilDB->getDbType()));
2328 $this->form->addItem($ne);
2333 $this->form->addItem($act);
2337 $ti->setValue(
$client->getDbSlaveHost());
2338 $ti->setMaxLength(120);
2339 $ti->setRequired(
true);
2340 $act->addSubItem($ti);
2344 $ti->setValue(
$client->getDbSlaveName());
2345 $ti->setRequired(
true);
2346 $ti->setMaxLength(40);
2347 $act->addSubItem($ti);
2351 $ti->setValue(
$client->getDbSlaveUser());
2352 $ti->setMaxLength(40);
2353 $ti->setRequired(
true);
2354 $act->addSubItem($ti);
2358 $ti->setValue(
$client->getDbSlavePort());
2359 $ti->setMaxLength(8);
2360 $act->addSubItem($ti);
2363 $set_pw =
new ilCheckboxInputGUI($this->lng->txt(
"db_set_password"),
"set_slave_password");
2368 $ti->setMaxLength(40);
2369 $set_pw->addSubItem($ti);
2371 $this->form->addCommandButton(
"saveDbSlave", $lng->txt(
"save"));
2373 $this->form->setTitle($lng->txt(
"db_slave_settings"));
2374 $this->form->setFormAction(
"setup.php?cmd=gateway");
2384 $client = $this->setup->getClient();
2386 $ilDB = $this->setup->getClient()->db;
2387 $this->lng->setDbHandler($ilDB);
2390 if ($this->form->checkInput()) {
2391 $client->setDbSlaveActive($this->form->getInput(
"slave_active"));
2392 if ($this->form->getInput(
"slave_active")) {
2393 $client->setDbSlaveHost($this->form->getInput(
"slave_host"));
2394 $client->setDbSlaveUser($this->form->getInput(
"slave_user"));
2395 $client->setDbSlavePort($this->form->getInput(
"slave_port"));
2396 $client->setDbSlaveName($this->form->getInput(
"slave_name"));
2397 if ($this->form->getInput(
"set_slave_password")) {
2398 $client->setDbSlavePass($this->form->getInput(
"slave_pass"));
2403 ilUtil::sendSuccess($lng->txt(
"saved_successfully"),
true);
2406 $this->form->setValuesByPost();
2422 if ($ilDB->getDbType() ==
"mysql") {
2423 $this->tabs->addSubTab(
"db", $this->lng->txt(
"db_master"),
"setup.php?client_id=" . $this->client_id .
"&cmd=db");
2424 $this->tabs->addSubTab(
"repl", $this->lng->txt(
"db_slave"),
"setup.php?client_id=" . $this->client_id .
"&cmd=dbslave");
2427 $this->tabs->activateSubTab($a_subtab_id);
2435 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false, $custom_updates_available =
false)
2439 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2444 $this->form->addItem($ne);
2447 if ($this->setup->getClient()->getDBSetup()->isDatabaseInstalled()
2448 && in_array($this->setup->getClient()->getDbType(), array(
2454 $ilDB = $this->setup->getClient()->db;
2455 $ne->setValue($ilDB->getDBVersion());
2456 $this->form->addItem($ne);
2461 $this->form->addItem($ne);
2465 $this->form->addItem($ne);
2469 $this->form->addItem($ne);
2473 $this->form->addItem($ne);
2481 $collations = array(
2487 "utf8_icelandic_ci",
2489 "utf8_lithuanian_ci",
2495 "utf8_slovenian_ci",
2501 foreach ($collations as $collation) {
2502 $options[$collation] = $collation;
2505 $si->setOptions($options);
2506 $si->setInfo($this->lng->txt(
"info_text_db_collation2") .
" " .
2507 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">" .
2508 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2509 $cb->addSubItem(
$si);
2511 $this->form->addItem($cb);
2515 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2517 $ilDB = $this->setup->getClient()->db;
2518 $this->lng->setDbHandler(
$ilDB);
2523 $ne->
setValue($dbupdate->currentVersion);
2524 $this->form->addItem($ne);
2528 $ne->
setValue($dbupdate->fileVersion);
2529 $this->form->addItem($ne);
2531 if (!$db_status = $dbupdate->getDBVersionStatus()) {
2534 for (
$i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion;
$i++) {
2537 if (count($options) > 1) {
2539 $si->setOptions($options);
2540 $si->setInfo($lng->txt(
"next_update_break_info"));
2541 $this->form->addItem(
$si);
2544 if ($dbupdate->getRunningStatus() > 0) {
2545 ilUtil::sendFailure($this->lng->txt(
"db_update_interrupted") .
" (Step " . $dbupdate->getRunningStatus() .
") <br /><br />" .
2546 $this->lng->txt(
"db_update_interrupted_avoid"));
2550 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2551 $this->form->addCommandButton(
"showUpdateSteps", $lng->txt(
"show_update_steps"));
2552 } elseif ($hotfix_available) {
2555 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2556 $this->form->addItem($ne);
2560 $ne->
setValue($dbupdate->getHotfixFileVersion());
2561 $this->form->addItem($ne);
2563 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2564 $this->form->addCommandButton(
"showHotfixSteps", $lng->txt(
"show_update_steps"));
2566 } elseif ($custom_updates_available) {
2569 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2570 $this->form->addItem($ne);
2574 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2575 $this->form->addItem($ne);
2577 $this->form->addCommandButton(
"applyCustomUpdates", $lng->txt(
"apply_custom_updates"));
2580 if ($dbupdate->getHotfixFileVersion() > 0) {
2583 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2584 $this->form->addItem($ne);
2588 $ne->
setValue($dbupdate->getHotfixFileVersion());
2589 $this->form->addItem($ne);
2591 if ($dbupdate->getCustomUpdatesFileVersion() > 0) {
2594 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2595 $this->form->addItem($ne);
2599 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2600 $this->form->addItem($ne);
2602 ilUtil::sendSuccess($this->lng->txt(
"database_is_uptodate"));
2606 $this->form->setTitle($lng->txt(
"database"));
2607 $this->form->setFormAction(
"setup.php?cmd=gateway");
2617 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2618 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2619 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2620 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2622 if (is_object($dbupdate)) {
2623 $values[
"update_break"] = $dbupdate->fileVersion;
2624 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200) {
2625 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2626 ($dbupdate->currentVersion % 100);
2630 $this->form->setValuesByArray($values);
2645 if (!$this->setup->getClient()->getDBSetup()->isDatabaseExisting()) {
2646 if (
$_POST[
"chk_db_create"]) {
2647 if (!$this->setup->createDatabase(
$_POST[
"collation"])) {
2648 echo
"installation failed";
2657 if (!$this->setup->installDatabase()) {
2660 ilUtil::sendSuccess($this->lng->txt(
"database_installed"),
true);
2676 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2677 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2678 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2679 include_once
"./Services/Tree/classes/class.ilTree.php";
2680 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2681 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2685 $ilDB = $this->setup->getClient()->db;
2686 $this->lng->setDbHandler(
$ilDB);
2692 if ($dbupdate->updateMsg ==
"no_changes") {
2693 $message = $this->lng->txt(
"no_changes") .
". " . $this->lng->txt(
"database_is_uptodate");
2696 foreach ($dbupdate->updateMsg as $row) {
2697 if ($row[
"msg"] ==
"update_applied") {
2698 $a_message .= $sep . $row[
"nr"];
2701 $e_message .=
"<br/>" . $this->lng->txt($row[
"msg"]) .
": " . $row[
"nr"];
2704 if ($a_message !=
"") {
2705 $a_message = $this->lng->txt(
"update_applied") .
": " . $a_message;
2741 if ($this->setup->getClient()->db_installed) {
2742 $ilDB = $this->setup->getClient()->db;
2743 $this->lng->setDbHandler(
$ilDB);
2745 $db_status = $dbupdate->getDBVersionStatus();
2746 $hotfix_available = $dbupdate->hotfixAvailable();
2747 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2751 $ntpl =
new ilTemplate(
"tpl.setup_steps.html",
true,
true,
"setup");
2753 $ntpl->setVariable(
"CONTENT", $dbupdate->getHotfixSteps());
2755 $ntpl->setVariable(
"CONTENT", $dbupdate->getUpdateSteps(
$_POST[
"update_break"]));
2757 $ntpl->setVariable(
"BACK", $this->lng->txt(
"back"));
2758 $ntpl->setVariable(
"HREF_BACK",
"./setup.php?client_id=&cmd=db");
2759 $this->tpl->setVariable(
"SETUP_CONTENT", $ntpl->get());
2775 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2777 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2778 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2779 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2780 include_once
"./Services/Tree/classes/class.ilTree.php";
2781 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2782 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2785 $ilDB = $this->setup->getClient()->db;
2786 $this->lng->setDbHandler(
$ilDB);
2792 if ($dbupdate->updateMsg ==
"no_changes") {
2793 $message = $this->lng->txt(
"no_changes") .
". " . $this->lng->txt(
"database_is_uptodate");
2796 foreach ($dbupdate->updateMsg as $row) {
2797 if ($row[
"msg"] ==
"update_applied") {
2798 $a_message .= $sep . $row[
"nr"];
2801 $e_message .=
"<br/>" . $this->lng->txt($row[
"msg"]) .
": " . $row[
"nr"];
2804 if ($a_message !=
"") {
2805 $a_message = $this->lng->txt(
"update_applied") .
": " . $a_message;
2822 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2826 if (!$this->setup->getClient()->db_installed) {
2828 $message =
"No database found! Please install database first.";
2835 $settings = array();
2837 foreach ($setting_fields as $field) {
2838 if ($field ==
'session_allow_client_maintenance') {
2839 if (isset(
$_POST[$field])) {
2847 $settings[$field] =
$_POST[$field];
2855 $this->setup->setSessionSettings($settings);
2858 $settings = $this->setup->getSessionSettings();
2860 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2863 include_once
'Services/Authentication/classes/class.ilSession.php';
2874 $ssettings->addOption($fixed);
2881 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2882 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2883 $ti->setMaxLength(5);
2885 $ti->
setValue($settings[
'session_max_count']);
2886 $ldsh->addSubItem($ti);
2891 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2892 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2893 $ti->setMaxLength(5);
2895 $ti->
setValue($settings[
'session_min_idle']);
2896 $ldsh->addSubItem($ti);
2901 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2902 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2903 $ti->setMaxLength(5);
2905 $ti->
setValue($settings[
'session_max_idle']);
2906 $ldsh->addSubItem($ti);
2910 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2911 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2912 $ti->setMaxLength(5);
2914 $ti->
setValue($settings[
'session_max_idle_after_first_request']);
2915 $ldsh->addSubItem($ti);
2918 $ssettings->addOption($ldsh);
2920 $form->addItem($ssettings);
2924 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2925 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2926 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2927 $form->addItem($chkb);
2931 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2933 $form->setTitle($this->lng->txt(
"sess_sessions"));
2934 $form->setFormAction(
'setup.php?client_id=' . $this->client_id .
'&cmd=sess');
2936 $this->tpl->setVariable(
"TXT_SETUP_TITLE", ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2937 $this->tpl->setVariable(
"TXT_INFO",
'');
2938 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2961 if (!$this->setup->getClient()->db_installed) {
2963 $message =
"No database found! Please install database first.";
2967 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2969 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2971 $this->tpl->setVariable(
"TXT_SETUP_TITLE", ucfirst(trim($this->lng->txt(
"setup_languages"))));
2972 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2974 $installed_langs = $this->lng->getInstalledLanguages();
2975 $lang_count = count($installed_langs);
2976 if ($lang_count > 0) {
2977 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2978 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count .
" " . $this->lng->txt(
"languages_installed");
2980 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2981 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2984 $this->setButtonPrev(
"lang");
2986 if ($lang_count > 0) {
2987 $this->setButtonNext(
"contact");
3001 if (empty(
$_POST[
"form"][
"lang_id"])) {
3006 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"])) {
3011 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
3017 foreach (
$result as $key => $lang_key) {
3018 $list .= $this->lng->txt(
"lang_" . $lang_key);
3020 if ($count > $key + 1) {
3026 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
3027 $message = $this->lng->txt(
"languages_installed");
3030 $message .=
"<br/>(" . $this->lng->txt(
"langs_not_valid_not_installed") .
": " . $list .
")";
3046 $settings = $this->setup->getClient()->getAllSettings();
3048 if (!$a_omit_init) {
3052 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3053 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
3054 $this->setButtonPrev(
"lang");
3056 $check = $this->setup->checkClientContact($this->setup->client);
3058 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
3059 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
3061 if ($check[
"status"]) {
3062 $this->setButtonNext(
"proxy");
3077 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3082 $ti->setMaxLength(64);
3084 $ti->setRequired(
true);
3085 $this->form->addItem($ti);
3089 $ti->setMaxLength(64);
3091 $this->form->addItem($ti);
3094 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
3095 $ti->setMaxLength(64);
3097 $this->form->addItem($ti);
3101 $sh->setTitle($lng->txt(
"contact_data"));
3102 $this->form->addItem($sh);
3105 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
3106 $ti->setMaxLength(64);
3108 $ti->setRequired(
true);
3109 $this->form->addItem($ti);
3112 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
3113 $ti->setMaxLength(64);
3115 $ti->setRequired(
true);
3116 $this->form->addItem($ti);
3119 "title" => array(
"max" => 64,
"size" => 30),
3120 "position" => array(
"max" => 64,
"size" => 30),
3121 "institution" => array(
"max" => 200,
"size" => 30),
3122 "street" => array(
"max" => 64,
"size" => 30),
3123 "zipcode" => array(
"max" => 10,
"size" => 5),
3124 "city" => array(
"max" => 64,
"size" => 30),
3125 "country" => array(
"max" => 64,
"size" => 30),
3126 "phone" => array(
"max" => 64,
"size" => 30)
3128 foreach ($fs as
$f => $op) {
3131 $ti->setMaxLength($op[
"max"]);
3132 $ti->setSize($op[
"size"]);
3133 $ti->setInfo($lng->txt(
""));
3134 $this->form->addItem($ti);
3138 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
3139 $ti->setRequired(
true);
3140 $ti->allowRFC822(
true);
3141 $this->form->addItem($ti);
3155 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
3157 $this->form->setTitle($lng->txt(
"client_data"));
3158 $this->form->setFormAction(
"setup.php?cmd=gateway");
3166 $settings = $this->setup->getClient()->getAllSettings();
3168 $values = $settings;
3170 $values[
"inst_name"] = ($this->setup->getClient()->getName())
3171 ? $this->setup->getClient()->getName()
3172 : $this->setup->getClient()->getId();
3173 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
3175 $this->form->setValuesByArray($values);
3186 if ($this->form->checkInput()) {
3187 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
3188 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
3189 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
3190 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
3191 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
3192 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
3193 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
3194 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
3195 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
3196 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
3197 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
3198 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
3199 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
3204 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
3205 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
3206 $this->setup->getClient()->ini->write();
3208 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
3212 $this->form->setValuesByPost();
3226 $settings = $this->setup->getClient()->getAllSettings();
3227 $nic_key = $this->setup->getClient()->getNICkey();
3230 $settings = $this->setup->getClient()->getAllSettings();
3232 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0) {
3233 $this->no_second_nav =
true;
3234 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic3") .
" " . $settings[
"inst_id"] .
".");
3237 $settings = $this->setup->getClient()->getAllSettings();
3239 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
3240 if (!$a_omit_init) {
3244 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3246 if (isset($settings[
"nic_enabled"])) {
3247 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3251 $this->setButtonPrev(
"proxy");
3253 if ($this->setup->getClient()->status[
"nic"][
"status"]) {
3254 $this->setButtonNext(
"finish",
"finish");
3269 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3276 $radg->addOption($op1);
3277 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
3278 $radg->addOption($op1);
3279 $this->form->addItem($radg);
3281 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
3282 $this->form->setFormAction(
"setup.php?cmd=gateway");
3290 $settings = $this->setup->getClient()->getAllSettings();
3291 $nic_key = $this->setup->getClient()->getNICkey();
3296 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1") {
3297 $values[
"register"] = 1;
3304 $values[
"register"] = 0;
3307 $this->form->setValuesByArray($values);
3318 if ($this->form->checkInput()) {
3320 if (
$_POST[
"register"] == 1) {
3322 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
3325 if (empty($this->setup->getClient()->nic_status[2])) {
3326 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
3330 $this->setup->getClient()->setSetting(
"inst_id", $this->setup->getClient()->nic_status[2]);
3331 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
3332 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3333 ilUtil::sendSuccess($this->lng->txt(
"nic_reg_enabled"),
true);
3355 $this->setup->getClient()->setSetting(
"inst_id",
"0");
3356 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
3357 ilUtil::sendSuccess($this->lng->txt(
"nic_reg_disabled"),
true);
3362 $this->form->setValuesByPost();
3385 $this->tpl->setVariable(
3387 $ctrl_structure_form->getHTML() .
"<br />" .
3388 $settings_type_form->getHTML() .
'<br />' .
3389 $mp_ns_form->getHTML()
3395 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3398 $form->setId(
'tree_impl');
3399 $form->setTitle($this->lng->txt(
'tree_implementation'));
3400 $form->setFormAction(
'setup.php?cmd=gateway');
3404 #$options->setRequired(true); 3407 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3410 $options->setValue(
$type);
3412 $ns =
new ilRadioOption($this->lng->txt(
'tree_implementation_ns'),
'ns');
3413 $options->addOption($ns);
3415 $mp =
new ilRadioOption($this->lng->txt(
'tree_implementation_mp'),
'mp');
3416 $options->addOption($mp);
3418 $form->addItem($options);
3419 $form->addCommandButton(
'switchTree', $this->lng->txt(
'tree_implementation_switch_btn'));
3420 $form->setShowTopButtons(
false);
3428 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3430 if (
$type ==
'ns' and
$_POST[
'tree_impl_type'] ==
'mp') {
3432 include_once
'./Services/Tree/classes/class.ilMaterializedPathTree.php';
3435 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree', array(
'lft'));
3436 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree', array(
'path'));
3437 $GLOBALS[
'ilDB']->addIndex(
'tree', array(
'path'),
'i4');
3439 $set->set(
'main_tree_impl',
'mp');
3440 } elseif (
$type ==
'mp' and
$_POST[
'tree_impl_type'] ==
'ns') {
3441 include_once
'./Services/Tree/classes/class.ilTree.php';
3443 $GLOBALS[
"DIC"][
"ilSetting"] =
function (
$c) {
3449 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree', array(
'lft'));
3450 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree', array(
'path'));
3451 $GLOBALS[
'ilDB']->addIndex(
'tree', array(
'lft'),
'i4');
3453 $set->set(
'main_tree_impl',
'ns');
3467 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3470 $form->setId(
"control_structure");
3471 $form->setTitle($this->lng->txt(
"ctrl_structure"));
3472 $form->setFormAction(
"setup.php?cmd=gateway");
3474 $ilDB = $this->setup->getClient()->db;
3475 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
3476 $crec =
$ilDB->fetchAssoc($cset);
3479 if ($crec[
"cnt"] == 0) {
3480 $item->
setInfo($this->lng->txt(
"ctrl_missing_desc"));
3482 $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
3484 $form->addItem($item);
3486 $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
3498 if (!$this->setup->getClient()->db_installed) {
3505 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
3515 $ilCtrlStructureReader->readStructure(
true);
3520 foreach ($modules as $module) {
3522 ILIAS_ABSOLUTE_PATH .
"/Modules/" . $module[
"subdir"] .
"/module.xml",
3535 ILIAS_ABSOLUTE_PATH .
"/Services/" . $service[
"subdir"] .
"/service.xml",
3555 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3558 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3561 $form->setId(
"settings_type");
3562 $form->setTitle($this->lng->txt(
"settings_type"));
3563 $form->setFormAction(
"setup.php?cmd=gateway");
3568 if (
$type ==
"clob") {
3569 $item->setInfo($this->lng->txt(
'settings_info_clob'));
3570 $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
3571 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
3573 $item->setInfo($this->lng->txt(
'settings_info_text'));
3574 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
3576 $form->addItem($item);
3578 if (is_array($this->longer_settings)) {
3581 if (count($this->longer_settings)) {
3582 foreach ($this->longer_settings as $row) {
3583 $subitem =
new ilCustomInputGUI(sprintf($this->lng->txt(
'settings_key_info'), $row[
'module'], $row[
'keyword']));
3584 $subitem->setInfo($row[
'value']);
3585 $item->addSubItem($subitem);
3588 $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
3590 $form->addItem($item);
3602 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3605 if ($old_type ==
"clob") {
3607 if (count($longer_settings)) {
3608 $this->longer_settings = $longer_settings;
3631 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3641 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
3642 $form = new \ilPropertyFormGUI();
3643 $form->setTitle($this->lng->txt(
'change_password'));
3645 $currentPassword = new \ilPasswordInputGUI($this->lng->txt(
'set_oldpasswd'),
'pass_old');
3646 $currentPassword->setDisableHtmlAutoComplete(
true);
3647 $currentPassword->setValidateAuthPost(
false);
3648 $currentPassword->setSkipSyntaxCheck(
true);
3649 $currentPassword->setRequired(
true);
3650 $currentPassword->setRetype(
false);
3651 $form->addItem($currentPassword);
3653 $newPassword = new \ilPasswordInputGUI($this->lng->txt(
'set_newpasswd'),
'pass');
3654 $newPassword->setDisableHtmlAutoComplete(
true);
3655 $newPassword->setValidateAuthPost(
false);
3656 $newPassword->setSkipSyntaxCheck(
true);
3657 $newPassword->setRequired(
true);
3658 $newPassword->setRetype(
true);
3659 $form->addItem($newPassword);
3661 $form->setFormAction(
'setup.php?cmd=gateway');
3662 $form->addCommandButton(
'savemasterpassword', $this->lng->txt(
'save'));
3674 $isValid = $form->checkInput();
3675 $form->setValuesByPost();
3681 $cp = $form->getInput(
'pass_old');
3682 $np = $form->getInput(
'pass');
3684 if (!$this->setup->verifyMasterPassword($cp)) {
3689 if (!$this->setup->storeMasterPassword($np)) {
3704 if (null === $form) {
3708 $this->tpl->addBlockFile(
'CONTENT',
'content',
'tpl.std_layout.html',
'setup');
3709 $this->tpl->setVariable(
'TXT_HEADER', $this->lng->txt(
'password_new_master'));
3710 $this->tpl->setVariable(
'TXT_INFO', $this->lng->txt(
'info_text_password'));
3711 $this->tpl->setVariable(
'SETUP_CONTENT', $form->getHTML());
3720 $this->no_second_nav =
true;
3723 $txt_info = $this->lng->txt(
"info_text_finish1") .
"<br /><br />" .
3724 "<p>" . $this->lng->txt(
"user") .
": <b>root</b><br />" .
3725 $this->lng->txt(
"password") .
": <b>homer</b></p>";
3726 $this->setButtonNext(
"login_new",
"login");
3728 $this->setup->getClient()->reconnect();
3731 $this->setup->getClient()->setSetting(
"setup_ok", 1);
3734 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3737 $txt_info = $this->lng->txt(
"info_text_finish2");
3742 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3743 $this->tpl->setVariable(
"TXT_INFO", $txt_info);
3745 $this->setButtonPrev(
"nic");
3759 if (
$_POST[
"form"][
"delete"]) {
3784 $msg = $this->setup->getClient()->delete(
$ini, $db, $files);
3790 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3793 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3796 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3797 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3798 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3799 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3811 if ($this->setup->getClient()->status[
"finish"][
"status"]) {
3812 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3813 $this->setup->getClient()->ini->setVariable(
"client",
"access", $val);
3814 $this->setup->getClient()->ini->write();
3815 $message =
"client_access_mode_changed";
3817 $message =
"client_setup_not_finished";
3838 $status = $this->setup->getStatus(
$client);
3840 if ($status[
"finish"][
"status"]) {
3841 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3842 $this->setup->ini->write();
3843 $message =
"default_client_changed";
3845 $message =
"client_setup_not_finished";
3860 foreach ($this->setup->getClient()->status as $key => $val) {
3861 if ($key !=
"finish" and $key !=
"access") {
3862 if ($val[
"status"] !=
true) {
3871 $list = $clientlist->getClients();
3873 if (count($list) == 1) {
3874 $this->setup->ini->setVariable(
"clients",
"default", $this->setup->getClient()->getId());
3875 $this->setup->ini->write();
3877 $this->setup->getClient()->ini->setVariable(
"client",
"access", 1);
3878 $this->setup->getClient()->ini->write();
3889 if (!$this->setup->getClient()->status[
"db"][
"status"]) {
3893 } elseif (!$this->setup->getClient()->status[
"lang"][
"status"]) {
3894 $this->cmd =
"lang";
3897 } elseif (!$this->setup->getClient()->status[
"contact"][
"status"]) {
3898 $this->cmd =
"contact";
3901 } elseif (!$this->setup->getClient()->status[
'proxy'][
'status']) {
3902 $this->cmd =
"proxy";
3905 } elseif (!$this->setup->getClient()->status[
"nic"][
"status"]) {
3909 } elseif (!$this->setup->getClient()->status[
"finish"][
"status"]) {
3910 $this->cmd =
"finish";
3923 if ($this->setup->ini->readVariable(
"clients",
"list")) {
3924 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3925 $this->setup->ini->write();
3928 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3929 $this->setup->ini->write();
3944 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
3946 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
3947 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
3948 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
3949 include_once
"./Services/Tree/classes/class.ilTree.php";
3950 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
3951 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
3954 $ilDB = $this->setup->getClient()->db;
3955 $this->lng->setDbHandler(
$ilDB);
3962 if ($dbupdate->updateMsg ==
"no_changes") {
3963 $message = $this->lng->txt(
"no_changes") .
". " . $this->lng->txt(
"database_is_uptodate");
3966 foreach ($dbupdate->updateMsg as $row) {
3967 if ($row[
"msg"] ==
"update_applied") {
3968 $a_message .= $sep . $row[
"nr"];
3971 $e_message .=
"<br/>" . $this->lng->txt($row[
"msg"]) .
": " . $row[
"nr"];
3974 if ($a_message !=
"") {
3975 $a_message = $this->lng->txt(
"update_applied") .
": " . $a_message;
3992 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3995 $this->form->setId(
"clone_form");
3996 $this->form->setFormAction(
"setup.php?cmd=gateway");
3998 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) {
3999 $this->form->setTitle($this->lng->txt(
"clone_source"));
4002 $list = $clientlist->getClients();
4003 $clientlistarray = array();
4005 foreach ($list as $key =>
$client) {
4006 if ((strcmp($key, $this->setup->getClient()->getId()) !=
'0') && (
$client->getDbType() ==
'mysql')) {
4013 $si->setOptions(array_merge(
4014 array(
"" =>
"-- " . $lng->txt(
"please_select") .
" --"),
4017 $si->setRequired(
true);
4018 $this->form->addItem(
$si);
4022 $this->form->addItem($cb);
4024 $this->form->addCommandButton(
"cloneSaveSource", $lng->txt(
"cloneit"));
4026 $disabledmessage =
"<h1>" . $this->lng->txt(
"clone_disabledmessage") .
"</h1><br>";
4027 if (!$this->setup->getClient()->status[
"access"][
"status"] ===
false) {
4028 $disabledmessage .= $this->lng->txt(
"clone_clientnotdisabled") .
"<br>";
4030 if (!stripos($this->setup->getClient()->getName(),
"aster") ===
false) {
4031 $disabledmessage .= $this->lng->txt(
"clone_clientismaster") .
"<br>";
4033 if ($this->setup->getClient()->getdbType() !=
"mysql") {
4034 $disabledmessage .= $this->lng->txt(
"clone_clientisnotmysql") .
"<br>";
4036 if (!$this->setup->getClient()->db_exists) {
4037 $disabledmessage .= $this->lng->txt(
"clone_clientnodatabase") .
"<br>";
4039 $this->form->setTitle($disabledmessage);
4045 if (!$this->setup->isAdmin()) {
4050 $this->form->setValuesByPost();
4051 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4052 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4059 if (!$this->setup->isAdmin()) {
4065 if ($this->form->checkInput()) {
4068 if ($this->form->getInput(
"iamsure") !=
"1") {
4069 $error = $this->lng->txt(
'clone_youmustcheckiamsure');
4072 if (!$this->setup->cloneFromSource($this->form->getInput(
"source"))) {
4073 $error = $this->lng->txt(
'clone_error') .
' -> ' . $this->setup->error;
4076 if (0 === strlen($error)) {
4082 $this->form->setValuesByPost();
4083 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4084 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4090 $settings = $this->setup->getClient()->getAllSettings();
4092 if (!$a_omit_init) {
4093 include_once(
"./Services/Administration/classes/class.ilSetting.php");
4095 $this->form->setValuesByArray(array(
4096 'proxy_status' => (
bool) $settings[
'proxy_status'],
4097 'proxy_host' => $settings[
'proxy_host'],
4098 'proxy_port' => $settings[
'proxy_port']
4100 if ((
bool) $settings[
'proxy_status']) {
4101 $this->setup->printProxyStatus($this->setup->client);
4104 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4105 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_proxy"));
4108 $check = $this->setup->checkClientProxySettings($this->setup->client);
4110 $this->setup->getClient()->status[
"proxy"][
"status"] = $check[
"status"];
4111 $this->setup->getClient()->status[
"proxy"][
"comment"] = $check[
"comment"];
4112 $this->setup->getClient()->status[
"proxy"][
"text"] = $check[
"comment"];
4114 if ($check[
"status"]) {
4115 $this->setButtonNext(
"nic");
4118 $this->setButtonPrev(
"contact");
4125 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
4127 $this->form->setFormAction(
"setup.php?cmd=gateway");
4131 $proxs->
setInfo($lng->txt(
'proxy_status_info'));
4132 $proxs->setValue(1);
4133 $this->form->addItem($proxs);
4137 $proxs->addSubItem($proxa);
4140 $prox =
new ilTextInputGUI($lng->txt(
'proxy_host'),
'proxy_host');
4141 $prox->setInfo($lng->txt(
'proxy_host_info'));
4142 $proxs->addSubItem($prox);
4145 $proxp =
new ilTextInputGUI($lng->txt(
'proxy_port'),
'proxy_port');
4146 $proxp->setInfo($lng->txt(
'proxy_port_info'));
4147 $proxp->setSize(10);
4148 $proxp->setMaxLength(10);
4149 $proxs->addSubItem($proxp);
4152 $this->form->addCommandButton(
'saveProxy', $lng->txt(
'save'));
4167 $isFormValid = $this->form->checkInput();
4169 $new_settings[
'proxy_status'] = (int) $this->form->getInput(
'proxy_status');
4170 $new_settings[
'proxy_host'] = trim($this->form->getInput(
'proxy_host'));
4171 $new_settings[
'proxy_port'] = trim($this->form->getInput(
'proxy_port'));
4174 if ($new_settings[
'proxy_status'] ==
true) {
4175 if (!strlen($new_settings[
'proxy_host'])) {
4176 $isFormValid =
false;
4177 $this->form->getItemByPostVar(
'proxy_host')->setAlert($lng->txt(
'msg_input_is_required'));
4179 if (!strlen($new_settings[
'proxy_port'])) {
4180 $isFormValid =
false;
4181 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'msg_input_is_required'));
4183 if (!preg_match(
'/[0-9]{1,}/', $new_settings[
'proxy_port']) ||
4184 $new_settings[
'proxy_port'] < 0 ||
4185 $new_settings[
'proxy_port'] > 65535) {
4186 $isFormValid =
false;
4187 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'proxy_port_numeric'));
4192 $this->setup->saveProxySettings($new_settings);
4194 ilUtil::sendSuccess($lng->txt(
'saved_successfully'));
4195 $settings = $this->setup->getClient()->getAllSettings();
4196 if ($settings[
'proxy_status'] ==
true) {
4197 $this->setup->printProxyStatus($this->setup->client);
4204 $this->form->setValuesByPost();
4205 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4214 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
4216 include_once(
"./setup/classes/class.ilBackgroundTaskTableGUI.php");
4219 $this->tpl->setVariable(
"SETUP_CONTENT", $this->
bt_tabs()->
get() . $table->getHTML());
4228 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
4231 $form->setTitle($this->lng->txt(
'background_task_configuration'));
4232 $form->addCommandButton(
'save_background_tasks', $this->lng->txt(
'save'));
4233 $form->addCommandButton(
'background_tasks', $this->lng->txt(
'cancel'));
4234 $form->setFormAction(
'setup.php?cmd=gateway');
4239 $rgroup->addOption($cc);
4242 $rgroup->addOption($cc);
4244 $form->addItem($rgroup);
4246 $i =
new ilNumberInputGUI($this->lng->txt(
'max_number_of_concurrent_tasks'),
'number_of_concurrent_tasks');
4254 require_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
4256 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
4261 $this->tpl->setVariable(
"SETUP_CONTENT", $this->
bt_tabs(
true)->
get() . $form->getHTML());
4269 $n_of_tasks = $this->setup->ini->readVariable(
"background_tasks",
"number_of_concurrent_tasks");
4270 $sync = $this->setup->ini->readVariable(
"background_tasks",
"concurrency");
4272 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
4273 $sync = $sync ? $sync :
'sync';
4275 $form->setValuesByArray([
4276 'concurrency' => $sync,
4277 'number_of_concurrent_tasks' => $n_of_tasks
4284 $form->setValuesByPost();
4287 if (!$form->checkInput()) {
4288 $this->tpl->setVariable(
'CONTENT', $this->
bt_tabs(
true)->
get() . $form->getHTML());
4293 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
4307 if (!$this->setup->ini->groupExists(
'background_tasks')) {
4308 $this->setup->ini->addGroup(
'background_tasks');
4309 $this->setup->ini->write();
4312 $this->setup->ini->setVariable(
"background_tasks",
"concurrency", $form->getInput(
'concurrency'));
4313 $this->setup->ini->setVariable(
"background_tasks",
"number_of_concurrent_tasks", $form->getInput(
'number_of_concurrent_tasks'));
4315 return $this->setup->ini->write();
4322 $client = $this->setup->getClient();
4325 $persistence = BasicPersistence::instance();
4326 $bucket_ids = $persistence->getBucketIdsByState(State::SCHEDULED);
4327 foreach ($bucket_ids as $bucket_id) {
4328 $persistence->deleteBucketById($bucket_id);
4331 ilUtil::sendSuccess($this->lng->txt(
'terminated_waiting_tasks'),
true);
Class ilMemcacheServerTableGUI.
checkDisplayMode($a_title="")
determine display mode and load according html layout
This class represents an option in a radio group.
changeDefaultClient()
set defualt client
determineToolsPathInstall()
Determine tools paths.
setValue($a_value)
Set Value.
getMasterPasswordForm()
return
displayError($a_message)
display error page
jumpToFirstUnfinishedSetupStep()
if setting up a client was not finished, jump back to the first uncompleted setup step ...
displayPreliminaries()
display preliminaries page
static _getLongerSettings($a_limit='4000')
get a list of setting records with values loger than a limit
setDisplayMode($a_mode)
set display mode to 'view' or 'setup' 'setup' -> show status panel and (prev/next) navigation buttons...
static _changeValueType($a_new_type='text')
change the type of the value column in the database
static _getValueType()
Get the type of the value column in the database.
displayIni($a_omit_form_init=false)
display setup in step
getRegistrationValues()
Get current values for registration from.
changeMasterPassword(\ilPropertyFormGUI $form=null)
display change password form and process form input
initDbSlaveForm()
Init db slave form.
displayClientOverview()
display client overview panel
Class ilGlobalCacheSettings.
installDatabase()
Install the database.
fillBackgroundTasksForm(&$form)
setInfo($a_info)
Set Information Text.
updateBasicSettings()
Update basic settings form.
displayFinishSetup()
display finish setup page
initDBSelectionForm()
Init db selection form.
displayDatabaseSlave($a_from_save=false)
Display database slave.
if($_SERVER['argc']< 4) $client
showUpdateSteps($a_hotfix=false)
Update database.
toggleClientList()
enable/disable client list on index page
initSettingsTypeForm()
Init the form to change the settings value type.
static getAllTypes($only_available=true)
getClientDbFormValues($dbupdate=null)
Get current values for client db from.
saveBasicSettings()
Save basic settings form.
initClientLoginForm()
Init client login form.
applyHotfix()
Apply hotfixes.
applyHotfix()
Apply hotfix.
static getSettingFields()
returns the array of setting fields
saveLanguages()
Save languages.
const SESSION_HANDLING_FIXED
static _getShortTimeZoneList()
get short timezone list
displaySessions()
display sessions form and process form input
setInfo($a_info)
Set Info.
static createFromParentReleation()
determineTools($a_tools=array())
Determine Tools.
displayTools()
display tools
initContactDataForm()
Init contact data form.
displayLanguages()
display language form and process form input
static isWindows()
check wether the current client system is a windows system
showLongerSettings()
show a list of setting values that are loger than 4000 characters
displayDatabase()
display database form and process form input
determineToolsPath()
Determine tools paths.
__construct()
Constructor.
Class ilBackgroundTaskTableGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
displayFooter()
page output and set title
saveProxy()
Save proxy settings.
setValue($a_value)
Set Value.
displayLogout()
display logout page
saveContact()
Save contact form.
displayMasterSetup($a_omit_init=false)
display master setup form & process form input
initBasicSettingsForm($a_install=false)
Init basic settings form.
initTreeImplementationForm()
getClientIniValues()
Get current values for client ini from.
static getAvailableComponents()
displayHeader()
display header with admin links and language flags
static getAvailableCoreServices()
Get all available core services.
checkPanelMode()
determine display mode and load correct panel
changeMasterSettings($a_omit_init=false)
display master settings and process form input
SetButtonPrev($a_cmd=0, $a_lng=0)
set previous navigation button
showHotfixSteps()
Show hotfix steps.
Class ilSetupPasswordManager.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
cmdAdmin()
process valid commands for admins
changeAccessMode($a_back)
enable/disable access to a client
displayProxy($a_omit_init=false)
displayDeleteConfirmation()
display delete client confirmation form and process form input
static initDomEvent(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent.
static getAvailableTypes($with_descriptions=true)
initControlStructureForm()
Init the form to reload the control structure.
displayProcessPanel()
display process panel
displayContactData($a_omit_init=false)
display contact data form and process form input
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
performMLogin()
Master Login.
cmdClient()
process valid commands for all clients
displaySubTabs()
Show subtabs.
updateDatabase()
Update database.
initMasterLoginForm()
Init master login form.
saveClientIni()
Save client ini form.
initClientOverviewForm()
Init client overview form.
getBasicSettingsValues()
Get current values for basic settings from.
loginClient()
login to a client
reloadControlStructure()
reload control structure
This class represents a non editable value in a property form.
saveRegistration()
Save registration form.
displayStartup()
display intro page for the first client installation
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static init(ilGlobalTemplateInterface $a_tpl=null)
Init.
displayStatusPanel()
display status panel
cloneInitForm()
Initialize clone form.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
cmdInstall()
process valid commands for pre-installation status
displayNavButtons()
display navigation buttons
displayNIC($a_omit_init=false)
display nic registration form and process form input
const SESSION_HANDLING_LOAD_DEPENDENT
setDbSubtabs($a_subtab_id="db")
Set db subtabs.
displayClientList()
display client list and process form input
SetButtonNext($a_cmd, $a_lng=0)
set next navigation button
static getInstallableTypes()
createBackgroundTasksForm()
static redirect($a_script)
initClientIniForm()
Init client ini form.
initClientDbForm($a_install=true, $dbupdate=null, $db_status=false, $hotfix_available=false, $custom_updates_available=false)
Init client db form.
changeSettingsType()
change the type of the value field in settings table
saveDbSlave()
Save db slave form.
getContactValues()
Get current values for contact from.
selectDBType()
Select database type.
validateSetup()
validatesetup status again and set access mode of the first client to online
initRegistrationForm($a_mode="edit")
Init registration form.
const UI_PASSWORD_PLACEHOLDER
applyUpdate($a_break=0)
Apply update.
static getAvailableCoreModules()
Get all available core modules.
Class ilSetupPasswordManager.
displayLogin($a_omit_minit=false, $a_omit_cinit=false)
display login form and process form