33 require_once
"class.ilSetup.php";
68 $this->revision =
'$Revision: 17651 $';
69 $this->version =
"2 ".substr(substr($this->revision,1),0,-2);
70 $this->lang = $this->lng->lang_key;
85 $this->client->status = $this->
getStatus();
88 if (($this->cmd =
$_GET[
"cmd"]) ==
"gateway")
91 @$this->cmd = key($_POST[
"cmd"]);
97 if ($this->
isAuthenticated() and !$this->client->status[
"finish"][
"status"] and $this->cmd !=
"clientlist" and $this->cmd !=
"")
115 if (!$this->
isInstalled() or !($this->ini->readVariable(
"clients",
"path")))
138 echo
"cmd: ".$this->cmd.
" | access: ".$this->access_mode.
" | display: ".
$this->display_mode;
139 var_dump($this->client->status);
159 case "preliminaries":
168 case "determineToolsPathInstall":
173 $this->
displayError($this->lng->txt(
"unknown_command"));
191 case "changepassword":
196 case "mastersettings":
201 case "determineToolsPath":
206 case "changedefault":
213 $this->ini_client_exists = $this->
newClient();
219 $this->ini_client_exists = $this->
newClient();
233 case "preliminaries":
253 if ($this->client->db_installed)
283 if (!isset(
$_GET[
"lang"]) and !$this->client->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"lang" and $this->error ===
true)
294 if (!isset(
$_GET[
"lang"]) and !$this->client->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"contact")
305 if (!isset(
$_GET[
"lang"]) and !$this->client->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"nic")
316 if (!isset(
$_GET[
"lang"]) and !$this->client->status[
"finish"][
"status"] and
$_GET[
"cmd"] ==
"finish")
336 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->client->getId());
340 if ($this->client->ini->readVariable(
"client",
"access") !=
"1")
342 $this->client->ini->setVariable(
"client",
"access",
"1");
343 $this->client->ini->write();
347 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->client->getId());
354 case "reloadStructure":
359 $this->
displayError($this->lng->txt(
"unknown_command"));
373 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.client_overview.html");
375 if ($this->client->db_installed)
377 $settings = $this->client->getAllSettings();
380 $txt_no_database = $this->lng->txt(
"no_database");
382 $access_status = ($this->client->status[
"access"][
"status"]) ?
"online" :
"disabled";
383 $access_button = ($this->client->status[
"access"][
"status"]) ?
"disable" :
"enable";
384 $access_link =
" [<a href=\"setup.php?cmd=changeaccess&client_id=".$this->client->getId().
"&back=view\">".$this->lng->txt($access_button).
"</a>]";
387 $this->tpl->setVariable(
"TXT_BASIC_DATA", $this->lng->txt(
"client_info"));
388 $this->tpl->setVariable(
"TXT_INST_NAME", $this->lng->txt(
"inst_name"));
389 $this->tpl->setVariable(
"TXT_INST_ID", $this->lng->txt(
"ilias_nic_id"));
390 $this->tpl->setVariable(
"TXT_CLIENT_ID2", $this->lng->txt(
"client_id"));
391 $this->tpl->setVariable(
"TXT_DB_VERSION", $this->lng->txt(
"db_version"));
392 $this->tpl->setVariable(
"TXT_ACCESS_STATUS", $this->lng->txt(
"access_status"));
394 $this->tpl->setVariable(
"TXT_SERVER_DATA", $this->lng->txt(
"server_info"));
395 $this->tpl->setVariable(
"TXT_ILIAS_VERSION", $this->lng->txt(
"ilias_version"));
396 $this->tpl->setVariable(
"TXT_HOSTNAME", $this->lng->txt(
"host"));
397 $this->tpl->setVariable(
"TXT_IP_ADDRESS", $this->lng->txt(
"ip_address"));
398 $this->tpl->setVariable(
"TXT_SERVER_PORT", $this->lng->txt(
"port"));
399 $this->tpl->setVariable(
"TXT_SERVER_SOFTWARE", $this->lng->txt(
"server_software"));
400 $this->tpl->setVariable(
"TXT_HTTP_PATH", $this->lng->txt(
"http_path"));
401 $this->tpl->setVariable(
"TXT_ABSOLUTE_PATH", $this->lng->txt(
"absolute_path"));
402 $this->tpl->setVariable(
"TXT_DEFAULT_LANGUAGE", $this->lng->txt(
"default_language"));
403 $this->tpl->setVariable(
"TXT_FEEDBACK_RECIPIENT", $this->lng->txt(
"feedback_recipient"));
404 $this->tpl->setVariable(
"TXT_ERROR_RECIPIENT", $this->lng->txt(
"error_recipient"));
407 $this->tpl->setVariable(
"TXT_SOFTWARE", $this->lng->txt(
"3rd_party_software"));
408 $this->tpl->setVariable(
"TXT_CONVERT_PATH", $this->lng->txt(
"path_to_convert"));
409 $this->tpl->setVariable(
"TXT_ZIP_PATH", $this->lng->txt(
"path_to_zip"));
410 $this->tpl->setVariable(
"TXT_UNZIP_PATH", $this->lng->txt(
"path_to_unzip"));
411 $this->tpl->setVariable(
"TXT_JAVA_PATH", $this->lng->txt(
"path_to_java"));
412 $this->tpl->setVariable(
"TXT_HTMLDOC_PATH", $this->lng->txt(
"path_to_htmldoc"));
413 $this->tpl->setVariable(
"TXT_LATEX_URL", $this->lng->txt(
"url_to_latex"));
414 $this->tpl->setVariable(
"TXT_VIRUS_SCANNER", $this->lng->txt(
"virus_scanner"));
415 $this->tpl->setVariable(
"TXT_SCAN_COMMAND", $this->lng->txt(
"scan_command"));
416 $this->tpl->setVariable(
"TXT_CLEAN_COMMAND", $this->lng->txt(
"clean_command"));
421 $this->tpl->setVariable(
"INST_ID",($this->client->db_installed) ? $settings[
"inst_id"] : $txt_no_database);
422 $this->tpl->setVariable(
"CLIENT_ID2",$this->client->getId());
423 $this->tpl->setVariable(
"INST_NAME",($this->client->getName()) ? $this->client->getName() :
"<".$this->lng->txt(
"no_client_name").
">");
424 $this->tpl->setVariable(
"INST_INFO",$this->client->getDescription());
425 $this->tpl->setVariable(
"DB_VERSION",($this->client->db_installed) ? $settings[
"db_version"] : $txt_no_database);
426 $this->tpl->setVariable(
"ACCESS_STATUS",$this->lng->txt($access_status).$access_link);
429 $this->tpl->setVariable(
"HTTP_PATH",ILIAS_HTTP_PATH);
431 $this->tpl->setVariable(
"HOSTNAME", $_SERVER[
"SERVER_NAME"]);
432 $this->tpl->setVariable(
"SERVER_PORT", $_SERVER[
"SERVER_PORT"]);
433 $this->tpl->setVariable(
"SERVER_ADMIN", $_SERVER[
"SERVER_ADMIN"]);
434 $this->tpl->setVariable(
"SERVER_SOFTWARE", $_SERVER[
"SERVER_SOFTWARE"]);
435 $this->tpl->setVariable(
"IP_ADDRESS", $_SERVER[
"SERVER_ADDR"]);
438 $this->tpl->setVariable(
"FEEDBACK_RECIPIENT",($this->client->db_installed) ? $settings[
"feedback_recipient"] : $txt_no_database);
439 $this->tpl->setVariable(
"ERROR_RECIPIENT",($this->client->db_installed) ? $settings[
"error_recipient"] : $txt_no_database);
442 $not_set = $this->lng->txt(
"path_not_set");
444 $convert = $this->ini->readVariable(
"tools",
"convert");
445 $zip = $this->ini->readVariable(
"tools",
"zip");
446 $unzip = $this->ini->readVariable(
"tools",
"unzip");
447 $java = $this->ini->readVariable(
"tools",
"java");
448 $htmldoc = $this->ini->readVariable(
"tools",
"htmldoc");
449 $latex = $this->ini->readVariable(
"tools",
"latex");
450 $vscan = $this->ini->readVariable(
"tools",
"vscantype");
451 $scancomm = $this->ini->readVariable(
"tools",
"scancommand");
452 $cleancomm = $this->ini->readVariable(
"tools",
"cleancommand");
454 $this->tpl->setVariable(
"CONVERT_PATH",($convert) ? $convert : $not_set);
455 $this->tpl->setVariable(
"ZIP_PATH",($zip) ? $zip : $not_set);
456 $this->tpl->setVariable(
"UNZIP_PATH",($unzip) ? $unzip : $not_set);
457 $this->tpl->setVariable(
"JAVA_PATH",($java) ? $java : $not_set);
458 $this->tpl->setVariable(
"HTMLDOC_PATH",($htmldoc) ? $htmldoc : $not_set);
459 $this->tpl->setVariable(
"LATEX_URL",($latex) ? $latex : $not_set);
460 $this->tpl->setVariable(
"VAL_SCAN_COMMAND",($scancomm) ? $scancomm : $not_set);
461 $this->tpl->setVariable(
"VAL_CLEAN_COMMAND",($cleancomm) ? $cleancomm : $not_set);
462 $this->tpl->setVariable(
"VAL_VIRUS_SCANNER",($vscan) ? $vscan : $not_set);
464 $this->tpl->parseCurrentBlock();
480 if ($a_mode !=
"view" and $a_mode !=
"setup")
485 $this->display_mode = $a_mode;
496 $languages = $this->lng->getLanguages();
498 $count = (int) round(count($languages) / 2);
501 foreach ($languages as $lang_key)
505 $this->tpl->touchBlock(
"lng_new_row");
508 $this->tpl->setCurrentBlock(
"languages");
509 $this->tpl->setVariable(
"LINK_LANG",
"./setup.php?cmd=".$this->cmd.
"&lang=".$lang_key);
510 $this->tpl->setVariable(
"LANG_NAME", $this->lng->txt(
"meta_l_".$lang_key));
511 $this->tpl->setVariable(
"LANG_ICON", $lang_key);
512 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
513 $this->tpl->setVariable(
"BORDER", 0);
514 $this->tpl->setVariable(
"VSPACE", 0);
515 $this->tpl->parseCurrentBlock();
520 if (count($languages) % 2)
522 $this->tpl->touchBlock(
"lng_empty_cell");
525 if ($this->cmd !=
"logout" and $this->
isInstalled())
530 if ($this->display_mode ==
"view" or $this->cmd ==
"clientlist" or $this->cmd ==
"changepassword" or $this->cmd ==
"mastersettings")
532 $this->tpl->setCurrentBlock(
"add_client");
533 $this->tpl->setVariable(
"TXT_ADD_CLIENT",ucfirst($this->lng->txt(
"new_client")));
534 $this->tpl->parseCurrentBlock();
538 $this->tpl->setCurrentBlock(
"display_list");
539 $this->tpl->setVariable(
"TXT_LIST",ucfirst($this->lng->txt(
"list_clients")));
540 $this->tpl->parseCurrentBlock();
543 $this->tpl->setCurrentBlock(
"edit_pathes");
544 $this->tpl->setVariable(
"TXT_EDIT_PATHES",$this->lng->txt(
"basic_settings"));
545 $this->tpl->parseCurrentBlock();
548 $this->tpl->setCurrentBlock(
"preliminaries");
549 $this->tpl->setVariable(
"TXT_PRELIMINARIES",$this->lng->txt(
"preliminaries"));
550 $this->tpl->parseCurrentBlock();
553 $this->tpl->setCurrentBlock(
"change_password");
554 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt(
"password")));
555 $this->tpl->parseCurrentBlock();
561 $this->tpl->setCurrentBlock(
"logout");
562 $this->tpl->setVariable(
"TXT_LOGOUT",$this->lng->txt(
"logout"));
563 $this->tpl->parseCurrentBlock();
567 $this->tpl->setVariable(
"VAL_CMD",
$_GET[
"cmd"]);
568 $this->tpl->setVariable(
"TXT_OK",$this->lng->txt(
"change"));
569 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE",$this->lng->txt(
"choose_language"));
570 $this->tpl->setVariable(
"PAGETITLE",
"Setup");
572 $this->tpl->setVariable(
"LOCATION_STYLESHEET",
"../templates/default/delos.css");
573 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
"../templates/default/delos_cont.css");
574 $this->tpl->setVariable(
"TXT_ILIAS_VERSION",
"ILIAS ".
ILIAS_VERSION);
575 $this->tpl->setVariable(
"TXT_SETUP",$this->lng->txt(
"setup"));
576 $this->tpl->setVariable(
"VERSION", $this->version);
577 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"version"));
578 $this->tpl->setVariable(
"LANG", $this->lang);
587 if ($this->cmd !=
"logout")
589 if ($this->ini_ilias_exists and $this->display_mode ==
"setup" and $this->client->getId() !=
"")
591 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"client_id").
": ".$this->client->getId().
")");
595 $this->tpl->setVariable(
"TXT_ACCESS_MODE",
"(".$this->lng->txt(
"root_access").
")");
611 if (!$this->btn_prev_on and !$this->btn_next_on)
616 $this->tpl->addBlockFile(
"NAVBUTTONS",
"navbuttons",
"tpl.navbuttons.html");
618 $this->tpl->setVariable(
"FORMACTION_BUTTONS",
"setup.php?cmd=gateway");
620 if ($this->btn_prev_on)
622 $this->tpl->setCurrentBlock(
"btn_back");
623 $this->tpl->setVariable(
"TXT_PREV", $this->btn_prev_lng);
624 $this->tpl->setVariable(
"CMD_PREV", $this->btn_prev_cmd);
625 $this->tpl->parseCurrentBlock();
628 if ($this->btn_next_on)
630 $this->tpl->setCurrentBlock(
"btn_forward");
631 $this->tpl->setVariable(
"TXT_NEXT", $this->btn_next_lng);
632 $this->tpl->setVariable(
"CMD_NEXT", $this->btn_next_cmd);
633 $this->tpl->parseCurrentBlock();
647 $this->btn_prev_on =
true;
648 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd :
"gateway";
649 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) :
"<< ".$this->lng->txt(
"prev");
660 $this->btn_next_on =
true;
661 $this->btn_next_cmd = ($a_cmd) ? $a_cmd :
"gateway";
662 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt(
"next").
" >>";
670 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
671 $FAILED =
"<strong><font color=\"red\">FAILED</font></strong>";
673 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.preliminaries.html");
675 $this->tpl->setVariable(
"TXT_SETUP_TITLE",$this->lng->txt(
"ilias_setup"));
676 $this->tpl->setVariable(
"TXT_SETUP_WELCOME", $this->lng->txt(
"setup_welcome"));
677 $this->tpl->setVariable(
"TXT_SETUP_INIFILE_DESC", $this->lng->txt(
"setup_inifile_desc"));
678 $this->tpl->setVariable(
"TXT_SETUP_DATABASE_DESC", $this->lng->txt(
"setup_database_desc"));
679 $this->tpl->setVariable(
"TXT_SETUP_LANGUAGES_DESC", $this->lng->txt(
"setup_languages_desc"));
680 $this->tpl->setVariable(
"TXT_SETUP_PASSWORD_DESC", $this->lng->txt(
"setup_password_desc"));
681 $this->tpl->setVariable(
"TXT_SETUP_NIC_DESC", $this->lng->txt(
"setup_nic_desc"));
683 $server_os = php_uname();
684 $server_web = $_SERVER[
"SERVER_SOFTWARE"];
685 $environment = $this->lng->txt(
"env_using").
" ".$server_os.
" <br/>".$this->lng->txt(
"with").
" ".$server_web;
687 if ((stristr($server_os,
"linux") || stristr($server_os,
"windows")) && stristr($server_web,
"apache"))
689 $env_comment = $this->lng->txt(
"env_ok");
693 $env_comment =
"<font color=\"red\">".$this->lng->txt(
"env_warning").
"</font>";
696 $this->tpl->setVariable(
"TXT_ENV_TITLE", $this->lng->txt(
"environment"));
697 $this->tpl->setVariable(
"TXT_ENV_INTRO", $environment);
698 $this->tpl->setVariable(
"TXT_ENV_COMMENT", $env_comment);
700 $this->tpl->setVariable(
"TXT_PRE_TITLE", $this->lng->txt(
"preliminaries"));
701 $this->tpl->setVariable(
"TXT_PRE_INTRO", $this->lng->txt(
"pre_intro"));
704 "cookies_enabled",
"dom",
"xsl",
"gd",
"memory");
707 $this->tpl->setCurrentBlock(
"preliminary");
708 $this->tpl->setVariable(
"TXT_PRE", $this->lng->txt(
"pre_".$preliminary));
709 if ($this->preliminaries_result[$preliminary][
"status"] ==
true)
711 $this->tpl->setVariable(
"STATUS_PRE", $OK);
715 $this->tpl->setVariable(
"STATUS_PRE", $FAILED);
717 $this->tpl->setVariable(
"COMMENT_PRE", $this->preliminaries_result[$preliminary][
"comment"]);
718 $this->tpl->parseCurrentBlock();
722 if ($this->preliminaries ===
true)
726 $cmd =
"mastersettings";
732 $btn_text = ($this->cmd ==
"preliminaries") ?
"" :
"installation";
734 $this->setButtonNext(
$cmd,$btn_text);
738 $this->tpl->setCurrentBlock(
"premessage");
739 $this->tpl->setVariable(
"TXT_PRE_ERR", sprintf($this->lng->txt(
"pre_error"),
740 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
741 $this->tpl->parseCurrentBlock();
754 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
759 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
774 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
779 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
787 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html");
789 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_mastersetup.html");
791 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
794 $checked =
"checked=\"checked\"";
797 $this->tpl->setVariable(
"TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt(
"dsfsdave"));
798 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
799 $this->tpl->setVariable(
"SUBMIT_CMD",
"install");
800 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
801 $this->tpl->setVariable(
"TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt(
"enter_dir_and_filename"));
802 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_first_install").
"<br/>".$this->lng->txt(
"info_text_pathes"));
805 if ($this->safe_mode)
807 $this->tpl->setVariable(
"SAFE_MODE_STYLE",
" class=\"message\" ");
808 $this->tpl->setVariable(
"TXT_SAFE_MODE_INFO", $this->lng->txt(
"safe_mode_enabled"));
812 $this->tpl->setVariable(
"TXT_SAFE_MODE_INFO",
"");
818 $data_dir_ws = getcwd().
"/data";
822 $this->tpl->setCurrentBlock(
"setup_datadir");
823 $this->tpl->setVariable(
"TXT_DATADIR_TITLE", $this->lng->txt(
"data_directories"));
824 $this->tpl->setVariable(
"TXT_DATADIR_PATH_IN_WS", $this->lng->txt(
"data_directory_in_ws"));
825 $this->tpl->setVariable(
"TXT_DATADIR_PATH_IN_WS_INFO", $this->lng->txt(
"data_directory_in_ws_info"));
826 $this->tpl->setVariable(
"TXT_DATADIR_PATH_INFO", $this->lng->txt(
"data_directory_info"));
827 $this->tpl->setVariable(
"DATADIR_IN_WS", $data_dir_ws);
828 $this->tpl->setVariable(
"TXT_DATADIR_PATH", $this->lng->txt(
"data_directory_outside_ws"));
829 $this->tpl->setVariable(
"TXT_DATADIR_COMMENT1", $this->lng->txt(
"datadir_path_comment1"));
830 $this->tpl->setVariable(
"TXT_CREATE", $this->lng->txt(
"create_directory"));
833 if (
$_SESSION[
"error_post_vars"][
"form"])
835 $this->tpl->setVariable(
"DATADIR_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"datadir_path"]);
837 elseif ($this->ini->readVariable(
"server",
"presetting") !=
"")
839 $this->tpl->setVariable(
"DATADIR_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"data_dir"));
845 $chk_datadir_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_datadir_path"]) ? $checked :
"";
846 $this->tpl->setVariable(
"CHK_DATADIR_PATH",$chk_datadir_path);
847 $this->tpl->parseCurrentBlock();
850 $this->tpl->setCurrentBlock(
"setup_log");
851 $this->tpl->setVariable(
"TXT_LOG_TITLE", $this->lng->txt(
"logging"));
852 $this->tpl->setVariable(
"TXT_LOG_PATH", $this->lng->txt(
"log_path"));
853 $this->tpl->setVariable(
"TXT_LOG_COMMENT", $this->lng->txt(
"log_path_comment"));
854 $this->tpl->setVariable(
"TXT_DISABLE_LOGGING", $this->lng->txt(
"disable_logging"));
857 if (
$_SESSION[
"error_post_vars"][
"form"])
859 $this->tpl->setVariable(
"LOG_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"log_path"]);
861 elseif ($this->ini->readVariable(
"server",
"presetting") !=
"")
863 $this->tpl->setVariable(
"LOG_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"log"));
866 $chk_log_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_log_status"]) ? $checked :
"";
867 $this->tpl->setVariable(
"CHK_LOG_STATUS",$chk_log_path);
868 $this->tpl->parseCurrentBlock();
871 $this->tpl->setCurrentBlock(
"setup_tools");
872 $this->tpl->setVariable(
"TXT_DISABLE_CHECK", $this->lng->txt(
"disable_check"));
873 $this->tpl->setVariable(
"TXT_REQ_TOOLS_TITLE", $this->lng->txt(
"3rd_party_software_req"));
874 $this->tpl->setVariable(
"TXT_OPT_TOOLS_TITLE", $this->lng->txt(
"3rd_party_software_opt"));
875 $this->tpl->setVariable(
"TXT_CONVERT_PATH", $this->lng->txt(
"convert_path"));
876 $this->tpl->setVariable(
"TXT_ZIP_PATH", $this->lng->txt(
"zip_path"));
877 $this->tpl->setVariable(
"TXT_UNZIP_PATH", $this->lng->txt(
"unzip_path"));
878 $this->tpl->setVariable(
"TXT_JAVA_PATH", $this->lng->txt(
"java_path"));
879 $this->tpl->setVariable(
"TXT_HTMLDOC_PATH", $this->lng->txt(
"htmldoc_path"));
880 $this->tpl->setVariable(
"TXT_LATEX_URL", $this->lng->txt(
"url_to_latex"));
882 $this->tpl->setVariable(
"TXT_CONVERT_COMMENT", $this->lng->txt(
"convert_path_comment"));
883 $this->tpl->setVariable(
"TXT_ZIP_COMMENT", $this->lng->txt(
"zip_path_comment"));
884 $this->tpl->setVariable(
"TXT_UNZIP_COMMENT", $this->lng->txt(
"unzip_path_comment"));
885 $this->tpl->setVariable(
"TXT_JAVA_COMMENT", $this->lng->txt(
"java_path_comment"));
886 $this->tpl->setVariable(
"TXT_HTMLDOC_COMMENT", $this->lng->txt(
"htmldoc_path_comment"));
887 $this->tpl->setVariable(
"TXT_LATEX_URL_COMMENT", $this->lng->txt(
"latex_url_comment"));
890 if (
$_SESSION[
"error_post_vars"][
"form"])
892 $this->tpl->setVariable(
"CONVERT_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"convert_path"]);
893 $this->tpl->setVariable(
"ZIP_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"zip_path"]);
894 $this->tpl->setVariable(
"UNZIP_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"unzip_path"]);
895 $this->tpl->setVariable(
"JAVA_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"java_path"]);
896 $this->tpl->setVariable(
"HTMLDOC_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"htmldoc_path"]);
897 $this->tpl->setVariable(
"LATEX_URL",
$_SESSION[
"error_post_vars"][
"form"][
"latex_url"]);
899 elseif ($this->ini->readVariable(
"server",
"presetting") !=
"")
901 $this->tpl->setVariable(
"CONVERT_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"convert"));
902 $this->tpl->setVariable(
"ZIP_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"zip"));
903 $this->tpl->setVariable(
"UNZIP_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"unzip"));
904 $this->tpl->setVariable(
"JAVA_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"java"));
905 $this->tpl->setVariable(
"HTMLDOC_PATH", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"htmldoc"));
906 $this->tpl->setVariable(
"LATEX_URL", $this->ini->readVariable($this->ini->readVariable(
"server",
"presetting"),
"latex"));
911 $this->tpl->setVariable(
"CONVERT_PATH", $det[
"convert_path"]);
912 $this->tpl->setVariable(
"ZIP_PATH", $det[
"zip_path"]);
913 $this->tpl->setVariable(
"UNZIP_PATH", $det[
"unzip_path"]);
914 $this->tpl->setVariable(
"JAVA_PATH", $det[
"java_path"]);
917 $this->tpl->setVariable(
"TXT_VIRUS_SCANNER", $this->lng->txt(
"virus_scanner"));
918 $this->tpl->setVariable(
"TXT_NONE", $this->lng->txt(
"none"));
919 $this->tpl->setVariable(
"TXT_SOPHOS", $this->lng->txt(
"sophos"));
920 $this->tpl->setVariable(
"TXT_ANTIVIR", $this->lng->txt(
"antivir"));
921 $this->tpl->setVariable(
"TXT_CLAMAV", $this->lng->txt(
"clamav"));
922 $this->tpl->setVariable(
"TXT_SCAN_COMMAND", $this->lng->txt(
"scan_command"));
923 $this->tpl->setVariable(
"TXT_CLEAN_COMMAND", $this->lng->txt(
"clean_command"));
926 $chk_convert_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_convert_path"]) ? $checked :
"";
927 $chk_zip_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_zip_path"]) ? $checked :
"";
928 $chk_unzip_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_unzip_path"]) ? $checked :
"";
929 $chk_java_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_java_path"]) ? $checked :
"";
930 $chk_htmldoc_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_htmldoc_path"]) ? $checked :
"";
931 $chk_latex_url = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_latex_url"]) ? $checked :
"";
933 $this->tpl->setVariable(
"CHK_CONVERT_PATH", $chk_convert_path);
934 $this->tpl->setVariable(
"CHK_ZIP_PATH", $chk_zip_path);
935 $this->tpl->setVariable(
"CHK_UNZIP_PATH", $chk_unzip_path);
936 $this->tpl->setVariable(
"CHK_JAVA_PATH", $chk_java_path);
937 $this->tpl->setVariable(
"CHK_HTMLDOC_PATH", $chk_htmldoc_path);
938 $this->tpl->setVariable(
"CHK_LATEX_URL", $chk_latex_url);
939 $this->tpl->parseCurrentBlock();
942 $this->tpl->setCurrentBlock(
"setup_pass");
943 $this->tpl->setVariable(
"TXT_SETUP_PASS_TITLE", $this->lng->txt(
"setup_pass_title"));
944 $this->tpl->setVariable(
"TXT_SETUP_PASS_COMMENT", $this->lng->txt(
"password_info"));
945 $this->tpl->setVariable(
"TXT_SETUP_PASS", $this->lng->txt(
"setup_pass"));
946 $this->tpl->setVariable(
"TXT_SETUP_PASS2", $this->lng->txt(
"setup_pass2"));
948 $this->tpl->setVariable(
"SETUP_PASS",
$_SESSION[
"error_post_vars"][
"form"][
"setup_pass"]);
949 $this->tpl->setVariable(
"SETUP_PASS2",
$_SESSION[
"error_post_vars"][
"form"][
"setup_pass2"]);
950 $this->tpl->parseCurrentBlock();
952 $this->setButtonPrev(
"preliminaries");
956 $this->setButtonNext(
"list");
967 ilUtil::redirect(ILIAS_HTTP_PATH.
"/login.php?client_id=".$this->client->getId());
975 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html");
980 if (empty($_POST[
"form"][
"admin_password"]))
986 $this->raiseError($this->lng->txt($error_msg),$this->error_obj->MESSAGE);
992 if (!$this->
loginAsAdmin($_POST[
"form"][
"admin_password"]))
994 $this->raiseError($this->lng->txt(
"login_invalid"),$this->error_obj->MESSAGE);
1002 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_login.html");
1003 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1004 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_login"));
1006 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_login"));
1008 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
1009 $this->tpl->setVariable(
"TXT_CLIENT_LOGIN",$this->lng->txt(
"client_login"));
1010 $this->tpl->setVariable(
"TXT_CLIENT_ID",$this->lng->txt(
"client_id"));
1011 $this->tpl->setVariable(
"TXT_USERNAME",ucfirst($this->lng->txt(
"username")));
1012 $this->tpl->setVariable(
"TXT_PASSWORD",ucfirst($this->lng->txt(
"password")));
1013 $this->tpl->setVariable(
"TXT_OR",strtoupper($this->lng->txt(
"or")));
1014 $this->tpl->setVariable(
"TXT_ADMIN_LOGIN",$this->lng->txt(
"admin_login"));
1015 $this->tpl->setVariable(
"TXT_ADMIN_PASSWORD",ucfirst($this->lng->txt(
"password")));
1016 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"submit"));
1029 $list = $clientlist->getClients();
1031 if (count($list) == 0)
1038 $data[
"data"] = array();
1039 $data[
"ctrl"] = array();
1040 $data[
"cols"] = array(
"",
"name",
"id",
"login",
"details",
"status",
"access");
1042 foreach ($list as $key =>
$client)
1047 if (!$status_arr[
"db"][
"status"])
1049 $status = $status_arr[
"db"][
"comment"];
1051 elseif (!$status_arr[
"finish"][
"status"])
1053 $status = $this->lng->txt(
"setup_not_finished");
1057 $status =
"<font color=\"green\"><strong>OK</strong></font>";
1060 if ($status_arr[
"access"][
"status"])
1066 $access =
"disabled";
1069 if ($key == $this->default_client)
1071 $default =
" checked=\"checked\"";
1078 if ($status_arr[
"finish"][
"status"] and $status_arr[
"access"][
"status"])
1080 $login =
"<a href=\"../login.php?client_id=".$key.
"\">Login</a>";
1087 $access_html =
"<a href=\"setup.php?cmd=changeaccess&client_id=".$key.
"&back=clientlist\">".$this->lng->txt($access).
"</a>";
1089 $client_name = (
$client->getName()) ?
$client->getName() :
"<".$this->lng->txt(
"no_client_name").
">";
1092 $data[
"data"][] = array(
1093 "default" =>
"<input type=\"radio\" name=\"form[default]\" value=\"".$key.
"\"".$default.
"/>",
1094 "name" => $client_name.
"#separator#".
$client->getDescription(),
1097 "details" =>
"<a href=\"setup.php?cmd=view&client_id=".$key.
"\">Details</a>",
1098 "status" => $status,
1099 "access_html" => $access_html
1104 $this->maxcount = count(
$data[
"data"]);
1109 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientlist.html");
1111 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_list"));
1116 $this->tpl->addBlockfile(
"CLIENT_LIST",
"client_list",
"tpl.table.html");
1118 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
1121 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"available_clients"));
1122 $this->tpl->setVariable(
"TXT_LISTSTATUS",($this->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"display_clientlist") : $this->lng->txt(
"hide_clientlist"));
1123 $this->tpl->setVariable(
"TXT_TOGGLELIST",($this->ini->readVariable(
"clients",
"list")) ? $this->lng->txt(
"disable") : $this->lng->txt(
"enable"));
1125 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1128 include_once
"../Services/Table/classes/class.ilTableGUI.php";
1130 $tbl->disable(
"sort");
1136 $tbl->setTitle(ucfirst($this->lng->txt(
"select_client")));
1138 foreach (
$data[
"cols"] as $val)
1140 $header_names[] = ucfirst($this->lng->txt($val));
1142 $tbl->setHeaderNames($header_names);
1143 $tbl->setHeaderVars(
$data[
"cols"],$header_params);
1144 $tbl->setColumnWidth(array(
"5%",
"30%",
"10%",
"10%",
"10%",
"20%",
"15%"));
1147 $tbl->setOrderColumn(
$_GET[
"sort_by"],
"name");
1148 $tbl->setOrderDirection(
$_GET[
"sort_order"],
"asc");
1151 $tbl->setMaxCount($maxcount);
1154 $this->tpl->setVariable(
"COLUMN_COUNTS",count(
$data[
"cols"]));
1159 $tbl->disable(
"footer");
1160 $tbl->disable(
"icon");
1161 $tbl->disable(
"numinfo");
1166 if (is_array(
$data[
"data"][0]))
1169 for ($i=0; $i < count(
$data[
"data"]); $i++)
1171 $data2 =
$data[
"data"][$i];
1172 $ctrl =
$data[
"ctrl"][$i];
1177 $this->tpl->setCurrentBlock(
"table_cell");
1178 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
1179 $this->tpl->parseCurrentBlock();
1181 foreach ($data2 as $key => $val)
1183 $this->tpl->setCurrentBlock(
"text");
1187 $name_field = explode(
"#separator#",$val);
1188 $val = $name_field[0].
"<br/><span class=\"subtitle\">".$name_field[1].
"</span>";
1191 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
1192 $this->tpl->parseCurrentBlock();
1194 $this->tpl->setCurrentBlock(
"table_cell");
1195 $this->tpl->parseCurrentBlock();
1199 $this->tpl->setCurrentBlock(
"tbl_content");
1200 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1201 $this->tpl->parseCurrentBlock();
1204 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1205 $this->tpl->setVariable(
"TPLPATH",TPLPATH);
1206 $this->tpl->setVariable(
"BTN_NAME",
"changedefault");
1207 $this->tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"set_default_client"));
1208 $this->tpl->parseCurrentBlock();
1210 $this->tpl->setCurrentBlock(
"tbl_action_row");
1211 $this->tpl->setVariable(
"TPLPATH",TPLPATH);
1212 $this->tpl->setVariable(
"COLUMN_COUNTS",
"7");
1213 $this->tpl->parseCurrentBlock();
1218 $this->btn_next_on =
true;
1219 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
" >>";
1220 $this->btn_next_cmd =
"newclient";
1246 $tools = array(
"convert",
"zip",
"unzip",
"java",
"htmldoc");
1247 $dirs = array(
"/usr/local",
"/usr/local/bin",
"/usr/bin",
"/bin",
"/sw/bin");
1248 foreach($tools as $tool)
1252 @exec(
"which ".$tool,
$ret);
1253 if (substr(
$ret[0], 0, 3) !=
"no " && substr(
$ret[0], 0, 1) ==
"/")
1255 $a_tools[$tool.
"_path"] =
$ret[0];
1262 if (is_file($dir.
"/".$tool))
1264 $a_tools[$tool.
"_path"] = $dir.
"/".$tool;
1281 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
1296 $this->raiseError($this->lng->txt($this->getError()),$this->error_obj->MESSAGE);
1303 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html");
1305 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_mastersetup.html");
1307 $this->tpl->setCurrentBlock(
"det_tools");
1308 $this->tpl->setVariable(
"TXT_DET_TOOLS_PATH", $this->lng->txt(
"determine_tools_paths"));
1309 $this->tpl->setVariable(
"CMD_DET_TOOLS_PATH",
"determineToolsPath");
1310 $this->tpl->parseCurrentBlock();
1312 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1315 $checked =
"checked=\"checked\"";
1318 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"basic_settings"));
1319 $this->tpl->setVariable(
"SUBMIT_CMD",
"mastersettings");
1320 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1321 $this->tpl->setVariable(
"TXT_ENTER_DIR_AND_FILENAME", $this->lng->txt(
"enter_dir_and_filename"));
1322 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_pathes"));
1324 if ($this->safe_mode)
1326 $this->tpl->setVariable(
"SAFE_MODE_STYLE",
" class=\"message\" ");
1327 $this->tpl->setVariable(
"TXT_SAFE_MODE_INFO", $this->lng->txt(
"safe_mode_enabled"));
1331 $this->tpl->setVariable(
"TXT_SAFE_MODE_INFO",
"");
1337 $data_dir_ws = getcwd().
"/data";
1341 $this->tpl->setCurrentBlock(
"display_datadir");
1342 $this->tpl->setVariable(
"TXT_DATADIR_TITLE", $this->lng->txt(
"data_directories"));
1343 $this->tpl->setVariable(
"TXT_DATADIR_PATH_IN_WS", $this->lng->txt(
"data_directory_in_ws"));
1344 $this->tpl->setVariable(
"DATADIR_IN_WS", $data_dir_ws);
1345 $this->tpl->setVariable(
"TXT_DATADIR_PATH", $this->lng->txt(
"data_directory_outside_ws"));
1346 $this->tpl->setVariable(
"DATADIR_PATH", $this->ini->readVariable(
"clients",
"datadir"));
1347 $this->tpl->setVariable(
"TXT_DATADIR_COMMENT2", $this->lng->txt(
"datadir_path_comment2"));
1348 $this->tpl->parseCurrentBlock();
1351 $this->tpl->setCurrentBlock(
"setup_log");
1352 $this->tpl->setVariable(
"TXT_LOG_TITLE", $this->lng->txt(
"logging"));
1353 $this->tpl->setVariable(
"TXT_LOG_PATH", $this->lng->txt(
"log_path"));
1354 $this->tpl->setVariable(
"TXT_LOG_COMMENT", $this->lng->txt(
"log_path_comment"));
1355 $this->tpl->setVariable(
"TXT_DISABLE_LOGGING", $this->lng->txt(
"disable_logging"));
1359 $this->tpl->setVariable(
"LOG_PATH",
$_SESSION[
"error_post_vars"][
"form"][
"log_path"]);
1360 $chk_log_status = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_log_status"]) ? $checked :
"";
1364 $this->tpl->setVariable(
"LOG_PATH",$this->ini->readVariable(
"log",
"path").
"/".$this->ini->readVariable(
"log",
"file"));
1365 $chk_log_status = ($this->ini->readVariable(
"log",
"enabled")) ?
"" : $checked;
1369 $this->tpl->setVariable(
"CHK_LOG_STATUS",$chk_log_status);
1370 $this->tpl->parseCurrentBlock();
1373 $this->tpl->setCurrentBlock(
"setup_tools");
1374 $this->tpl->setVariable(
"TXT_DISABLE_CHECK", $this->lng->txt(
"disable_check"));
1375 $this->tpl->setVariable(
"TXT_REQ_TOOLS_TITLE", $this->lng->txt(
"3rd_party_software_req"));
1376 $this->tpl->setVariable(
"TXT_OPT_TOOLS_TITLE", $this->lng->txt(
"3rd_party_software_opt"));
1377 $this->tpl->setVariable(
"TXT_CONVERT_PATH", $this->lng->txt(
"convert_path"));
1378 $this->tpl->setVariable(
"TXT_ZIP_PATH", $this->lng->txt(
"zip_path"));
1379 $this->tpl->setVariable(
"TXT_UNZIP_PATH", $this->lng->txt(
"unzip_path"));
1380 $this->tpl->setVariable(
"TXT_JAVA_PATH", $this->lng->txt(
"java_path"));
1381 $this->tpl->setVariable(
"TXT_HTMLDOC_PATH", $this->lng->txt(
"htmldoc_path"));
1382 $this->tpl->setVariable(
"TXT_LATEX_URL", $this->lng->txt(
"url_to_latex"));
1383 $this->tpl->setVariable(
"TXT_FOP_PATH", $this->lng->txt(
"fop_path"));
1385 $this->tpl->setVariable(
"TXT_VIRUS_SCANNER", $this->lng->txt(
"virus_scanner"));
1386 $this->tpl->setVariable(
"TXT_NONE", $this->lng->txt(
"none"));
1387 $this->tpl->setVariable(
"TXT_SOPHOS", $this->lng->txt(
"sophos"));
1388 $this->tpl->setVariable(
"TXT_ANTIVIR", $this->lng->txt(
"antivir"));
1389 $this->tpl->setVariable(
"TXT_CLAMAV", $this->lng->txt(
"clamav"));
1390 $this->tpl->setVariable(
"TXT_SCAN_COMMAND", $this->lng->txt(
"scan_command"));
1391 $this->tpl->setVariable(
"TXT_CLEAN_COMMAND", $this->lng->txt(
"clean_command"));
1393 $this->tpl->setVariable(
"TXT_CONVERT_COMMENT", $this->lng->txt(
"convert_path_comment"));
1394 $this->tpl->setVariable(
"TXT_ZIP_COMMENT", $this->lng->txt(
"zip_path_comment"));
1395 $this->tpl->setVariable(
"TXT_UNZIP_COMMENT", $this->lng->txt(
"unzip_path_comment"));
1396 $this->tpl->setVariable(
"TXT_JAVA_COMMENT", $this->lng->txt(
"java_path_comment"));
1397 $this->tpl->setVariable(
"TXT_HTMLDOC_COMMENT", $this->lng->txt(
"htmldoc_path_comment"));
1398 $this->tpl->setVariable(
"TXT_LATEX_URL_COMMENT", $this->lng->txt(
"latex_url_comment"));
1399 $this->tpl->setVariable(
"TXT_FOP_COMMENT", $this->lng->txt(
"fop_path_comment"));
1403 $vals =
$_SESSION[
"error_post_vars"][
"form"];
1407 $vals[
"convert_path"] = $this->ini->readVariable(
"tools",
"convert");
1408 $vals[
"zip_path"] = $this->ini->readVariable(
"tools",
"zip");
1409 $vals[
"unzip_path"] = $this->ini->readVariable(
"tools",
"unzip");
1410 $vals[
"java_path"] = $this->ini->readVariable(
"tools",
"java");
1411 $vals[
"htmldoc_path"] = $this->ini->readVariable(
"tools",
"htmldoc");
1412 $vals[
"latex_url"] = $this->ini->readVariable(
"tools",
"latex");
1413 $vals[
"fop_path"] = $this->ini->readVariable(
"tools",
"fop");
1414 $vals[
"vscanner_type"] = $this->ini->readVariable(
"tools",
"vscantype");
1415 $vals[
"scan_command"] = $this->ini->readVariable(
"tools",
"scancommand");
1416 $vals[
"clean_command"] = $this->ini->readVariable(
"tools",
"cleancommand");
1419 $tools = array(
"convert" =>
"testConvert",
"zip" =>
"testZip",
1420 "unzip" =>
"testUnzip",
"java" =>
"testJava",
"htmldoc" =>
"testHtmldoc",
1421 "latex" =>
"testLatex");
1422 foreach ($tools as $tool => $func)
1424 $end = ($tool ==
"latex")
1427 if (($err = $this->$func($vals[$tool.
"_".$end])) !=
"")
1429 $this->tpl->setCurrentBlock(
"warning_".$tool);
1430 $this->tpl->setVariable(
"TXT_WARNING_".strtoupper($tool), $this->lng->txt($err));
1431 $this->tpl->parseCurrentBlock();
1435 $this->tpl->setVariable(
"CONVERT_PATH", $vals[
"convert_path"]);
1436 $this->tpl->setVariable(
"ZIP_PATH", $vals[
"zip_path"]);
1437 $this->tpl->setVariable(
"UNZIP_PATH", $vals[
"unzip_path"]);
1438 $this->tpl->setVariable(
"JAVA_PATH", $vals[
"java_path"]);
1439 $this->tpl->setVariable(
"HTMLDOC_PATH", $vals[
"htmldoc_path"]);
1440 $this->tpl->setVariable(
"LATEX_URL", $vals[
"latex_url"]);
1441 $this->tpl->setVariable(
"FOP_PATH", $vals[
"fop_path"]);
1442 $this->tpl->setVariable(
"STYPE_".
1443 strtoupper($vals[
"vscanner_type"]),
" selected=\"1\" ");
1444 $this->tpl->setVariable(
"SCAN_COMMAND", $vals[
"scan_command"]);
1445 $this->tpl->setVariable(
"CLEAN_COMMAND", $vals[
"clean_command"]);
1447 $chk_convert_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_convert_path"]) ? $checked :
"";
1448 $chk_zip_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_zip_path"]) ? $checked :
"";
1449 $chk_unzip_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_unzip_path"]) ? $checked :
"";
1450 $chk_java_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_java_path"]) ? $checked :
"";
1451 $chk_htmldoc_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_htmldoc_path"]) ? $checked :
"";
1452 $chk_latex_url = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_latex_url"]) ? $checked :
"";
1453 $chk_fop_path = (
$_SESSION[
"error_post_vars"][
"form"][
"chk_fop_path"]) ? $checked :
"";
1455 $this->tpl->setVariable(
"CHK_LOG_STATUS", $chk_log_stauts);
1456 $this->tpl->setVariable(
"CHK_CONVERT_PATH", $chk_convert_path);
1457 $this->tpl->setVariable(
"CHK_ZIP_PATH", $chk_zip_path);
1458 $this->tpl->setVariable(
"CHK_UNZIP_PATH", $chk_unzip_path);
1459 $this->tpl->setVariable(
"CHK_JAVA_PATH", $chk_java_path);
1460 $this->tpl->setVariable(
"CHK_HTMLDOC_PATH", $chk_htmldoc_path);
1461 $this->tpl->setVariable(
"CHK_LATEX_URL", $chk_latex_url);
1462 $this->tpl->setVariable(
"CHK_FOP_PATH", $chk_fop_path);
1463 $this->tpl->parseCurrentBlock();
1465 $this->btn_next_on =
true;
1466 $this->btn_next_lng = $this->lng->txt(
"create_new_client").
" >>";
1467 $this->btn_next_cmd =
"newclient";
1482 if (!$_POST[
"form"][
"client_id"])
1484 $this->raiseError($this->lng->txt(
"ini_no_client_id"),$this->error_obj->MESSAGE);
1487 if (strlen($_POST[
"form"][
"client_id"]) != strlen(urlencode(($_POST[
"form"][
"client_id"]))))
1489 $this->raiseError($this->lng->txt(
"ini_client_id_invalid"),$this->error_obj->MESSAGE);
1492 if (strlen($_POST[
"form"][
"client_id"]) < 4)
1494 $this->raiseError($this->lng->txt(
"ini_client_id_too_short"),$this->error_obj->MESSAGE);
1497 if (strlen($_POST[
"form"][
"client_id"]) > 32)
1499 $this->raiseError($this->lng->txt(
"ini_client_id_too_long"),$this->error_obj->MESSAGE);
1503 if (!$_POST[
"form"][
"db_host"])
1505 $this->raiseError($this->lng->txt(
"ini_no_db_host"),$this->error_obj->MESSAGE);
1508 if (!$_POST[
"form"][
"db_name"])
1510 $this->raiseError($this->lng->txt(
"ini_no_db_name"),$this->error_obj->MESSAGE);
1513 if (!$_POST[
"form"][
"db_user"])
1515 $this->raiseError($this->lng->txt(
"ini_no_db_user"),$this->error_obj->MESSAGE);
1519 if (!$this->ini_client_exists)
1526 $this->raiseError($this->lng->txt(
"ini_client_id_exists"),$this->error_obj->MESSAGE);
1533 $old_db_name = $this->client->getDbName();
1534 $old_client_id = $this->client->getId();
1536 $this->client->setId($_POST[
"form"][
"client_id"]);
1537 $this->client->setDbHost($_POST[
"form"][
"db_host"]);
1538 $this->client->setDbName($_POST[
"form"][
"db_name"]);
1539 $this->client->setDbUser($_POST[
"form"][
"db_user"]);
1540 $this->client->setDbPass($_POST[
"form"][
"db_pass"]);
1541 $this->client->setDSN();
1544 if (!$this->client->checkDatabaseHost())
1546 $this->raiseError($this->client->getError(),$this->error_obj->MESSAGE);
1550 if (!$this->client->isMysql4_1OrHigher())
1552 $this->raiseError($this->lng->txt(
"need_mysql_4_1_or_higher"),$this->error_obj->MESSAGE);
1556 $db_installed = $this->client->checkDatabaseExists();
1558 if ($db_installed and (!$this->ini_ilias_exists or ($this->client->getDbName() != $old_db_name)))
1560 $_POST[
"form"][
"db_name"] = $old_db_name;
1561 $message = ucfirst($this->lng->txt(
"database")).
" \"".$this->client->getDbName().
"\" ".$this->lng->txt(
"ini_db_name_exists");
1562 $this->raiseError($message,$this->error_obj->MESSAGE);
1565 if ($this->ini_client_exists and $old_client_id != $this->client->getId())
1567 $message = $this->lng->txt(
"ini_client_id_no_change");
1568 $this->raiseError($message,$this->error_obj->MESSAGE);
1572 if (!$this->ini_client_exists)
1577 $this->client->status[
"ini"][
"status"] =
true;
1583 $this->client->status[
"ini"][
"status"] =
false;
1584 $this->client->status[
"ini"][
"comment"] = $err;
1589 if ($this->client->ini->write())
1592 $this->client->status[
"ini"][
"status"] =
true;
1596 $err = $this->client->ini->getError();
1598 $this->client->status[
"ini"][
"status"] =
false;
1599 $this->client->status[
"ini"][
"comment"] = $err;
1605 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_ini.html");
1607 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1608 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1610 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_ini"));
1613 if (
$_SESSION[
"error_post_vars"][
"form"])
1615 $this->tpl->setVariable(
"CLIENT_ID",
$_SESSION[
"error_post_vars"][
"form"][
"client_id"]);
1616 $this->tpl->setVariable(
"DB_HOST",
$_SESSION[
"error_post_vars"][
"form"][
"db_host"]);
1617 $this->tpl->setVariable(
"DB_NAME",
$_SESSION[
"error_post_vars"][
"form"][
"db_name"]);
1618 $this->tpl->setVariable(
"DB_USER",
$_SESSION[
"error_post_vars"][
"form"][
"db_user"]);
1619 $this->tpl->setVariable(
"DB_PASS",
$_SESSION[
"error_post_vars"][
"form"][
"db_pass"]);
1623 $this->tpl->setVariable(
"CLIENT_ID", $this->client->getId());
1624 $this->tpl->setVariable(
"DB_HOST", $this->client->getDbHost());
1625 $this->tpl->setVariable(
"DB_NAME", $this->client->getDbName());
1626 $this->tpl->setVariable(
"DB_USER", $this->client->getDbUser());
1627 $this->tpl->setVariable(
"DB_PASS", $this->client->getDbPass());
1630 $this->tpl->setVariable(
"TXT_CLIENT_HEADER", $this->lng->txt(
"inst_identification"));
1631 $this->tpl->setVariable(
"TXT_CLIENT_ID", $this->lng->txt(
"client_id"));
1632 $this->tpl->setVariable(
"TXT_DB_HEADER", $this->lng->txt(
"db_conn"));
1633 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
1634 $this->tpl->setVariable(
"TXT_DB_HOST", $this->lng->txt(
"db_host"));
1635 $this->tpl->setVariable(
"TXT_DB_NAME", $this->lng->txt(
"db_name"));
1636 $this->tpl->setVariable(
"TXT_DB_USER", $this->lng->txt(
"db_user"));
1637 $this->tpl->setVariable(
"TXT_DB_PASS", $this->lng->txt(
"db_pass"));
1639 if ($this->client->status[
"ini"][
"status"])
1641 $this->setButtonNext(
"db");
1654 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.error.html");
1656 $this->tpl->setCurrentBlock(
"content");
1657 $this->tpl->setVariable(
"FORMACTION",
$_SESSION[
"referer"]);
1658 $this->tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
1659 $this->tpl->setVariable(
"ERROR_MESSAGE",($a_message));
1660 $this->tpl->parseCurrentBlock();
1671 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.logout.html");
1675 $this->logged_out =
true;
1676 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"logged_out"));
1677 $this->tpl->setCurrentBlock(
"home_link");
1678 $this->tpl->setVariable(
"TXT_INDEX",$this->lng->txt(
"ilias_homepage"));
1679 $this->tpl->setVariable(
"LNK_INDEX",ILIAS_HTTP_PATH.
"/index.php");
1680 $this->tpl->parseCurrentBlock();
1688 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1694 unset($steps[
"access"]);
1696 $steps[
"ini"][
"text"] = $this->lng->txt(
"setup_process_step_ini");
1697 $steps[
"db"][
"text"] = $this->lng->txt(
"setup_process_step_db");
1698 $steps[
"lang"][
"text"] = $this->lng->txt(
"setup_process_step_lang");
1699 $steps[
"contact"][
"text"] = $this->lng->txt(
"setup_process_step_contact");
1700 $steps[
"nic"][
"text"] = $this->lng->txt(
"setup_process_step_nic");
1701 $steps[
"finish"][
"text"] = $this->lng->txt(
"setup_process_step_finish");
1703 $this->tpl->addBlockFile(
"PROCESS_MENU",
"process_menu",
"tpl.process_panel.html");
1705 $this->tpl->setVariable(
"TXT_SETUP_PROCESS_STATUS",$this->lng->txt(
"setup_process_status"));
1709 foreach ($steps as $key => $val)
1711 $this->tpl->setCurrentBlock(
"menu_row");
1712 $this->tpl->setVariable(
"TXT_STEP",$this->lng->txt(
"step").
" ".$num.
": ");
1713 $this->tpl->setVariable(
"TXT_ACTION",$val[
"text"]);
1714 $this->tpl->setVariable(
"IMG_ARROW",
"spacer.gif");
1718 if ($this->cmd == $key and isset($this->cmd))
1720 $this->tpl->setVariable(
"HIGHLIGHT",
" style=\"font-weight:bold;\"");
1721 $this->tpl->setVariable(
"IMG_ARROW",
"arrow_right.png");
1724 $status = ($val[
"status"]) ? $OK :
"";
1726 $this->tpl->setVariable(
"TXT_STATUS",$status);
1727 $this->tpl->parseCurrentBlock();
1736 $OK =
"<font color=\"green\"><strong>OK</strong></font>";
1738 $this->tpl->addBlockFile(
"STATUS_PANEL",
"status_panel",
"tpl.status_panel.html");
1740 $this->tpl->setVariable(
"TXT_OVERALL_STATUS", $this->lng->txt(
"overall_status"));
1742 if ($this->client->status)
1744 foreach ($this->client->status as $key => $val)
1746 $status = ($val[
"status"]) ? $OK :
" ";
1747 $this->tpl->setCurrentBlock(
"status_row");
1748 $this->tpl->setVariable(
"TXT_STEP", $this->lng->txt(
"step_".$key));
1749 $this->tpl->setVariable(
"TXT_STATUS",$status);
1750 $this->tpl->setVariable(
"TXT_COMMENT",$val[
"comment"]);
1751 $this->tpl->parseCurrentBlock();
1763 switch ($this->display_mode)
1766 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientview.html");
1768 include
"./include/inc.client_tabs.php";
1769 $client_name = ($this->client->getName()) ? $this->client->getName() : $this->lng->txt(
"no_client_name");
1770 $this->tpl->setVariable(
"TXT_HEADER",$client_name.
" (".$this->lng->txt(
"client_id").
": ".$this->client->getId().
")");
1774 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html");
1775 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt($a_title));
1779 $this->
displayError($this->lng->txt(
"unknown_display_mode"));
1790 switch ($this->display_mode)
1807 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.clientsetup.html");
1809 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_first_client"));
1810 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"setup_first_client"));
1814 $this->setButtonNext(
"ini");
1827 if ($_POST[
"form"][
"db_flag"] == 1)
1831 if (!$this->client->db_installed)
1833 if (!$this->client->db_exists)
1835 if ($_POST[
"form"][
"chk_db_create"])
1839 $message = $this->lng->txt($this->
getError());
1840 $this->raiseError($message,$this->error_obj->MESSAGE);
1845 $message = $this->lng->txt(
"database_not_exists_create_first");
1846 $this->raiseError($message,$this->error_obj->MESSAGE);
1852 $message = $this->lng->txt($this->
getError());
1853 $this->client->status[
"db"][
"status"] =
false;
1854 $this->client->status[
"db"][
"comment"] =
"install_error";
1858 $message = $this->lng->txt(
"database_installed");
1863 include_once
"../classes/class.ilDBUpdate.php";
1864 include_once
"../Services/AccessControl/classes/class.ilRbacAdmin.php";
1865 include_once
"../Services/AccessControl/classes/class.ilRbacReview.php";
1866 include_once
"../Services/AccessControl/classes/class.ilRbacSystem.php";
1867 include_once
"../Services/Tree/classes/class.ilTree.php";
1868 include_once
"../classes/class.ilSaxParser.php";
1869 include_once
"../Services/Object/classes/class.ilObjectDefinition.php";
1872 $this->lng->setDbHandler($this->client->db);
1875 $ilDB =
new ilDbx($this->client->dsn);
1879 $dbupdate->applyUpdate();
1881 if ($dbupdate->updateMsg ==
"no_changes")
1883 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
1887 foreach ($dbupdate->updateMsg as $row)
1889 $message .= $this->lng->txt($row[
"msg"]).
": ".$row[
"nr"].
"<br/>";
1897 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_db.html");
1899 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
1900 $this->tpl->setVariable(
"DB_HOST", $this->client->getDbHost());
1901 $this->tpl->setVariable(
"DB_NAME", $this->client->getDbName());
1902 $this->tpl->setVariable(
"DB_USER", $this->client->getDbUser());
1903 $this->tpl->setVariable(
"DB_PASS", $this->client->getDbPass());
1905 if ($this->client->db_installed)
1908 $this->lng->setDbHandler($this->client->db);
1910 include_once
"../classes/class.ilDBUpdate.php";
1911 $ilDB =
new ilDbx($this->client->dsn);
1914 if (!$db_status = $dbupdate->getDBVersionStatus())
1916 $remark =
"<font color=\"red\">".$this->lng->txt(
"database_needs_update").
1917 " (".$this->lng->txt(
"database_version").
": ".$dbupdate->currentVersion.
1918 " ; ".$this->lng->txt(
"file_version").
": ".$dbupdate->fileVersion.
")</font>";
1919 $this->tpl->setVariable(
"TXT_INFO", $remark);
1921 $this->tpl->setCurrentBlock(
"btn_submit");
1922 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"database_update"));
1923 $this->tpl->parseCurrentBlock();
1927 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"database_is_uptodate"));
1928 $this->client->status[
"db"][
"status"] =
true;
1929 $this->client->status[
"db"][
"comment"] =
"version ".$dbupdate->getCurrentVersion();
1932 $this->tpl->setVariable(
"TXT_DB_VERSION", $this->lng->txt(
"version"));
1933 $this->tpl->setVariable(
"VAL_DB_VERSION", $ilDB->getMySQLVersion());
1950 if (
$_SESSION[
"error_post_vars"][
"form"][
"chk_db_create"])
1952 $checked =
"checked=\"checked\"";
1955 $this->tpl->setCurrentBlock(
"option_db_create");
1956 $this->tpl->setVariable(
"TXT_DB_CREATE", $this->lng->txt(
"database_create"));
1957 $this->tpl->setVariable(
"DB_CREATE_CHECK",$checked);
1958 $this->tpl->parseCurrentBlock();
1960 $ilDB =
new ilDbx($this->client->dsn_host);
1962 if ($ilDB->isMySQL4_1OrHigher())
1964 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"database_install"));
1965 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_db").
"<br />".
1966 "<p><code>CREATE DATABASE <your_db> CHARACTER SET utf8 COLLATE <your_collation></code></p>".
1967 "<p><b>".$this->lng->txt(
"info_text_db2").
"</b></p><br/>");
1971 $this->tpl->setVariable(
"TXT_INFO",
"<p><b>".$this->lng->txt(
"need_mysql_4_1_or_higher").
"</b></p><br />");
1975 $this->tpl->setVariable(
"TXT_DB_VERSION", $this->lng->txt(
"version"));
1976 $this->tpl->setVariable(
"VAL_DB_VERSION", $ilDB->getMySQLVersion());
1991 if ($ilDB->isMySQL4_1OrHigher())
2000 "utf8_icelandic_ci",
2002 "utf8_lithuanian_ci",
2008 "utf8_slovenian_ci",
2014 foreach($collations as $collation)
2016 $this->tpl->setCurrentBlock(
"collation_item");
2017 $this->tpl->setVariable(
"VAL_COLLATION_ITEM", $collation);
2018 $this->tpl->setVariable(
"TXT_COLLATION_ITEM", $collation);
2019 $this->tpl->parseCurrentBlock();
2021 $this->tpl->setCurrentBlock(
"collation_selection");
2022 $this->tpl->setVariable(
"TXT_COLLATION", $this->lng->txt(
"collation"));
2023 $this->tpl->parseCurrentBlock();
2028 $this->tpl->setVariable(
"COLLATION_INFO2",
"<br />".$this->lng->txt(
"info_text_db_collation2").
" ".
2029 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2030 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2034 $this->tpl->parseCurrentBlock();
2036 $this->tpl->setVariable(
"TXT_SETUP_TITLE", $this->lng->txt(
"setup_database"));
2037 $this->tpl->setVariable(
"TXT_DB_HEADER", $this->lng->txt(
"db_conn"));
2038 $this->tpl->setVariable(
"TXT_DB_TYPE", $this->lng->txt(
"db_type"));
2039 $this->tpl->setVariable(
"TXT_DB_HOST", $this->lng->txt(
"db_host"));
2040 $this->tpl->setVariable(
"TXT_DB_NAME", $this->lng->txt(
"db_name"));
2041 $this->tpl->setVariable(
"TXT_DB_USER", $this->lng->txt(
"db_user"));
2042 $this->tpl->setVariable(
"TXT_DB_PASS", $this->lng->txt(
"db_pass"));
2045 if (!$this->client->db_installed)
2047 $this->setButtonPrev(
"ini");
2050 if ($this->client->db_installed and $db_status)
2052 $this->setButtonNext(
"lang");
2065 if (!$this->client->db_installed)
2068 $message =
"No database found! Please install database first.";
2075 if (empty($_POST[
"form"][
"lang_id"]))
2077 $message = $this->lng->txt(
"lang_min_one_language");
2078 $this->raiseError($message,$this->error_obj->MESSAGE);
2081 if (!in_array($_POST[
"form"][
"lang_default"],$_POST[
"form"][
"lang_id"]))
2083 $message = $this->lng->txt(
"lang_not_installed_default");
2084 $this->error =
true;
2085 $this->raiseError($message,$this->error_obj->MESSAGE);
2089 $result = $this->lng->installLanguages($_POST[
"form"][
"lang_id"], $_POST[
"form"][
"lang_local"]);
2096 foreach (
$result as $key => $lang_key)
2098 $list .= $this->lng->txt(
"lang_".$lang_key);
2100 if ($count > $key + 1)
2107 $this->client->setDefaultLanguage($_POST[
"form"][
"lang_default"]);
2108 $message = $this->lng->txt(
"languages_installed");
2112 $message .=
"<br/>(".$this->lng->txt(
"langs_not_valid_not_installed").
": ".$list.
")";
2118 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_lang.html");
2120 $languages = $this->lng->getInstallableLanguages();
2121 $installed_langs = $this->lng->getInstalledLanguages();
2122 $installed_local_langs = $this->lng->getInstalledLocalLanguages();
2123 $local_langs = $this->lng->getLocalLanguages();
2124 $default_lang = $this->client->getDefaultLanguage();
2126 $lang_count = count($installed_langs);
2128 $this->tpl->setVariable(
"TXT_LANG_HEADER", ucwords($this->lng->txt(
"available_languages")));
2129 $this->tpl->setVariable(
"TXT_LANGUAGE", ucwords($this->lng->txt(
"language")));
2130 $this->tpl->setVariable(
"TXT_INSTALLED", ucwords($this->lng->txt(
"installed")));
2131 $this->tpl->setVariable(
"TXT_INCLUDE_LOCAL", ucwords($this->lng->txt(
"include_local")));
2132 $this->tpl->setVariable(
"TXT_DEFAULT", ucwords($this->lng->txt(
"default")));
2134 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2136 $this->tpl->setVariable(
"TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt(
"setup_languages"))));
2137 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_lang"));
2139 if ($lang_count > 0)
2141 $this->client->status[
"lang"][
"status"] =
true;
2142 $this->client->status[
"lang"][
"comment"] = $lang_count.
" ".$this->lng->txt(
"languages_installed");
2146 $this->client->status[
"lang"][
"status"] =
false;
2147 $this->client->status[
"lang"][
"comment"] = $this->lng->txt(
"lang_none_installed");
2150 foreach ($languages as $lang_key)
2152 $this->tpl->setCurrentBlock(
"language_row");
2153 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
2154 $this->tpl->setVariable(
"TXT_LANG", $this->lng->txt(
"lang_".$lang_key));
2155 $this->tpl->setVariable(
"BORDER", 0);
2156 $this->tpl->setVariable(
"VSPACE", 0);
2158 if (in_array($lang_key,$installed_langs))
2160 $this->tpl->setVariable(
"CHECKED", (
"checked=\"checked\""));
2163 if (!in_array($lang_key,$local_langs))
2165 $this->tpl->setVariable(
"LOCAL", (
"disabled=\"disabled\""));
2167 else if (in_array($lang_key,$installed_local_langs))
2169 $this->tpl->setVariable(
"LOCAL", (
"checked=\"checked\""));
2172 if ($lang_key == $default_lang)
2174 $this->tpl->setVariable(
"DEFAULT", (
"checked=\"checked\""));
2177 $this->tpl->parseCurrentBlock();
2180 $this->setButtonPrev(
"db");
2182 if ($lang_count > 0)
2184 $this->setButtonNext(
"contact");
2197 $settings = $this->client->getAllSettings();
2206 if (empty($_POST[
"form"][
"admin_firstname"]) or empty($_POST[
"form"][
"admin_lastname"])
2207 or empty($_POST[
"form"][
"admin_street"]) or empty($_POST[
"form"][
"admin_zipcode"])
2208 or empty($_POST[
"form"][
"admin_country"]) or empty($_POST[
"form"][
"admin_city"])
2209 or empty($_POST[
"form"][
"admin_phone"]) or empty($_POST[
"form"][
"admin_email"])
2210 or empty($_POST[
"form"][
"inst_name"]) or empty($_POST[
"form"][
"inst_info"]))
2212 $form_valid =
false;
2213 $message = $this->lng->txt(
"fill_out_required_fields");
2221 $form_valid =
false;
2222 $message = $this->lng->txt(
"input_error").
": '".$this->lng->txt(
"email").
"'<br/>".$this->lng->txt(
"email_not_valid");
2253 $this->client->setSetting(
"admin_firstname",
ilUtil::stripSlashes($_POST[
"form"][
"admin_firstname"]));
2254 $this->client->setSetting(
"admin_lastname",
ilUtil::stripSlashes($_POST[
"form"][
"admin_lastname"]));
2256 $this->client->setSetting(
"admin_position",
ilUtil::stripSlashes($_POST[
"form"][
"admin_position"]));
2257 $this->client->setSetting(
"admin_institution",
ilUtil::stripSlashes($_POST[
"form"][
"admin_institution"]));
2258 $this->client->setSetting(
"admin_street",
ilUtil::stripSlashes($_POST[
"form"][
"admin_street"]));
2259 $this->client->setSetting(
"admin_zipcode",
ilUtil::stripSlashes($_POST[
"form"][
"admin_zipcode"]));
2261 $this->client->setSetting(
"admin_country",
ilUtil::stripSlashes($_POST[
"form"][
"admin_country"]));
2264 $this->client->setSetting(
"inst_institution",
ilUtil::stripSlashes($_POST[
"form"][
"inst_institution"]));
2270 $this->client->ini->write();
2273 $settings = $this->client->getAllSettings();
2280 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_contact.html");
2283 $this->tpl->setVariable(
"INST_NAME",
ilUtil::prepareFormOutput(($this->client->getName()) ? $this->client->getName() : $this->client->getId()));
2301 $this->tpl->setVariable(
"TXT_INST_DATA", $this->lng->txt(
"client_data"));
2302 $this->tpl->setVariable(
"TXT_INST_NAME", $this->lng->txt(
"client_name"));
2303 $this->tpl->setVariable(
"TXT_INST_INFO", $this->lng->txt(
"client_info"));
2304 $this->tpl->setVariable(
"TXT_INST_INSTITUTION", $this->lng->txt(
"client_institution"));
2307 $this->tpl->setVariable(
"TXT_CONTACT_DATA", $this->lng->txt(
"contact_data"));
2308 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
2309 $this->tpl->setVariable(
"TXT_FIRSTNAME", $this->lng->txt(
"firstname"));
2310 $this->tpl->setVariable(
"TXT_LASTNAME", $this->lng->txt(
"lastname"));
2311 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
2312 $this->tpl->setVariable(
"TXT_POSITION", $this->lng->txt(
"position"));
2313 $this->tpl->setVariable(
"TXT_INSTITUTION", $this->lng->txt(
"institution"));
2314 $this->tpl->setVariable(
"TXT_STREET", $this->lng->txt(
"street"));
2315 $this->tpl->setVariable(
"TXT_ZIPCODE", $this->lng->txt(
"zipcode"));
2316 $this->tpl->setVariable(
"TXT_CITY", $this->lng->txt(
"city"));
2317 $this->tpl->setVariable(
"TXT_COUNTRY", $this->lng->txt(
"country"));
2318 $this->tpl->setVariable(
"TXT_PHONE", $this->lng->txt(
"phone"));
2319 $this->tpl->setVariable(
"TXT_EMAIL", $this->lng->txt(
"email"));
2320 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2322 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2323 $this->tpl->setVariable(
"TXT_SETUP_TITLE",
"contact information & client data");
2324 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_contact"));
2326 $this->setButtonPrev(
"lang");
2330 $this->client->status[
"contact"][
"status"] = $check[
"status"];
2331 $this->client->status[
"contact"][
"comment"] = $check[
"comment"];
2333 if ($check[
"status"])
2335 $this->setButtonNext(
"nic");
2347 $settings = $this->client->getAllSettings();
2348 $nic_key = $this->client->getNICkey();
2354 if ($_POST[
"form"][
"register"] == 1)
2357 $this->client->updateNIC($this->ilias_nic_server);
2360 if (empty($this->client->nic_status[2]))
2362 $this->client->setSetting(
"nic_enabled",
"-1");
2363 $message = $this->lng->txt(
"nic_reg_failed");
2367 $this->client->setSetting(
"inst_id",$this->client->nic_status[2]);
2368 $this->client->setSetting(
"nic_enabled",
"1");
2369 $this->client->status[
"nic"][
"status"] =
true;
2370 $message = $this->lng->txt(
"nic_reg_enabled");
2373 elseif ($_POST[
"form"][
"register"] == 2)
2375 $nic_by_email = (int) $_POST[
"form"][
"nic_id"];
2377 $checksum = md5($nic_key.$nic_by_email);
2379 if (!$nic_by_email or $_POST[
"form"][
"nic_checksum"] != $checksum)
2381 $message = $this->lng->txt(
"nic_reg_enter_correct_id");
2385 $this->client->setSetting(
"inst_id",$nic_by_email);
2386 $this->client->setSetting(
"nic_enabled",
"1");
2387 $message = $this->lng->txt(
"nic_reg_enabled");
2392 $this->client->setSetting(
"inst_id",
"0");
2393 $this->client->setSetting(
"nic_enabled",
"0");
2394 $message = $this->lng->txt(
"nic_reg_disabled");
2401 $settings = $this->client->getAllSettings();
2403 if ($settings[
"nic_enabled"] ==
"1" && $settings[
"inst_id"] > 0)
2405 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
"info_text_nic3").
" ".$settings[
"inst_id"].
".");
2410 $settings = $this->client->getAllSettings();
2412 $email_subject = rawurlencode(
"NIC registration request");
2413 $email_body = base64_encode($this->client->getURLStringForNIC($this->ilias_nic_server));
2414 $email_link =
"<a href=\"mailto:ilias-nic@uni-koeln.de?subject=".$email_subject.
"&body=".$email_body.
"\">".$this->lng->txt(
"email").
"</a>";
2416 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_nic1").
" ".$email_link.
" ".$this->lng->txt(
"info_text_nic2"));
2419 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_nic.html");
2421 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2424 $this->tpl->setVariable(
"TXT_NIC_ENTER_ID",$this->lng->txt(
"nic_reg_enter_id"));
2425 $this->tpl->setVariable(
"TXT_NIC_ENTER_CHECKSUM",$this->lng->txt(
"nic_reg_enter_checksum"));
2426 $this->tpl->setVariable(
"TXT_NIC_REGISTER",$this->lng->txt(
"nic_registration"));
2427 $this->tpl->setVariable(
"TXT_NIC_ENABLE",$this->lng->txt(
"nic_reg_online"));
2428 $this->tpl->setVariable(
"TXT_NIC_EMAIL",$this->lng->txt(
"nic_reg_email"));
2429 $this->tpl->setVariable(
"TXT_NIC_DISABLE",$this->lng->txt(
"nic_reg_disable").
" <span class=\"subtitle\">".$this->lng->txt(
"nic_reg_disable_comment").
"</span>");
2431 $checked =
"checked=\"checked\"";
2433 if (!isset($settings[
"nic_enabled"]) or $settings[
"nic_enabled"] ==
"1")
2435 $this->tpl->setVariable(
"ENABLED",$checked);
2437 elseif ($settings[
"nic_enabled"] ==
"2")
2439 $this->tpl->setVariable(
"EMAIL",$checked);
2443 $this->tpl->setVariable(
"DISABLED",$checked);
2446 if (isset($settings[
"nic_enabled"]))
2448 $this->client->status[
"nic"][
"status"] =
true;
2452 $this->setButtonPrev(
"contact");
2454 if ($this->client->status[
"nic"][
"status"])
2456 $this->setButtonNext(
"finish",
"finish");
2471 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_tools.html");
2472 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2473 $this->tpl->setVariable(
"TXT_TOOLS", $this->lng->txt(
"tools"));
2474 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE", $this->lng->txt(
"ctrl_structure"));
2475 $this->tpl->setVariable(
"TXT_RELOAD", $this->lng->txt(
"reload"));
2477 $q =
"SELECT count(*) as cnt FROM ctrl_calls";
2478 $cset = $this->client->db->query($q);
2480 if ($crec[
"cnt"] == 0)
2482 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2483 $this->lng->txt(
"ctrl_missing_desc"));
2487 $this->tpl->setVariable(
"TXT_CTRL_STRUCTURE_DESC",
2488 $this->lng->txt(
"ctrl_structure_desc"));
2491 $this->tpl->parseCurrentBlock();
2503 if (!$this->client->db_installed)
2511 $GLOBALS[
"ilDB"] =
new ilDbx($this->client->dsn);
2514 require_once
"./classes/class.ilModuleReader.php";
2515 require_once
"./classes/class.ilServiceReader.php";
2516 require_once
"./classes/class.ilCtrlStructureReader.php";
2519 require_once
"./Services/Component/classes/class.ilModule.php";
2520 require_once
"./Services/Component/classes/class.ilService.php";
2526 foreach($modules as $module)
2529 $module[
"subdir"],
"Modules");
2535 foreach($services as $service)
2538 $service[
"subdir"],
"Services");
2544 $ilCtrlStructureReader->readStructure(
true);
2556 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.std_layout.html");
2558 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_password"));
2565 if (empty($_POST[
"form"][
"pass_old"]))
2567 $message = $this->lng->txt(
"password_enter_old");
2568 $this->raiseError($message,$this->error_obj->MESSAGE);
2571 if (md5($_POST[
"form"][
"pass_old"]) != $pass_old)
2573 $message = $this->lng->txt(
"password_old_wrong");
2574 $this->raiseError($message,$this->error_obj->MESSAGE);
2577 if (empty($_POST[
"form"][
"pass"]))
2579 $message = $this->lng->txt(
"password_empty");
2580 $this->raiseError($message,$this->error_obj->MESSAGE);
2583 if ($_POST[
"form"][
"pass"] != $_POST[
"form"][
"pass2"])
2585 $message = $this->lng->txt(
"password_not_match");
2586 $this->raiseError($message,$this->error_obj->MESSAGE);
2589 if (md5($_POST[
"form"][
"pass"]) == $pass_old)
2591 $message = $this->lng->txt(
"password_same");
2592 $this->raiseError($message,$this->error_obj->MESSAGE);
2597 $message = $this->lng->txt(
"save_error");
2598 $this->raiseError($message,$this->error_obj->MESSAGE);
2606 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_change_admin_password.html");
2608 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"password_new_master"));
2611 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2612 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
2613 $this->tpl->setVariable(
"TXT_PASS_TITLE",$this->lng->txt(
"change_password"));
2614 $this->tpl->setVariable(
"TXT_PASS_OLD",$this->lng->txt(
"set_oldpasswd"));
2615 $this->tpl->setVariable(
"TXT_PASS",$this->lng->txt(
"set_newpasswd"));
2616 $this->tpl->setVariable(
"TXT_PASS2",$this->lng->txt(
"password_retype"));
2617 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2630 $txt_info = $this->lng->txt(
"info_text_finish1").
"<br /><br />".
2631 "<p>".$this->lng->txt(
"user").
": <b>root</b><br />".
2632 $this->lng->txt(
"password").
": <b>homer</b></p>";
2633 $this->setButtonNext(
"login_new",
"login");
2635 $this->client->reconnect();
2638 $this->client->setSetting(
"setup_ok",1);
2641 $this->client->status[
"finish"][
"status"] =
true;
2646 $txt_info = $this->lng->txt(
"info_text_finish2");
2651 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.clientsetup_finish.html");
2652 $this->tpl->setVariable(
"TXT_INFO",$txt_info);
2654 $this->setButtonPrev(
"nic");
2668 if ($_POST[
"form"][
"delete"])
2700 $this->tpl->setVariable(
"TXT_INFO", $this->lng->txt(
"info_text_delete"));
2703 $this->tpl->addBlockFile(
"SETUP_CONTENT",
"setup_content",
"tpl.form_delete_client.html");
2706 $this->tpl->setVariable(
"FORMACTION",
"setup.php?cmd=gateway");
2707 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
2708 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM", $this->lng->txt(
"delete_confirm"));
2709 $this->tpl->setVariable(
"TXT_DELETE_INFO", $this->lng->txt(
"delete_info"));
2721 if ($this->client->status[
"finish"][
"status"])
2723 $val = ($this->client->ini->readVariable(
"client",
"access")) ?
"0" :
true;
2724 $this->client->ini->setVariable(
"client",
"access",$val);
2725 $this->client->ini->write();
2726 $message =
"client_access_mode_changed";
2730 $message =
"client_setup_not_finished";
2745 $client =
new ilClient($_POST[
"form"][
"default"], $this->db_connections);
2749 $this->raiseError($this->lng->txt(
"no_valid_client_id"),$this->error_obj->MESSAGE);
2754 if ($status[
"finish"][
"status"])
2756 $this->ini->setVariable(
"clients",
"default",
$client->getId());
2757 $this->ini->write();
2758 $message =
"default_client_changed";
2762 $message =
"client_setup_not_finished";
2777 foreach ($this->client->status as $key => $val)
2779 if ($key !=
"finish" and $key !=
"access")
2781 if ($val[
"status"] !=
true)
2791 $list = $clientlist->getClients();
2793 if (count($list) == 1)
2795 $this->ini->setVariable(
"clients",
"default",$this->client->getId());
2796 $this->ini->write();
2798 $this->client->ini->setVariable(
"client",
"access",1);
2799 $this->client->ini->write();
2810 if (!$this->client->status[
"db"][
"status"])
2816 elseif (!$this->client->status[
"lang"][
"status"])
2818 $this->cmd =
"lang";
2822 elseif (!$this->client->status[
"contact"][
"status"])
2824 $this->cmd =
"contact";
2828 elseif (!$this->client->status[
"nic"][
"status"])
2834 elseif (!$this->client->status[
"finish"][
"status"])
2836 $this->cmd =
"finish";
2851 if ($this->ini->readVariable(
"clients",
"list"))
2853 $this->ini->setVariable(
"clients",
"list",
"0");
2854 $this->ini->write();
2859 $this->ini->setVariable(
"clients",
"list",
"1");
2860 $this->ini->write();