4 require_once
"./setup/classes/class.ilSetup.php";
47 $this->revision =
'$Revision: 49124 $';
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":
406 case "changeSettingsType":
407 case "showLongerSettings":
412 $this->
displayError($this->lng->txt(
"unknown_command"));
434 if ($a_mode !=
"view" and $a_mode !=
"setup")
439 $this->display_mode = $a_mode;
450 $languages = $this->lng->getLanguages();
452 $count = (int) round(count($languages) / 2);
455 foreach ($languages as $lang_key)
459 $this->tpl->touchBlock(
"lng_new_row");
462 $this->tpl->setCurrentBlock(
"languages");
463 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
464 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
465 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
466 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
467 $this->tpl->setVariable(
"BORDER", 0);
468 $this->tpl->setVariable(
"VSPACE", 0);
469 $this->tpl->parseCurrentBlock();
474 if (count($languages) % 2)
476 $this->tpl->touchBlock(
"lng_empty_cell");
479 if ($this->cmd !=
"logout" and $this->setup->isInstalled())
482 if ($this->setup->isAdmin())
484 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
486 $this->tpl->setCurrentBlock(
"add_client");
487 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
488 $this->tpl->parseCurrentBlock();
492 $class = ($this->active_tab ==
"clientlist")
495 $this->tpl->setCurrentBlock(
"display_list");
496 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
497 $this->tpl->setVariable(
"TAB_CLASS", $class);
498 $this->tpl->parseCurrentBlock();
501 $class = ($this->active_tab ==
"basicsettings")
504 $this->tpl->setCurrentBlock(
"edit_pathes");
505 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
506 $this->tpl->setVariable(
"TAB_CLASS", $class);
507 $this->tpl->parseCurrentBlock();
510 $class = ($this->active_tab ==
"preliminaries")
513 $this->tpl->setCurrentBlock(
"preliminaries");
514 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
515 $this->tpl->setVariable(
"TAB_CLASS", $class);
516 $this->tpl->parseCurrentBlock();
519 $class = ($this->active_tab ==
"password")
522 $this->tpl->setCurrentBlock(
"change_password");
523 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
524 $this->tpl->setVariable(
"TAB_CLASS", $class);
525 $this->tpl->parseCurrentBlock();
529 if ($this->setup->isAuthenticated())
531 $this->tpl->setCurrentBlock(
"logout");
532 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
533 $this->tpl->parseCurrentBlock();
537 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
538 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
539 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
540 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
542 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
543 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
544 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
545 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
546 $this->tpl->setVariable(
"VERSION", $this->version);
547 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
548 $this->tpl->setVariable(
"LANG", $this->lang);
557 if ($this->cmd !=
"logout")
559 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
561 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
563 elseif ($this->setup->isAdmin())
565 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
581 if (!$this->btn_prev_on and !$this->btn_next_on)
586 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
589 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
591 if ($this->btn_prev_on)
593 $ntpl->setCurrentBlock(
"btn_back");
594 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
595 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
596 $ntpl->parseCurrentBlock();
599 if ($this->btn_next_on)
601 $ntpl->setCurrentBlock(
"btn_forward");
602 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
603 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
604 $ntpl->parseCurrentBlock();
607 $nav_html = $ntpl->get();
608 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
609 if (!$this->no_second_nav)
611 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
624 $this->btn_prev_on =
true;
625 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
626 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
637 $this->btn_next_on =
true;
638 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
639 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
654 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
655 $btpl->setCurrentBlock(
"btn");
656 $btpl->setVariable(
"CMD",
"changeaccess");
657 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
658 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
659 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
660 $btpl->parseCurrentBlock();
661 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
664 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
676 $settings = $this->setup->getClient()->getAllSettings();
678 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
681 $this->form->setTitle($lng->txt(
"client_info"));
685 $ne->
setValue(($this->setup->getClient()->getName())
686 ? $this->setup->getClient()->getName()
687 :
"<".$this->lng->txt(
"no_client_name").
">");
688 $ne->setInfo($this->setup->getClient()->getDescription());
689 $this->form->addItem($ne);
693 $ne->
setValue($this->setup->getClient()->getId());
694 $this->form->addItem($ne);
698 $ne->
setValue(($this->setup->getClient()->db_installed)
699 ? $settings[
"inst_id"]
701 $this->form->addItem($ne);
705 $ne->
setValue(($this->setup->getClient()->db_installed)
706 ? $settings[
"db_version"]
708 $this->form->addItem($ne);
713 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
714 $ne->
setValue($this->lng->txt($access_status).$access_link);
715 $this->form->addItem($ne);
719 $sh->setTitle($this->lng->txt(
"server_info"));
720 $this->form->addItem($sh);
725 $this->form->addItem($ne);
729 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
730 $this->form->addItem($ne);
735 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
736 $this->form->addItem($ne);
740 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
741 $this->form->addItem($ne);
746 $this->form->addItem($ne);
751 $this->form->addItem($ne);
755 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
756 $this->form->addItem($sh);
758 $tools = array(
"convert",
"zip",
"unzip",
"java",
"htmldoc",
"mkisofs");
760 foreach ($tools as $tool)
764 $p = $this->setup->ini->readVariable(
"tools", $tool);
765 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
766 $this->form->addItem($ne);
771 $p = $this->setup->ini->readVariable(
"tools",
"latex");
772 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
773 $this->form->addItem($ne);
777 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
778 $this->form->addItem($ne);
782 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
783 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
784 $this->form->addItem($ne);
788 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
789 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
790 $this->form->addItem($ne);
792 $this->form->setFormAction(
"setup.php?cmd=gateway");
804 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
805 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
807 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
809 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
810 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
811 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
812 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
813 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
814 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
815 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
817 $server_os = php_uname();
818 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
819 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
821 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
823 $env_comment = $this->lng->txt(
"env_ok");
827 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
830 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
831 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
832 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
834 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
835 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
837 $preliminaries = array(
"php",
"root",
"folder_create",
838 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
839 foreach ($preliminaries as $preliminary)
841 $this->tpl->setCurrentBlock(
"preliminary");
842 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
843 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
845 $this->tpl->setVariable(
"STATUS_PRE", $OK);
849 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
851 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
852 $this->tpl->parseCurrentBlock();
856 if ($this->setup->preliminaries ===
true)
858 if ($this->setup->isInstalled())
860 $cmd =
"mastersettings";
866 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
868 $this->setButtonNext(
$cmd,$btn_text);
872 $this->tpl->setCurrentBlock(
"premessage");
873 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
874 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
875 $this->tpl->parseCurrentBlock();
888 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
889 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
890 $this->tpl->setVariable(
"TXT_INFO",
891 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
893 $this->setButtonPrev(
"preliminaries");
895 if ($this->setup->isInstalled())
897 $this->setButtonNext(
"list");
904 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
912 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
913 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
914 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
916 $this->btn_next_on =
true;
917 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
918 $this->btn_next_cmd =
"newclient";
925 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
935 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
942 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
945 ? str_replace(
"\\",
"/", getcwd())
948 $ne->setValue($cwd.
"/data");
949 $this->form->addItem($ne);
954 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
955 $ti->
setInfo($lng->txt(
"data_directory_info"));
956 $ti->setRequired(
true);
957 $this->form->addItem($ti);
962 $this->form->addItem($ne);
972 $sh->setTitle($lng->txt(
"logging"));
973 $this->form->addItem($sh);
977 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
978 $this->form->addItem($ti);
982 $this->form->addItem($cb);
986 $sh->setTitle($lng->txt(
"server_settings"));
987 $this->form->addItem($sh);
990 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
993 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
995 $si->setRequired(
true);
996 $this->form->addItem($si);
1000 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
1001 $this->form->addItem($sh);
1004 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1005 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
1006 $ti->setRequired(
true);
1007 $this->form->addItem($ti);
1011 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
1012 $ti->setRequired(
true);
1013 $this->form->addItem($ti);
1017 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1018 $ti->setRequired(
true);
1019 $this->form->addItem($ti);
1023 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1024 $this->form->addItem($sh);
1028 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1029 $this->form->addItem($ti);
1032 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1033 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1034 $this->form->addItem($ti);
1037 $ti =
new ilTextInputGUI($lng->txt(
"mkisofs_path"),
"mkisofs_path");
1038 $ti->
setInfo($lng->txt(
"mkisofs_path_comment"));
1039 $this->form->addItem($ti);
1042 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1043 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1044 $this->form->addItem($ti);
1048 "none" => $lng->txt(
"none"),
1049 "sophos" => $lng->txt(
"sophos"),
1050 "antivir" => $lng->txt(
"antivir"),
1051 "clamav" => $lng->txt(
"clamav")
1055 $this->form->addItem($si);
1058 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1059 $this->form->addItem($ti);
1062 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1063 $this->form->addItem($ti);
1068 $sh->setTitle($lng->txt(
"master_password"));
1069 $this->form->addItem($sh);
1074 $pi->setSkipSyntaxCheck(
true);
1075 $pi->setInfo($lng->txt(
"password_info"));
1076 $this->form->addItem($pi);
1081 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1085 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1086 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1089 $this->form->setTitle($lng->txt(
"data_directories"));
1090 $this->form->setFormAction(
"setup.php?cmd=gateway");
1095 $this->form->setValuesByArray($det);
1107 $values[
"webspace_dir"] = getcwd().
"/data";
1108 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1109 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1110 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1111 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1112 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1113 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1114 $values[
"mkisofs_path"] = $this->setup->ini->readVariable(
"tools",
"mkisofs");
1115 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1116 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1117 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1118 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1119 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1120 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1121 $this->setup->ini->readVariable(
"log",
"file");
1122 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1123 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1125 $this->form->setValuesByArray($values);
1137 if ($this->form->checkInput())
1142 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1143 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1152 if (!$this->setup->checkDataDirSetup(
$_POST))
1154 $i = $this->form->getItemByPostVar(
"datadir_path");
1155 $i->setAlert($this->lng->txt($this->setup->getError()));
1158 else if (!$this->setup->checkLogSetup(
$_POST))
1160 $i = $this->form->getItemByPostVar(
"log_path");
1161 $i->setAlert($this->lng->txt($this->setup->getError()));
1164 else if (!$this->setup->checkPasswordSetup(
$_POST))
1168 else if (!$this->setup->saveMasterSetup(
$_POST))
1179 $this->form->setValuesByPost();
1192 if ($this->form->checkInput())
1196 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1197 "unzip_path",
"java_path",
"htmldoc_path",
"mkisofs_path");
1204 if (!$this->setup->checkLogSetup(
$_POST))
1206 $i = $this->form->getItemByPostVar(
"log_path");
1207 $i->setAlert($this->lng->txt($this->setup->getError()));
1210 else if (!$this->setup->updateMasterSettings(
$_POST))
1221 $this->form->setValuesByPost();
1236 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1246 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1250 $m_form = $this->form->getHTML();
1256 $cl_form = $this->form->getHTML();
1260 $m_form = $this->form->getHTML();
1262 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1263 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1272 if ($this->form->checkInput())
1274 $i = $this->form->getItemByPostVar(
"mpassword");
1275 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1277 $i->setAlert($this->lng->txt(
"login_invalid"));
1287 $this->form->setValuesByPost();
1297 if ($this->form->checkInput())
1299 $i = $this->form->getItemByPostVar(
"password");
1300 if (!$this->setup->loginAsClient(
1301 array(
"client_id" =>
$_POST[
"client_id"],
1302 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1304 $i->setAlert($this->setup->getError());
1314 $this->form->setValuesByPost();
1325 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1332 $this->form->addItem($ti);
1337 $this->form->addItem($ti);
1342 $pi->setRetype(
false);
1343 $pi->setSkipSyntaxCheck(
true);
1344 $this->form->addItem($pi);
1346 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1348 $this->form->setTitle($lng->txt(
"client_login"));
1349 $this->form->setFormAction(
"setup.php?cmd=gateway");
1359 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1365 $pi->setRetype(
false);
1366 $pi->setSkipSyntaxCheck(
true);
1367 $this->form->addItem($pi);
1369 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1371 $this->form->setTitle($lng->txt(
"admin_login"));
1372 $this->form->setFormAction(
"setup.php?cmd=gateway");
1387 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1388 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1392 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1393 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1394 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1396 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1398 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1401 $this->btn_next_on =
true;
1402 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1403 $this->btn_next_cmd =
"newclient";
1429 ? str_replace(
"\\",
"/", getcwd())
1433 $tools = array(
"convert" =>
"convert",
1434 "zip" =>
"zip",
"unzip" =>
"unzip",
1435 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"mkisofs" =>
"mkisofs");
1436 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1440 $tools = array(
"convert" =>
"convert.exe",
1441 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1442 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1443 $cwd.
"/Services/Windows/bin32/unzip",
1444 $cwd.
"/Services/Windows/bin32/convert");
1446 foreach($tools as $k => $tool)
1450 @exec(
"which ".$tool,
$ret);
1451 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1453 $a_tools[$k.
"_path"] =
$ret[0];
1460 if (@is_file($dir.
"/".$tool))
1462 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1487 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1493 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1495 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1496 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1498 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1499 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1501 if ($this->setup->getClient()->status[
"ini"][
"status"])
1503 $this->setButtonNext(
"db");
1516 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1521 "mysql" =>
"MySQL 5.0.x or higher",
1522 "oracle" =>
"Oracle 10g or higher",
1526 $si->setInfo($lng->txt(
""));
1527 $this->form->addItem($si);
1529 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1531 $this->form->setTitle($lng->txt(
"db_selection"));
1532 $this->form->setFormAction(
"setup.php?cmd=gateway");
1546 if (
$_POST[
"db_type"] !=
"")
1555 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1556 if (!$a_omit_form_init)
1561 $this->tpl->setVariable(
"SETUP_CONTENT",
1562 $this->form->getHTML());
1564 if ($this->setup->getClient()->status[
"ini"][
"status"])
1566 $this->setButtonNext(
"db");
1579 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1583 if ($this->setup->ini_client_exists)
1586 $hi->setValue($this->client_id);
1587 $this->form->addItem($hi);
1591 $this->form->addItem($ne);
1597 $ti->setRequired(
true);
1598 $this->form->addItem($ti);
1603 $sh->setTitle($lng->txt(
"db_conn"));
1604 $this->form->addItem($sh);
1608 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1609 $this->form->addItem($ne);
1614 $ti->setRequired(
true);
1615 $this->form->addItem($ti);
1625 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1628 $this->form->addItem($ti);
1633 $ti->setRequired(
true);
1634 $this->form->addItem($ti);
1639 $this->form->addItem($ti);
1644 $this->form->addItem($ti);
1646 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1648 $this->form->setTitle($lng->txt(
"inst_identification"));
1649 $this->form->setFormAction(
"setup.php?cmd=gateway");
1659 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1660 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1661 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1662 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1663 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1664 $values[
"client_id"] = $this->setup->getClient()->getId();
1666 $this->form->setValuesByArray($values);
1677 if ($this->form->checkInput())
1679 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"]))))
1681 $i = $this->form->getItemByPostVar(
"client_id");
1682 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1685 else if (strlen(
$_POST[
"client_id"]) < 4)
1687 $i = $this->form->getItemByPostVar(
"client_id");
1688 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1691 else if (strlen(
$_POST[
"client_id"]) > 32)
1693 $i = $this->form->getItemByPostVar(
"client_id");
1694 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1699 $i = $this->form->getItemByPostVar(
"client_id");
1700 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1707 $old_db_name = $this->setup->getClient()->getDbName();
1708 $old_db_type = $this->setup->getClient()->getDbType();
1709 $old_client_id = $this->setup->getClient()->getId();
1712 if (!$this->setup->ini_client_exists)
1719 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1720 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1721 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1722 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1723 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1724 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1725 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1726 $this->setup->getClient()->setDSN();
1729 if (!$this->setup->getClient()->checkDatabaseHost())
1731 $i = $this->form->getItemByPostVar(
"db_host");
1732 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1738 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1740 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1742 $_POST[
"db_name"] = $old_db_name;
1743 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1744 $i = $this->form->getItemByPostVar(
"db_name");
1745 $i->setAlert($message);
1751 if (!$this->setup->ini_client_exists)
1753 if ($this->setup->saveNewClient())
1756 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1762 $err = $this->setup->getError();
1764 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1765 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1770 if ($this->setup->getClient()->ini->write())
1773 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1778 $err = $this->setup->getClient()->ini->getError();
1780 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1781 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1789 $this->form->setValuesByPost();
1800 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1802 $this->tpl->setCurrentBlock(
"content");
1803 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1804 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1805 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1806 $this->tpl->parseCurrentBlock();
1817 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1821 $this->logged_out =
true;
1822 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1823 $this->tpl->setCurrentBlock(
"home_link");
1824 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1825 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1826 $this->tpl->parseCurrentBlock();
1834 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1837 $steps = $this->setup->getStatus();
1840 unset($steps[
"access"]);
1842 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1843 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1845 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1846 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1847 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1848 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1850 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1854 foreach ($steps as $key => $val)
1856 $stpl->setCurrentBlock(
"menu_row");
1857 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1858 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1859 $stpl->setVariable(
"IMG_ARROW",
"spacer.gif");
1863 if ($this->cmd == $key and isset($this->cmd))
1865 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1866 $stpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1869 $status = ($val[
"status"]) ? $OK :
"";
1871 $stpl->setVariable(
"TXT_STATUS",$status);
1872 $stpl->parseCurrentBlock();
1875 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1877 $this->tpl->setVariable(
"PROCESS_MENU", $stpl->get());
1885 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1887 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html",
"setup");
1889 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1891 if ($this->setup->getClient()->status)
1893 foreach ($this->setup->getClient()->status as $key => $val)
1895 $status = ($val[
"status"]) ? $OK :
" ";
1896 $this->tpl->setCurrentBlock(
"status_row");
1897 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1898 $this->tpl->setVariable(
"TXT_STATUS",$status);
1899 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1900 $this->tpl->parseCurrentBlock();
1912 switch ($this->display_mode)
1915 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1917 include
"./setup/include/inc.client_tabs.php";
1918 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1919 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
1923 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1924 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1928 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1939 switch ($this->display_mode)
1956 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1958 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
1959 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
1963 $this->setButtonNext(
"ini");
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->getHotfixCurrentVersion());
2146 $this->form->addItem($ne);
2150 $ne->
setValue($dbupdate->getHotfixFileVersion());
2151 $this->form->addItem($ne);
2153 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2158 if ($dbupdate->getHotfixFileVersion() > 0)
2162 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
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.ilDBUpdate.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.ilDBUpdate.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");
2413 include_once
'Services/Authentication/classes/class.ilSession.php';
2424 $ssettings->addOption($fixed);
2431 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2432 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2433 $ti->setMaxLength(5);
2435 $ti->
setValue($settings[
'session_max_count']);
2436 $ldsh->addSubItem($ti);
2441 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2442 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2443 $ti->setMaxLength(5);
2445 $ti->
setValue($settings[
'session_min_idle']);
2446 $ldsh->addSubItem($ti);
2451 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2452 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2453 $ti->setMaxLength(5);
2455 $ti->
setValue($settings[
'session_max_idle']);
2456 $ldsh->addSubItem($ti);
2460 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2461 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2462 $ti->setMaxLength(5);
2464 $ti->
setValue($settings[
'session_max_idle_after_first_request']);
2465 $ldsh->addSubItem($ti);
2468 $ssettings->addOption($ldsh);
2470 $form->addItem($ssettings);
2474 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2475 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2476 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2477 $form->addItem($chkb);
2481 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2483 $form->setTitle($this->lng->txt(
"sess_sessions"));
2484 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2486 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2487 $this->tpl->setVariable(
"TXT_INFO",
'');
2488 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2511 if (!$this->setup->getClient()->db_installed)
2514 $message =
"No database found! Please install database first.";
2518 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2520 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2522 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2523 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2525 $installed_langs = $this->lng->getInstalledLanguages();
2526 $lang_count = count($installed_langs);
2527 if ($lang_count > 0)
2529 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2530 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2534 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2535 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2538 $this->setButtonPrev(
"lang");
2540 if ($lang_count > 0)
2542 $this->setButtonNext(
"contact");
2556 if (empty(
$_POST[
"form"][
"lang_id"]))
2562 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2568 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2575 foreach (
$result as $key => $lang_key)
2577 $list .= $this->lng->txt(
"lang_".$lang_key);
2579 if ($count > $key + 1)
2586 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2587 $message = $this->lng->txt(
"languages_installed");
2591 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2607 $settings = $this->setup->getClient()->getAllSettings();
2614 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2615 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2616 $this->setButtonPrev(
"lang");
2618 $check = $this->setup->checkClientContact($this->setup->client);
2620 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2621 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2623 if ($check[
"status"])
2625 $this->setButtonNext(
"nic");
2640 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2647 $ti->setRequired(
true);
2648 $this->form->addItem($ti);
2654 $this->form->addItem($ti);
2657 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2660 $this->form->addItem($ti);
2664 $sh->setTitle($lng->txt(
"contact_data"));
2665 $this->form->addItem($sh);
2668 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
2671 $ti->setRequired(
true);
2672 $this->form->addItem($ti);
2675 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
2678 $ti->setRequired(
true);
2679 $this->form->addItem($ti);
2682 "title" => array(
"max" => 64,
"size" => 30),
2683 "position" => array(
"max" => 64,
"size" => 30),
2684 "institution" => array(
"max" => 200,
"size" => 30),
2685 "street" => array(
"max" => 64,
"size" => 30),
2686 "zipcode" => array(
"max" => 10,
"size" => 5),
2687 "city" => array(
"max" => 64,
"size" => 30),
2688 "country" => array(
"max" => 64,
"size" => 30),
2689 "phone" => array(
"max" => 64,
"size" => 30)
2691 foreach ($fs as $f => $op)
2696 $ti->setSize($op[
"size"]);
2697 $ti->setInfo($lng->txt(
""));
2698 $this->form->addItem($ti);
2702 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
2703 $ti->setRequired(
true);
2704 $this->form->addItem($ti);
2706 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
2708 $this->form->setTitle($lng->txt(
"client_data"));
2709 $this->form->setFormAction(
"setup.php?cmd=gateway");
2718 $settings = $this->setup->getClient()->getAllSettings();
2720 $values = $settings;
2722 $values[
"inst_name"] = ($this->setup->getClient()->getName())
2723 ? $this->setup->getClient()->getName()
2724 : $this->setup->getClient()->getId();
2725 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
2727 $this->form->setValuesByArray($values);
2738 if ($this->form->checkInput())
2740 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
2741 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
2742 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
2743 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
2744 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
2745 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
2746 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
2747 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
2748 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
2749 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
2750 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
2751 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
2752 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
2755 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
2756 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
2757 $this->setup->getClient()->ini->write();
2763 $this->form->setValuesByPost();
2777 $settings = $this->setup->getClient()->getAllSettings();
2778 $nic_key = $this->setup->getClient()->getNICkey();
2781 $settings = $this->setup->getClient()->getAllSettings();
2783 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2785 $this->no_second_nav =
true;
2786 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2791 $settings = $this->setup->getClient()->getAllSettings();
2793 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
2799 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2801 if (isset($settings[
"nic_enabled"]))
2803 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2808 $this->setButtonPrev(
"contact");
2810 if ($this->setup->getClient()->status[
"nic"][
"status"])
2812 $this->setButtonNext(
"finish",
"finish");
2827 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2834 $radg->addOption($op1);
2835 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
2836 $radg->addOption($op1);
2837 $this->form->addItem($radg);
2839 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
2840 $this->form->setFormAction(
"setup.php?cmd=gateway");
2848 $settings = $this->setup->getClient()->getAllSettings();
2849 $nic_key = $this->setup->getClient()->getNICkey();
2854 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2856 $values[
"register"] = 1;
2864 $values[
"register"] = 0;
2867 $this->form->setValuesByArray($values);
2878 if ($this->form->checkInput())
2881 if (
$_POST[
"register"] == 1)
2884 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
2887 if (empty($this->setup->getClient()->nic_status[2]))
2889 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
2895 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
2896 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
2897 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2921 $this->setup->getClient()->setSetting(
"inst_id",
"0");
2922 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
2928 $this->form->setValuesByPost();
2950 $this->tpl->setVariable(
"SETUP_CONTENT",
2951 $ctrl_structure_form->getHTML() .
"<br />" .
2952 $settings_type_form->getHTML());
2989 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
2992 $form->setId(
"control_structure");
2993 $form->setTitle($this->lng->txt(
"ctrl_structure"));
2994 $form->setFormAction(
"setup.php?cmd=gateway");
2996 $ilDB = $this->setup->getClient()->db;
2997 $cset =
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
2998 $crec =
$ilDB->fetchAssoc($cset);
3001 if ($crec[
"cnt"] == 0)
3003 $item->
setInfo($this->lng->txt(
"ctrl_missing_desc"));
3007 $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
3009 $form->addItem($item);
3011 $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
3023 if (!$this->setup->getClient()->db_installed)
3031 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
3034 require_once
"./setup/classes/class.ilModuleReader.php";
3035 require_once
"./setup/classes/class.ilServiceReader.php";
3036 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
3038 require_once
"./Services/Component/classes/class.ilModule.php";
3039 require_once
"./Services/Component/classes/class.ilService.php";
3044 foreach($modules as $module)
3047 $module[
"subdir"],
"Modules");
3053 foreach($services as $service)
3056 $service[
"subdir"],
"Services");
3062 $ilCtrlStructureReader->readStructure(
true);
3074 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3077 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3080 $form->setId(
"settings_type");
3081 $form->setTitle($this->lng->txt(
"settings_type"));
3082 $form->setFormAction(
"setup.php?cmd=gateway");
3085 $item->
setValue(strtoupper($type));
3087 if ($type ==
"clob")
3089 $item->setInfo($this->lng->txt(
'settings_info_clob'));
3090 $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
3091 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
3095 $item->setInfo($this->lng->txt(
'settings_info_text'));
3096 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
3098 $form->addItem($item);
3100 if (is_array($this->longer_settings))
3104 if (count($this->longer_settings))
3106 foreach ($this->longer_settings as
$row)
3108 $subitem =
new ilCustomInputGUI(sprintf($this->lng->txt(
'settings_key_info'), $row[
'module'], $row[
'keyword']));
3109 $subitem->setInfo($row[
'value']);
3110 $item->addSubItem($subitem);
3115 $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
3117 $form->addItem($item);
3129 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3132 if ($old_type ==
"clob")
3135 if (count($longer_settings))
3137 $this->longer_settings = $longer_settings;
3165 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3175 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3177 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3182 $pass_old = $this->setup->getPassword();
3184 if (empty(
$_POST[
"form"][
"pass_old"]))
3186 $message = $this->lng->txt(
"password_enter_old");
3187 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3190 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3192 $message = $this->lng->txt(
"password_old_wrong");
3193 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3196 if (empty(
$_POST[
"form"][
"pass"]))
3198 $message = $this->lng->txt(
"password_empty");
3199 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3204 $message = $this->lng->txt(
"password_not_match");
3205 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3208 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3210 $message = $this->lng->txt(
"password_same");
3211 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3214 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3216 $message = $this->lng->txt(
"save_error");
3217 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3225 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3227 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3230 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3231 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3232 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3233 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3234 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3235 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3236 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3245 $this->no_second_nav =
true;
3249 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3250 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3251 $this->lng->txt(
"password").
": <b>homer</b></p>";
3252 $this->setButtonNext(
"login_new",
"login");
3254 $this->setup->getClient()->reconnect();
3257 $this->setup->getClient()->setSetting(
"setup_ok",1);
3260 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3265 $txt_info = $this->lng->txt(
"info_text_finish2");
3270 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3271 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3273 $this->setButtonPrev(
"nic");
3287 if (
$_POST[
"form"][
"delete"])
3313 $msg = $this->setup->getClient()->delete(
$ini,$db,
$files);
3319 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3322 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3325 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3326 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3327 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3328 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3340 if ($this->setup->getClient()->status[
"finish"][
"status"])
3342 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3343 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3344 $this->setup->getClient()->ini->write();
3345 $message =
"client_access_mode_changed";
3349 $message =
"client_setup_not_finished";
3368 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3371 $status = $this->setup->getStatus(
$client);
3373 if ($status[
"finish"][
"status"])
3375 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3376 $this->setup->ini->write();
3377 $message =
"default_client_changed";
3381 $message =
"client_setup_not_finished";
3396 foreach ($this->setup->getClient()->status as $key => $val)
3398 if ($key !=
"finish" and $key !=
"access")
3400 if ($val[
"status"] !=
true)
3408 $clientlist =
new ilClientList($this->setup->db_connections);
3410 $list = $clientlist->getClients();
3412 if (count($list) == 1)
3414 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3415 $this->setup->ini->write();
3417 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3418 $this->setup->getClient()->ini->write();
3429 if (!$this->setup->getClient()->status[
"db"][
"status"])
3435 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3437 $this->cmd =
"lang";
3441 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3443 $this->cmd =
"contact";
3447 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3453 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3455 $this->cmd =
"finish";
3470 if ($this->setup->ini->readVariable(
"clients",
"list"))
3472 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3473 $this->setup->ini->write();
3478 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3479 $this->setup->ini->write();