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");
57 $this->revision =
'$Revision: 49592 $';
58 $this->version =
"2 ".substr(substr($this->revision,1),0,-2);
59 $this->lang = $this->lng->lang_key;
66 if (
$_POST[
"client_id"] !=
"")
86 $this->setup->ini_client_exists = $this->setup->newClient(
$client_id);
87 if (is_object($this->setup->getClient()))
89 $this->setup->getClient()->status = $this->setup->getStatus(
$client_id);
93 if (($this->cmd =
$_GET[
"cmd"]) ==
"gateway")
96 @$this->cmd = key(
$_POST[
"cmd"]);
102 if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status[
"finish"][
"status"] and $this->cmd !=
"clientlist" and $this->cmd !=
"")
115 if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled())
118 if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable(
"clients",
"path")))
124 if ($this->cmd ==
"performLogin" || $this->cmd ==
"performMLogin")
137 if ($this->setup->isAdmin())
152 echo
"cmd: ".$this->cmd.
" | access: ".$this->setup->access_mode.
" | display: ".
$this->display_mode;
153 var_dump($this->setup->getClient()->status);
174 case "preliminaries":
175 $this->setup->checkPreliminaries();
183 case "determineToolsPathInstall":
187 case "saveBasicSettings":
192 $this->
displayError($this->lng->txt(
"unknown_command"));
210 $this->active_tab =
"clientlist";
213 case "changepassword":
216 $this->active_tab =
"password";
219 case "mastersettings":
222 $this->active_tab =
"basicsettings";
225 case "determineToolsPath":
230 case "changedefault":
235 $this->cmd =
"selectdb";
237 $this->setup->ini_client_exists = $this->setup->newClient();
251 $this->setup->ini_client_exists = $this->setup->newClient();
265 case "preliminaries":
266 $this->setup->checkPreliminaries();
268 $this->active_tab =
"preliminaries";
271 case "updateBasicSettings":
273 case "performMLogin":
293 if ($this->setup->getClient()->db_installed)
327 if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"sess" and $this->setup->error ===
true)
338 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"lang" and $this->setup->error ===
true)
349 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"contact")
360 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"proxy")
371 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic")
382 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish")
402 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
406 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1")
408 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
409 $this->setup->getClient()->ini->write();
413 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
420 case "reloadStructure":
428 case "saveClientIni":
429 case "installDatabase":
430 case "displayDatabase":
431 case "updateDatabase":
432 case "showUpdateSteps":
433 case "saveLanguages":
435 case "displayContactData":
437 case "saveRegistration":
439 case "showHotfixSteps":
440 case "applyCustomUpdates":
441 case "changeSettingsType":
442 case "showLongerSettings":
443 case "cloneSelectSource":
444 case "cloneSaveSource":
451 $this->
displayError($this->lng->txt(
"unknown_command"));
473 if ($a_mode !=
"view" and $a_mode !=
"setup")
478 $this->display_mode = $a_mode;
489 $languages = $this->lng->getLanguages();
491 $count = (int) round(count($languages) / 2);
494 foreach ($languages as $lang_key)
498 $this->tpl->touchBlock(
"lng_new_row");
501 $this->tpl->setCurrentBlock(
"languages");
502 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
503 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
504 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
505 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
506 $this->tpl->setVariable(
"BORDER", 0);
507 $this->tpl->setVariable(
"VSPACE", 0);
508 $this->tpl->parseCurrentBlock();
513 if (count($languages) % 2)
515 $this->tpl->touchBlock(
"lng_empty_cell");
518 if ($this->cmd !=
"logout" and $this->setup->isInstalled())
521 if ($this->setup->isAdmin())
523 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
525 $this->tpl->setCurrentBlock(
"add_client");
526 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
527 $this->tpl->parseCurrentBlock();
531 $class = ($this->active_tab ==
"clientlist")
534 $this->tpl->setCurrentBlock(
"display_list");
535 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
536 $this->tpl->setVariable(
"TAB_CLASS", $class);
537 $this->tpl->parseCurrentBlock();
540 $class = ($this->active_tab ==
"basicsettings")
543 $this->tpl->setCurrentBlock(
"edit_pathes");
544 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
545 $this->tpl->setVariable(
"TAB_CLASS", $class);
546 $this->tpl->parseCurrentBlock();
549 $class = ($this->active_tab ==
"preliminaries")
552 $this->tpl->setCurrentBlock(
"preliminaries");
553 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
554 $this->tpl->setVariable(
"TAB_CLASS", $class);
555 $this->tpl->parseCurrentBlock();
558 $class = ($this->active_tab ==
"password")
561 $this->tpl->setCurrentBlock(
"change_password");
562 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
563 $this->tpl->setVariable(
"TAB_CLASS", $class);
564 $this->tpl->parseCurrentBlock();
568 if ($this->setup->isAuthenticated())
570 $this->tpl->setCurrentBlock(
"logout");
571 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
572 $this->tpl->parseCurrentBlock();
576 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
577 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
578 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
579 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
581 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
582 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
583 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
584 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
585 $this->tpl->setVariable(
"VERSION", $this->version);
586 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
587 $this->tpl->setVariable(
"LANG", $this->lang);
596 if ($this->cmd !=
"logout")
598 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
600 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
602 elseif ($this->setup->isAdmin())
604 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
620 if (!$this->btn_prev_on and !$this->btn_next_on)
625 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
628 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
630 if ($this->btn_prev_on)
632 $ntpl->setCurrentBlock(
"btn_back");
633 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
634 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
635 $ntpl->parseCurrentBlock();
638 if ($this->btn_next_on)
640 $ntpl->setCurrentBlock(
"btn_forward");
641 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
642 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
643 $ntpl->parseCurrentBlock();
646 $nav_html = $ntpl->get();
647 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
648 if (!$this->no_second_nav)
650 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
663 $this->btn_prev_on =
true;
664 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
665 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
676 $this->btn_next_on =
true;
677 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
678 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
693 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
694 $btpl->setCurrentBlock(
"btn");
695 $btpl->setVariable(
"CMD",
"changeaccess");
696 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
697 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
698 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
699 $btpl->parseCurrentBlock();
700 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
703 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
715 $settings = $this->setup->getClient()->getAllSettings();
717 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
720 $this->form->setTitle($lng->txt(
"client_info"));
724 $ne->
setValue(($this->setup->getClient()->getName())
725 ? $this->setup->getClient()->getName()
726 :
"<".$this->lng->txt(
"no_client_name").
">");
727 $ne->setInfo($this->setup->getClient()->getDescription());
728 $this->form->addItem($ne);
732 $ne->
setValue($this->setup->getClient()->getId());
733 $this->form->addItem($ne);
737 $ne->
setValue(($this->setup->getClient()->db_installed)
738 ? $settings[
"inst_id"]
740 $this->form->addItem($ne);
744 $ne->
setValue(($this->setup->getClient()->db_installed)
745 ? $settings[
"db_version"]
747 $this->form->addItem($ne);
752 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
753 $ne->
setValue($this->lng->txt($access_status).$access_link);
754 $this->form->addItem($ne);
758 $sh->setTitle($this->lng->txt(
"server_info"));
759 $this->form->addItem($sh);
764 $this->form->addItem($ne);
768 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
769 $this->form->addItem($ne);
774 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
775 $this->form->addItem($ne);
779 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
780 $this->form->addItem($ne);
785 $this->form->addItem($ne);
790 $this->form->addItem($ne);
794 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
795 $this->form->addItem($sh);
797 $tools = array(
"convert",
"zip",
"unzip",
"ghostscript",
"java",
"htmldoc",
"ffmpeg");
799 foreach ($tools as $tool)
803 $p = $this->setup->ini->readVariable(
"tools", $tool);
804 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
805 $this->form->addItem($ne);
810 $p = $this->setup->ini->readVariable(
"tools",
"latex");
811 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
812 $this->form->addItem($ne);
816 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
817 $this->form->addItem($ne);
821 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
822 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
823 $this->form->addItem($ne);
827 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
828 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
829 $this->form->addItem($ne);
831 $this->form->setFormAction(
"setup.php?cmd=gateway");
843 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
844 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
846 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
848 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
849 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
850 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
851 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
852 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
853 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
854 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
856 $server_os = php_uname();
857 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
858 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
860 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
862 $env_comment = $this->lng->txt(
"env_ok");
866 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
869 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
870 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
871 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
873 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
874 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
876 $preliminaries = array(
"php",
"root",
"folder_create",
877 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
878 foreach ($preliminaries as $preliminary)
880 $this->tpl->setCurrentBlock(
"preliminary");
881 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
882 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
884 $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)
897 if ($this->setup->isInstalled())
899 $cmd =
"mastersettings";
905 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
907 $this->setButtonNext(
$cmd,$btn_text);
911 $this->tpl->setCurrentBlock(
"premessage");
912 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
913 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
914 $this->tpl->parseCurrentBlock();
927 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
928 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
929 $this->tpl->setVariable(
"TXT_INFO",
930 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
932 $this->setButtonPrev(
"preliminaries");
934 if ($this->setup->isInstalled())
936 $this->setButtonNext(
"list");
943 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
951 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
952 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
953 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
955 $this->btn_next_on =
true;
956 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
957 $this->btn_next_cmd =
"newclient";
964 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
974 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
981 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
984 ? str_replace(
"\\",
"/", getcwd())
987 $ne->setValue($cwd.
"/data");
988 $this->form->addItem($ne);
993 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
994 $ti->
setInfo($lng->txt(
"data_directory_info"));
995 $ti->setRequired(
true);
996 $this->form->addItem($ti);
1001 $this->form->addItem($ne);
1011 $sh->setTitle($lng->txt(
"logging"));
1012 $this->form->addItem($sh);
1016 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
1017 $this->form->addItem($ti);
1021 $this->form->addItem($cb);
1025 $sh->setTitle($lng->txt(
"server_settings"));
1026 $this->form->addItem($sh);
1029 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
1031 $si->setOptions(array_merge(
1032 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
1034 $si->setRequired(
true);
1035 $this->form->addItem(
$si);
1039 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
1040 $this->form->addItem($sh);
1043 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1044 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
1045 $ti->setRequired(
true);
1046 $this->form->addItem($ti);
1050 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
1051 $ti->setRequired(
true);
1052 $this->form->addItem($ti);
1056 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1057 $ti->setRequired(
true);
1058 $this->form->addItem($ti);
1062 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1063 $this->form->addItem($sh);
1066 $ti =
new ilTextInputGUI($lng->txt(
"ghostscript_path"),
"ghostscript_path");
1067 $ti->
setInfo($lng->txt(
"ghostscript_path_comment".$lvext));
1068 $this->form->addItem($ti);
1072 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1073 $this->form->addItem($ti);
1076 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1077 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1078 $this->form->addItem($ti);
1081 $ti =
new ilTextInputGUI($lng->txt(
"ffmpeg_path"),
"ffmpeg_path");
1082 $ti->
setInfo($lng->txt(
"ffmpeg_path_comment"));
1083 $this->form->addItem($ti);
1086 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1087 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1088 $this->form->addItem($ti);
1092 "none" => $lng->txt(
"none"),
1093 "sophos" => $lng->txt(
"sophos"),
1094 "antivir" => $lng->txt(
"antivir"),
1095 "clamav" => $lng->txt(
"clamav")
1099 $this->form->addItem($si);
1102 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1103 $this->form->addItem($ti);
1106 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1107 $this->form->addItem($ti);
1112 $sh->setTitle($lng->txt(
"master_password"));
1113 $this->form->addItem($sh);
1118 $pi->setSkipSyntaxCheck(
true);
1119 $pi->setInfo($lng->txt(
"password_info"));
1120 $this->form->addItem($pi);
1125 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1129 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1130 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1133 $this->form->setTitle($lng->txt(
"data_directories"));
1134 $this->form->setFormAction(
"setup.php?cmd=gateway");
1139 $this->form->setValuesByArray($det);
1151 $values[
"webspace_dir"] = getcwd().
"/data";
1152 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1153 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1154 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1155 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1156 $values[
"ghostscript_path"] = $this->setup->ini->readVariable(
"tools",
"ghostscript");
1157 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1158 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1160 $values[
"ffmpeg_path"] = $this->setup->ini->readVariable(
"tools",
"ffmpeg");
1161 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1162 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1163 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1164 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1165 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1166 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1167 $this->setup->ini->readVariable(
"log",
"file");
1168 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1169 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1171 $this->form->setValuesByArray($values);
1183 if ($this->form->checkInput())
1188 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1189 "unzip_path",
"ghostscript_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1198 if (!$this->setup->checkDataDirSetup(
$_POST))
1200 $i = $this->form->getItemByPostVar(
"datadir_path");
1201 $i->setAlert($this->lng->txt($this->setup->getError()));
1204 else if (!$this->setup->checkLogSetup(
$_POST))
1206 $i = $this->form->getItemByPostVar(
"log_path");
1207 $i->setAlert($this->lng->txt($this->setup->getError()));
1210 else if (!$this->setup->checkPasswordSetup(
$_POST))
1214 else if (!$this->setup->saveMasterSetup(
$_POST))
1225 $this->form->setValuesByPost();
1238 if ($this->form->checkInput())
1242 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1243 "unzip_path",
"ghostscript_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1250 if (!$this->setup->checkLogSetup(
$_POST))
1252 $i = $this->form->getItemByPostVar(
"log_path");
1253 $i->setAlert($this->lng->txt($this->setup->getError()));
1256 else if (!$this->setup->updateMasterSettings(
$_POST))
1267 $this->form->setValuesByPost();
1282 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1292 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1296 $m_form = $this->form->getHTML();
1302 $cl_form = $this->form->getHTML();
1306 $m_form = $this->form->getHTML();
1308 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1309 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1318 if ($this->form->checkInput())
1320 $i = $this->form->getItemByPostVar(
"mpassword");
1321 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1323 $i->setAlert($this->lng->txt(
"login_invalid"));
1333 $this->form->setValuesByPost();
1343 if ($this->form->checkInput())
1345 $i = $this->form->getItemByPostVar(
"password");
1346 if (!$this->setup->loginAsClient(
1347 array(
"client_id" =>
$_POST[
"client_id"],
1348 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1350 $i->setAlert($this->setup->getError());
1360 $this->form->setValuesByPost();
1371 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1378 $this->form->addItem($ti);
1383 $this->form->addItem($ti);
1388 $pi->setRetype(
false);
1389 $pi->setSkipSyntaxCheck(
true);
1390 $this->form->addItem($pi);
1392 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1394 $this->form->setTitle($lng->txt(
"client_login"));
1395 $this->form->setFormAction(
"setup.php?cmd=gateway");
1405 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1411 $pi->setRetype(
false);
1412 $pi->setSkipSyntaxCheck(
true);
1413 $this->form->addItem($pi);
1415 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1417 $this->form->setTitle($lng->txt(
"admin_login"));
1418 $this->form->setFormAction(
"setup.php?cmd=gateway");
1433 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1434 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1438 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1439 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1440 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1442 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1444 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1447 $this->btn_next_on =
true;
1448 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1449 $this->btn_next_cmd =
"newclient";
1475 ? str_replace(
"\\",
"/", getcwd())
1479 $tools = array(
"convert" =>
"convert",
1480 "zip" =>
"zip",
"unzip" =>
"unzip",
"ghostscript" =>
"gs",
1481 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"ffmpeg" =>
"ffmpeg");
1482 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1486 $tools = array(
"convert" =>
"convert.exe",
1487 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1488 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1489 $cwd.
"/Services/Windows/bin32/unzip",
1490 $cwd.
"/Services/Windows/bin32/convert");
1492 foreach($tools as $k => $tool)
1496 @exec(
"which ".$tool,
$ret);
1497 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1499 $a_tools[$k.
"_path"] =
$ret[0];
1504 foreach(
$dirs as $dir)
1506 if (@is_file($dir.
"/".$tool))
1508 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1533 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1539 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1541 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1542 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1544 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1545 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1547 if ($this->setup->getClient()->status[
"ini"][
"status"])
1549 $this->setButtonNext(
"db");
1562 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1567 "mysql" =>
"MySQL 5.0.x or higher (MyISAM engine)",
1568 "innodb" =>
"MySQL 5.0.x or higher (InnoDB engine)",
1569 "oracle" =>
"Oracle 10g or higher",
1570 "postgres" =>
"Postgres (experimental)"
1574 $si->setInfo($lng->txt(
""));
1575 $this->form->addItem(
$si);
1577 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1579 $this->form->setTitle($lng->txt(
"db_selection"));
1580 $this->form->setFormAction(
"setup.php?cmd=gateway");
1594 if (
$_POST[
"db_type"] !=
"")
1603 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1604 if (!$a_omit_form_init)
1609 $this->tpl->setVariable(
"SETUP_CONTENT",
1610 $this->form->getHTML());
1612 if ($this->setup->getClient()->status[
"ini"][
"status"])
1614 $this->setButtonNext(
"db");
1627 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1631 if ($this->setup->ini_client_exists)
1634 $hi->setValue($this->client_id);
1635 $this->form->addItem($hi);
1639 $this->form->addItem($ne);
1645 $ti->setRequired(
true);
1646 $this->form->addItem($ti);
1651 $sh->setTitle($lng->txt(
"db_conn"));
1652 $this->form->addItem($sh);
1656 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1657 $this->form->addItem($ne);
1662 $ti->setRequired(
true);
1663 $this->form->addItem($ti);
1666 if (in_array(
$_SESSION[
"db_type"], array(
"mysql",
"postgres",
"innodb")))
1673 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1676 $this->form->addItem($ti);
1681 $ti->setRequired(
true);
1682 $this->form->addItem($ti);
1687 $this->form->addItem($ti);
1692 $this->form->addItem($ti);
1694 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1696 $this->form->setTitle($lng->txt(
"inst_identification"));
1697 $this->form->setFormAction(
"setup.php?cmd=gateway");
1707 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1708 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1709 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1710 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1711 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1712 $values[
"client_id"] = $this->setup->getClient()->getId();
1714 $this->form->setValuesByArray($values);
1725 if ($this->form->checkInput())
1727 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"])))
1728 || is_int(strpos(
$_POST[
"client_id"],
"_")))
1730 $i = $this->form->getItemByPostVar(
"client_id");
1731 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1734 else if (strlen(
$_POST[
"client_id"]) < 4)
1736 $i = $this->form->getItemByPostVar(
"client_id");
1737 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1740 else if (strlen(
$_POST[
"client_id"]) > 32)
1742 $i = $this->form->getItemByPostVar(
"client_id");
1743 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1748 $i = $this->form->getItemByPostVar(
"client_id");
1749 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1756 $old_db_name = $this->setup->getClient()->getDbName();
1757 $old_db_type = $this->setup->getClient()->getDbType();
1758 $old_client_id = $this->setup->getClient()->getId();
1761 if (!$this->setup->ini_client_exists)
1768 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1769 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1770 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1771 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1772 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1773 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1774 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1775 $this->setup->getClient()->setDSN();
1778 if (!$this->setup->getClient()->checkDatabaseHost())
1780 $i = $this->form->getItemByPostVar(
"db_host");
1781 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1787 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1789 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1791 $_POST[
"db_name"] = $old_db_name;
1792 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1793 $i = $this->form->getItemByPostVar(
"db_name");
1794 $i->setAlert($message);
1800 if (!$this->setup->ini_client_exists)
1802 if ($this->setup->saveNewClient())
1805 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1811 $err = $this->setup->getError();
1813 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1814 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1819 if ($this->setup->getClient()->ini->write())
1822 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1827 $err = $this->setup->getClient()->ini->getError();
1829 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1830 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1838 $this->form->setValuesByPost();
1849 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1851 $this->tpl->setCurrentBlock(
"content");
1852 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1853 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1854 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1855 $this->tpl->parseCurrentBlock();
1866 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1870 $this->logged_out =
true;
1871 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1872 $this->tpl->setCurrentBlock(
"home_link");
1873 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1874 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1875 $this->tpl->parseCurrentBlock();
1883 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1886 $steps = $this->setup->getStatus();
1891 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1892 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1894 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1895 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1896 $steps[
"proxy"][
"text"] = $this->lng->txt(
"setup_process_step_proxy");
1897 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1898 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1900 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1904 foreach (
$steps as $key => $val)
1906 $stpl->setCurrentBlock(
"menu_row");
1907 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1908 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1909 $stpl->setVariable(
"IMG_ARROW",
"spacer.png");
1913 if ($this->cmd == $key and isset($this->cmd))
1915 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1916 $stpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1919 $status = ($val[
"status"]) ? $OK :
"";
1921 $stpl->setVariable(
"TXT_STATUS",$status);
1922 $stpl->parseCurrentBlock();
1925 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1927 $this->tpl->setVariable(
"PROCESS_MENU", $stpl->get());
1935 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1937 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html",
"setup");
1939 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1941 if ($this->setup->getClient()->status)
1943 foreach ($this->setup->getClient()->status as $key => $val)
1945 $status = ($val[
"status"]) ? $OK :
" ";
1946 $this->tpl->setCurrentBlock(
"status_row");
1947 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1948 $this->tpl->setVariable(
"TXT_STATUS",$status);
1951 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1952 $this->tpl->parseCurrentBlock();
1964 switch ($this->display_mode)
1967 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1969 include
"./setup/include/inc.client_tabs.php";
1970 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1971 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
1975 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1976 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1980 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1994 $sub_tab_html = $this->tabs->getSubTabHTML();
1995 if ($sub_tab_html !=
"")
1997 $this->tpl->setVariable(
"SUBTABS", $sub_tab_html);
2008 switch ($this->display_mode)
2025 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
2027 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
2028 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
2032 $this->setButtonNext(
"ini");
2051 if ($this->setup->getClient()->db_installed)
2053 $this->setDbSubTabs(
"db");
2055 $ilDB = $this->setup->getClient()->db;
2056 $this->lng->setDbHandler($ilDB);
2057 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2059 $db_status = $dbupdate->getDBVersionStatus();
2060 $hotfix_available = $dbupdate->hotfixAvailable();
2061 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2062 $this->
initClientDbForm(
false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2064 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2068 $this->setButtonNext(
"lang");
2073 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
2074 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
2075 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
2079 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2080 $this->setButtonPrev(
"ini");
2100 if (!$this->setup->getClient()->db_installed)
2105 $this->setDbSubTabs(
"repl");
2109 $ilDB = $this->setup->getClient()->db;
2110 $this->lng->setDbHandler($ilDB);
2120 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2134 $client = $this->setup->getClient();
2136 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2141 $ne->
setValue($lng->txt(
"db_".$ilDB->getDbType()));
2142 $this->form->addItem($ne);
2147 $this->form->addItem($act);
2152 $ti->setMaxLength(120);
2153 $ti->setRequired(
true);
2154 $act->addSubItem($ti);
2159 $ti->setRequired(
true);
2160 $ti->setMaxLength(40);
2161 $act->addSubItem($ti);
2166 $ti->setMaxLength(40);
2167 $ti->setRequired(
true);
2168 $act->addSubItem($ti);
2173 $ti->setMaxLength(8);
2174 $act->addSubItem($ti);
2177 $set_pw =
new ilCheckboxInputGUI($this->lng->txt(
"db_set_password"),
"set_slave_password");
2183 $set_pw->addSubItem($ti);
2185 $this->form->addCommandButton(
"saveDbSlave", $lng->txt(
"save"));
2187 $this->form->setTitle($lng->txt(
"db_slave_settings"));
2188 $this->form->setFormAction(
"setup.php?cmd=gateway");
2198 $client = $this->setup->getClient();
2200 $ilDB = $this->setup->getClient()->db;
2201 $this->lng->setDbHandler($ilDB);
2204 if ($this->form->checkInput())
2206 $client->setDbSlaveActive($this->form->getInput(
"slave_active"));
2207 if ($this->form->getInput(
"slave_active"))
2209 $client->setDbSlaveHost($this->form->getInput(
"slave_host"));
2210 $client->setDbSlaveUser($this->form->getInput(
"slave_user"));
2211 $client->setDbSlavePort($this->form->getInput(
"slave_port"));
2212 $client->setDbSlaveName($this->form->getInput(
"slave_name"));
2213 if ($this->form->getInput(
"set_slave_password"))
2215 $client->setDbSlavePass($this->form->getInput(
"slave_pass"));
2225 $this->form->setValuesByPost();
2241 if ($ilDB->getDbType() ==
"mysql")
2243 $this->tabs->addSubTab(
"db", $this->lng->txt(
"db_master"),
"setup.php?client_id=".$this->client_id.
"&cmd=db");
2244 $this->tabs->addSubTab(
"repl", $this->lng->txt(
"db_slave"),
"setup.php?client_id=".$this->client_id.
"&cmd=dbslave");
2247 $this->tabs->activateSubTab($a_subtab_id);
2255 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false, $custom_updates_available =
false)
2259 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2264 $this->form->addItem($ne);
2267 if ($this->setup->getClient()->getDBType() ==
"mysql" ||
2268 $this->setup->getClient()->getDBType() ==
"innodb")
2271 $ilDB = $this->setup->getClient()->db;
2272 $ne->
setValue($ilDB->getDBVersion());
2273 $this->form->addItem($ne);
2278 $this->form->addItem($ne);
2282 $this->form->addItem($ne);
2286 $this->form->addItem($ne);
2290 $this->form->addItem($ne);
2293 if (($this->setup->getClient()->getDBType() ==
"mysql" ||
2294 $this->setup->getClient()->getDBType() ==
"innodb") && $a_install)
2307 "utf8_icelandic_ci",
2309 "utf8_lithuanian_ci",
2315 "utf8_slovenian_ci",
2321 foreach($collations as $collation)
2327 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2328 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2329 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2330 $cb->addSubItem(
$si);
2332 $this->form->addItem($cb);
2337 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2341 $ilDB = $this->setup->getClient()->db;
2342 $this->lng->setDbHandler($ilDB);
2347 $ne->
setValue($dbupdate->currentVersion);
2348 $this->form->addItem($ne);
2352 $ne->
setValue($dbupdate->fileVersion);
2353 $this->form->addItem($ne);
2355 if (!$db_status = $dbupdate->getDBVersionStatus())
2359 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2367 $si->setInfo($lng->txt(
"next_update_break_info"));
2368 $this->form->addItem(
$si);
2371 if ($dbupdate->getRunningStatus() > 0)
2374 $this->lng->txt(
"db_update_interrupted_avoid"));
2380 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2381 $this->form->addCommandButton(
"showUpdateSteps", $lng->txt(
"show_update_steps"));
2383 else if ($hotfix_available)
2387 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2388 $this->form->addItem($ne);
2392 $ne->
setValue($dbupdate->getHotfixFileVersion());
2393 $this->form->addItem($ne);
2395 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2396 $this->form->addCommandButton(
"showHotfixSteps", $lng->txt(
"show_update_steps"));
2399 elseif($custom_updates_available)
2403 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2404 $this->form->addItem($ne);
2408 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2409 $this->form->addItem($ne);
2411 $this->form->addCommandButton(
"applyCustomUpdates", $lng->txt(
"apply_custom_updates"));
2416 if ($dbupdate->getHotfixFileVersion() > 0)
2420 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2421 $this->form->addItem($ne);
2425 $ne->
setValue($dbupdate->getHotfixFileVersion());
2426 $this->form->addItem($ne);
2428 if ($dbupdate->getCustomUpdatesFileVersion() > 0)
2432 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2433 $this->form->addItem($ne);
2437 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2438 $this->form->addItem($ne);
2444 $this->form->setTitle($lng->txt(
"database"));
2445 $this->form->setFormAction(
"setup.php?cmd=gateway");
2458 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2459 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2460 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2461 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2462 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2463 if (is_object($dbupdate))
2465 $values[
"update_break"] = $dbupdate->fileVersion;
2466 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2468 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2469 ($dbupdate->currentVersion % 100);
2473 $this->form->setValuesByArray($values);
2488 if (!$this->setup->getClient()->db_exists)
2490 if (
$_POST[
"chk_db_create"])
2492 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2504 if (!$this->setup->installDatabase())
2526 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2528 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2529 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2530 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2531 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2532 include_once
"./Services/Tree/classes/class.ilTree.php";
2533 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2534 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2537 $tz = $this->setup->ini->readVariable(
"server",
"timezone");
2540 if (function_exists(
'date_default_timezone_set'))
2542 date_default_timezone_set($tz);
2544 define (
"IL_TIMEZONE", $tz);
2548 $ilDB = $this->setup->getClient()->db;
2549 $this->lng->setDbHandler($ilDB);
2553 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2555 if ($dbupdate->updateMsg ==
"no_changes")
2557 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2562 foreach ($dbupdate->updateMsg as
$row)
2564 if ($row[
"msg"] ==
"update_applied")
2566 $a_message.= $sep.$row[
"nr"];
2571 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2574 if ($a_message !=
"")
2576 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2612 if ($this->setup->getClient()->db_installed)
2614 $ilDB = $this->setup->getClient()->db;
2615 $this->lng->setDbHandler($ilDB);
2617 $db_status = $dbupdate->getDBVersionStatus();
2618 $hotfix_available = $dbupdate->hotfixAvailable();
2619 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2623 $ntpl =
new ilTemplate(
"tpl.setup_steps.html",
true,
true,
"setup");
2626 $ntpl->setVariable(
"CONTENT", $dbupdate->getHotfixSteps());
2630 $ntpl->setVariable(
"CONTENT", $dbupdate->getUpdateSteps(
$_POST[
"update_break"]));
2632 $ntpl->setVariable(
"BACK", $this->lng->txt(
"back"));
2633 $ntpl->setVariable(
"HREF_BACK",
"./setup.php?client_id=&cmd=db");
2634 $this->tpl->setVariable(
"SETUP_CONTENT", $ntpl->get());
2650 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2652 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2653 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2654 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2655 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2656 include_once
"./Services/Tree/classes/class.ilTree.php";
2657 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2658 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2661 $ilDB = $this->setup->getClient()->db;
2662 $this->lng->setDbHandler($ilDB);
2666 $dbupdate->applyHotfix();
2668 if ($dbupdate->updateMsg ==
"no_changes")
2670 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2675 foreach ($dbupdate->updateMsg as
$row)
2677 if ($row[
"msg"] ==
"update_applied")
2679 $a_message.= $sep.$row[
"nr"];
2684 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2687 if ($a_message !=
"")
2689 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2706 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2710 if (!$this->setup->getClient()->db_installed)
2713 $message =
"No database found! Please install database first.";
2720 $settings = array();
2722 foreach( $setting_fields as $field )
2724 if( $field ==
'session_allow_client_maintenance' )
2727 else $_POST[$field] =
'0';
2732 $settings[$field] =
$_POST[$field];
2742 if(
$valid) $this->setup->setSessionSettings($settings);
2744 $settings = $this->setup->getSessionSettings();
2746 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2749 include_once
'Services/Authentication/classes/class.ilSession.php';
2760 $ssettings->addOption($fixed);
2767 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2768 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2769 $ti->setMaxLength(5);
2771 $ti->
setValue($settings[
'session_max_count']);
2772 $ldsh->addSubItem($ti);
2777 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2778 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2779 $ti->setMaxLength(5);
2781 $ti->
setValue($settings[
'session_min_idle']);
2782 $ldsh->addSubItem($ti);
2787 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2788 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2789 $ti->setMaxLength(5);
2791 $ti->
setValue($settings[
'session_max_idle']);
2792 $ldsh->addSubItem($ti);
2796 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2797 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2798 $ti->setMaxLength(5);
2800 $ti->
setValue($settings[
'session_max_idle_after_first_request']);
2801 $ldsh->addSubItem($ti);
2804 $ssettings->addOption($ldsh);
2806 $form->addItem($ssettings);
2810 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2811 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2812 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2813 $form->addItem($chkb);
2817 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2819 $form->setTitle($this->lng->txt(
"sess_sessions"));
2820 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2822 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2823 $this->tpl->setVariable(
"TXT_INFO",
'');
2824 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2847 if (!$this->setup->getClient()->db_installed)
2850 $message =
"No database found! Please install database first.";
2854 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2856 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2858 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2859 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2861 $installed_langs = $this->lng->getInstalledLanguages();
2862 $lang_count = count($installed_langs);
2863 if ($lang_count > 0)
2865 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2866 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2870 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2871 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2874 $this->setButtonPrev(
"lang");
2876 if ($lang_count > 0)
2878 $this->setButtonNext(
"contact");
2892 if (empty(
$_POST[
"form"][
"lang_id"]))
2898 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2904 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2911 foreach (
$result as $key => $lang_key)
2913 $list .= $this->lng->txt(
"lang_".$lang_key);
2915 if ($count > $key + 1)
2922 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2923 $message = $this->lng->txt(
"languages_installed");
2927 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2943 $settings = $this->setup->getClient()->getAllSettings();
2950 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2951 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2952 $this->setButtonPrev(
"lang");
2954 $check = $this->setup->checkClientContact($this->setup->client);
2956 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2957 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2959 if ($check[
"status"])
2961 $this->setButtonNext(
"proxy");
2976 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2983 $ti->setRequired(
true);
2984 $this->form->addItem($ti);
2990 $this->form->addItem($ti);
2993 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2996 $this->form->addItem($ti);
3000 $sh->setTitle($lng->txt(
"contact_data"));
3001 $this->form->addItem($sh);
3004 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
3007 $ti->setRequired(
true);
3008 $this->form->addItem($ti);
3011 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
3014 $ti->setRequired(
true);
3015 $this->form->addItem($ti);
3018 "title" => array(
"max" => 64,
"size" => 30),
3019 "position" => array(
"max" => 64,
"size" => 30),
3020 "institution" => array(
"max" => 200,
"size" => 30),
3021 "street" => array(
"max" => 64,
"size" => 30),
3022 "zipcode" => array(
"max" => 10,
"size" => 5),
3023 "city" => array(
"max" => 64,
"size" => 30),
3024 "country" => array(
"max" => 64,
"size" => 30),
3025 "phone" => array(
"max" => 64,
"size" => 30)
3027 foreach ($fs as $f => $op)
3032 $ti->setSize($op[
"size"]);
3033 $ti->setInfo($lng->txt(
""));
3034 $this->form->addItem($ti);
3038 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
3039 $ti->setRequired(
true);
3040 $this->form->addItem($ti);
3043 $ti =
new ilEmailInputGUI($lng->txt(
"feedback_recipient"),
"feedback_recipient");
3044 $ti->setInfo($lng->txt(
"feedback_recipient_info"));
3045 $ti->setRequired(
true);
3046 $this->form->addItem($ti);
3049 $ti =
new ilEmailInputGUI($lng->txt(
"error_recipient"),
"error_recipient");
3050 $this->form->addItem($ti);
3052 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
3054 $this->form->setTitle($lng->txt(
"client_data"));
3055 $this->form->setFormAction(
"setup.php?cmd=gateway");
3064 $settings = $this->setup->getClient()->getAllSettings();
3066 $values = $settings;
3068 $values[
"inst_name"] = ($this->setup->getClient()->getName())
3069 ? $this->setup->getClient()->getName()
3070 : $this->setup->getClient()->getId();
3071 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
3073 $this->form->setValuesByArray($values);
3084 if ($this->form->checkInput())
3086 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
3087 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
3088 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
3089 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
3090 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
3091 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
3092 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
3093 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
3094 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
3095 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
3096 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
3097 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
3098 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
3099 $this->setup->getClient()->setSetting(
"feedback_recipient",
$_POST[
"feedback_recipient"]);
3100 $this->setup->getClient()->setSetting(
"error_recipient",
$_POST[
"error_recipient"]);
3103 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
3104 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
3105 $this->setup->getClient()->ini->write();
3111 $this->form->setValuesByPost();
3125 $settings = $this->setup->getClient()->getAllSettings();
3126 $nic_key = $this->setup->getClient()->getNICkey();
3129 $settings = $this->setup->getClient()->getAllSettings();
3131 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
3133 $this->no_second_nav =
true;
3134 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
3139 $settings = $this->setup->getClient()->getAllSettings();
3141 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
3147 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3149 if (isset($settings[
"nic_enabled"]))
3151 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3156 $this->setButtonPrev(
"proxy");
3158 if ($this->setup->getClient()->status[
"nic"][
"status"])
3160 $this->setButtonNext(
"finish",
"finish");
3175 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3182 $radg->addOption($op1);
3183 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
3184 $radg->addOption($op1);
3185 $this->form->addItem($radg);
3187 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
3188 $this->form->setFormAction(
"setup.php?cmd=gateway");
3196 $settings = $this->setup->getClient()->getAllSettings();
3197 $nic_key = $this->setup->getClient()->getNICkey();
3202 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
3204 $values[
"register"] = 1;
3212 $values[
"register"] = 0;
3215 $this->form->setValuesByArray($values);
3226 if ($this->form->checkInput())
3229 if (
$_POST[
"register"] == 1)
3232 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
3235 if (empty($this->setup->getClient()->nic_status[2]))
3237 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
3243 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
3244 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
3245 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3269 $this->setup->getClient()->setSetting(
"inst_id",
"0");
3270 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
3276 $this->form->setValuesByPost();
3299 $this->tpl->setVariable(
"SETUP_CONTENT",
3300 $ctrl_structure_form->getHTML() .
"<br />" .
3301 $settings_type_form->getHTML().
'<br />'.
3302 $mp_ns_form->getHTML());
3308 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3311 $form->setId(
'tree_impl');
3312 $form->setTitle($this->lng->txt(
'tree_implementation'));
3313 $form->setFormAction(
'setup.php?cmd=gateway');
3317 #$options->setRequired(true);
3320 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3325 $ns =
new ilRadioOption($this->lng->txt(
'tree_implementation_ns'),
'ns');
3328 $mp =
new ilRadioOption($this->lng->txt(
'tree_implementation_mp'),
'mp');
3332 $form->addCommandButton(
'switchTree', $this->lng->txt(
'tree_implementation_switch_btn'));
3333 $form->setShowTopButtons(
false);
3342 $type = ($set->get(
'main_tree_impl',
'ns') ==
'ns' ?
'ns' :
'mp');
3344 if($type ==
'ns' and
$_POST[
'tree_impl_type'] ==
'mp')
3347 include_once
'./Services/Tree/classes/class.ilMaterializedPathTree.php';
3350 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
3351 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
3352 $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'path'),
'i4');
3354 $set->set(
'main_tree_impl',
'mp');
3357 elseif($type ==
'mp' and
$_POST[
'tree_impl_type'] ==
'ns')
3359 include_once
'./Services/Tree/classes/class.ilTree.php';
3364 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'lft'));
3365 $GLOBALS[
'ilDB']->dropIndexByFields(
'tree',array(
'path'));
3366 $GLOBALS[
'ilDB']->addIndex(
'tree',array(
'lft'),
'i4');
3368 $set->set(
'main_tree_impl',
'ns');
3382 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3385 $form->setId(
"control_structure");
3386 $form->setTitle($this->lng->txt(
"ctrl_structure"));
3387 $form->setFormAction(
"setup.php?cmd=gateway");
3389 $ilDB = $this->setup->getClient()->db;
3390 $cset = $ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
3391 $crec = $ilDB->fetchAssoc($cset);
3394 if ($crec[
"cnt"] == 0)
3396 $item->
setInfo($this->lng->txt(
"ctrl_missing_desc"));
3400 $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
3402 $form->addItem($item);
3404 $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
3416 if (!$this->setup->getClient()->db_installed)
3424 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
3427 require_once
"./setup/classes/class.ilModuleReader.php";
3428 require_once
"./setup/classes/class.ilServiceReader.php";
3429 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
3431 require_once
"./Services/Component/classes/class.ilModule.php";
3432 require_once
"./Services/Component/classes/class.ilService.php";
3439 foreach($modules as $module)
3442 $module[
"subdir"],
"Modules");
3450 foreach($services as $service)
3453 $service[
"subdir"],
"Services");
3459 $ilCtrlStructureReader->readStructure(
true);
3471 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3474 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3477 $form->setId(
"settings_type");
3478 $form->setTitle($this->lng->txt(
"settings_type"));
3479 $form->setFormAction(
"setup.php?cmd=gateway");
3482 $item->
setValue(strtoupper($type));
3484 if ($type ==
"clob")
3486 $item->setInfo($this->lng->txt(
'settings_info_clob'));
3487 $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
3488 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
3492 $item->setInfo($this->lng->txt(
'settings_info_text'));
3493 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
3495 $form->addItem($item);
3497 if (is_array($this->longer_settings))
3501 if (count($this->longer_settings))
3503 foreach ($this->longer_settings as
$row)
3505 $subitem =
new ilCustomInputGUI(sprintf($this->lng->txt(
'settings_key_info'), $row[
'module'], $row[
'keyword']));
3506 $subitem->setInfo($row[
'value']);
3507 $item->addSubItem($subitem);
3512 $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
3514 $form->addItem($item);
3526 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3529 if ($old_type ==
"clob")
3532 if (count($longer_settings))
3534 $this->longer_settings = $longer_settings;
3562 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3572 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3574 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3579 $pass_old = $this->setup->getPassword();
3581 if (empty(
$_POST[
"form"][
"pass_old"]))
3583 $message = $this->lng->txt(
"password_enter_old");
3584 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3587 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3589 $message = $this->lng->txt(
"password_old_wrong");
3590 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3593 if (empty(
$_POST[
"form"][
"pass"]))
3595 $message = $this->lng->txt(
"password_empty");
3596 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3601 $message = $this->lng->txt(
"password_not_match");
3602 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3605 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3607 $message = $this->lng->txt(
"password_same");
3608 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3611 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3613 $message = $this->lng->txt(
"save_error");
3614 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3622 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3624 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3627 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3628 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3629 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3630 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3631 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3632 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3633 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3642 $this->no_second_nav =
true;
3646 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3647 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3648 $this->lng->txt(
"password").
": <b>homer</b></p>";
3649 $this->setButtonNext(
"login_new",
"login");
3651 $this->setup->getClient()->reconnect();
3654 $this->setup->getClient()->setSetting(
"setup_ok",1);
3657 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3662 $txt_info = $this->lng->txt(
"info_text_finish2");
3667 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3668 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3670 $this->setButtonPrev(
"nic");
3684 if (
$_POST[
"form"][
"delete"])
3710 $msg = $this->setup->getClient()->delete(
$ini,$db,$files);
3716 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3719 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3722 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3723 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3724 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3725 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3737 if ($this->setup->getClient()->status[
"finish"][
"status"])
3739 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3740 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3741 $this->setup->getClient()->ini->write();
3742 $message =
"client_access_mode_changed";
3746 $message =
"client_setup_not_finished";
3765 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3768 $status = $this->setup->getStatus(
$client);
3770 if ($status[
"finish"][
"status"])
3772 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3773 $this->setup->ini->write();
3774 $message =
"default_client_changed";
3778 $message =
"client_setup_not_finished";
3793 foreach ($this->setup->getClient()->status as $key => $val)
3795 if ($key !=
"finish" and $key !=
"access")
3797 if ($val[
"status"] !=
true)
3805 $clientlist =
new ilClientList($this->setup->db_connections);
3807 $list = $clientlist->getClients();
3809 if (count($list) == 1)
3811 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3812 $this->setup->ini->write();
3814 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3815 $this->setup->getClient()->ini->write();
3826 if (!$this->setup->getClient()->status[
"db"][
"status"])
3832 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3834 $this->cmd =
"lang";
3838 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3840 $this->cmd =
"contact";
3844 elseif(!$this->setup->getClient()->status[
'proxy'][
'status'])
3846 $this->cmd =
"proxy";
3850 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3856 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3858 $this->cmd =
"finish";
3873 if ($this->setup->ini->readVariable(
"clients",
"list"))
3875 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3876 $this->setup->ini->write();
3881 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3882 $this->setup->ini->write();
3897 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
3899 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
3900 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
3901 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
3902 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
3903 include_once
"./Services/Tree/classes/class.ilTree.php";
3904 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
3905 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
3908 $ilDB = $this->setup->getClient()->db;
3909 $this->lng->setDbHandler($ilDB);
3913 $dbupdate->applyCustomUpdates();
3915 if ($dbupdate->updateMsg ==
"no_changes")
3917 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
3922 foreach ($dbupdate->updateMsg as
$row)
3924 if ($row[
"msg"] ==
"update_applied")
3926 $a_message.= $sep.$row[
"nr"];
3931 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
3934 if ($a_message !=
"")
3936 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
3953 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3956 $this->form->setId(
"clone_form");
3957 $this->form->setFormAction(
"setup.php?cmd=gateway");
3959 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 )
3961 $this->form->setTitle($this->lng->txt(
"clone_source"));
3963 $clientlist =
new ilClientList($this->setup->db_connections);
3964 $list = $clientlist->getClients();
3965 $clientlistarray = array();
3967 foreach ($list as $key =>
$client){
3968 if ((strcmp($key, $this->setup->getClient()->getId()) !=
'0') && (
$client->getDbType() ==
'mysql')) {
3975 $si->setOptions(array_merge(
3976 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
3978 $si->setRequired(
true);
3979 $this->form->addItem(
$si);
3983 $this->form->addItem($cb);
3985 $this->form->addCommandButton(
"cloneSaveSource", $lng->txt(
"cloneit"));
3987 $disabledmessage =
"<h1>" . $this->lng->txt(
"clone_disabledmessage") .
"</h1><br>";
3988 if (!$this->setup->getClient()->status[
"access"][
"status"] ===
false) {
3989 $disabledmessage .= $this->lng->txt(
"clone_clientnotdisabled") .
"<br>";
3991 if (!stripos($this->setup->getClient()->getName(),
"aster") ===
false) {
3992 $disabledmessage .= $this->lng->txt(
"clone_clientismaster") .
"<br>";
3994 if ($this->setup->getClient()->getdbType() !=
"mysql") {
3995 $disabledmessage .= $this->lng->txt(
"clone_clientisnotmysql") .
"<br>";
3997 if (!$this->setup->getClient()->db_exists) {
3998 $disabledmessage .= $this->lng->txt(
"clone_clientnodatabase") .
"<br>";
4000 $this->form->setTitle($disabledmessage);
4006 if (!$this->setup->isAdmin())
4012 $this->form->setValuesByPost();
4013 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4014 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4021 if (!$this->setup->isAdmin())
4028 if ($this->form->checkInput())
4030 if ($this->form->getInput(
"iamsure") !=
"1")
4032 $message = $this->lng->txt(
"clone_youmustcheckiamsure");
4033 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
4035 if (!$this->setup->cloneFromSource($this->form->getInput(
"source")))
4037 $message = $this->lng->txt(
"clone_error");
4038 $this->setup->raiseError($message .
" -> " . $this->setup->error,$this->setup->error_obj->MESSAGE);
4044 $this->form->setValuesByPost();
4045 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
4046 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4052 $settings = $this->setup->getClient()->getAllSettings();
4056 include_once(
"./Services/Administration/classes/class.ilSetting.php");
4058 $this->form->setValuesByArray(array(
4059 'proxy_status' => (
bool)$settings[
'proxy_status'],
4060 'proxy_host' => $settings[
'proxy_host'],
4061 'proxy_port' => $settings[
'proxy_port']
4063 if((
bool)$settings[
'proxy_status'])
4065 $this->setup->printProxyStatus($this->setup->client);
4068 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
4069 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_proxy"));
4072 $check = $this->setup->checkClientProxySettings($this->setup->client);
4074 $this->setup->getClient()->status[
"proxy"][
"status"] = $check[
"status"];
4075 $this->setup->getClient()->status[
"proxy"][
"comment"] = $check[
"comment"];
4076 $this->setup->getClient()->status[
"proxy"][
"text"] = $check[
"comment"];
4078 if ($check[
"status"])
4080 $this->setButtonNext(
"nic");
4083 $this->setButtonPrev(
"contact");
4090 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
4092 $this->form->setFormAction(
"setup.php?cmd=gateway");
4096 $proxs->
setInfo($lng->txt(
'proxy_status_info'));
4097 $proxs->setValue(1);
4098 $this->form->addItem($proxs);
4102 $proxs->addSubItem($proxa);
4105 $prox =
new ilTextInputGUI($lng->txt(
'proxy_host'),
'proxy_host');
4106 $prox->
setInfo($lng->txt(
'proxy_host_info'));
4107 $proxs->addSubItem($prox);
4110 $proxp =
new ilTextInputGUI($lng->txt(
'proxy_port'),
'proxy_port');
4111 $proxp->
setInfo($lng->txt(
'proxy_port_info'));
4112 $proxp->setSize(10);
4113 $proxp->setMaxLength(10);
4114 $proxs->addSubItem($proxp);
4117 $this->form->addCommandButton(
'saveProxy', $lng->txt(
'save'));
4132 $isFormValid = $this->form->checkInput();
4134 $new_settings[
'proxy_status'] = (int)$this->form->getInput(
'proxy_status');
4135 $new_settings[
'proxy_host'] = trim($this->form->getInput(
'proxy_host'));
4136 $new_settings[
'proxy_port'] = trim($this->form->getInput(
'proxy_port'));
4140 if($new_settings[
'proxy_status'] ==
true)
4142 if(!strlen($new_settings[
'proxy_host']))
4144 $isFormValid =
false;
4145 $this->form->getItemByPostVar(
'proxy_host')->setAlert($lng->txt(
'msg_input_is_required'));
4147 if(!strlen($new_settings[
'proxy_port']))
4149 $isFormValid =
false;
4150 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'msg_input_is_required'));
4152 if(!preg_match(
'/[0-9]{1,}/', $new_settings[
'proxy_port']) ||
4153 $new_settings[
'proxy_port'] < 0 ||
4154 $new_settings[
'proxy_port'] > 65535)
4156 $isFormValid =
false;
4157 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'proxy_port_numeric'));
4163 $this->setup->saveProxySettings($new_settings);
4166 $settings = $this->setup->getClient()->getAllSettings();
4167 if($settings[
'proxy_status'] ==
true)
4169 $this->setup->printProxyStatus($this->setup->client);
4178 $this->form->setValuesByPost();
4179 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());