4 require_once
"./setup/classes/class.ilSetup.php";
47 $this->revision =
'$Revision: 31725 $';
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");
1975 include_once
"./Services/Database/classes/class.ilDBUpdateEA.php";
1982 if ($this->setup->getClient()->db_installed)
1984 $ilDB = $this->setup->getClient()->db;
1985 $this->lng->setDbHandler($ilDB);
1987 $db_status = $dbupdate->getDBVersionStatus();
1988 $hotfix_available = $dbupdate->hotfixAvailable();
1991 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1995 $this->setButtonNext(
"lang");
2000 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
2001 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
2002 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
2006 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2007 $this->setButtonPrev(
"ini");
2016 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false)
2020 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2025 $this->form->addItem($ne);
2028 if ($this->setup->getClient()->getDBType() ==
"mysql")
2031 $ilDB = $this->setup->getClient()->db;
2032 $ne->setValue($ilDB->getDBVersion());
2033 $this->form->addItem($ne);
2038 $this->form->addItem($ne);
2042 $this->form->addItem($ne);
2046 $this->form->addItem($ne);
2050 $this->form->addItem($ne);
2053 if ($this->setup->getClient()->getDBType() ==
"mysql" && $a_install)
2066 "utf8_icelandic_ci",
2068 "utf8_lithuanian_ci",
2074 "utf8_slovenian_ci",
2080 foreach($collations as $collation)
2082 $options[$collation] = $collation;
2086 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2087 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2088 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2089 $cb->addSubItem($si);
2091 $this->form->addItem($cb);
2096 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2100 $ilDB = $this->setup->getClient()->db;
2101 $this->lng->setDbHandler(
$ilDB);
2106 $ne->
setValue($dbupdate->currentVersion);
2107 $this->form->addItem($ne);
2111 $ne->
setValue($dbupdate->fileVersion);
2112 $this->form->addItem($ne);
2114 if (!$db_status = $dbupdate->getDBVersionStatus())
2118 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2122 if (count($options) > 1)
2124 $si =
new ilSelectInputGUI($lng->txt(
"next_update_break"),
"update_break");
2126 $si->setInfo($lng->txt(
"next_update_break_info"));
2127 $this->form->addItem($si);
2130 if ($dbupdate->getRunningStatus() > 0)
2133 $this->lng->txt(
"db_update_interrupted_avoid"));
2139 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2141 else if ($hotfix_available)
2145 $ne->
setValue($dbupdate->getHotfixCurrentVersionAsString());
2146 $this->form->addItem($ne);
2150 $ne->
setValue($dbupdate->getHotfixFileVersionAsString());
2151 $this->form->addItem($ne);
2153 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2158 if (strlen($dbupdate->getHotfixFileVersionAsString()))
2162 $ne->
setValue($dbupdate->getHotfixCurrentVersionAsString());
2163 $this->form->addItem($ne);
2167 $ne->
setValue($dbupdate->getHotfixFileVersion());
2168 $this->form->addItem($ne);
2174 $this->form->setTitle($lng->txt(
"database"));
2175 $this->form->setFormAction(
"setup.php?cmd=gateway");
2188 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2189 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2190 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2191 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2192 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2193 if (is_object($dbupdate))
2195 $values[
"update_break"] = $dbupdate->fileVersion;
2196 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2198 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2199 ($dbupdate->currentVersion % 100);
2203 $this->form->setValuesByArray($values);
2218 if (!$this->setup->getClient()->db_exists)
2220 if (
$_POST[
"chk_db_create"])
2222 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2234 if (!$this->setup->installDatabase())
2256 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2258 include_once
"./Services/Database/classes/class.ilDBUpdateEA.php";
2259 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2260 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2261 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2262 include_once
"./Services/Tree/classes/class.ilTree.php";
2263 include_once
"./classes/class.ilSaxParser.php";
2264 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2267 $ilDB = $this->setup->getClient()->db;
2268 $this->lng->setDbHandler(
$ilDB);
2272 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2274 if ($dbupdate->updateMsg ==
"no_changes")
2276 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2281 foreach ($dbupdate->updateMsg as
$row)
2283 if ($row[
"msg"] ==
"update_applied")
2285 $a_message.= $sep.$row[
"nr"];
2290 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2293 if ($a_message !=
"")
2295 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2314 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2316 include_once
"./Services/Database/classes/class.ilDBUpdateEA.php";
2317 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2318 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2319 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2320 include_once
"./Services/Tree/classes/class.ilTree.php";
2321 include_once
"./classes/class.ilSaxParser.php";
2322 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2325 $ilDB = $this->setup->getClient()->db;
2326 $this->lng->setDbHandler(
$ilDB);
2330 $dbupdate->applyHotfix();
2332 if ($dbupdate->updateMsg ==
"no_changes")
2334 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2339 foreach ($dbupdate->updateMsg as
$row)
2341 if ($row[
"msg"] ==
"update_applied")
2343 $a_message.= $sep.$row[
"nr"];
2348 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2351 if ($a_message !=
"")
2353 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2370 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2374 if (!$this->setup->getClient()->db_installed)
2377 $message =
"No database found! Please install database first.";
2384 $settings = array();
2386 foreach( $setting_fields as $field )
2388 if( $field ==
'session_allow_client_maintenance' )
2391 else $_POST[$field] =
'0';
2396 $settings[$field] =
$_POST[$field];
2406 if(
$valid) $this->setup->setSessionSettings($settings);
2408 $settings = $this->setup->getSessionSettings();
2410 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2415 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2416 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2417 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2418 $form->addItem($chkb);
2422 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2423 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2424 $ti->setMaxLength(5);
2426 $ti->setValue($settings[
'session_max_count']);
2427 $form->addItem($ti);
2432 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2433 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2434 $ti->setMaxLength(5);
2436 $ti->setValue($settings[
'session_min_idle']);
2437 $form->addItem($ti);
2442 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2443 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2444 $ti->setMaxLength(5);
2446 $ti->setValue($settings[
'session_max_idle']);
2447 $form->addItem($ti);
2451 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2452 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2453 $ti->setMaxLength(5);
2455 $ti->setValue($settings[
'session_max_idle_after_first_request']);
2456 $form->addItem($ti);
2459 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2461 $form->setTitle($this->lng->txt(
"sess_sessions"));
2462 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2464 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2465 $this->tpl->setVariable(
"TXT_INFO",
'');
2466 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2489 if (!$this->setup->getClient()->db_installed)
2492 $message =
"No database found! Please install database first.";
2496 include_once(
"./setup/classes/class.ilSetupLanguagesTableGUI.php");
2498 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2500 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2501 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2503 $installed_langs = $this->lng->getInstalledLanguages();
2504 $lang_count = count($installed_langs);
2505 if ($lang_count > 0)
2507 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2508 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2512 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2513 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2516 $this->setButtonPrev(
"lang");
2518 if ($lang_count > 0)
2520 $this->setButtonNext(
"contact");
2534 if (empty(
$_POST[
"form"][
"lang_id"]))
2540 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2546 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2548 if (is_array($result))
2550 $count = count($result);
2553 foreach ($result as $key => $lang_key)
2555 $list .= $this->lng->txt(
"lang_".$lang_key);
2557 if ($count > $key + 1)
2564 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2565 $message = $this->lng->txt(
"languages_installed");
2567 if ($result !==
true)
2569 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2585 $settings = $this->setup->getClient()->getAllSettings();
2592 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2593 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2594 $this->setButtonPrev(
"lang");
2596 $check = $this->setup->checkClientContact($this->setup->client);
2598 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2599 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2601 if ($check[
"status"])
2603 $this->setButtonNext(
"nic");
2618 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2625 $ti->setRequired(
true);
2626 $this->form->addItem($ti);
2632 $this->form->addItem($ti);
2635 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2638 $this->form->addItem($ti);
2642 $sh->setTitle($lng->txt(
"contact_data"));
2643 $this->form->addItem($sh);
2646 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
2649 $ti->setRequired(
true);
2650 $this->form->addItem($ti);
2653 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
2656 $ti->setRequired(
true);
2657 $this->form->addItem($ti);
2660 "title" => array(
"max" => 64,
"size" => 30),
2661 "position" => array(
"max" => 64,
"size" => 30),
2662 "institution" => array(
"max" => 200,
"size" => 30),
2663 "street" => array(
"max" => 64,
"size" => 30),
2664 "zipcode" => array(
"max" => 10,
"size" => 5),
2665 "city" => array(
"max" => 64,
"size" => 30),
2666 "country" => array(
"max" => 64,
"size" => 30),
2667 "phone" => array(
"max" => 64,
"size" => 30)
2669 foreach ($fs as
$f => $op)
2674 $ti->setSize($op[
"size"]);
2675 $ti->setInfo($lng->txt(
""));
2676 $this->form->addItem($ti);
2680 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
2681 $ti->setRequired(
true);
2682 $this->form->addItem($ti);
2684 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
2686 $this->form->setTitle($lng->txt(
"client_data"));
2687 $this->form->setFormAction(
"setup.php?cmd=gateway");
2696 $settings = $this->setup->getClient()->getAllSettings();
2698 $values = $settings;
2700 $values[
"inst_name"] = ($this->setup->getClient()->getName())
2701 ? $this->setup->getClient()->getName()
2702 : $this->setup->getClient()->getId();
2703 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
2705 $this->form->setValuesByArray($values);
2716 if ($this->form->checkInput())
2718 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
2719 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
2720 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
2721 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
2722 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
2723 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
2724 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
2725 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
2726 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
2727 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
2728 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
2729 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
2730 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
2733 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
2734 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
2735 $this->setup->getClient()->ini->write();
2741 $this->form->setValuesByPost();
2755 $settings = $this->setup->getClient()->getAllSettings();
2756 $nic_key = $this->setup->getClient()->getNICkey();
2759 $settings = $this->setup->getClient()->getAllSettings();
2761 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2763 $this->no_second_nav =
true;
2764 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2769 $settings = $this->setup->getClient()->getAllSettings();
2771 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
2777 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2779 if (isset($settings[
"nic_enabled"]))
2781 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2786 $this->setButtonPrev(
"contact");
2788 if ($this->setup->getClient()->status[
"nic"][
"status"])
2790 $this->setButtonNext(
"finish",
"finish");
2805 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2812 $radg->addOption($op1);
2813 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
2814 $radg->addOption($op1);
2815 $this->form->addItem($radg);
2817 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
2818 $this->form->setFormAction(
"setup.php?cmd=gateway");
2826 $settings = $this->setup->getClient()->getAllSettings();
2827 $nic_key = $this->setup->getClient()->getNICkey();
2832 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2834 $values[
"register"] = 1;
2842 $values[
"register"] = 0;
2845 $this->form->setValuesByArray($values);
2856 if ($this->form->checkInput())
2859 if (
$_POST[
"register"] == 1)
2862 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
2865 if (empty($this->setup->getClient()->nic_status[2]))
2867 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
2873 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
2874 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
2875 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2899 $this->setup->getClient()->setSetting(
"inst_id",
"0");
2900 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
2906 $this->form->setValuesByPost();
2923 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_tools.html",
"setup");
2924 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2925 $this->tpl->setVariable(
"TXT_TOOLS", $this->lng->txt(
"tools"));
2926 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE", $this->lng->txt(
"ctrl_structure"));
2927 $this->tpl->setVariable(
"TXT_RELOAD", $this->lng->txt(
"reload"));
2929 $ilDB = $this->setup->getClient()->db;
2930 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
2931 $crec =
$ilDB->fetchAssoc($cset);
2933 if ($crec[
"cnt"] == 0)
2935 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2936 $this->lng->txt(
"ctrl_missing_desc"));
2940 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2941 $this->lng->txt(
"ctrl_structure_desc"));
2944 $this->tpl->parseCurrentBlock();
2956 if (!$this->setup->getClient()->db_installed)
2964 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
2967 require_once
"./setup/classes/class.ilModuleReader.php";
2968 require_once
"./setup/classes/class.ilServiceReader.php";
2969 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
2971 require_once
"./Services/Component/classes/class.ilModule.php";
2972 require_once
"./Services/Component/classes/class.ilService.php";
2977 foreach($modules as $module)
2980 $module[
"subdir"],
"Modules");
2986 foreach($services as $service)
2989 $service[
"subdir"],
"Services");
2995 $ilCtrlStructureReader->readStructure(
true);
3007 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3009 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3014 $pass_old = $this->setup->getPassword();
3016 if (empty(
$_POST[
"form"][
"pass_old"]))
3018 $message = $this->lng->txt(
"password_enter_old");
3019 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3022 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3024 $message = $this->lng->txt(
"password_old_wrong");
3025 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3028 if (empty(
$_POST[
"form"][
"pass"]))
3030 $message = $this->lng->txt(
"password_empty");
3031 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3036 $message = $this->lng->txt(
"password_not_match");
3037 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3040 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3042 $message = $this->lng->txt(
"password_same");
3043 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3046 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3048 $message = $this->lng->txt(
"save_error");
3049 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3057 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3059 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3062 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3063 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3064 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3065 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3066 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3067 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3068 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3077 $this->no_second_nav =
true;
3081 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3082 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3083 $this->lng->txt(
"password").
": <b>homer</b></p>";
3084 $this->setButtonNext(
"login_new",
"login");
3086 $this->setup->getClient()->reconnect();
3089 $this->setup->getClient()->setSetting(
"setup_ok",1);
3092 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3097 $txt_info = $this->lng->txt(
"info_text_finish2");
3102 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3103 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3105 $this->setButtonPrev(
"nic");
3119 if (
$_POST[
"form"][
"delete"])
3145 $msg = $this->setup->getClient()->delete(
$ini,$db,
$files);
3151 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3154 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3157 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3158 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3159 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3160 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3172 if ($this->setup->getClient()->status[
"finish"][
"status"])
3174 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3175 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3176 $this->setup->getClient()->ini->write();
3177 $message =
"client_access_mode_changed";
3181 $message =
"client_setup_not_finished";
3200 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3203 $status = $this->setup->getStatus(
$client);
3205 if ($status[
"finish"][
"status"])
3207 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3208 $this->setup->ini->write();
3209 $message =
"default_client_changed";
3213 $message =
"client_setup_not_finished";
3228 foreach ($this->setup->getClient()->status as $key => $val)
3230 if ($key !=
"finish" and $key !=
"access")
3232 if ($val[
"status"] !=
true)
3240 $clientlist =
new ilClientList($this->setup->db_connections);
3242 $list = $clientlist->getClients();
3244 if (count($list) == 1)
3246 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3247 $this->setup->ini->write();
3249 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3250 $this->setup->getClient()->ini->write();
3261 if (!$this->setup->getClient()->status[
"db"][
"status"])
3267 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3269 $this->cmd =
"lang";
3273 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3275 $this->cmd =
"contact";
3279 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3285 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3287 $this->cmd =
"finish";
3302 if ($this->setup->ini->readVariable(
"clients",
"list"))
3304 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3305 $this->setup->ini->write();
3310 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3311 $this->setup->ini->write();