4 require_once
"./setup/classes/class.ilSetup.php";
47 $this->revision =
'$Revision: 36109 $';
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"] ==
"lang" and $this->setup->error ===
true)
321 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"contact")
332 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic")
343 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish")
363 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
367 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1")
369 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
370 $this->setup->getClient()->ini->write();
374 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
381 case "reloadStructure":
385 case "saveClientIni":
386 case "installDatabase":
387 case "displayDatabase":
388 case "updateDatabase":
389 case "saveLanguages":
391 case "displayContactData":
393 case "saveRegistration":
399 $this->
displayError($this->lng->txt(
"unknown_command"));
421 if ($a_mode !=
"view" and $a_mode !=
"setup")
426 $this->display_mode = $a_mode;
437 $languages = $this->lng->getLanguages();
439 $count = (int) round(count($languages) / 2);
442 foreach ($languages as $lang_key)
446 $this->tpl->touchBlock(
"lng_new_row");
449 $this->tpl->setCurrentBlock(
"languages");
450 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
451 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
452 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
453 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
454 $this->tpl->setVariable(
"BORDER", 0);
455 $this->tpl->setVariable(
"VSPACE", 0);
456 $this->tpl->parseCurrentBlock();
461 if (count($languages) % 2)
463 $this->tpl->touchBlock(
"lng_empty_cell");
466 if ($this->cmd !=
"logout" and $this->setup->isInstalled())
469 if ($this->setup->isAdmin())
471 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
473 $this->tpl->setCurrentBlock(
"add_client");
474 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
475 $this->tpl->parseCurrentBlock();
479 $class = ($this->active_tab ==
"clientlist")
482 $this->tpl->setCurrentBlock(
"display_list");
483 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
484 $this->tpl->setVariable(
"TAB_CLASS", $class);
485 $this->tpl->parseCurrentBlock();
488 $class = ($this->active_tab ==
"basicsettings")
491 $this->tpl->setCurrentBlock(
"edit_pathes");
492 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
493 $this->tpl->setVariable(
"TAB_CLASS", $class);
494 $this->tpl->parseCurrentBlock();
497 $class = ($this->active_tab ==
"preliminaries")
500 $this->tpl->setCurrentBlock(
"preliminaries");
501 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
502 $this->tpl->setVariable(
"TAB_CLASS", $class);
503 $this->tpl->parseCurrentBlock();
506 $class = ($this->active_tab ==
"password")
509 $this->tpl->setCurrentBlock(
"change_password");
510 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
511 $this->tpl->setVariable(
"TAB_CLASS", $class);
512 $this->tpl->parseCurrentBlock();
516 if ($this->setup->isAuthenticated())
518 $this->tpl->setCurrentBlock(
"logout");
519 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
520 $this->tpl->parseCurrentBlock();
524 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
525 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
526 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
527 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
529 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
530 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
531 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
532 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
533 $this->tpl->setVariable(
"VERSION", $this->version);
534 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
535 $this->tpl->setVariable(
"LANG", $this->lang);
544 if ($this->cmd !=
"logout")
546 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
548 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
550 elseif ($this->setup->isAdmin())
552 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
568 if (!$this->btn_prev_on and !$this->btn_next_on)
573 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
576 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
578 if ($this->btn_prev_on)
580 $ntpl->setCurrentBlock(
"btn_back");
581 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
582 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
583 $ntpl->parseCurrentBlock();
586 if ($this->btn_next_on)
588 $ntpl->setCurrentBlock(
"btn_forward");
589 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
590 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
591 $ntpl->parseCurrentBlock();
594 $nav_html = $ntpl->get();
595 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
596 if (!$this->no_second_nav)
598 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
611 $this->btn_prev_on =
true;
612 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
613 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
624 $this->btn_next_on =
true;
625 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
626 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
641 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
642 $btpl->setCurrentBlock(
"btn");
643 $btpl->setVariable(
"CMD",
"changeaccess");
644 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
645 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
646 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
647 $btpl->parseCurrentBlock();
648 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
651 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
663 $settings = $this->setup->getClient()->getAllSettings();
665 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
668 $this->form->setTitle($lng->txt(
"client_info"));
672 $ne->
setValue(($this->setup->getClient()->getName())
673 ? $this->setup->getClient()->getName()
674 :
"<".$this->lng->txt(
"no_client_name").
">");
675 $ne->setInfo($this->setup->getClient()->getDescription());
676 $this->form->addItem($ne);
680 $ne->
setValue($this->setup->getClient()->getId());
681 $this->form->addItem($ne);
685 $ne->
setValue(($this->setup->getClient()->db_installed)
686 ? $settings[
"inst_id"]
688 $this->form->addItem($ne);
692 $ne->
setValue(($this->setup->getClient()->db_installed)
693 ? $settings[
"db_version"]
695 $this->form->addItem($ne);
700 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
701 $ne->
setValue($this->lng->txt($access_status).$access_link);
702 $this->form->addItem($ne);
706 $sh->setTitle($this->lng->txt(
"server_info"));
707 $this->form->addItem($sh);
712 $this->form->addItem($ne);
716 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
717 $this->form->addItem($ne);
722 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
723 $this->form->addItem($ne);
727 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
728 $this->form->addItem($ne);
733 $this->form->addItem($ne);
738 $this->form->addItem($ne);
742 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
743 $this->form->addItem($sh);
745 $tools = array(
"convert",
"zip",
"unzip",
"java",
"htmldoc",
"mkisofs");
747 foreach ($tools as $tool)
751 $p = $this->setup->ini->readVariable(
"tools", $tool);
752 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
753 $this->form->addItem($ne);
758 $p = $this->setup->ini->readVariable(
"tools",
"latex_url");
759 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
760 $this->form->addItem($ne);
764 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
765 $this->form->addItem($ne);
769 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
770 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
771 $this->form->addItem($ne);
775 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
776 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
777 $this->form->addItem($ne);
779 $this->form->setFormAction(
"setup.php?cmd=gateway");
791 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
792 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
794 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
796 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
797 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
798 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
799 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
800 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
801 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
802 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
804 $server_os = php_uname();
805 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
806 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
808 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
810 $env_comment = $this->lng->txt(
"env_ok");
814 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
817 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
818 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
819 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
821 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
822 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
824 $preliminaries = array(
"php",
"root",
"folder_create",
825 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
826 foreach ($preliminaries as $preliminary)
828 $this->tpl->setCurrentBlock(
"preliminary");
829 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
830 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
832 $this->tpl->setVariable(
"STATUS_PRE", $OK);
836 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
838 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
839 $this->tpl->parseCurrentBlock();
843 if ($this->setup->preliminaries ===
true)
845 if ($this->setup->isInstalled())
847 $cmd =
"mastersettings";
853 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
855 $this->setButtonNext(
$cmd,$btn_text);
859 $this->tpl->setCurrentBlock(
"premessage");
860 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
861 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
862 $this->tpl->parseCurrentBlock();
875 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
876 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
877 $this->tpl->setVariable(
"TXT_INFO",
878 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
880 $this->setButtonPrev(
"preliminaries");
882 if ($this->setup->isInstalled())
884 $this->setButtonNext(
"list");
891 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
899 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
900 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
901 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
903 $this->btn_next_on =
true;
904 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
905 $this->btn_next_cmd =
"newclient";
912 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
922 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
929 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
932 ? str_replace(
"\\",
"/", getcwd())
935 $ne->setValue($cwd.
"/data");
936 $this->form->addItem($ne);
941 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
942 $ti->
setInfo($lng->txt(
"data_directory_info"));
943 $ti->setRequired(
true);
944 $this->form->addItem($ti);
949 $this->form->addItem($ne);
959 $sh->setTitle($lng->txt(
"logging"));
960 $this->form->addItem($sh);
964 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
965 $this->form->addItem($ti);
969 $this->form->addItem($cb);
973 $sh->setTitle($lng->txt(
"server_settings"));
974 $this->form->addItem($sh);
977 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
980 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
982 $si->setRequired(
true);
983 $this->form->addItem($si);
987 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
988 $this->form->addItem($sh);
991 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
992 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
993 $ti->setRequired(
true);
994 $this->form->addItem($ti);
998 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
999 $ti->setRequired(
true);
1000 $this->form->addItem($ti);
1004 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1005 $ti->setRequired(
true);
1006 $this->form->addItem($ti);
1010 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1011 $this->form->addItem($sh);
1015 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1016 $this->form->addItem($ti);
1019 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1020 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1021 $this->form->addItem($ti);
1024 $ti =
new ilTextInputGUI($lng->txt(
"mkisofs_path"),
"mkisofs_path");
1025 $ti->
setInfo($lng->txt(
"mkisofs_path_comment"));
1026 $this->form->addItem($ti);
1029 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1030 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1031 $this->form->addItem($ti);
1035 "none" => $lng->txt(
"none"),
1036 "sophos" => $lng->txt(
"sophos"),
1037 "antivir" => $lng->txt(
"antivir"),
1038 "clamav" => $lng->txt(
"clamav")
1042 $this->form->addItem($si);
1045 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1046 $this->form->addItem($ti);
1049 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1050 $this->form->addItem($ti);
1055 $sh->setTitle($lng->txt(
"master_password"));
1056 $this->form->addItem($sh);
1061 $pi->setSkipSyntaxCheck(
true);
1062 $pi->setInfo($lng->txt(
"password_info"));
1063 $this->form->addItem($pi);
1068 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1072 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1073 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1076 $this->form->setTitle($lng->txt(
"data_directories"));
1077 $this->form->setFormAction(
"setup.php?cmd=gateway");
1082 $this->form->setValuesByArray($det);
1094 $values[
"webspace_dir"] = getcwd().
"/data";
1095 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1096 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1097 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1098 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1099 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1100 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1101 $values[
"mkisofs_path"] = $this->setup->ini->readVariable(
"tools",
"mkisofs");
1102 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1103 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1104 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1105 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1106 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1107 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1108 $this->setup->ini->readVariable(
"log",
"file");
1109 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1110 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1112 $this->form->setValuesByArray($values);
1124 if ($this->form->checkInput())
1129 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1130 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1139 if (!$this->setup->checkDataDirSetup(
$_POST))
1141 $i = $this->form->getItemByPostVar(
"datadir_path");
1142 $i->setAlert($this->lng->txt($this->setup->getError()));
1145 else if (!$this->setup->checkLogSetup(
$_POST))
1147 $i = $this->form->getItemByPostVar(
"log_path");
1148 $i->setAlert($this->lng->txt($this->setup->getError()));
1151 else if (!$this->setup->checkPasswordSetup(
$_POST))
1155 else if (!$this->setup->saveMasterSetup(
$_POST))
1166 $this->form->setValuesByPost();
1179 if ($this->form->checkInput())
1183 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1184 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1191 if (!$this->setup->checkLogSetup(
$_POST))
1193 $i = $this->form->getItemByPostVar(
"log_path");
1194 $i->setAlert($this->lng->txt($this->setup->getError()));
1197 else if (!$this->setup->updateMasterSettings(
$_POST))
1208 $this->form->setValuesByPost();
1223 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1233 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1237 $m_form = $this->form->getHTML();
1243 $cl_form = $this->form->getHTML();
1247 $m_form = $this->form->getHTML();
1249 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1250 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1259 if ($this->form->checkInput())
1261 $i = $this->form->getItemByPostVar(
"mpassword");
1262 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1264 $i->setAlert($this->lng->txt(
"login_invalid"));
1274 $this->form->setValuesByPost();
1284 if ($this->form->checkInput())
1286 $i = $this->form->getItemByPostVar(
"password");
1287 if (!$this->setup->loginAsClient(
1288 array(
"client_id" =>
$_POST[
"client_id"],
1289 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1291 $i->setAlert($this->setup->getError());
1301 $this->form->setValuesByPost();
1312 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1319 $this->form->addItem($ti);
1324 $this->form->addItem($ti);
1329 $pi->setRetype(
false);
1330 $pi->setSkipSyntaxCheck(
true);
1331 $this->form->addItem($pi);
1333 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1335 $this->form->setTitle($lng->txt(
"client_login"));
1336 $this->form->setFormAction(
"setup.php?cmd=gateway");
1346 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1352 $pi->setRetype(
false);
1353 $pi->setSkipSyntaxCheck(
true);
1354 $this->form->addItem($pi);
1356 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1358 $this->form->setTitle($lng->txt(
"admin_login"));
1359 $this->form->setFormAction(
"setup.php?cmd=gateway");
1374 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1375 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1379 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1380 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1381 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1383 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1385 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1388 $this->btn_next_on =
true;
1389 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1390 $this->btn_next_cmd =
"newclient";
1416 ? str_replace(
"\\",
"/", getcwd())
1420 $tools = array(
"convert" =>
"convert",
1421 "zip" =>
"zip",
"unzip" =>
"unzip",
1422 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"mkisofs" =>
"mkisofs");
1423 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1427 $tools = array(
"convert" =>
"convert.exe",
1428 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1429 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1430 $cwd.
"/Services/Windows/bin32/unzip",
1431 $cwd.
"/Services/Windows/bin32/convert");
1433 foreach($tools as $k => $tool)
1437 @exec(
"which ".$tool,
$ret);
1438 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1440 $a_tools[$k.
"_path"] =
$ret[0];
1447 if (@is_file($dir.
"/".$tool))
1449 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1474 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1480 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1482 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1483 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1485 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1486 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1488 if ($this->setup->getClient()->status[
"ini"][
"status"])
1490 $this->setButtonNext(
"db");
1503 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1508 "mysql" =>
"MySQL 5.0.x or higher",
1509 "oracle" =>
"Oracle 10g or higher",
1513 $si->setInfo($lng->txt(
""));
1514 $this->form->addItem($si);
1516 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1518 $this->form->setTitle($lng->txt(
"db_selection"));
1519 $this->form->setFormAction(
"setup.php?cmd=gateway");
1533 if (
$_POST[
"db_type"] !=
"")
1542 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1543 if (!$a_omit_form_init)
1548 $this->tpl->setVariable(
"SETUP_CONTENT",
1549 $this->form->getHTML());
1551 if ($this->setup->getClient()->status[
"ini"][
"status"])
1553 $this->setButtonNext(
"db");
1566 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1570 if ($this->setup->ini_client_exists)
1573 $hi->setValue($this->client_id);
1574 $this->form->addItem($hi);
1578 $this->form->addItem($ne);
1584 $ti->setRequired(
true);
1585 $this->form->addItem($ti);
1590 $sh->setTitle($lng->txt(
"db_conn"));
1591 $this->form->addItem($sh);
1595 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1596 $this->form->addItem($ne);
1601 $ti->setRequired(
true);
1602 $this->form->addItem($ti);
1612 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1615 $this->form->addItem($ti);
1620 $ti->setRequired(
true);
1621 $this->form->addItem($ti);
1626 $this->form->addItem($ti);
1631 $this->form->addItem($ti);
1633 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1635 $this->form->setTitle($lng->txt(
"inst_identification"));
1636 $this->form->setFormAction(
"setup.php?cmd=gateway");
1646 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1647 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1648 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1649 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1650 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1651 $values[
"client_id"] = $this->setup->getClient()->getId();
1653 $this->form->setValuesByArray($values);
1664 if ($this->form->checkInput())
1666 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"]))))
1668 $i = $this->form->getItemByPostVar(
"client_id");
1669 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1672 else if (strlen(
$_POST[
"client_id"]) < 4)
1674 $i = $this->form->getItemByPostVar(
"client_id");
1675 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1678 else if (strlen(
$_POST[
"client_id"]) > 32)
1680 $i = $this->form->getItemByPostVar(
"client_id");
1681 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1686 $i = $this->form->getItemByPostVar(
"client_id");
1687 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1694 $old_db_name = $this->setup->getClient()->getDbName();
1695 $old_db_type = $this->setup->getClient()->getDbType();
1696 $old_client_id = $this->setup->getClient()->getId();
1699 if (!$this->setup->ini_client_exists)
1706 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1707 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1708 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1709 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1710 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1711 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1712 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1713 $this->setup->getClient()->setDSN();
1716 if (!$this->setup->getClient()->checkDatabaseHost())
1718 $i = $this->form->getItemByPostVar(
"db_host");
1719 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1725 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1727 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1729 $_POST[
"db_name"] = $old_db_name;
1730 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1731 $i = $this->form->getItemByPostVar(
"db_name");
1732 $i->setAlert($message);
1738 if (!$this->setup->ini_client_exists)
1740 if ($this->setup->saveNewClient())
1743 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1749 $err = $this->setup->getError();
1751 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1752 $this->setup->getClient()->status[
"ini"][
"comment"] =
$err;
1757 if ($this->setup->getClient()->ini->write())
1760 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1765 $err = $this->setup->getClient()->ini->getError();
1767 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1768 $this->setup->getClient()->status[
"ini"][
"comment"] =
$err;
1776 $this->form->setValuesByPost();
1787 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1789 $this->tpl->setCurrentBlock(
"content");
1790 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1791 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1792 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1793 $this->tpl->parseCurrentBlock();
1804 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1808 $this->logged_out =
true;
1809 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1810 $this->tpl->setCurrentBlock(
"home_link");
1811 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1812 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1813 $this->tpl->parseCurrentBlock();
1821 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1824 $steps = $this->setup->getStatus();
1827 unset($steps[
"access"]);
1829 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1830 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1831 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1832 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1833 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1834 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1836 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1840 foreach ($steps as
$key => $val)
1842 $stpl->setCurrentBlock(
"menu_row");
1843 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1844 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1845 $stpl->setVariable(
"IMG_ARROW",
"spacer.gif");
1849 if ($this->cmd ==
$key and isset($this->cmd))
1851 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1852 $stpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1855 $status = ($val[
"status"]) ? $OK :
"";
1857 $stpl->setVariable(
"TXT_STATUS",$status);
1858 $stpl->parseCurrentBlock();
1861 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1863 $this->tpl->setVariable(
"PROCESS_MENU", $stpl->get());
1871 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1873 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html",
"setup");
1875 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1877 if ($this->setup->getClient()->status)
1879 foreach ($this->setup->getClient()->status as
$key => $val)
1881 $status = ($val[
"status"]) ? $OK :
" ";
1882 $this->tpl->setCurrentBlock(
"status_row");
1883 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1884 $this->tpl->setVariable(
"TXT_STATUS",$status);
1885 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1886 $this->tpl->parseCurrentBlock();
1898 switch ($this->display_mode)
1901 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1903 include
"./setup/include/inc.client_tabs.php";
1904 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1905 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
1909 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1910 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1914 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1925 switch ($this->display_mode)
1942 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1944 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
1945 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
1949 $this->setButtonNext(
"ini");
1968 if ($this->setup->getClient()->db_installed)
1970 $ilDB = $this->setup->getClient()->db;
1971 $this->lng->setDbHandler($ilDB);
1973 $db_status = $dbupdate->getDBVersionStatus();
1974 $hotfix_available = $dbupdate->hotfixAvailable();
1977 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1981 $this->setButtonNext(
"lang");
1986 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
1987 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
1988 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
1992 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1993 $this->setButtonPrev(
"ini");
2002 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false)
2006 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2011 $this->form->addItem($ne);
2014 if ($this->setup->getClient()->getDBType() ==
"mysql")
2017 $ilDB = $this->setup->getClient()->db;
2018 $ne->setValue($ilDB->getDBVersion());
2019 $this->form->addItem($ne);
2024 $this->form->addItem($ne);
2028 $this->form->addItem($ne);
2032 $this->form->addItem($ne);
2036 $this->form->addItem($ne);
2039 if ($this->setup->getClient()->getDBType() ==
"mysql" && $a_install)
2052 "utf8_icelandic_ci",
2054 "utf8_lithuanian_ci",
2060 "utf8_slovenian_ci",
2066 foreach($collations as $collation)
2068 $options[$collation] = $collation;
2072 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2073 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2074 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2075 $cb->addSubItem($si);
2077 $this->form->addItem($cb);
2082 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2086 $ilDB = $this->setup->getClient()->db;
2087 $this->lng->setDbHandler(
$ilDB);
2092 $ne->
setValue($dbupdate->currentVersion);
2093 $this->form->addItem($ne);
2097 $ne->
setValue($dbupdate->fileVersion);
2098 $this->form->addItem($ne);
2100 if (!$db_status = $dbupdate->getDBVersionStatus())
2104 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2108 if (count($options) > 1)
2110 $si =
new ilSelectInputGUI($lng->txt(
"next_update_break"),
"update_break");
2112 $si->setInfo($lng->txt(
"next_update_break_info"));
2113 $this->form->addItem($si);
2116 if ($dbupdate->getRunningStatus() > 0)
2119 $this->lng->txt(
"db_update_interrupted_avoid"));
2125 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2127 else if ($hotfix_available)
2131 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2132 $this->form->addItem($ne);
2136 $ne->
setValue($dbupdate->getHotfixFileVersion());
2137 $this->form->addItem($ne);
2139 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2144 if ($dbupdate->getHotfixFileVersion() > 0)
2148 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2149 $this->form->addItem($ne);
2153 $ne->
setValue($dbupdate->getHotfixFileVersion());
2154 $this->form->addItem($ne);
2160 $this->form->setTitle($lng->txt(
"database"));
2161 $this->form->setFormAction(
"setup.php?cmd=gateway");
2174 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2175 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2176 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2177 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2178 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2179 if (is_object($dbupdate))
2181 $values[
"update_break"] = $dbupdate->fileVersion;
2182 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2184 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2185 ($dbupdate->currentVersion % 100);
2189 $this->form->setValuesByArray($values);
2204 if (!$this->setup->getClient()->db_exists)
2206 if (
$_POST[
"chk_db_create"])
2208 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2220 if (!$this->setup->installDatabase())
2242 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2244 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2245 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2246 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2247 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2248 include_once
"./Services/Tree/classes/class.ilTree.php";
2249 include_once
"./classes/class.ilSaxParser.php";
2250 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2253 $ilDB = $this->setup->getClient()->db;
2254 $this->lng->setDbHandler(
$ilDB);
2258 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2260 if ($dbupdate->updateMsg ==
"no_changes")
2262 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2267 foreach ($dbupdate->updateMsg as
$row)
2269 if ($row[
"msg"] ==
"update_applied")
2271 $a_message.= $sep.$row[
"nr"];
2276 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2279 if ($a_message !=
"")
2281 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2300 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2302 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2303 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2304 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2305 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2306 include_once
"./Services/Tree/classes/class.ilTree.php";
2307 include_once
"./classes/class.ilSaxParser.php";
2308 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2311 $ilDB = $this->setup->getClient()->db;
2312 $this->lng->setDbHandler(
$ilDB);
2316 $dbupdate->applyHotfix();
2318 if ($dbupdate->updateMsg ==
"no_changes")
2320 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2325 foreach ($dbupdate->updateMsg as
$row)
2327 if ($row[
"msg"] ==
"update_applied")
2329 $a_message.= $sep.$row[
"nr"];
2334 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2337 if ($a_message !=
"")
2339 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2358 if (!$this->setup->getClient()->db_installed)
2361 $message =
"No database found! Please install database first.";
2365 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2367 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2369 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2370 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2372 $installed_langs = $this->lng->getInstalledLanguages();
2373 $lang_count = count($installed_langs);
2374 if ($lang_count > 0)
2376 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2377 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2381 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2382 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2385 $this->setButtonPrev(
"db");
2387 if ($lang_count > 0)
2389 $this->setButtonNext(
"contact");
2403 if (empty(
$_POST[
"form"][
"lang_id"]))
2409 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2415 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2424 $list .= $this->lng->txt(
"lang_".$lang_key);
2426 if ($count >
$key + 1)
2433 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2434 $message = $this->lng->txt(
"languages_installed");
2438 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2454 $settings = $this->setup->getClient()->getAllSettings();
2461 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2462 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2463 $this->setButtonPrev(
"lang");
2465 $check = $this->setup->checkClientContact($this->setup->client);
2467 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2468 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2470 if ($check[
"status"])
2472 $this->setButtonNext(
"nic");
2487 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2494 $ti->setRequired(
true);
2495 $this->form->addItem($ti);
2501 $this->form->addItem($ti);
2504 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2507 $this->form->addItem($ti);
2511 $sh->setTitle($lng->txt(
"contact_data"));
2512 $this->form->addItem($sh);
2515 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
2518 $ti->setRequired(
true);
2519 $this->form->addItem($ti);
2522 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
2525 $ti->setRequired(
true);
2526 $this->form->addItem($ti);
2529 "title" => array(
"max" => 64,
"size" => 30),
2530 "position" => array(
"max" => 64,
"size" => 30),
2531 "institution" => array(
"max" => 200,
"size" => 30),
2532 "street" => array(
"max" => 64,
"size" => 30),
2533 "zipcode" => array(
"max" => 10,
"size" => 5),
2534 "city" => array(
"max" => 64,
"size" => 30),
2535 "country" => array(
"max" => 64,
"size" => 30),
2536 "phone" => array(
"max" => 64,
"size" => 30)
2538 foreach ($fs as
$f => $op)
2543 $ti->setSize($op[
"size"]);
2544 $ti->setInfo($lng->txt(
""));
2545 $this->form->addItem($ti);
2549 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
2550 $ti->setRequired(
true);
2551 $this->form->addItem($ti);
2553 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
2555 $this->form->setTitle($lng->txt(
"client_data"));
2556 $this->form->setFormAction(
"setup.php?cmd=gateway");
2565 $settings = $this->setup->getClient()->getAllSettings();
2567 $values = $settings;
2569 $values[
"inst_name"] = ($this->setup->getClient()->getName())
2570 ? $this->setup->getClient()->getName()
2571 : $this->setup->getClient()->getId();
2572 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
2574 $this->form->setValuesByArray($values);
2585 if ($this->form->checkInput())
2587 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
2588 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
2589 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
2590 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
2591 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
2592 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
2593 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
2594 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
2595 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
2596 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
2597 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
2598 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
2599 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
2602 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
2603 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
2604 $this->setup->getClient()->ini->write();
2610 $this->form->setValuesByPost();
2624 $settings = $this->setup->getClient()->getAllSettings();
2625 $nic_key = $this->setup->getClient()->getNICkey();
2628 $settings = $this->setup->getClient()->getAllSettings();
2630 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2632 $this->no_second_nav =
true;
2633 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2638 $settings = $this->setup->getClient()->getAllSettings();
2640 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
2646 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2648 if (isset($settings[
"nic_enabled"]))
2650 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2655 $this->setButtonPrev(
"contact");
2657 if ($this->setup->getClient()->status[
"nic"][
"status"])
2659 $this->setButtonNext(
"finish",
"finish");
2674 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2681 $radg->addOption($op1);
2682 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
2683 $radg->addOption($op1);
2684 $this->form->addItem($radg);
2686 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
2687 $this->form->setFormAction(
"setup.php?cmd=gateway");
2695 $settings = $this->setup->getClient()->getAllSettings();
2696 $nic_key = $this->setup->getClient()->getNICkey();
2701 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2703 $values[
"register"] = 1;
2711 $values[
"register"] = 0;
2714 $this->form->setValuesByArray($values);
2725 if ($this->form->checkInput())
2728 if (
$_POST[
"register"] == 1)
2731 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
2734 if (empty($this->setup->getClient()->nic_status[2]))
2736 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
2742 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
2743 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
2744 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2768 $this->setup->getClient()->setSetting(
"inst_id",
"0");
2769 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
2775 $this->form->setValuesByPost();
2792 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_tools.html",
"setup");
2793 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2794 $this->tpl->setVariable(
"TXT_TOOLS", $this->lng->txt(
"tools"));
2795 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE", $this->lng->txt(
"ctrl_structure"));
2796 $this->tpl->setVariable(
"TXT_RELOAD", $this->lng->txt(
"reload"));
2798 $ilDB = $this->setup->getClient()->db;
2799 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
2800 $crec =
$ilDB->fetchAssoc($cset);
2802 if ($crec[
"cnt"] == 0)
2804 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2805 $this->lng->txt(
"ctrl_missing_desc"));
2809 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2810 $this->lng->txt(
"ctrl_structure_desc"));
2813 $this->tpl->parseCurrentBlock();
2825 if (!$this->setup->getClient()->db_installed)
2833 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
2836 require_once
"./setup/classes/class.ilModuleReader.php";
2837 require_once
"./setup/classes/class.ilServiceReader.php";
2838 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
2840 require_once
"./Services/Component/classes/class.ilModule.php";
2841 require_once
"./Services/Component/classes/class.ilService.php";
2846 foreach($modules as $module)
2849 $module[
"subdir"],
"Modules");
2855 foreach($services as $service)
2858 $service[
"subdir"],
"Services");
2864 $ilCtrlStructureReader->readStructure(
true);
2876 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
2878 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
2883 $pass_old = $this->setup->getPassword();
2885 if (empty(
$_POST[
"form"][
"pass_old"]))
2887 $message = $this->lng->txt(
"password_enter_old");
2888 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2891 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
2893 $message = $this->lng->txt(
"password_old_wrong");
2894 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2897 if (empty(
$_POST[
"form"][
"pass"]))
2899 $message = $this->lng->txt(
"password_empty");
2900 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2905 $message = $this->lng->txt(
"password_not_match");
2906 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2909 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
2911 $message = $this->lng->txt(
"password_same");
2912 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2915 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
2917 $message = $this->lng->txt(
"save_error");
2918 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
2926 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
2928 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
2931 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2932 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
2933 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
2934 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
2935 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
2936 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
2937 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2946 $this->no_second_nav =
true;
2950 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
2951 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
2952 $this->lng->txt(
"password").
": <b>homer</b></p>";
2953 $this->setButtonNext(
"login_new",
"login");
2955 $this->setup->getClient()->reconnect();
2958 $this->setup->getClient()->setSetting(
"setup_ok",1);
2961 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
2966 $txt_info = $this->lng->txt(
"info_text_finish2");
2971 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
2972 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
2974 $this->setButtonPrev(
"nic");
2988 if (
$_POST[
"form"][
"delete"])
3014 $msg = $this->setup->getClient()->delete(
$ini,$db,
$files);
3020 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3023 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3026 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3027 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3028 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3029 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3041 if ($this->setup->getClient()->status[
"finish"][
"status"])
3043 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3044 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3045 $this->setup->getClient()->ini->write();
3046 $message =
"client_access_mode_changed";
3050 $message =
"client_setup_not_finished";
3069 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3072 $status = $this->setup->getStatus(
$client);
3074 if ($status[
"finish"][
"status"])
3076 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3077 $this->setup->ini->write();
3078 $message =
"default_client_changed";
3082 $message =
"client_setup_not_finished";
3097 foreach ($this->setup->getClient()->status as
$key => $val)
3099 if ($key !=
"finish" and $key !=
"access")
3101 if ($val[
"status"] !=
true)
3109 $clientlist =
new ilClientList($this->setup->db_connections);
3111 $list = $clientlist->getClients();
3113 if (count($list) == 1)
3115 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3116 $this->setup->ini->write();
3118 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3119 $this->setup->getClient()->ini->write();
3130 if (!$this->setup->getClient()->status[
"db"][
"status"])
3136 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3138 $this->cmd =
"lang";
3142 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3144 $this->cmd =
"contact";
3148 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3154 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3156 $this->cmd =
"finish";
3171 if ($this->setup->ini->readVariable(
"clients",
"list"))
3173 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3174 $this->setup->ini->write();
3179 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3180 $this->setup->ini->write();