4 require_once
"./setup/classes/class.ilSetup.php";
46 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
48 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
52 $this->revision =
'$Revision$';
53 $this->version =
"2 ".substr(substr($this->revision,1),0,-2);
54 $this->lang = $this->lng->lang_key;
61 if (
$_POST[
"client_id"] !=
"")
81 $this->setup->ini_client_exists = $this->setup->newClient(
$client_id);
82 if (is_object($this->setup->getClient()))
84 $this->setup->getClient()->status = $this->setup->getStatus(
$client_id);
88 if (($this->cmd =
$_GET[
"cmd"]) ==
"gateway")
91 @$this->cmd = key(
$_POST[
"cmd"]);
97 if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status[
"finish"][
"status"] and $this->cmd !=
"clientlist" and $this->cmd !=
"")
110 if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled())
113 if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable(
"clients",
"path")))
119 if ($this->cmd ==
"performLogin" || $this->cmd ==
"performMLogin")
132 if ($this->setup->isAdmin())
147 echo
"cmd: ".$this->cmd.
" | access: ".$this->setup->access_mode.
" | display: ".
$this->display_mode;
148 var_dump($this->setup->getClient()->status);
169 case "preliminaries":
170 $this->setup->checkPreliminaries();
178 case "determineToolsPathInstall":
182 case "saveBasicSettings":
187 $this->
displayError($this->lng->txt(
"unknown_command"));
205 $this->active_tab =
"clientlist";
208 case "changepassword":
211 $this->active_tab =
"password";
214 case "mastersettings":
217 $this->active_tab =
"basicsettings";
220 case "determineToolsPath":
225 case "changedefault":
230 $this->cmd =
"selectdb";
232 $this->setup->ini_client_exists = $this->setup->newClient();
246 $this->setup->ini_client_exists = $this->setup->newClient();
260 case "preliminaries":
261 $this->setup->checkPreliminaries();
263 $this->active_tab =
"preliminaries";
266 case "updateBasicSettings":
268 case "performMLogin":
288 if ($this->setup->getClient()->db_installed)
318 if (!isset(
$_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"sess" and $this->setup->error ===
true)
329 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"lang" and $this->setup->error ===
true)
340 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"contact")
351 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"proxy")
362 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"nic")
373 if (!isset($_GET[
"lang"]) and !$this->setup->getClient()->status[
"finish"][
"status"] and $_GET[
"cmd"] ==
"finish")
393 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
397 if ($this->setup->getClient()->ini->readVariable(
"client",
"access") !=
"1")
399 $this->setup->getClient()->ini->setVariable(
"client",
"access",
"1");
400 $this->setup->getClient()->ini->write();
404 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
411 case "reloadStructure":
415 case "saveClientIni":
416 case "installDatabase":
417 case "displayDatabase":
418 case "updateDatabase":
419 case "showUpdateSteps":
420 case "saveLanguages":
422 case "displayContactData":
424 case "saveRegistration":
426 case "showHotfixSteps":
427 case "applyCustomUpdates":
428 case "changeSettingsType":
429 case "showLongerSettings":
430 case "cloneSelectSource":
431 case "cloneSaveSource":
437 $this->
displayError($this->lng->txt(
"unknown_command"));
459 if ($a_mode !=
"view" and $a_mode !=
"setup")
464 $this->display_mode = $a_mode;
475 $languages = $this->lng->getLanguages();
477 $count = (int) round(count($languages) / 2);
480 foreach ($languages as $lang_key)
484 $this->tpl->touchBlock(
"lng_new_row");
487 $this->tpl->setCurrentBlock(
"languages");
488 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
489 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
490 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
491 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
492 $this->tpl->setVariable(
"BORDER", 0);
493 $this->tpl->setVariable(
"VSPACE", 0);
494 $this->tpl->parseCurrentBlock();
499 if (count($languages) % 2)
501 $this->tpl->touchBlock(
"lng_empty_cell");
504 if ($this->cmd !=
"logout" and $this->setup->isInstalled())
507 if ($this->setup->isAdmin())
509 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
511 $this->tpl->setCurrentBlock(
"add_client");
512 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
513 $this->tpl->parseCurrentBlock();
517 $class = ($this->active_tab ==
"clientlist")
520 $this->tpl->setCurrentBlock(
"display_list");
521 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
522 $this->tpl->setVariable(
"TAB_CLASS", $class);
523 $this->tpl->parseCurrentBlock();
526 $class = ($this->active_tab ==
"basicsettings")
529 $this->tpl->setCurrentBlock(
"edit_pathes");
530 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
531 $this->tpl->setVariable(
"TAB_CLASS", $class);
532 $this->tpl->parseCurrentBlock();
535 $class = ($this->active_tab ==
"preliminaries")
538 $this->tpl->setCurrentBlock(
"preliminaries");
539 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
540 $this->tpl->setVariable(
"TAB_CLASS", $class);
541 $this->tpl->parseCurrentBlock();
544 $class = ($this->active_tab ==
"password")
547 $this->tpl->setCurrentBlock(
"change_password");
548 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
549 $this->tpl->setVariable(
"TAB_CLASS", $class);
550 $this->tpl->parseCurrentBlock();
554 if ($this->setup->isAuthenticated())
556 $this->tpl->setCurrentBlock(
"logout");
557 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
558 $this->tpl->parseCurrentBlock();
562 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
563 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
564 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
565 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
567 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
568 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"./css/setup.css");
569 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
570 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
571 $this->tpl->setVariable(
"VERSION", $this->version);
572 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
573 $this->tpl->setVariable(
"LANG", $this->lang);
582 if ($this->cmd !=
"logout")
584 if ($this->setup->ini_ilias_exists and $this->display_mode ==
"setup" and $this->setup->getClient()->getId() !=
"")
586 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
588 elseif ($this->setup->isAdmin())
590 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
606 if (!$this->btn_prev_on and !$this->btn_next_on)
611 $ntpl =
new ilTemplate(
"tpl.navbuttons.html",
true,
true,
"setup");
614 $ntpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
616 if ($this->btn_prev_on)
618 $ntpl->setCurrentBlock(
"btn_back");
619 $ntpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
620 $ntpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
621 $ntpl->parseCurrentBlock();
624 if ($this->btn_next_on)
626 $ntpl->setCurrentBlock(
"btn_forward");
627 $ntpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
628 $ntpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
629 $ntpl->parseCurrentBlock();
632 $nav_html = $ntpl->get();
633 $this->tpl->setVariable(
"NAVBUTTONS", $nav_html);
634 if (!$this->no_second_nav)
636 $this->tpl->setVariable(
"NAVBUTTONS2", $nav_html);
649 $this->btn_prev_on =
true;
650 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
651 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"prev");
662 $this->btn_next_on =
true;
663 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
664 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next");
679 $btpl =
new ilTemplate(
"tpl.buttons.html",
true,
true,
"setup");
680 $btpl->setCurrentBlock(
"btn");
681 $btpl->setVariable(
"CMD",
"changeaccess");
682 $access_button = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"disable" :
"enable";
683 $btpl->setVariable(
"TXT", $this->lng->txt($access_button));
684 $btpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
685 $btpl->parseCurrentBlock();
686 $this->tpl->setVariable(
"BUTTONS", $btpl->get());
689 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
701 $settings = $this->setup->getClient()->getAllSettings();
703 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
706 $this->form->setTitle($lng->txt(
"client_info"));
710 $ne->
setValue(($this->setup->getClient()->getName())
711 ? $this->setup->getClient()->getName()
712 :
"<".$this->lng->txt(
"no_client_name").
">");
713 $ne->setInfo($this->setup->getClient()->getDescription());
714 $this->form->addItem($ne);
718 $ne->
setValue($this->setup->getClient()->getId());
719 $this->form->addItem($ne);
723 $ne->
setValue(($this->setup->getClient()->db_installed)
724 ? $settings[
"inst_id"]
726 $this->form->addItem($ne);
730 $ne->
setValue(($this->setup->getClient()->db_installed)
731 ? $settings[
"db_version"]
733 $this->form->addItem($ne);
738 $access_status = ($this->setup->getClient()->status[
"access"][
"status"]) ?
"online" :
"disabled";
739 $ne->
setValue($this->lng->txt($access_status).$access_link);
740 $this->form->addItem($ne);
744 $sh->setTitle($this->lng->txt(
"server_info"));
745 $this->form->addItem($sh);
750 $this->form->addItem($ne);
754 $ne->
setValue($_SERVER[
"SERVER_NAME"]);
755 $this->form->addItem($ne);
760 $ne->
setValue($_SERVER[
"SERVER_ADDR"].
":".$_SERVER[
"SERVER_PORT"]);
761 $this->form->addItem($ne);
765 $ne->
setValue($_SERVER[
"SERVER_SOFTWARE"]);
766 $this->form->addItem($ne);
771 $this->form->addItem($ne);
776 $this->form->addItem($ne);
780 $sh->setTitle($this->lng->txt(
"3rd_party_software"));
781 $this->form->addItem($sh);
783 $tools = array(
"convert",
"zip",
"unzip",
"java",
"htmldoc",
"ffmpeg");
785 foreach ($tools as $tool)
789 $p = $this->setup->ini->readVariable(
"tools", $tool);
790 $ne->setValue($p ? $p : $this->lng->txt(
"not_configured"));
791 $this->form->addItem($ne);
796 $p = $this->setup->ini->readVariable(
"tools",
"latex");
797 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
798 $this->form->addItem($ne);
802 $ne->
setValue($this->setup->ini->readVariable(
"tools",
"vscantype"));
803 $this->form->addItem($ne);
807 $p = $this->setup->ini->readVariable(
"tools",
"scancommand");
808 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
809 $this->form->addItem($ne);
813 $p = $this->setup->ini->readVariable(
"tools",
"cleancommand");
814 $ne->
setValue($p ? $p : $this->lng->txt(
"not_configured"));
815 $this->form->addItem($ne);
817 $this->form->setFormAction(
"setup.php?cmd=gateway");
829 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
830 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
832 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html",
"setup");
834 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
835 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
836 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
837 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
838 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
839 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
840 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
842 $server_os = php_uname();
843 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
844 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
846 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
848 $env_comment = $this->lng->txt(
"env_ok");
852 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
855 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
856 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
857 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
859 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
860 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
862 $preliminaries = array(
"php",
"root",
"folder_create",
863 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
864 foreach ($preliminaries as $preliminary)
866 $this->tpl->setCurrentBlock(
"preliminary");
867 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
868 if ($this->setup->preliminaries_result[$preliminary][
"status"] ==
true)
870 $this->tpl->setVariable(
"STATUS_PRE", $OK);
874 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
876 $this->tpl->setVariable(
"COMMENT_PRE", $this->setup->preliminaries_result[$preliminary][
"comment"]);
877 $this->tpl->parseCurrentBlock();
881 if ($this->setup->preliminaries ===
true)
883 if ($this->setup->isInstalled())
885 $cmd =
"mastersettings";
891 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
893 $this->setButtonNext(
$cmd,$btn_text);
897 $this->tpl->setCurrentBlock(
"premessage");
898 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
899 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
900 $this->tpl->parseCurrentBlock();
913 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
914 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
915 $this->tpl->setVariable(
"TXT_INFO",
916 $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
918 $this->setButtonPrev(
"preliminaries");
920 if ($this->setup->isInstalled())
922 $this->setButtonNext(
"list");
929 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
937 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
938 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
939 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
941 $this->btn_next_on =
true;
942 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
943 $this->btn_next_cmd =
"newclient";
950 $this->tpl->setVariable(
"SETUP_CONTENT",
"<br>".$this->form->getHTML().
"<br>");
960 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
967 $ne->
setInfo($this->lng->txt(
"data_directory_in_ws_info"));
970 ? str_replace(
"\\",
"/", getcwd())
973 $ne->setValue($cwd.
"/data");
974 $this->form->addItem($ne);
979 $ti =
new ilTextInputGUI($lng->txt(
"data_directory_outside_ws"),
"datadir_path");
980 $ti->
setInfo($lng->txt(
"data_directory_info"));
981 $ti->setRequired(
true);
982 $this->form->addItem($ti);
987 $this->form->addItem($ne);
997 $sh->setTitle($lng->txt(
"logging"));
998 $this->form->addItem($sh);
1002 $ti->
setInfo($lng->txt(
"log_path_comment".$lvext));
1003 $this->form->addItem($ti);
1007 $this->form->addItem($cb);
1011 $sh->setTitle($lng->txt(
"server_settings"));
1012 $this->form->addItem($sh);
1015 include_once(
"./Services/Calendar/classes/class.ilCalendarUtil.php");
1017 $si->setOptions(array_merge(
1018 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
1020 $si->setRequired(
true);
1021 $this->form->addItem(
$si);
1025 $sh->setTitle($lng->txt(
"3rd_party_software_req"));
1026 $this->form->addItem($sh);
1029 $ti =
new ilTextInputGUI($lng->txt(
"convert_path"),
"convert_path");
1030 $ti->
setInfo($lng->txt(
"convert_path_comment".$lvext));
1031 $ti->setRequired(
true);
1032 $this->form->addItem($ti);
1036 $ti->
setInfo($lng->txt(
"zip_path_comment".$lvext));
1037 $ti->setRequired(
true);
1038 $this->form->addItem($ti);
1042 $ti->
setInfo($lng->txt(
"unzip_path_comment".$lvext));
1043 $ti->setRequired(
true);
1044 $this->form->addItem($ti);
1048 $sh->setTitle($lng->txt(
"3rd_party_software_opt"));
1049 $this->form->addItem($sh);
1053 $ti->
setInfo($lng->txt(
"java_path_comment".$lvext));
1054 $this->form->addItem($ti);
1057 $ti =
new ilTextInputGUI($lng->txt(
"htmldoc_path"),
"htmldoc_path");
1058 $ti->
setInfo($lng->txt(
"htmldoc_path_comment".$lvext));
1059 $this->form->addItem($ti);
1062 $ti =
new ilTextInputGUI($lng->txt(
"ffmpeg_path"),
"ffmpeg_path");
1063 $ti->
setInfo($lng->txt(
"ffmpeg_path_comment"));
1064 $this->form->addItem($ti);
1067 $ti =
new ilTextInputGUI($lng->txt(
"url_to_latex"),
"latex_url");
1068 $ti->
setInfo($lng->txt(
"latex_url_comment"));
1069 $this->form->addItem($ti);
1073 "none" => $lng->txt(
"none"),
1074 "sophos" => $lng->txt(
"sophos"),
1075 "antivir" => $lng->txt(
"antivir"),
1076 "clamav" => $lng->txt(
"clamav")
1080 $this->form->addItem($si);
1083 $ti =
new ilTextInputGUI($lng->txt(
"scan_command"),
"scan_command");
1084 $this->form->addItem($ti);
1087 $ti =
new ilTextInputGUI($lng->txt(
"clean_command"),
"clean_command");
1088 $this->form->addItem($ti);
1093 $sh->setTitle($lng->txt(
"master_password"));
1094 $this->form->addItem($sh);
1099 $pi->setSkipSyntaxCheck(
true);
1100 $pi->setInfo($lng->txt(
"password_info"));
1101 $this->form->addItem($pi);
1106 $this->form->addCommandButton(
"saveBasicSettings", $lng->txt(
"save"));
1110 $this->form->addCommandButton(
"updateBasicSettings", $lng->txt(
"save"));
1111 $this->form->addCommandButton(
"determineToolsPath", $lng->txt(
"determine_tools_paths"));
1114 $this->form->setTitle($lng->txt(
"data_directories"));
1115 $this->form->setFormAction(
"setup.php?cmd=gateway");
1120 $this->form->setValuesByArray($det);
1132 $values[
"webspace_dir"] = getcwd().
"/data";
1133 $values[
"data_dir"] = $this->setup->ini->readVariable(
"clients",
"datadir");
1134 $values[
"convert_path"] = $this->setup->ini->readVariable(
"tools",
"convert");
1135 $values[
"zip_path"] = $this->setup->ini->readVariable(
"tools",
"zip");
1136 $values[
"unzip_path"] = $this->setup->ini->readVariable(
"tools",
"unzip");
1137 $values[
"java_path"] = $this->setup->ini->readVariable(
"tools",
"java");
1138 $values[
"htmldoc_path"] = $this->setup->ini->readVariable(
"tools",
"htmldoc");
1140 $values[
"ffmpeg_path"] = $this->setup->ini->readVariable(
"tools",
"ffmpeg");
1141 $values[
"latex_url"] = $this->setup->ini->readVariable(
"tools",
"latex");
1142 $values[
"fop_path"] = $this->setup->ini->readVariable(
"tools",
"fop");
1143 $values[
"vscanner_type"] = $this->setup->ini->readVariable(
"tools",
"vscantype");
1144 $values[
"scan_command"] = $this->setup->ini->readVariable(
"tools",
"scancommand");
1145 $values[
"clean_command"] = $this->setup->ini->readVariable(
"tools",
"cleancommand");
1146 $values[
"log_path"] = $this->setup->ini->readVariable(
"log",
"path").
"/".
1147 $this->setup->ini->readVariable(
"log",
"file");
1148 $values[
"chk_log_status"] = !$this->setup->ini->readVariable(
"log",
"enabled");
1149 $values[
"time_zone"] = $this->setup->ini->readVariable(
"server",
"timezone");
1151 $this->form->setValuesByArray($values);
1163 if ($this->form->checkInput())
1168 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1169 "unzip_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1178 if (!$this->setup->checkDataDirSetup(
$_POST))
1180 $i = $this->form->getItemByPostVar(
"datadir_path");
1181 $i->setAlert($this->lng->txt($this->setup->getError()));
1184 else if (!$this->setup->checkLogSetup(
$_POST))
1186 $i = $this->form->getItemByPostVar(
"log_path");
1187 $i->setAlert($this->lng->txt($this->setup->getError()));
1190 else if (!$this->setup->checkPasswordSetup(
$_POST))
1194 else if (!$this->setup->saveMasterSetup(
$_POST))
1205 $this->form->setValuesByPost();
1218 if ($this->form->checkInput())
1222 $fs = array(
"datadir_path",
"log_path",
"convert_path",
"zip_path",
1223 "unzip_path",
"java_path",
"htmldoc_path",
"ffmpeg_path");
1230 if (!$this->setup->checkLogSetup(
$_POST))
1232 $i = $this->form->getItemByPostVar(
"log_path");
1233 $i->setAlert($this->lng->txt($this->setup->getError()));
1236 else if (!$this->setup->updateMasterSettings(
$_POST))
1247 $this->form->setValuesByPost();
1262 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->setup->getClient()->getId());
1272 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
1276 $m_form = $this->form->getHTML();
1282 $cl_form = $this->form->getHTML();
1286 $m_form = $this->form->getHTML();
1288 $this->tpl->setVariable(
"SETUP_CONTENT", $cl_form.
"<br>".$m_form);
1289 $this->tpl->setVariable(
"TXT_HEADER", $lng->txt(
"login"));
1298 if ($this->form->checkInput())
1300 $i = $this->form->getItemByPostVar(
"mpassword");
1301 if (!$this->setup->loginAsAdmin(
$_POST[
"mpassword"]))
1303 $i->setAlert($this->lng->txt(
"login_invalid"));
1313 $this->form->setValuesByPost();
1323 if ($this->form->checkInput())
1325 $i = $this->form->getItemByPostVar(
"password");
1326 if (!$this->setup->loginAsClient(
1327 array(
"client_id" =>
$_POST[
"client_id"],
1328 "username" =>
$_POST[
"username"],
"password" =>
$_POST[
"password"])))
1330 $i->setAlert($this->setup->getError());
1340 $this->form->setValuesByPost();
1351 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1358 $this->form->addItem($ti);
1363 $this->form->addItem($ti);
1368 $pi->setRetype(
false);
1369 $pi->setSkipSyntaxCheck(
true);
1370 $this->form->addItem($pi);
1372 $this->form->addCommandButton(
"performLogin", $lng->txt(
"login"));
1374 $this->form->setTitle($lng->txt(
"client_login"));
1375 $this->form->setFormAction(
"setup.php?cmd=gateway");
1385 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1391 $pi->setRetype(
false);
1392 $pi->setSkipSyntaxCheck(
true);
1393 $this->form->addItem($pi);
1395 $this->form->addCommandButton(
"performMLogin", $lng->txt(
"login"));
1397 $this->form->setTitle($lng->txt(
"admin_login"));
1398 $this->form->setFormAction(
"setup.php?cmd=gateway");
1413 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html",
"setup");
1414 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1418 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"list_clients"));
1419 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1420 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->setup->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1422 include_once(
"./setup/classes/class.ilClientListTableGUI.php");
1424 $this->tpl->setVariable(
"CLIENT_LIST",
$tab->getHTML());
1427 $this->btn_next_on =
true;
1428 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
"...";
1429 $this->btn_next_cmd =
"newclient";
1455 ? str_replace(
"\\",
"/", getcwd())
1459 $tools = array(
"convert" =>
"convert",
1460 "zip" =>
"zip",
"unzip" =>
"unzip",
1461 "java" =>
"java",
"htmldoc" =>
"htmldoc",
"ffmpeg" =>
"ffmpeg");
1462 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin",
"/usr/bin");
1466 $tools = array(
"convert" =>
"convert.exe",
1467 "zip" =>
"zip.exe",
"unzip" =>
"unzip.exe");
1468 $dirs = array($cwd.
"/Services/Windows/bin32/zip",
1469 $cwd.
"/Services/Windows/bin32/unzip",
1470 $cwd.
"/Services/Windows/bin32/convert");
1472 foreach($tools as $k => $tool)
1476 @exec(
"which ".$tool,
$ret);
1477 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1479 $a_tools[$k.
"_path"] =
$ret[0];
1484 foreach(
$dirs as $dir)
1486 if (@is_file($dir.
"/".$tool))
1488 $a_tools[$k.
"_path"] = $dir.
"/".$tool;
1513 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
1519 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_select_db.html",
"setup");
1521 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1522 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1524 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1525 $this->tpl->setVariable(
"TXT_DB_SELECTION", $this->lng->txt(
"db_selection"));
1527 if ($this->setup->getClient()->status[
"ini"][
"status"])
1529 $this->setButtonNext(
"db");
1542 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1547 "mysql" =>
"MySQL 5.0.x or higher (MyISAM engine)",
1548 "innodb" =>
"MySQL 5.0.x or higher (InnoDB engine)",
1549 "oracle" =>
"Oracle 10g or higher",
1550 "postgres" =>
"Postgres (experimental)"
1553 $si->setOptions($options);
1554 $si->setInfo($lng->txt(
""));
1555 $this->form->addItem(
$si);
1557 $this->form->addCommandButton(
"selectdbtype", $lng->txt(
"save"));
1559 $this->form->setTitle($lng->txt(
"db_selection"));
1560 $this->form->setFormAction(
"setup.php?cmd=gateway");
1574 if (
$_POST[
"db_type"] !=
"")
1583 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1584 if (!$a_omit_form_init)
1589 $this->tpl->setVariable(
"SETUP_CONTENT",
1590 $this->form->getHTML());
1592 if ($this->setup->getClient()->status[
"ini"][
"status"])
1594 $this->setButtonNext(
"db");
1607 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1611 if ($this->setup->ini_client_exists)
1614 $hi->setValue($this->client_id);
1615 $this->form->addItem($hi);
1619 $this->form->addItem($ne);
1625 $ti->setRequired(
true);
1626 $this->form->addItem($ti);
1631 $sh->setTitle($lng->txt(
"db_conn"));
1632 $this->form->addItem($sh);
1636 $ne->
setValue($lng->txt(
"db_".$_SESSION[
"db_type"]));
1637 $this->form->addItem($ne);
1642 $ti->setRequired(
true);
1643 $this->form->addItem($ti);
1646 if (in_array(
$_SESSION[
"db_type"], array(
"mysql",
"postgres",
"innodb")))
1653 $ti =
new ilTextInputGUI($lng->txt(
"db_service_name"),
"db_name");
1656 $this->form->addItem($ti);
1661 $ti->setRequired(
true);
1662 $this->form->addItem($ti);
1667 $this->form->addItem($ti);
1672 $this->form->addItem($ti);
1674 $this->form->addCommandButton(
"saveClientIni", $lng->txt(
"save"));
1676 $this->form->setTitle($lng->txt(
"inst_identification"));
1677 $this->form->setFormAction(
"setup.php?cmd=gateway");
1687 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
1688 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
1689 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
1690 $values[
"db_pass"] = $this->setup->getClient()->getDbPass();
1691 $values[
"db_name"] = $this->setup->getClient()->getDbName();
1692 $values[
"client_id"] = $this->setup->getClient()->getId();
1694 $this->form->setValuesByArray($values);
1705 if ($this->form->checkInput())
1707 if (strlen(
$_POST[
"client_id"]) != strlen(urlencode((
$_POST[
"client_id"])))
1708 || is_int(strpos(
$_POST[
"client_id"],
"_")))
1710 $i = $this->form->getItemByPostVar(
"client_id");
1711 $i->setAlert($this->lng->txt(
"ini_client_id_invalid"));
1714 else if (strlen(
$_POST[
"client_id"]) < 4)
1716 $i = $this->form->getItemByPostVar(
"client_id");
1717 $i->setAlert($this->lng->txt(
"ini_client_id_too_short"));
1720 else if (strlen(
$_POST[
"client_id"]) > 32)
1722 $i = $this->form->getItemByPostVar(
"client_id");
1723 $i->setAlert($this->lng->txt(
"ini_client_id_too_long"));
1728 $i = $this->form->getItemByPostVar(
"client_id");
1729 $i->setAlert($this->lng->txt(
"ini_client_id_exists"));
1736 $old_db_name = $this->setup->getClient()->getDbName();
1737 $old_db_type = $this->setup->getClient()->getDbType();
1738 $old_client_id = $this->setup->getClient()->getId();
1741 if (!$this->setup->ini_client_exists)
1748 $this->setup->getClient()->setId(
$_POST[
"client_id"]);
1749 $this->setup->getClient()->setDbHost(
$_POST[
"db_host"]);
1750 $this->setup->getClient()->setDbName(
$_POST[
"db_name"]);
1751 $this->setup->getClient()->setDbUser(
$_POST[
"db_user"]);
1752 $this->setup->getClient()->setDbPort(
$_POST[
"db_port"]);
1753 $this->setup->getClient()->setDbPass(
$_POST[
"db_pass"]);
1754 $this->setup->getClient()->setDbType(
$_SESSION[
"db_type"]);
1755 $this->setup->getClient()->setDSN();
1758 if (!$this->setup->getClient()->checkDatabaseHost())
1760 $i = $this->form->getItemByPostVar(
"db_host");
1761 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1767 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1769 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1771 $_POST[
"db_name"] = $old_db_name;
1772 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->setup->getClient()->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1773 $i = $this->form->getItemByPostVar(
"db_name");
1774 $i->setAlert($message);
1780 if (!$this->setup->ini_client_exists)
1782 if ($this->setup->saveNewClient())
1785 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1791 $err = $this->setup->getError();
1793 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1794 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1799 if ($this->setup->getClient()->ini->write())
1802 $this->setup->getClient()->status[
"ini"][
"status"] =
true;
1807 $err = $this->setup->getClient()->ini->getError();
1809 $this->setup->getClient()->status[
"ini"][
"status"] =
false;
1810 $this->setup->getClient()->status[
"ini"][
"comment"] = $err;
1818 $this->form->setValuesByPost();
1829 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html",
"setup");
1831 $this->tpl->setCurrentBlock(
"content");
1832 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1833 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1834 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1835 $this->tpl->parseCurrentBlock();
1846 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html",
"setup");
1850 $this->logged_out =
true;
1851 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1852 $this->tpl->setCurrentBlock(
"home_link");
1853 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1854 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1855 $this->tpl->parseCurrentBlock();
1863 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1866 $steps = $this->setup->getStatus();
1871 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1872 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1874 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1875 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1876 $steps[
"proxy"][
"text"] = $this->lng->txt(
"setup_process_step_proxy");
1877 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1878 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1880 $stpl =
new ilTemplate(
"tpl.process_panel.html",
true,
true,
"setup");
1884 foreach (
$steps as $key => $val)
1886 $stpl->setCurrentBlock(
"menu_row");
1887 $stpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1888 $stpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1889 $stpl->setVariable(
"IMG_ARROW",
"spacer.png");
1893 if ($this->cmd == $key and isset($this->cmd))
1895 $stpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1896 $stpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1899 $status = ($val[
"status"]) ? $OK :
"";
1901 $stpl->setVariable(
"TXT_STATUS",$status);
1902 $stpl->parseCurrentBlock();
1905 $stpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1907 $this->tpl->setVariable(
"PROCESS_MENU", $stpl->get());
1915 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1917 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html",
"setup");
1919 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1921 if ($this->setup->getClient()->status)
1923 foreach ($this->setup->getClient()->status as $key => $val)
1925 $status = ($val[
"status"]) ? $OK :
" ";
1926 $this->tpl->setCurrentBlock(
"status_row");
1927 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1928 $this->tpl->setVariable(
"TXT_STATUS",$status);
1931 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1932 $this->tpl->parseCurrentBlock();
1944 switch ($this->display_mode)
1947 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html",
"setup");
1949 include
"./setup/include/inc.client_tabs.php";
1950 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(
"no_client_name");
1951 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->setup->getClient()->getId().
")");
1955 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1956 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1960 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1971 switch ($this->display_mode)
1988 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html",
"setup");
1990 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
1991 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
1995 $this->setButtonNext(
"ini");
2014 if ($this->setup->getClient()->db_installed)
2016 $ilDB = $this->setup->getClient()->db;
2017 $this->lng->setDbHandler($ilDB);
2018 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2020 $db_status = $dbupdate->getDBVersionStatus();
2021 $hotfix_available = $dbupdate->hotfixAvailable();
2022 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2023 $this->
initClientDbForm(
false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2025 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2029 $this->setButtonNext(
"lang");
2034 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
2035 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
2036 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
2040 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2041 $this->setButtonPrev(
"ini");
2050 public function initClientDbForm($a_install =
true, $dbupdate = null, $db_status =
false, $hotfix_available =
false, $custom_updates_available =
false)
2054 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2059 $this->form->addItem($ne);
2062 if ($this->setup->getClient()->getDBType() ==
"mysql" ||
2063 $this->setup->getClient()->getDBType() ==
"innodb")
2066 $ilDB = $this->setup->getClient()->db;
2067 $ne->
setValue($ilDB->getDBVersion());
2068 $this->form->addItem($ne);
2073 $this->form->addItem($ne);
2077 $this->form->addItem($ne);
2081 $this->form->addItem($ne);
2085 $this->form->addItem($ne);
2088 if (($this->setup->getClient()->getDBType() ==
"mysql" ||
2089 $this->setup->getClient()->getDBType() ==
"innodb") && $a_install)
2102 "utf8_icelandic_ci",
2104 "utf8_lithuanian_ci",
2110 "utf8_slovenian_ci",
2116 foreach($collations as $collation)
2118 $options[$collation] = $collation;
2121 $si->setOptions($options);
2122 $si->setInfo($this->lng->txt(
"info_text_db_collation2").
" ".
2123 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2124 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2125 $cb->addSubItem(
$si);
2127 $this->form->addItem($cb);
2132 $this->form->addCommandButton(
"installDatabase", $lng->txt(
"database_install"));
2136 $ilDB = $this->setup->getClient()->db;
2137 $this->lng->setDbHandler($ilDB);
2142 $ne->
setValue($dbupdate->currentVersion);
2143 $this->form->addItem($ne);
2147 $ne->
setValue($dbupdate->fileVersion);
2148 $this->form->addItem($ne);
2150 if (!$db_status = $dbupdate->getDBVersionStatus())
2154 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2158 if (count($options) > 1)
2161 $si->setOptions($options);
2162 $si->setInfo($lng->txt(
"next_update_break_info"));
2163 $this->form->addItem(
$si);
2166 if ($dbupdate->getRunningStatus() > 0)
2169 $this->lng->txt(
"db_update_interrupted_avoid"));
2175 $this->form->addCommandButton(
"updateDatabase", $lng->txt(
"database_update"));
2176 $this->form->addCommandButton(
"showUpdateSteps", $lng->txt(
"show_update_steps"));
2178 else if ($hotfix_available)
2182 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2183 $this->form->addItem($ne);
2187 $ne->
setValue($dbupdate->getHotfixFileVersion());
2188 $this->form->addItem($ne);
2190 $this->form->addCommandButton(
"applyHotfix", $lng->txt(
"apply_hotfixes"));
2191 $this->form->addCommandButton(
"showHotfixSteps", $lng->txt(
"show_update_steps"));
2194 elseif($custom_updates_available)
2198 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2199 $this->form->addItem($ne);
2203 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2204 $this->form->addItem($ne);
2206 $this->form->addCommandButton(
"applyCustomUpdates", $lng->txt(
"apply_custom_updates"));
2211 if ($dbupdate->getHotfixFileVersion() > 0)
2215 $ne->
setValue($dbupdate->getHotfixCurrentVersion());
2216 $this->form->addItem($ne);
2220 $ne->
setValue($dbupdate->getHotfixFileVersion());
2221 $this->form->addItem($ne);
2223 if ($custom_updates_available && $dbupdate->getCustomUpdatesFileVersion() > 0)
2227 $ne->
setValue($dbupdate->getCustomUpdatesCurrentVersion());
2228 $this->form->addItem($ne);
2232 $ne->
setValue($dbupdate->getCustomUpdatesFileVersion());
2233 $this->form->addItem($ne);
2239 $this->form->setTitle($lng->txt(
"database"));
2240 $this->form->setFormAction(
"setup.php?cmd=gateway");
2253 $values[
"db_host"] = $this->setup->getClient()->getDbHost();
2254 $values[
"db_name"] = $this->setup->getClient()->getDbName();
2255 $values[
"db_user"] = $this->setup->getClient()->getDbUser();
2256 $values[
"db_port"] = $this->setup->getClient()->getDbPort();
2257 $values[
"db_type"] = $lng->txt(
"db_".$this->setup->getClient()->getDbType());
2258 if (is_object($dbupdate))
2260 $values[
"update_break"] = $dbupdate->fileVersion;
2261 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2263 $values[
"update_break"] = $dbupdate->currentVersion + 200 -
2264 ($dbupdate->currentVersion % 100);
2268 $this->form->setValuesByArray($values);
2283 if (!$this->setup->getClient()->db_exists)
2285 if (
$_POST[
"chk_db_create"])
2287 if (!$this->setup->createDatabase(
$_POST[
"collation"]))
2299 if (!$this->setup->installDatabase())
2321 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2323 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2324 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2325 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2326 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2327 include_once
"./Services/Tree/classes/class.ilTree.php";
2328 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2329 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2332 $tz = $this->setup->ini->readVariable(
"server",
"timezone");
2335 if (function_exists(
'date_default_timezone_set'))
2337 date_default_timezone_set($tz);
2339 define (
"IL_TIMEZONE", $tz);
2343 $ilDB = $this->setup->getClient()->db;
2344 $this->lng->setDbHandler($ilDB);
2348 $dbupdate->applyUpdate((
int)
$_POST[
"update_break"]);
2350 if ($dbupdate->updateMsg ==
"no_changes")
2352 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2357 foreach ($dbupdate->updateMsg as
$row)
2359 if ($row[
"msg"] ==
"update_applied")
2361 $a_message.= $sep.$row[
"nr"];
2366 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2369 if ($a_message !=
"")
2371 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2407 if ($this->setup->getClient()->db_installed)
2409 $ilDB = $this->setup->getClient()->db;
2410 $this->lng->setDbHandler($ilDB);
2412 $db_status = $dbupdate->getDBVersionStatus();
2413 $hotfix_available = $dbupdate->hotfixAvailable();
2414 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2418 $ntpl =
new ilTemplate(
"tpl.setup_steps.html",
true,
true,
"setup");
2421 $ntpl->setVariable(
"CONTENT", $dbupdate->getHotfixSteps());
2425 $ntpl->setVariable(
"CONTENT", $dbupdate->getUpdateSteps(
$_POST[
"update_break"]));
2427 $ntpl->setVariable(
"BACK", $this->lng->txt(
"back"));
2428 $ntpl->setVariable(
"HREF_BACK",
"./setup.php?client_id=&cmd=db");
2429 $this->tpl->setVariable(
"SETUP_CONTENT", $ntpl->get());
2445 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2447 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
2448 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
2449 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
2450 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
2451 include_once
"./Services/Tree/classes/class.ilTree.php";
2452 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
2453 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
2456 $ilDB = $this->setup->getClient()->db;
2457 $this->lng->setDbHandler($ilDB);
2461 $dbupdate->applyHotfix();
2463 if ($dbupdate->updateMsg ==
"no_changes")
2465 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
2470 foreach ($dbupdate->updateMsg as
$row)
2472 if ($row[
"msg"] ==
"update_applied")
2474 $a_message.= $sep.$row[
"nr"];
2479 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
2482 if ($a_message !=
"")
2484 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
2501 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
2505 if (!$this->setup->getClient()->db_installed)
2508 $message =
"No database found! Please install database first.";
2515 $settings = array();
2517 foreach( $setting_fields as $field )
2519 if( $field ==
'session_allow_client_maintenance' )
2522 else $_POST[$field] =
'0';
2527 $settings[$field] =
$_POST[$field];
2537 if(
$valid) $this->setup->setSessionSettings($settings);
2539 $settings = $this->setup->getSessionSettings();
2541 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2544 include_once
'Services/Authentication/classes/class.ilSession.php';
2555 $ssettings->addOption($fixed);
2562 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_count'),
"session_max_count");
2563 $ti->
setInfo($this->lng->txt(
'sess_max_session_count_info'));
2564 $ti->setMaxLength(5);
2566 $ti->
setValue($settings[
'session_max_count']);
2567 $ldsh->addSubItem($ti);
2572 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_min_session_idle'),
"session_min_idle");
2573 $ti->
setInfo($this->lng->txt(
'sess_min_session_idle_info'));
2574 $ti->setMaxLength(5);
2576 $ti->
setValue($settings[
'session_min_idle']);
2577 $ldsh->addSubItem($ti);
2582 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle'),
"session_max_idle");
2583 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_info'));
2584 $ti->setMaxLength(5);
2586 $ti->
setValue($settings[
'session_max_idle']);
2587 $ldsh->addSubItem($ti);
2591 $ti =
new ilTextInputGUI($this->lng->txt(
'sess_max_session_idle_after_first_request'),
"session_max_idle_after_first_request");
2592 $ti->
setInfo($this->lng->txt(
'sess_max_session_idle_after_first_request_info'));
2593 $ti->setMaxLength(5);
2595 $ti->
setValue($settings[
'session_max_idle_after_first_request']);
2596 $ldsh->addSubItem($ti);
2599 $ssettings->addOption($ldsh);
2601 $form->addItem($ssettings);
2605 $chkb =
new ilCheckboxInputGUI($this->lng->txt(
'sess_allow_client_maintenance'),
"session_allow_client_maintenance");
2606 $chkb->
setInfo($this->lng->txt(
'sess_allow_client_maintenance_info'));
2607 $chkb->setChecked($settings[
'session_allow_client_maintenance'] ?
true :
false);
2608 $form->addItem($chkb);
2612 $form->addCommandButton(
"sess", $this->lng->txt(
'save'));
2614 $form->setTitle($this->lng->txt(
"sess_sessions"));
2615 $form->setFormAction(
'setup.php?client_id='.$this->client_id.
'&cmd=sess');
2617 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
'sess_sessions'))));
2618 $this->tpl->setVariable(
"TXT_INFO",
'');
2619 $this->tpl->setVariable(
"SETUP_CONTENT", $form->getHTML());
2642 if (!$this->setup->getClient()->db_installed)
2645 $message =
"No database found! Please install database first.";
2649 include_once(
"./setup/classes/class.ilSetupLanguageTableGUI.php");
2651 $this->tpl->setVariable(
"SETUP_CONTENT",
$tab->getHTML());
2653 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2654 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2656 $installed_langs = $this->lng->getInstalledLanguages();
2657 $lang_count = count($installed_langs);
2658 if ($lang_count > 0)
2660 $this->setup->getClient()->status[
"lang"][
"status"] =
true;
2661 $this->setup->getClient()->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2665 $this->setup->getClient()->status[
"lang"][
"status"] =
false;
2666 $this->setup->getClient()->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2669 $this->setButtonPrev(
"lang");
2671 if ($lang_count > 0)
2673 $this->setButtonNext(
"contact");
2687 if (empty(
$_POST[
"form"][
"lang_id"]))
2693 if (!in_array(
$_POST[
"form"][
"lang_default"],
$_POST[
"form"][
"lang_id"]))
2699 $result = $this->lng->installLanguages(
$_POST[
"form"][
"lang_id"],
$_POST[
"form"][
"lang_local"]);
2706 foreach (
$result as $key => $lang_key)
2708 $list .= $this->lng->txt(
"lang_".$lang_key);
2710 if ($count > $key + 1)
2717 $this->setup->getClient()->setDefaultLanguage(
$_POST[
"form"][
"lang_default"]);
2718 $message = $this->lng->txt(
"languages_installed");
2722 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2738 $settings = $this->setup->getClient()->getAllSettings();
2745 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2746 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2747 $this->setButtonPrev(
"lang");
2749 $check = $this->setup->checkClientContact($this->setup->client);
2751 $this->setup->getClient()->status[
"contact"][
"status"] = $check[
"status"];
2752 $this->setup->getClient()->status[
"contact"][
"comment"] = $check[
"comment"];
2754 if ($check[
"status"])
2756 $this->setButtonNext(
"proxy");
2771 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2778 $ti->setRequired(
true);
2779 $this->form->addItem($ti);
2785 $this->form->addItem($ti);
2788 $ti =
new ilTextInputGUI($lng->txt(
"client_institution"),
"inst_institution");
2791 $this->form->addItem($ti);
2795 $sh->setTitle($lng->txt(
"contact_data"));
2796 $this->form->addItem($sh);
2799 $ti =
new ilTextInputGUI($lng->txt(
"firstname"),
"admin_firstname");
2802 $ti->setRequired(
true);
2803 $this->form->addItem($ti);
2806 $ti =
new ilTextInputGUI($lng->txt(
"lastname"),
"admin_lastname");
2809 $ti->setRequired(
true);
2810 $this->form->addItem($ti);
2813 "title" => array(
"max" => 64,
"size" => 30),
2814 "position" => array(
"max" => 64,
"size" => 30),
2815 "institution" => array(
"max" => 200,
"size" => 30),
2816 "street" => array(
"max" => 64,
"size" => 30),
2817 "zipcode" => array(
"max" => 10,
"size" => 5),
2818 "city" => array(
"max" => 64,
"size" => 30),
2819 "country" => array(
"max" => 64,
"size" => 30),
2820 "phone" => array(
"max" => 64,
"size" => 30)
2822 foreach ($fs as $f => $op)
2827 $ti->setSize($op[
"size"]);
2828 $ti->setInfo($lng->txt(
""));
2829 $this->form->addItem($ti);
2833 $ti =
new ilEmailInputGUI($lng->txt(
"email"),
"admin_email");
2834 $ti->setRequired(
true);
2835 $this->form->addItem($ti);
2838 $ti =
new ilEmailInputGUI($lng->txt(
"feedback_recipient"),
"feedback_recipient");
2839 $ti->setInfo($lng->txt(
"feedback_recipient_info"));
2840 $ti->setRequired(
true);
2841 $this->form->addItem($ti);
2844 $ti =
new ilEmailInputGUI($lng->txt(
"error_recipient"),
"error_recipient");
2845 $this->form->addItem($ti);
2847 $this->form->addCommandButton(
"saveContact", $lng->txt(
"save"));
2849 $this->form->setTitle($lng->txt(
"client_data"));
2850 $this->form->setFormAction(
"setup.php?cmd=gateway");
2859 $settings = $this->setup->getClient()->getAllSettings();
2861 $values = $settings;
2863 $values[
"inst_name"] = ($this->setup->getClient()->getName())
2864 ? $this->setup->getClient()->getName()
2865 : $this->setup->getClient()->getId();
2866 $values[
"inst_info"] = $this->setup->getClient()->getDescription();
2868 $this->form->setValuesByArray($values);
2879 if ($this->form->checkInput())
2881 $this->setup->getClient()->setSetting(
"admin_firstname",
$_POST[
"admin_firstname"]);
2882 $this->setup->getClient()->setSetting(
"admin_lastname",
$_POST[
"admin_lastname"]);
2883 $this->setup->getClient()->setSetting(
"admin_title",
$_POST[
"admin_title"]);
2884 $this->setup->getClient()->setSetting(
"admin_position",
$_POST[
"admin_position"]);
2885 $this->setup->getClient()->setSetting(
"admin_institution",
$_POST[
"admin_institution"]);
2886 $this->setup->getClient()->setSetting(
"admin_street",
$_POST[
"admin_street"]);
2887 $this->setup->getClient()->setSetting(
"admin_zipcode",
$_POST[
"admin_zipcode"]);
2888 $this->setup->getClient()->setSetting(
"admin_city",
$_POST[
"admin_city"]);
2889 $this->setup->getClient()->setSetting(
"admin_country",
$_POST[
"admin_country"]);
2890 $this->setup->getClient()->setSetting(
"admin_phone",
$_POST[
"admin_phone"]);
2891 $this->setup->getClient()->setSetting(
"admin_email",
$_POST[
"admin_email"]);
2892 $this->setup->getClient()->setSetting(
"inst_institution",
$_POST[
"inst_institution"]);
2893 $this->setup->getClient()->setSetting(
"inst_name",
$_POST[
"inst_name"]);
2894 $this->setup->getClient()->setSetting(
"feedback_recipient",
$_POST[
"feedback_recipient"]);
2895 $this->setup->getClient()->setSetting(
"error_recipient",
$_POST[
"error_recipient"]);
2898 $this->setup->getClient()->setName(
$_POST[
"inst_name"]);
2899 $this->setup->getClient()->setDescription(
$_POST[
"inst_info"]);
2900 $this->setup->getClient()->ini->write();
2906 $this->form->setValuesByPost();
2920 $settings = $this->setup->getClient()->getAllSettings();
2921 $nic_key = $this->setup->getClient()->getNICkey();
2924 $settings = $this->setup->getClient()->getAllSettings();
2926 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2928 $this->no_second_nav =
true;
2929 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2934 $settings = $this->setup->getClient()->getAllSettings();
2936 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic"));
2942 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
2944 if (isset($settings[
"nic_enabled"]))
2946 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
2951 $this->setButtonPrev(
"proxy");
2953 if ($this->setup->getClient()->status[
"nic"][
"status"])
2955 $this->setButtonNext(
"finish",
"finish");
2970 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2977 $radg->addOption($op1);
2978 $op1 =
new ilRadioOption($lng->txt(
"nic_reg_disable"), 0, $lng->txt(
"nic_reg_disable_info"));
2979 $radg->addOption($op1);
2980 $this->form->addItem($radg);
2982 $this->form->addCommandButton(
"saveRegistration", $lng->txt(
"save"));
2983 $this->form->setFormAction(
"setup.php?cmd=gateway");
2991 $settings = $this->setup->getClient()->getAllSettings();
2992 $nic_key = $this->setup->getClient()->getNICkey();
2997 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2999 $values[
"register"] = 1;
3007 $values[
"register"] = 0;
3010 $this->form->setValuesByArray($values);
3021 if ($this->form->checkInput())
3024 if (
$_POST[
"register"] == 1)
3027 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
3030 if (empty($this->setup->getClient()->nic_status[2]))
3032 $this->setup->getClient()->setSetting(
"nic_enabled",
"-1");
3038 $this->setup->getClient()->setSetting(
"inst_id",$this->setup->getClient()->nic_status[2]);
3039 $this->setup->getClient()->setSetting(
"nic_enabled",
"1");
3040 $this->setup->getClient()->status[
"nic"][
"status"] =
true;
3064 $this->setup->getClient()->setSetting(
"inst_id",
"0");
3065 $this->setup->getClient()->setSetting(
"nic_enabled",
"0");
3071 $this->form->setValuesByPost();
3093 $this->tpl->setVariable(
"SETUP_CONTENT",
3094 $ctrl_structure_form->getHTML() .
"<br />" .
3095 $settings_type_form->getHTML());
3132 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3135 $form->setId(
"control_structure");
3136 $form->setTitle($this->lng->txt(
"ctrl_structure"));
3137 $form->setFormAction(
"setup.php?cmd=gateway");
3139 $ilDB = $this->setup->getClient()->db;
3140 $cset = $ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
3141 $crec = $ilDB->fetchAssoc($cset);
3144 if ($crec[
"cnt"] == 0)
3146 $item->
setInfo($this->lng->txt(
"ctrl_missing_desc"));
3150 $item->setInfo($this->lng->txt(
"ctrl_structure_desc"));
3152 $form->addItem($item);
3154 $form->addCommandButton(
"reloadStructure", $this->lng->txt(
"reload"));
3166 if (!$this->setup->getClient()->db_installed)
3174 $GLOBALS[
"ilDB"] = $this->setup->getClient()->getDB();
3177 require_once
"./setup/classes/class.ilModuleReader.php";
3178 require_once
"./setup/classes/class.ilServiceReader.php";
3179 require_once
"./setup/classes/class.ilCtrlStructureReader.php";
3181 require_once
"./Services/Component/classes/class.ilModule.php";
3182 require_once
"./Services/Component/classes/class.ilService.php";
3187 foreach($modules as $module)
3190 $module[
"subdir"],
"Modules");
3196 foreach($services as $service)
3199 $service[
"subdir"],
"Services");
3205 $ilCtrlStructureReader->readStructure(
true);
3217 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3220 include_once (
"Services/Form/classes/class.ilPropertyFormGUI.php");
3223 $form->setId(
"settings_type");
3224 $form->setTitle($this->lng->txt(
"settings_type"));
3225 $form->setFormAction(
"setup.php?cmd=gateway");
3228 $item->
setValue(strtoupper($type));
3230 if ($type ==
"clob")
3232 $item->setInfo($this->lng->txt(
'settings_info_clob'));
3233 $form->addCommandButton(
"showLongerSettings", $this->lng->txt(
"settings_show_longer"));
3234 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_text"));
3238 $item->setInfo($this->lng->txt(
'settings_info_text'));
3239 $form->addCommandButton(
"changeSettingsType", $this->lng->txt(
"settings_change_clob"));
3241 $form->addItem($item);
3243 if (is_array($this->longer_settings))
3247 if (count($this->longer_settings))
3249 foreach ($this->longer_settings as
$row)
3251 $subitem =
new ilCustomInputGUI(sprintf($this->lng->txt(
'settings_key_info'), $row[
'module'], $row[
'keyword']));
3252 $subitem->setInfo($row[
'value']);
3253 $item->addSubItem($subitem);
3258 $item->setHTML($this->lng->txt(
'settings_no_longer_values'));
3260 $form->addItem($item);
3272 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3275 if ($old_type ==
"clob")
3278 if (count($longer_settings))
3280 $this->longer_settings = $longer_settings;
3308 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3318 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html",
"setup");
3320 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
3325 $pass_old = $this->setup->getPassword();
3327 if (empty(
$_POST[
"form"][
"pass_old"]))
3329 $message = $this->lng->txt(
"password_enter_old");
3330 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3333 if (md5(
$_POST[
"form"][
"pass_old"]) != $pass_old)
3335 $message = $this->lng->txt(
"password_old_wrong");
3336 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3339 if (empty(
$_POST[
"form"][
"pass"]))
3341 $message = $this->lng->txt(
"password_empty");
3342 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3347 $message = $this->lng->txt(
"password_not_match");
3348 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3351 if (md5(
$_POST[
"form"][
"pass"]) == $pass_old)
3353 $message = $this->lng->txt(
"password_same");
3354 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3357 if (!$this->setup->setPassword(
$_POST[
"form"][
"pass"]))
3359 $message = $this->lng->txt(
"save_error");
3360 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3368 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html",
"setup");
3370 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
3373 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3374 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
3375 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
3376 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
3377 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
3378 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
3379 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3388 $this->no_second_nav =
true;
3392 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
3393 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
3394 $this->lng->txt(
"password").
": <b>homer</b></p>";
3395 $this->setButtonNext(
"login_new",
"login");
3397 $this->setup->getClient()->reconnect();
3400 $this->setup->getClient()->setSetting(
"setup_ok",1);
3403 $this->setup->getClient()->status[
"finish"][
"status"] =
true;
3408 $txt_info = $this->lng->txt(
"info_text_finish2");
3413 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html",
"setup");
3414 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
3416 $this->setButtonPrev(
"nic");
3430 if (
$_POST[
"form"][
"delete"])
3456 $msg = $this->setup->getClient()->delete(
$ini,$db,$files);
3462 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
3465 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html",
"setup");
3468 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
3469 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
3470 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
3471 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
3483 if ($this->setup->getClient()->status[
"finish"][
"status"])
3485 $val = ($this->setup->getClient()->ini->readVariable(
"client",
"access")) ?
"0" :
true;
3486 $this->setup->getClient()->ini->setVariable(
"client",
"access",$val);
3487 $this->setup->getClient()->ini->write();
3488 $message =
"client_access_mode_changed";
3492 $message =
"client_setup_not_finished";
3511 $this->setup->raiseError($this->lng->txt(
"no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3514 $status = $this->setup->getStatus(
$client);
3516 if ($status[
"finish"][
"status"])
3518 $this->setup->ini->setVariable(
"clients",
"default",
$client->getId());
3519 $this->setup->ini->write();
3520 $message =
"default_client_changed";
3524 $message =
"client_setup_not_finished";
3539 foreach ($this->setup->getClient()->status as $key => $val)
3541 if ($key !=
"finish" and $key !=
"access")
3543 if ($val[
"status"] !=
true)
3551 $clientlist =
new ilClientList($this->setup->db_connections);
3553 $list = $clientlist->getClients();
3555 if (count($list) == 1)
3557 $this->setup->ini->setVariable(
"clients",
"default",$this->setup->getClient()->getId());
3558 $this->setup->ini->write();
3560 $this->setup->getClient()->ini->setVariable(
"client",
"access",1);
3561 $this->setup->getClient()->ini->write();
3572 if (!$this->setup->getClient()->status[
"db"][
"status"])
3578 elseif (!$this->setup->getClient()->status[
"lang"][
"status"])
3580 $this->cmd =
"lang";
3584 elseif (!$this->setup->getClient()->status[
"contact"][
"status"])
3586 $this->cmd =
"contact";
3590 elseif(!$this->setup->getClient()->status[
'proxy'][
'status'])
3592 $this->cmd =
"proxy";
3596 elseif (!$this->setup->getClient()->status[
"nic"][
"status"])
3602 elseif (!$this->setup->getClient()->status[
"finish"][
"status"])
3604 $this->cmd =
"finish";
3619 if ($this->setup->ini->readVariable(
"clients",
"list"))
3621 $this->setup->ini->setVariable(
"clients",
"list",
"0");
3622 $this->setup->ini->write();
3627 $this->setup->ini->setVariable(
"clients",
"list",
"1");
3628 $this->setup->ini->write();
3643 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
3645 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
3646 include_once
"./Services/AccessControl/classes/class.ilRbacAdmin.php";
3647 include_once
"./Services/AccessControl/classes/class.ilRbacReview.php";
3648 include_once
"./Services/AccessControl/classes/class.ilRbacSystem.php";
3649 include_once
"./Services/Tree/classes/class.ilTree.php";
3650 include_once
"./Services/Xml/classes/class.ilSaxParser.php";
3651 include_once
"./Services/Object/classes/class.ilObjectDefinition.php";
3654 $ilDB = $this->setup->getClient()->db;
3655 $this->lng->setDbHandler($ilDB);
3659 $dbupdate->applyCustomUpdates();
3661 if ($dbupdate->updateMsg ==
"no_changes")
3663 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
3668 foreach ($dbupdate->updateMsg as
$row)
3670 if ($row[
"msg"] ==
"update_applied")
3672 $a_message.= $sep.$row[
"nr"];
3677 $e_message.=
"<br/>".$this->lng->txt($row[
"msg"]).
": ".$row[
"nr"];
3680 if ($a_message !=
"")
3682 $a_message = $this->lng->txt(
"update_applied").
": ".$a_message;
3699 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3702 $this->form->setId(
"clone_form");
3703 $this->form->setFormAction(
"setup.php?cmd=gateway");
3705 if ($this->setup->getClient()->status[
"access"][
"status"] ===
false and stripos($this->setup->getClient()->getName(),
"master") ===
false and $this->setup->getClient()->getdbType() ==
"mysql" and $this->setup->getClient()->db_exists )
3707 $this->form->setTitle($this->lng->txt(
"clone_source"));
3709 $clientlist =
new ilClientList($this->setup->db_connections);
3710 $list = $clientlist->getClients();
3711 $clientlistarray = array();
3713 foreach ($list as $key =>
$client){
3714 if ((strcmp($key, $this->setup->getClient()->getId()) !=
'0') && (
$client->getDbType() ==
'mysql')) {
3721 $si->setOptions(array_merge(
3722 array(
"" =>
"-- ".$lng->txt(
"please_select").
" --"),
3724 $si->setRequired(
true);
3725 $this->form->addItem(
$si);
3729 $this->form->addItem($cb);
3731 $this->form->addCommandButton(
"cloneSaveSource", $lng->txt(
"cloneit"));
3733 $disabledmessage =
"<h1>" . $this->lng->txt(
"clone_disabledmessage") .
"</h1><br>";
3734 if (!$this->setup->getClient()->status[
"access"][
"status"] ===
false) {
3735 $disabledmessage .= $this->lng->txt(
"clone_clientnotdisabled") .
"<br>";
3737 if (!stripos($this->setup->getClient()->getName(),
"aster") ===
false) {
3738 $disabledmessage .= $this->lng->txt(
"clone_clientismaster") .
"<br>";
3740 if ($this->setup->getClient()->getdbType() !=
"mysql") {
3741 $disabledmessage .= $this->lng->txt(
"clone_clientisnotmysql") .
"<br>";
3743 if (!$this->setup->getClient()->db_exists) {
3744 $disabledmessage .= $this->lng->txt(
"clone_clientnodatabase") .
"<br>";
3746 $this->form->setTitle($disabledmessage);
3752 if (!$this->setup->isAdmin())
3758 $this->form->setValuesByPost();
3759 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
3760 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3767 if (!$this->setup->isAdmin())
3774 if ($this->form->checkInput())
3776 if ($this->form->getInput(
"iamsure") !=
"1")
3778 $message = $this->lng->txt(
"clone_youmustcheckiamsure");
3779 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3781 if (!$this->setup->cloneFromSource($this->form->getInput(
"source")))
3783 $message = $this->lng->txt(
"clone_error");
3784 $this->setup->raiseError($message .
" -> " . $this->setup->error,$this->setup->error_obj->MESSAGE);
3790 $this->form->setValuesByPost();
3791 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_clone"));
3792 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3798 $settings = $this->setup->getClient()->getAllSettings();
3802 include_once(
"./Services/Administration/classes/class.ilSetting.php");
3804 $this->form->setValuesByArray(array(
3805 'proxy_status' => (
bool)$settings[
'proxy_status'],
3806 'proxy_host' => $settings[
'proxy_host'],
3807 'proxy_port' => $settings[
'proxy_port']
3809 if((
bool)$settings[
'proxy_status'])
3811 $this->setup->printProxyStatus($this->setup->client);
3814 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());
3815 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_proxy"));
3818 $check = $this->setup->checkClientProxySettings($this->setup->client);
3820 $this->setup->getClient()->status[
"proxy"][
"status"] = $check[
"status"];
3821 $this->setup->getClient()->status[
"proxy"][
"comment"] = $check[
"comment"];
3822 $this->setup->getClient()->status[
"proxy"][
"text"] = $check[
"comment"];
3824 if ($check[
"status"])
3826 $this->setButtonNext(
"nic");
3829 $this->setButtonPrev(
"contact");
3836 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
3838 $this->form->setFormAction(
"setup.php?cmd=gateway");
3842 $proxs->
setInfo($lng->txt(
'proxy_status_info'));
3843 $proxs->setValue(1);
3844 $this->form->addItem($proxs);
3848 $proxs->addSubItem($proxa);
3851 $prox =
new ilTextInputGUI($lng->txt(
'proxy_host'),
'proxy_host');
3852 $prox->
setInfo($lng->txt(
'proxy_host_info'));
3853 $proxs->addSubItem($prox);
3856 $proxp =
new ilTextInputGUI($lng->txt(
'proxy_port'),
'proxy_port');
3857 $proxp->
setInfo($lng->txt(
'proxy_port_info'));
3858 $proxp->setSize(10);
3859 $proxp->setMaxLength(10);
3860 $proxs->addSubItem($proxp);
3863 $this->form->addCommandButton(
'saveProxy', $lng->txt(
'save'));
3878 $isFormValid = $this->form->checkInput();
3880 $new_settings[
'proxy_status'] = (int)$this->form->getInput(
'proxy_status');
3881 $new_settings[
'proxy_host'] = trim($this->form->getInput(
'proxy_host'));
3882 $new_settings[
'proxy_port'] = trim($this->form->getInput(
'proxy_port'));
3886 if($new_settings[
'proxy_status'] ==
true)
3888 if(!strlen($new_settings[
'proxy_host']))
3890 $isFormValid =
false;
3891 $this->form->getItemByPostVar(
'proxy_host')->setAlert($lng->txt(
'msg_input_is_required'));
3893 if(!strlen($new_settings[
'proxy_port']))
3895 $isFormValid =
false;
3896 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'msg_input_is_required'));
3898 if(!preg_match(
'/[0-9]{1,}/', $new_settings[
'proxy_port']) ||
3899 $new_settings[
'proxy_port'] < 0 ||
3900 $new_settings[
'proxy_port'] > 65535)
3902 $isFormValid =
false;
3903 $this->form->getItemByPostVar(
'proxy_port')->setAlert($lng->txt(
'proxy_port_numeric'));
3909 $this->setup->saveProxySettings($new_settings);
3912 $settings = $this->setup->getClient()->getAllSettings();
3913 if($settings[
'proxy_status'] ==
true)
3915 $this->setup->printProxyStatus($this->setup->client);
3924 $this->form->setValuesByPost();
3925 $this->tpl->setVariable(
"SETUP_CONTENT", $this->form->getHTML());