4 require_once
"./setup/classes/class.ilSetup.php";
47 $this->revision =
'$Revision: 36110 $';
48 $this->version =
"2 ".substr(substr($this->revision,1),0,-2);
49 $this->lang = $this->lng->lang_key;
56 if (
$_POST[
"client_id"] !=
"")
76 $this->setup->ini_client_exists = $this->setup->newClient(
$client_id);
77 $this->setup->getClient()->status = $this->setup->getStatus(
$client_id);
80 if (($this->cmd =
$_GET[
"cmd"]) ==
"gateway")
83 @$this->cmd = key(
$_POST[
"cmd"]);
89 if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status[
"finish"][
"status"] and $this->cmd !=
"clientlist" and $this->cmd !=
"")
102 if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled())
105 if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable(
"clients",
"path")))
111 if ($this->cmd ==
"performLogin" || $this->cmd ==
"performMLogin")
124 if ($this->setup->isAdmin())
139 echo
"cmd: ".$this->cmd.
" | access: ".$this->setup->access_mode.
" | display: ".
$this->display_mode;
140 var_dump($this->setup->getClient()->status);
161 case "preliminaries":
162 $this->setup->checkPreliminaries();
170 case "determineToolsPathInstall":
174 case "saveBasicSettings":
179 $this->
displayError($this->lng->txt(
"unknown_command"));
197 $this->active_tab =
"clientlist";
200 case "changepassword":
203 $this->active_tab =
"password";
206 case "mastersettings":
209 $this->active_tab =
"basicsettings";
212 case "determineToolsPath":
217 case "changedefault":
222 $this->cmd =
"selectdb";
224 $this->setup->ini_client_exists = $this->setup->newClient();
238 $this->setup->ini_client_exists = $this->setup->newClient();
252 case "preliminaries":
253 $this->setup->checkPreliminaries();
255 $this->active_tab =
"preliminaries";
258 case "updateBasicSettings":
260 case "performMLogin":
280 if ($this->setup->getClient()->db_installed)
310 if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"sess" and $this->setup->error ===
true)
321 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"lang" and $this->setup->error ===
true)
332 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"contact")
343 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic")
354 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish")
374 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
378 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1")
380 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
381 $this->setup->getClient()->ini->write();
385 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
392 case "reloadStructure":
396 case "saveClientIni":
397 case "installDatabase":
398 case "displayDatabase":
399 case "updateDatabase":
400 case "saveLanguages":
402 case "displayContactData":
404 case "saveRegistration":
410 $this->
displayError($this->lng->txt(
"unknown_command"));
432 if ($a_mode !=
"view" and $a_mode !=
"setup")
437 $this->display_mode = $a_mode;
448 $languages = $this->lng->getLanguages();
450 $count = (int) round(count($languages) / 2);
453 foreach ($languages as $lang_key)
457 $this->tpl->touchBlock(
"lng_new_row");
460 $this->tpl->setCurrentBlock(
"languages");
461 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
462 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
463 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
464 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
465 $this->tpl->setVariable(
"BORDER", 0);
466 $this->tpl->setVariable(
"VSPACE", 0);
467 $this->tpl->parseCurrentBlock();
472 if (count($languages) % 2)
474 $this->tpl->touchBlock(
"lng_empty_cell");
477 if ($this->cmd !=
"logout" and $this->setup->isInstalled())
480 if ($this->setup->isAdmin())
482 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
484 $this->tpl->setCurrentBlock(
"add_client");
485 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
486 $this->tpl->parseCurrentBlock();
490 $class = ($this->active_tab ==
"clientlist")
493 $this->tpl->setCurrentBlock(
"display_list");
494 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
495 $this->tpl->setVariable(
"TAB_CLASS", $class);
496 $this->tpl->parseCurrentBlock();
499 $class = ($this->active_tab ==
"basicsettings")
502 $this->tpl->setCurrentBlock(
"edit_pathes");
503 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
504 $this->tpl->setVariable(
"TAB_CLASS", $class);
505 $this->tpl->parseCurrentBlock();
508 $class = ($this->active_tab ==
"preliminaries")
511 $this->tpl->setCurrentBlock(
"preliminaries");
512 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
513 $this->tpl->setVariable(
"TAB_CLASS", $class);
514 $this->tpl->parseCurrentBlock();
517 $class = ($this->active_tab ==
"password")
520 $this->tpl->setCurrentBlock(
"change_password");
521 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
522 $this->tpl->setVariable(
"TAB_CLASS", $class);
523 $this->tpl->parseCurrentBlock();
527 if ($this->setup->isAuthenticated())
529 $this->tpl->setCurrentBlock(
"logout");
530 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
531 $this->tpl->parseCurrentBlock();
535 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
536 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
537 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
538 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
540 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
541 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
542 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
543 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
544 $this->tpl->setVariable(
"VERSION", $this->version);
545 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
546 $this->tpl->setVariable(
"LANG", $this->lang);
555 if ($this->cmd !=
"logout")
557 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
559 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
561 elseif ($this->setup->isAdmin())
563 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
579 if (!$this->btn_prev_on and !$this->btn_next_on)
584 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
587 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
589 if ($this->btn_prev_on)
591 $ntpl->setCurrentBlock(
"btn_back");
592 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
593 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
594 $ntpl->parseCurrentBlock();
597 if ($this->btn_next_on)
599 $ntpl->setCurrentBlock(
"btn_forward");
600 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
601 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
602 $ntpl->parseCurrentBlock();
605 $nav_html = $ntpl->get();
606 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
607 if (!$this->no_second_nav)
609 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
622 $this->btn_prev_on =
true;
623 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
624 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
635 $this->btn_next_on =
true;
636 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
637 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
652 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
653 $btpl->setCurrentBlock(
"btn");
654 $btpl->setVariable(
"CMD",
"changeaccess");
655 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
656 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
657 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
658 $btpl->parseCurrentBlock();
659 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
662 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
674 $settings = $this->setup->getClient()->getAllSettings();
676 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
679 $this->form->setTitle($lng->txt(
"client_info"));
683 $ne->
setValue(($this->setup->getClient()->getName())
684 ? $this->setup->getClient()->getName()
685 :
"<".$this->lng->txt(
"no_client_name").
">");
686 $ne->setInfo($this->setup->getClient()->getDescription());
687 $this->form->addItem($ne);
691 $ne->
setValue($this->setup->getClient()->getId());
692 $this->form->addItem($ne);
696 $ne->
setValue(($this->setup->getClient()->db_installed)
697 ? $settings[
"inst_id"]
699 $this->form->addItem($ne);
703 $ne->
setValue(($this->setup->getClient()->db_installed)
704 ? $settings[
"db_version"]
706 $this->form->addItem($ne);
711 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
712 $ne->
setValue($this->lng->txt($access_status).$access_link);
713 $this->form->addItem($ne);
717 $sh->setTitle($this->lng->txt(
"server_info"));
718 $this->form->addItem($sh);
723 $this->form->addItem($ne);
727 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
728 $this->form->addItem($ne);
733 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
734 $this->form->addItem($ne);
738 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
739 $this->form->addItem($ne);
744 $this->form->addItem($ne);
749 $this->form->addItem($ne);
753 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
754 $this->form->addItem($sh);
756 $tools = array(
"convert",
"zip",
"unzip",
"java",
"htmldoc",
"mkisofs");
758 foreach ($tools as $tool)
762 $p = $this->setup->ini->readVariable(
"tools", $tool);
763 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
764 $this->form->addItem($ne);
769 $p = $this->setup->ini->readVariable(
"tools",
"latex_url");
770 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
771 $this->form->addItem($ne);
775 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
776 $this->form->addItem($ne);
780 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
781 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
782 $this->form->addItem($ne);
786 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
787 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
788 $this->form->addItem($ne);
790 $this->form->setFormAction(
"setup.php?cmd=gateway");
802 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
803 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
805 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
807 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
808 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
809 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
810 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
811 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
812 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
813 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
815 $server_os = php_uname();
816 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
817 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
819 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
821 $env_comment = $this->lng->txt(
"env_ok");
825 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
828 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
829 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
830 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
832 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
833 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
835 $preliminaries = array(
"php",
"root",
"folder_create",
836 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
837 foreach ($preliminaries as $preliminary)
839 $this->tpl->setCurrentBlock(
"preliminary");
840 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
841 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
843 $this->tpl->setVariable(
"STATUS_PRE", $OK);
847 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
849 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
850 $this->tpl->parseCurrentBlock();
854 if ($this->setup->preliminaries ===
true)
856 if ($this->setup->isInstalled())
858 $cmd =
"mastersettings";
864 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
866 $this->setButtonNext(
$cmd,$btn_text);
870 $this->tpl->setCurrentBlock(
"premessage");
871 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
872 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
873 $this->tpl->parseCurrentBlock();
886 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
887 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
888 $this->tpl->setVariable(
"TXT_INFO",
889 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
891 $this->setButtonPrev(
"preliminaries");
893 if ($this->setup->isInstalled())
895 $this->setButtonNext(
"list");
902 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
910 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
911 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
912 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
914 $this->btn_next_on =
true;
915 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
916 $this->btn_next_cmd =
"newclient";
923 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
933 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
940 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
943 ? str_replace(
"\\",
"/", getcwd())
946 $ne->setValue($cwd.
"/data");
947 $this->form->addItem($ne);
952 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
953 $ti->
setInfo($lng->txt(
"data_directory_info"));
954 $ti->setRequired(
true);
955 $this->form->addItem($ti);
960 $this->form->addItem($ne);
970 $sh->setTitle($lng->txt(
"logging"));
971 $this->form->addItem($sh);
975 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
976 $this->form->addItem($ti);
980 $this->form->addItem($cb);
984 $sh->setTitle($lng->txt(
"server_settings"));
985 $this->form->addItem($sh);
988 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
991 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
993 $si->setRequired(
true);
994 $this->form->addItem($si);
998 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
999 $this->form->addItem($sh);
1002 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1003 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
1004 $ti->setRequired(
true);
1005 $this->form->addItem($ti);
1009 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
1010 $ti->setRequired(
true);
1011 $this->form->addItem($ti);
1015 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1016 $ti->setRequired(
true);
1017 $this->form->addItem($ti);
1021 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1022 $this->form->addItem($sh);
1026 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1027 $this->form->addItem($ti);
1030 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1031 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1032 $this->form->addItem($ti);
1035 $ti =
new ilTextInputGUI($lng->txt(
"mkisofs_path"),
"mkisofs_path");
1036 $ti->
setInfo($lng->txt(
"mkisofs_path_comment"));
1037 $this->form->addItem($ti);
1040 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1041 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1042 $this->form->addItem($ti);
1046 "none" => $lng->txt(
"none"),
1047 "sophos" => $lng->txt(
"sophos"),
1048 "antivir" => $lng->txt(
"antivir"),
1049 "clamav" => $lng->txt(
"clamav")
1053 $this->form->addItem($si);
1056 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1057 $this->form->addItem($ti);
1060 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1061 $this->form->addItem($ti);
1066 $sh->setTitle($lng->txt(
"master_password"));
1067 $this->form->addItem($sh);
1072 $pi->setSkipSyntaxCheck(
true);
1073 $pi->setInfo($lng->txt(
"password_info"));
1074 $this->form->addItem($pi);
1079 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1083 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1084 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1087 $this->form->setTitle($lng->txt(
"data_directories"));
1088 $this->form->setFormAction(
"setup.php?cmd=gateway");
1093 $this->form->setValuesByArray($det);
1105 $values[
"webspace_dir"] = getcwd().
"/data";
1106 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1107 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1108 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1109 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1110 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1111 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1112 $values[
"mkisofs_path"] = $this->setup->ini->readVariable(
"tools",
"mkisofs");
1113 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1114 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1115 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1116 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1117 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1118 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1119 $this->setup->ini->readVariable(
"log",
"file");
1120 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1121 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1123 $this->form->setValuesByArray($values);
1135 if ($this->form->checkInput())
1140 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1141 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1150 if (!$this->setup->checkDataDirSetup(
$_POST))
1152 $i = $this->form->getItemByPostVar(
"datadir_path");
1153 $i->setAlert($this->lng->txt($this->setup->getError()));
1156 else if (!$this->setup->checkLogSetup(
$_POST))
1158 $i = $this->form->getItemByPostVar(
"log_path");
1159 $i->setAlert($this->lng->txt($this->setup->getError()));
1162 else if (!$this->setup->checkPasswordSetup(
$_POST))
1166 else if (!$this->setup->saveMasterSetup(
$_POST))
1177 $this->form->setValuesByPost();
1190 if ($this->form->checkInput())
1194 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1195 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1202 if (!$this->setup->checkLogSetup(
$_POST))
1204 $i = $this->form->getItemByPostVar(
"log_path");
1205 $i->setAlert($this->lng->txt($this->setup->getError()));
1208 else if (!$this->setup->updateMasterSettings(
$_POST))
1219 $this->form->setValuesByPost();
1234 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1244 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1248 $m_form = $this->form->getHTML();
1254 $cl_form = $this->form->getHTML();
1258 $m_form = $this->form->getHTML();
1260 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1261 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1270 if ($this->form->checkInput())
1272 $i = $this->form->getItemByPostVar(
"mpassword");
1273 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1275 $i->setAlert($this->lng->txt(
"login_invalid"));
1285 $this->form->setValuesByPost();
1295 if ($this->form->checkInput())
1297 $i = $this->form->getItemByPostVar(
"password");
1298 if (!$this->setup->loginAsClient(
1299 array(
"client_id" =>
$_POST[
"client_id"],
1300 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1302 $i->setAlert($this->setup->getError());
1312 $this->form->setValuesByPost();
1323 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1330 $this->form->addItem($ti);
1335 $this->form->addItem($ti);
1340 $pi->setRetype(
false);
1341 $pi->setSkipSyntaxCheck(
true);
1342 $this->form->addItem($pi);
1344 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1346 $this->form->setTitle($lng->txt(
"client_login"));
1347 $this->form->setFormAction(
"setup.php?cmd=gateway");
1357 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1363 $pi->setRetype(
false);
1364 $pi->setSkipSyntaxCheck(
true);
1365 $this->form->addItem($pi);
1367 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1369 $this->form->setTitle($lng->txt(
"admin_login"));
1370 $this->form->setFormAction(
"setup.php?cmd=gateway");
1385 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1386 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1390 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1391 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1392 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1394 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1396 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1399 $this->btn_next_on =
true;
1400 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1401 $this->btn_next_cmd =
"newclient";
1427 ? str_replace(
"\\",
"/", getcwd())
1431 $tools = array(
"convert" =>
"convert",
1432 "zip" =>
"zip",
"unzip" =>
"unzip",
1433 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"mkisofs" =>
"mkisofs");
1434 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1438 $tools = array(
"convert" =>
"convert.exe",
1439 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1440 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1441 $cwd.
"/Services/Windows/bin32/unzip",
1442 $cwd.
"/Services/Windows/bin32/convert");
1444 foreach($tools as $k => $tool)
1448 @exec(
"which ".$tool,
$ret);
1449 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1451 $a_tools[$k.
"_path"] =
$ret[0];
1458 if (@is_file($dir.
"/".$tool))
1460 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1485 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1491 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1493 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1494 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1496 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1497 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1499 if ($this->setup->getClient()->status[
"ini"][
"status"])
1501 $this->setButtonNext(
"db");
1514 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1519 "mysql" =>
"MySQL 5.0.x or higher",
1520 "oracle" =>
"Oracle 10g or higher",
1524 $si->setInfo($lng->txt(
""));
1525 $this->form->addItem($si);
1527 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1529 $this->form->setTitle($lng->txt(
"db_selection"));
1530 $this->form->setFormAction(
"setup.php?cmd=gateway");
1544 if (
$_POST[
"db_type"] !=
"")
1553 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1554 if (!$a_omit_form_init)
1559 $this->tpl->setVariable(
"SETUP_CONTENT",
1560 $this->form->getHTML());
1562 if ($this->setup->getClient()->status[
"ini"][
"status"])
1564 $this->setButtonNext(
"db");
1577 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1581 if ($this->setup->ini_client_exists)
1584 $hi->setValue($this->client_id);
1585 $this->form->addItem($hi);
1589 $this->form->addItem($ne);
1595 $ti->setRequired(
true);
1596 $this->form->addItem($ti);
1601 $sh->setTitle($lng->txt(
"db_conn"));
1602 $this->form->addItem($sh);
1606 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1607 $this->form->addItem($ne);
1612 $ti->setRequired(
true);
1613 $this->form->addItem($ti);
1623 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1626 $this->form->addItem($ti);
1631 $ti->setRequired(
true);
1632 $this->form->addItem($ti);
1637 $this->form->addItem($ti);
1642 $this->form->addItem($ti);
1644 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1646 $this->form->setTitle($lng->txt(
"inst_identification"));
1647 $this->form->setFormAction(
"setup.php?cmd=gateway");
1657 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1658 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1659 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1660 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1661 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1662 $values[
"client_id"] = $this->setup->getClient()->getId();
1664 $this->form->setValuesByArray($values);
1675 if ($this->form->checkInput())
1677 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"]))))
1679 $i = $this->form->getItemByPostVar(
"client_id");
1680 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1683 else if (strlen(
$_POST[
"client_id"]) < 4)
1685 $i = $this->form->getItemByPostVar(
"client_id");
1686 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1689 else if (strlen(
$_POST[
"client_id"]) > 32)
1691 $i = $this->form->getItemByPostVar(
"client_id");
1692 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1697 $i = $this->form->getItemByPostVar(
"client_id");
1698 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1705 $old_db_name = $this->setup->getClient()->getDbName();
1706 $old_db_type = $this->setup->getClient()->getDbType();
1707 $old_client_id = $this->setup->getClient()->getId();
1710 if (!$this->setup->ini_client_exists)
1717 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1718 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1719 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1720 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1721 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1722 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1723 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1724 $this->setup->getClient()->setDSN();
1727 if (!$this->setup->getClient()->checkDatabaseHost())
1729 $i = $this->form->getItemByPostVar(
"db_host");
1730 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1736 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1738 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1740 $_POST[
"db_name"] = $old_db_name;
1741 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1742 $i = $this->form->getItemByPostVar(
"db_name");
1743 $i->setAlert($message);
1749 if (!$this->setup->ini_client_exists)
1751 if ($this->setup->saveNewClient())
1754 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1760 $err = $this->setup->getError();
1762 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1763 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1768 if ($this->setup->getClient()->ini->write())
1771 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1776 $err = $this->setup->getClient()->ini->getError();
1778 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1779 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1787 $this->form->setValuesByPost();
1798 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1800 $this->tpl->setCurrentBlock(
"content");
1801 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1802 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1803 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1804 $this->tpl->parseCurrentBlock();
1815 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1819 $this->logged_out =
true;
1820 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1821 $this->tpl->setCurrentBlock(
"home_link");
1822 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1823 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1824 $this->tpl->parseCurrentBlock();
1832 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1835 $steps = $this->setup->getStatus();
1838 unset($steps[
"access"]);
1840 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1841 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1843 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1844 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1845 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1846 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1848 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1852 foreach ($steps as $key => $val)
1854 $stpl->setCurrentBlock(
"menu_row");
1855 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1856 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1857 $stpl->setVariable(
"IMG_ARROW",
"spacer.gif");
1861 if ($this->cmd == $key and isset($this->cmd))
1863 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1864 $stpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1867 $status = ($val[
"status"]) ? $OK :
"";
1869 $stpl->setVariable(
"TXT_STATUS",$status);
1870 $stpl->parseCurrentBlock();
1873 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1875 $this->tpl->setVariable(
"PROCESS_MENU", $stpl->get());
1883 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1885 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html",
"setup");
1887 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1889 if ($this->setup->getClient()->status)
1891 foreach ($this->setup->getClient()->status as $key => $val)
1893 $status = ($val[
"status"]) ? $OK :
" ";
1894 $this->tpl->setCurrentBlock(
"status_row");
1895 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1896 $this->tpl->setVariable(
"TXT_STATUS",$status);
1897 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1898 $this->tpl->parseCurrentBlock();
1910 switch ($this->display_mode)
1913 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1915 include
"./setup/include/inc.client_tabs.php";
1916 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1917 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
1921 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1922 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1926 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1937 switch ($this->display_mode)
1954 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1956 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
1957 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
1961 $this->setButtonNext(
"ini");
1980 if ($this->setup->getClient()->db_installed)
1982 $ilDB = $this->setup->getClient()->db;
1983 $this->lng->setDbHandler($ilDB);
1985 $db_status = $dbupdate->getDBVersionStatus();
1986 $hotfix_available = $dbupdate->hotfixAvailable();
1989 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1993 $this->setButtonNext(
"lang");
1998 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
1999 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
2000 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
2004 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2005 $this->setButtonPrev(
"ini");
2014 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false)
2018 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2023 $this->form->addItem($ne);
2026 if ($this->setup->getClient()->getDBType() ==
"mysql")
2029 $ilDB = $this->setup->getClient()->db;
2030 $ne->setValue($ilDB->getDBVersion());
2031 $this->form->addItem($ne);
2036 $this->form->addItem($ne);
2040 $this->form->addItem($ne);
2044 $this->form->addItem($ne);
2048 $this->form->addItem($ne);
2051 if ($this->setup->getClient()->getDBType() ==
"mysql" && $a_install)
2064 "utf8_icelandic_ci",
2066 "utf8_lithuanian_ci",
2072 "utf8_slovenian_ci",
2078 foreach($collations as $collation)
2080 $options[$collation] = $collation;
2084 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2085 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2086 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2087 $cb->addSubItem($si);
2089 $this->form->addItem($cb);
2094 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2098 $ilDB = $this->setup->getClient()->db;
2099 $this->lng->setDbHandler(
$ilDB);
2104 $ne->
setValue($dbupdate->currentVersion);
2105 $this->form->addItem($ne);
2109 $ne->
setValue($dbupdate->fileVersion);
2110 $this->form->addItem($ne);
2112 if (!$db_status = $dbupdate->getDBVersionStatus())
2116 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2120 if (count($options) > 1)
2122 $si =
new ilSelectInputGUI($lng->txt(
"next_update_break"),
"update_break");
2124 $si->setInfo($lng->txt(
"next_update_break_info"));
2125 $this->form->addItem($si);
2128 if ($dbupdate->getRunningStatus() > 0)
2131 $this->lng->txt(
"db_update_interrupted_avoid"));
2137 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2139 else if ($hotfix_available)
2143 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2144 $this->form->addItem($ne);
2148 $ne->
setValue($dbupdate->getHotfixFileVersion());
2149 $this->form->addItem($ne);
2151 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2156 if ($dbupdate->getHotfixFileVersion() > 0)
2160 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2161 $this->form->addItem($ne);
2165 $ne->
setValue($dbupdate->getHotfixFileVersion());
2166 $this->form->addItem($ne);
2172 $this->form->setTitle($lng->txt(
"database"));
2173 $this->form->setFormAction(
"setup.php?cmd=gateway");
2186 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2187 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2188 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2189 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2190 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2191 if (is_object($dbupdate))
2193 $values[
"update_break"] = $dbupdate->fileVersion;
2194 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2196 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2197 ($dbupdate->currentVersion % 100);
2201 $this->form->setValuesByArray($values);
2216 if (!$this->setup->getClient()->db_exists)
2218 if (
$_POST[
"chk_db_create"])
2220 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2232 if (!$this->setup->installDatabase())
2254 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2256 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2257 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2258 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2259 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2260 include_once
"./Services/Tree/classes/class.ilTree.php";
2261 include_once
"./classes/class.ilSaxParser.php";
2262 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2265 $ilDB = $this->setup->getClient()->db;
2266 $this->lng->setDbHandler(
$ilDB);
2270 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2272 if ($dbupdate->updateMsg ==
"no_changes")
2274 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2279 foreach ($dbupdate->updateMsg as
$row)
2281 if ($row[
"msg"] ==
"update_applied")
2283 $a_message.= $sep.$row[
"nr"];
2288 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2291 if ($a_message !=
"")
2293 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2312 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2314 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2315 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2316 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2317 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2318 include_once
"./Services/Tree/classes/class.ilTree.php";
2319 include_once
"./classes/class.ilSaxParser.php";
2320 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2323 $ilDB = $this->setup->getClient()->db;
2324 $this->lng->setDbHandler(
$ilDB);
2328 $dbupdate->applyHotfix();
2330 if ($dbupdate->updateMsg ==
"no_changes")
2332 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2337 foreach ($dbupdate->updateMsg as
$row)
2339 if ($row[
"msg"] ==
"update_applied")
2341 $a_message.= $sep.$row[
"nr"];
2346 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2349 if ($a_message !=
"")
2351 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2368 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2372 if (!$this->setup->getClient()->db_installed)
2375 $message =
"No database found! Please install database first.";
2382 $settings = array();
2384 foreach( $setting_fields as $field )
2386 if( $field ==
'session_allow_client_maintenance' )
2389 else $_POST[$field] =
'0';
2394 $settings[$field] =
$_POST[$field];
2404 if(
$valid) $this->setup->setSessionSettings($settings);
2406 $settings = $this->setup->getSessionSettings();
2408 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2413 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2414 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2415 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2416 $form->addItem($chkb);
2420 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2421 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2422 $ti->setMaxLength(5);
2424 $ti->setValue($settings[
'session_max_count']);
2425 $form->addItem($ti);
2430 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2431 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2432 $ti->setMaxLength(5);
2434 $ti->setValue($settings[
'session_min_idle']);
2435 $form->addItem($ti);
2440 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2441 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2442 $ti->setMaxLength(5);
2444 $ti->setValue($settings[
'session_max_idle']);
2445 $form->addItem($ti);
2449 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2450 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2451 $ti->setMaxLength(5);
2453 $ti->setValue($settings[
'session_max_idle_after_first_request']);
2454 $form->addItem($ti);
2457 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2459 $form->setTitle($this->lng->txt(
"sess_sessions"));
2460 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2462 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2463 $this->tpl->setVariable(
"TXT_INFO",
'');
2464 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2487 if (!$this->setup->getClient()->db_installed)
2490 $message =
"No database found! Please install database first.";
2494 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2496 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2498 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2499 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2501 $installed_langs = $this->lng->getInstalledLanguages();
2502 $lang_count = count($installed_langs);
2503 if ($lang_count > 0)
2505 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2506 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2510 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2511 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2514 $this->setButtonPrev(
"lang");
2516 if ($lang_count > 0)
2518 $this->setButtonNext(
"contact");
2532 if (empty(
$_POST[
"form"][
"lang_id"]))
2538 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2544 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2551 foreach (
$result as $key => $lang_key)
2553 $list .= $this->lng->txt(
"lang_".$lang_key);
2555 if ($count > $key + 1)
2562 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2563 $message = $this->lng->txt(
"languages_installed");
2567 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2583 $settings = $this->setup->getClient()->getAllSettings();
2590 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2591 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2592 $this->setButtonPrev(
"lang");
2594 $check = $this->setup->checkClientContact($this->setup->client);
2596 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2597 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2599 if ($check[
"status"])
2601 $this->setButtonNext(
"nic");
2616 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2623 $ti->setRequired(
true);
2624 $this->form->addItem($ti);
2630 $this->form->addItem($ti);
2633 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2636 $this->form->addItem($ti);
2640 $sh->setTitle($lng->txt(
"contact_data"));
2641 $this->form->addItem($sh);
2644 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
2647 $ti->setRequired(
true);
2648 $this->form->addItem($ti);
2651 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
2654 $ti->setRequired(
true);
2655 $this->form->addItem($ti);
2658 "title" => array(
"max" => 64,
"size" => 30),
2659 "position" => array(
"max" => 64,
"size" => 30),
2660 "institution" => array(
"max" => 200,
"size" => 30),
2661 "street" => array(
"max" => 64,
"size" => 30),
2662 "zipcode" => array(
"max" => 10,
"size" => 5),
2663 "city" => array(
"max" => 64,
"size" => 30),
2664 "country" => array(
"max" => 64,
"size" => 30),
2665 "phone" => array(
"max" => 64,
"size" => 30)
2667 foreach ($fs as $f => $op)
2672 $ti->setSize($op[
"size"]);
2673 $ti->setInfo($lng->txt(
""));
2674 $this->form->addItem($ti);
2678 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
2679 $ti->setRequired(
true);
2680 $this->form->addItem($ti);
2682 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
2684 $this->form->setTitle($lng->txt(
"client_data"));
2685 $this->form->setFormAction(
"setup.php?cmd=gateway");
2694 $settings = $this->setup->getClient()->getAllSettings();
2696 $values = $settings;
2698 $values[
"inst_name"] = ($this->setup->getClient()->getName())
2699 ? $this->setup->getClient()->getName()
2700 : $this->setup->getClient()->getId();
2701 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
2703 $this->form->setValuesByArray($values);
2714 if ($this->form->checkInput())
2716 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
2717 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
2718 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
2719 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
2720 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
2721 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
2722 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
2723 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
2724 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
2725 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
2726 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
2727 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
2728 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
2731 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
2732 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
2733 $this->setup->getClient()->ini->write();
2739 $this->form->setValuesByPost();
2753 $settings = $this->setup->getClient()->getAllSettings();
2754 $nic_key = $this->setup->getClient()->getNICkey();
2757 $settings = $this->setup->getClient()->getAllSettings();
2759 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2761 $this->no_second_nav =
true;
2762 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2767 $settings = $this->setup->getClient()->getAllSettings();
2769 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
2775 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2777 if (isset($settings[
"nic_enabled"]))
2779 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2784 $this->setButtonPrev(
"contact");
2786 if ($this->setup->getClient()->status[
"nic"][
"status"])
2788 $this->setButtonNext(
"finish",
"finish");
2803 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2810 $radg->addOption($op1);
2811 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
2812 $radg->addOption($op1);
2813 $this->form->addItem($radg);
2815 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
2816 $this->form->setFormAction(
"setup.php?cmd=gateway");
2824 $settings = $this->setup->getClient()->getAllSettings();
2825 $nic_key = $this->setup->getClient()->getNICkey();
2830 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2832 $values[
"register"] = 1;
2840 $values[
"register"] = 0;
2843 $this->form->setValuesByArray($values);
2854 if ($this->form->checkInput())
2857 if (
$_POST[
"register"] == 1)
2860 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
2863 if (empty($this->setup->getClient()->nic_status[2]))
2865 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
2871 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
2872 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
2873 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2897 $this->setup->getClient()->setSetting(
"inst_id",
"0");
2898 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
2904 $this->form->setValuesByPost();
2921 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_tools.html",
"setup");
2922 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2923 $this->tpl->setVariable(
"TXT_TOOLS", $this->lng->txt(
"tools"));
2924 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE", $this->lng->txt(
"ctrl_structure"));
2925 $this->tpl->setVariable(
"TXT_RELOAD", $this->lng->txt(
"reload"));
2927 $ilDB = $this->setup->getClient()->db;
2928 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
2929 $crec =
$ilDB->fetchAssoc($cset);
2931 if ($crec[
"cnt"] == 0)
2933 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2934 $this->lng->txt(
"ctrl_missing_desc"));
2938 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2939 $this->lng->txt(
"ctrl_structure_desc"));
2942 $this->tpl->parseCurrentBlock();
2954 if (!$this->setup->getClient()->db_installed)
2962 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
2965 require_once
"./setup/classes/class.ilModuleReader.php";
2966 require_once
"./setup/classes/class.ilServiceReader.php";
2967 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
2969 require_once
"./Services/Component/classes/class.ilModule.php";
2970 require_once
"./Services/Component/classes/class.ilService.php";
2975 foreach($modules as $module)
2978 $module[
"subdir"],
"Modules");
2984 foreach($services as $service)
2987 $service[
"subdir"],
"Services");
2993 $ilCtrlStructureReader->readStructure(
true);
3005 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3007 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3012 $pass_old = $this->setup->getPassword();
3014 if (empty(
$_POST[
"form"][
"pass_old"]))
3016 $message = $this->lng->txt(
"password_enter_old");
3017 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3020 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3022 $message = $this->lng->txt(
"password_old_wrong");
3023 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3026 if (empty(
$_POST[
"form"][
"pass"]))
3028 $message = $this->lng->txt(
"password_empty");
3029 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3034 $message = $this->lng->txt(
"password_not_match");
3035 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3038 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3040 $message = $this->lng->txt(
"password_same");
3041 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3044 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3046 $message = $this->lng->txt(
"save_error");
3047 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3055 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3057 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3060 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3061 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3062 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3063 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3064 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3065 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3066 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3075 $this->no_second_nav =
true;
3079 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3080 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3081 $this->lng->txt(
"password").
": <b>homer</b></p>";
3082 $this->setButtonNext(
"login_new",
"login");
3084 $this->setup->getClient()->reconnect();
3087 $this->setup->getClient()->setSetting(
"setup_ok",1);
3090 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3095 $txt_info = $this->lng->txt(
"info_text_finish2");
3100 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3101 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3103 $this->setButtonPrev(
"nic");
3117 if (
$_POST[
"form"][
"delete"])
3143 $msg = $this->setup->getClient()->delete(
$ini,$db,
$files);
3149 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3152 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3155 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3156 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3157 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3158 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3170 if ($this->setup->getClient()->status[
"finish"][
"status"])
3172 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3173 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3174 $this->setup->getClient()->ini->write();
3175 $message =
"client_access_mode_changed";
3179 $message =
"client_setup_not_finished";
3198 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3201 $status = $this->setup->getStatus(
$client);
3203 if ($status[
"finish"][
"status"])
3205 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3206 $this->setup->ini->write();
3207 $message =
"default_client_changed";
3211 $message =
"client_setup_not_finished";
3226 foreach ($this->setup->getClient()->status as $key => $val)
3228 if ($key !=
"finish" and $key !=
"access")
3230 if ($val[
"status"] !=
true)
3238 $clientlist =
new ilClientList($this->setup->db_connections);
3240 $list = $clientlist->getClients();
3242 if (count($list) == 1)
3244 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3245 $this->setup->ini->write();
3247 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3248 $this->setup->getClient()->ini->write();
3259 if (!$this->setup->getClient()->status[
"db"][
"status"])
3265 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3267 $this->cmd =
"lang";
3271 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3273 $this->cmd =
"contact";
3277 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3283 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3285 $this->cmd =
"finish";
3300 if ($this->setup->ini->readVariable(
"clients",
"list"))
3302 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3303 $this->setup->ini->write();
3308 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3309 $this->setup->ini->write();