4 include_once(
"./setup/classes/class.ilDBConnections.php");
75 define(
"ILIAS_MODULE",
"setup");
77 $this->auth = ($this->
checkAuth()) ?
true :
false;
78 $this->access_mode = $a_auth_type;
81 if ($this->safe_mode = ini_get(
"safe_mode"))
87 $this->ini_file_path = ILIAS_ABSOLUTE_PATH.
"/ilias.ini.php";
88 $this->setup_defaults = ILIAS_ABSOLUTE_PATH.
"/setup/ilias.master.ini.php";
91 $this->ini_ilias_exists = $this->
init();
125 $this->client = $a_cl;
144 $this->ini =
new ilIniFile($this->ini_file_path);
146 if (!$this->ini->read())
148 $this->ini->GROUPS = parse_ini_file($this->setup_defaults,
true);
149 $this->error = get_class($this).
": ".$this->ini->getError();
153 $this->setup_password = $this->ini->readVariable(
"setup",
"pass");
154 $this->default_client = $this->ini->readVariable(
"clients",
"default");
156 define(
"ILIAS_DATA_DIR",$this->ini->readVariable(
"clients",
"datadir"));
157 define(
"ILIAS_WEB_DIR",$this->ini->readVariable(
"clients",
"path"));
169 $_SESSION[
"ClientId"] = $this->client->getId();
172 if (!$this->client->create())
174 $this->error = $this->client->getError();
179 $this->ini_client_exists =
true;
194 if ($a_old_client_id != $this->client->getId())
198 ilUtil::delDir(ILIAS_ABSOLUTE_PATH.
"/".ILIAS_WEB_DIR.
"/".$a_old_client_id);
203 $this->ini_client_exists =
true;
214 if ($this->client->getDBSetup()->isDatabaseInstalled()) {
215 $this->error = $this->lng->txt(
"database_exists");
220 $db_setup = $this->client->getDBSetup();
221 return $db_setup->createDatabase($a_collation);
231 if (!$this->client->getDBSetup()->isDatabaseConnectable()) {
235 if ($this->client->getDBSetup()->installDatabase()) {
236 $this->client->db_installed =
true;
251 $a = @file_exists($this->INI_FILE);
263 if (is_writable(
"."))
265 $arr[
"status"] =
true;
268 $arr[
"comment"] = getcwd();
273 $arr[
"status"] =
false;
274 $arr[
"comment"] = $this->lng->txt(
"pre_folder_write_error");
277 $arr[
"comment"] = getcwd().
": ".$arr[
"comment"];
292 if (@mkdir($a_dir.
"/crst879dldsk9d", 0774))
294 $arr[
"status"] =
true;
295 $arr[
"comment"] =
"";
297 @rmdir($a_dir.
"/crst879dldsk9d");
301 $arr[
"status"] =
false;
304 $arr[
"comment"] = getcwd().
": ".$this->lng->txt(
"pre_folder_create_error");
319 if ($sess->usesCookies)
321 $arr[
"status"] =
true;
322 $arr[
"comment"] =
"";
326 $arr[
"status"] =
false;
327 $arr[
"comment"] = $this->lng->txt(
"pre_cookies_disabled");
341 $arr[
"status"] =
true;
342 $arr[
"comment"] =
"PHP ".$version;
343 if (version_compare(
$version,
'5.3.0',
'<'))
345 $arr[
"status"] =
false;
346 $arr[
"comment"] =
"PHP ".$version.
". ".$this->lng->txt(
"pre_php_version_too_low");
360 if (function_exists(
"mysql_query"))
362 $arr[
"status"] =
true;
363 $arr[
"comment"] = $this->lng->txt(
"pre_mysql_4_1_or_higher");
367 $arr[
"status"] =
false;
368 $arr[
"comment"] = $this->lng->txt(
"pre_mysql_missing");
397 if (class_exists(
"DOMDocument"))
399 $arr[
"status"] =
true;
403 $arr[
"status"] =
false;
404 $arr[
"comment"] = $this->lng->txt(
"pre_dom_missing");
418 if (class_exists(
"XSLTProcessor"))
420 $arr[
"status"] =
true;
424 $arr[
"status"] =
false;
425 $arr[
"comment"] = sprintf($this->lng->txt(
"pre_xsl_missing"),
426 "http://php.net/manual/en/book.xsl.php");
440 if (function_exists(
"imagefill") && function_exists(
"imagecolorallocate"))
442 $arr[
"status"] =
true;
446 $arr[
"status"] =
false;
447 $arr[
"comment"] = sprintf($this->lng->txt(
"pre_gd_missing"),
448 "http://php.net/manual/en/book.image.php");
462 $limit = ini_get(
"memory_limit");
465 if (is_int(strpos($limit,
"M")))
467 $limit_n = (int) $limit;
476 $arr[
"status"] =
true;
477 $arr[
"comment"] = $limit.
". ".$this->lng->txt(
"pre_memory_limit_recommend");
481 $arr[
"status"] =
false;
482 $arr[
"comment"] = $limit.
". ".$this->lng->txt(
"pre_memory_limit_too_low");
495 if (version_compare(PHP_VERSION,
'7.0.0',
'>=')) {
496 $arr[
"status"] =
true;
502 $load_comments = ini_get(
"opcache.load_comments");
503 if ($load_comments == 1) {
504 $arr[
"status"] =
true;
506 $arr[
"status"] =
false;
507 $arr[
"comment"] = $this->lng->txt(
"pre_opcache_comments");
548 foreach ($this->preliminaries_result as $val)
550 if ($val[
"status"] ===
false)
552 $this->preliminaries =
false;
566 return $this->ini->readVariable(
"setup",
"pass");
576 $this->ini->setVariable(
"setup",
"pass",md5($a_password));
578 if ($this->ini->write() ==
false)
580 $this->error = $this->ini->getError();
596 if (empty($a_auth_data[
"client_id"]))
598 $this->error =
"no_client_id";
602 if (empty($a_auth_data[
"username"]))
604 $this->error =
"no_username";
608 if (empty($a_auth_data[
"password"]))
610 $this->error =
"no_password";
614 if (!$this->
newClient($a_auth_data[
"client_id"]))
616 $this->error =
"unknown_client_id";
617 unset($this->client);
621 if (!$this->client->db_exists)
623 $this->error =
"no_db_connect_consult_admin";
624 unset($this->client);
628 $s1 = $this->client->db->query(
"SELECT value from settings WHERE keyword = ".
629 $this->client->db->quote(
'system_role_id',
'text'));
630 $r1 = $this->client->db->fetchAssoc($s1);
631 $system_role_id = $r1[
"value"];
634 if($this->client->db->tableColumnExists(
'usr_data',
'passwd_enc_type'))
636 $add_usrfields .=
' , usr_data.passwd_enc_type, usr_data.passwd_salt ';
638 $q =
"SELECT usr_data.usr_id, usr_data.passwd $add_usrfields " .
640 "LEFT JOIN rbac_ua ON rbac_ua.usr_id=usr_data.usr_id " .
641 "WHERE rbac_ua.rol_id = " . $this->client->db->quote((
int)$system_role_id,
'integer') .
" " .
642 "AND usr_data.login=" . $this->client->db->quote($a_auth_data[
"username"],
'text');
643 $r = $this->client->db->query($q);
644 if(!$this->client->db->numRows(
$r))
646 $this->error =
'login_invalid';
650 $data = $this->client->db->fetchAssoc(
$r);
652 global $ilClientIniFile;
654 $ilClientIniFile = $this->client->ini;
656 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
660 require_once
'setup/classes/class.ilObjSetupUser.php';
663 $user->setPasswordEncodingType(
$data[
'passwd_enc_type']);
664 $user->setPasswordSalt(
$data[
'passwd_salt']);
670 $password_valid =
$data[
'passwd'] == md5($a_auth_data[
'password']);
677 $_SESSION[
'auth_path'] = ILIAS_HTTP_PATH;
679 $_SESSION[
'ClientId'] = $this->client->getId();
684 $this->error =
'login_invalid';
696 $a_password = md5($a_password);
698 if ($this->ini->readVariable(
"setup",
"pass") == $a_password)
701 $_SESSION[
"auth_path"] = ILIAS_HTTP_PATH;
721 $this->client =
new ilClient($a_client_id, $this->db_connections);
723 if (!$this->client->init())
726 $this->error = get_class($this).
": ".$this->client->getError();
745 if ($this->ini_client_exists)
758 if ($status[
"db"][
"status"] ===
false and $status[
"db"][
"update"] !==
true)
762 $status[
"lang"][
"status"] =
false;
763 $status[
"lang"][
"comment"] = $status[
"db"][
"comment"];
764 $status[
"contact"][
"status"] =
false;
765 $status[
"contact"][
"comment"] = $status[
"db"][
"comment"];
767 $status[
"proxy"][
"status"] =
false;
768 $status[
"proxy"][
"comment"] = $status[
"db"][
"comment"];
770 $status[
"nic"][
"status"] =
false;
771 $status[
"nic"][
"comment"] = $status[
"db"][
"comment"];
795 if (
$client->getSetting(
"setup_ok"))
797 $arr[
"status"] =
true;
802 $arr[
"status"] =
false;
803 $arr[
"comment"] = $this->lng->txt(
"setup_not_finished");
816 if (
$client->ini->readVariable(
"client",
"access") ==
"1")
818 $arr[
"status"] =
true;
819 $arr[
"comment"] = $this->lng->txt(
"online");
823 $arr[
"status"] =
false;
824 $arr[
"comment"] = $this->lng->txt(
"disabled");
837 if (!$arr[
"status"] =
$client->init())
839 $arr[
"comment"] =
$client->getError();
857 if (!$arr[
"status"] = $client->db_exists) {
858 $arr[
"comment"] = $this->lng->txt(
"no_database");
863 if (!$arr[
"status"] = $client->db_installed) {
864 $arr[
"comment"] = $this->lng->txt(
"db_not_installed");
869 $client->setup_ok = (bool)$client->
getSetting(
"setup_ok");
871 include_once
"./Services/Database/classes/class.ilDBUpdate.php";
872 $this->lng->setDbHandler($client->db);
875 if (!$arr[
"status"] = $dbupdate->getDBVersionStatus()) {
876 $arr[
"comment"] = $this->lng->txt(
"db_needs_update");
877 $arr[
"update"] =
true;
881 if ($dbupdate->hotfixAvailable()) {
882 $arr[
"status"] =
false;
883 $arr[
"comment"] = $this->lng->txt(
"hotfix_available");
884 $arr[
"update"] =
true;
888 if ($dbupdate->customUpdatesAvailable()) {
889 $arr[
"status"] =
false;
890 $arr[
"comment"] = $this->lng->txt(
"custom_updates_available");
891 $arr[
"update"] =
true;
900 $cset = $ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
901 $crec = $ilDB->fetchAssoc($cset);
903 if ($crec[
"cnt"] == 0) {
904 $arr[
"status"] =
false;
905 $arr[
"comment"] = $this->lng->txt(
"db_control_structure_missing");
906 $arr[
"update"] =
true;
921 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
928 $query =
"SELECT keyword, value FROM settings WHERE ".$db->in(
'keyword', $fields,
false,
'text');
934 if(
$row[
'value'] !=
'' )
939 if (count($rows) != count($fields))
941 if($a_as_bool)
return false;
942 $arr[
"status"] =
false;
943 $arr[
"comment"] = $this->lng->txt(
"session_management_not_configured");
947 if($a_as_bool)
return true;
948 $arr[
"status"] =
true;
949 $arr[
"comment"] = $this->lng->txt(
"session_management_configured");
964 $fields =
array(
'proxy_status',
'proxy_host',
'proxy_port' );
966 $query =
"SELECT keyword, value FROM settings WHERE " . $ilDB->in(
'keyword', $fields,
false,
'text');
969 $proxy_settings =
array();
970 $already_saved =
false;
971 while (
$row = $ilDB->fetchAssoc(
$res)) {
972 $already_saved =
true;
973 $proxy_settings[
$row[
'keyword']] = $row[
'value'];
976 if (!$already_saved) {
977 $arr[
"status"] =
false;
978 $arr[
"comment"] = $this->lng->txt(
"proxy");
979 $arr[
"text"] = $this->lng->txt(
"proxy");
981 if ((
bool)$proxy_settings[
"proxy_status"] ==
false) {
982 $arr[
"status"] =
true;
983 $arr[
"comment"] = $this->lng->txt(
"proxy_disabled");
984 $arr[
"text"] = $this->lng->txt(
"proxy_disabled");
986 $arr[
"status"] =
true;
987 $arr[
"comment"] = $this->lng->txt(
"proxy_activated_configurated");
988 $arr[
"text"] = $this->lng->txt(
"proxy_activated_configurated");
1002 $installed_langs = $this->lng->getInstalledLanguages();
1004 $count = count($installed_langs);
1007 $arr[
"status"] =
false;
1008 $arr[
"comment"] = $this->lng->txt(
"lang_none_installed");
1010 $arr[
"status"] =
true;
1024 $arr[
"status"] =
true;
1027 $settings =
$client->getAllSettings();
1028 $client_name =
$client->getName();
1031 if (empty($settings[
"admin_firstname"])
or empty($settings[
"admin_lastname"])
or 1032 empty($settings[
"admin_email"])
or empty($client_name))
1034 $arr[
"status"] =
false;
1035 $arr[
"comment"] = $this->lng->txt(
"missing_data");
1041 $arr[
"status"] =
false;
1042 $arr[
"comment"] = $this->lng->txt(
"email_not_valid");
1055 $settings =
$client->getAllSettings();
1057 if (!isset($settings[
"nic_enabled"]))
1059 $arr[
"status"] =
false;
1060 $arr[
"comment"] = $this->lng->txt(
"nic_not_disabled");
1064 $arr[
"status"] =
true;
1066 if ($settings[
"nic_enabled"] ==
"-1")
1068 $arr[
"comment"] = $this->lng->txt(
"nic_reg_failed");
1072 if (!$settings[
"nic_enabled"])
1074 $arr[
"comment"] = $this->lng->txt(
"nic_reg_disabled");
1078 $arr[
"comment"] = $this->lng->txt(
"nic_reg_enabled");
1079 if ($settings[
"inst_id"] <= 0)
1081 $arr[
"status"] =
false;
1112 return ($this->access_mode ==
"admin") ? true :
false;
1124 if ($a_formdata[
"chk_datadir_path"] == 1)
1128 $this->error =
"create_datadir_failed";
1134 if (!@file_exists(ILIAS_ABSOLUTE_PATH.
"/".$this->ini->readVariable(
"clients",
"path"))
and !@is_dir(ILIAS_ABSOLUTE_PATH.
"/".$this->ini->readVariable(
"clients",
"path")))
1136 if (!
ilUtil::makeDir(ILIAS_ABSOLUTE_PATH.
"/".$this->ini->readVariable(
"clients",
"path")))
1138 $this->error =
"create_webdir_failed";
1144 $log_path = substr($form_log_path,0,strrpos($form_log_path,
"/"));
1145 $log_file = substr($form_log_path,strlen($log_path)+1);
1148 $this->ini->setVariable(
"server",
"http_path",ILIAS_HTTP_PATH);
1149 $this->ini->setVariable(
"server",
"absolute_path",ILIAS_ABSOLUTE_PATH);
1150 $this->ini->setVariable(
"server",
"timezone",preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"time_zone"])));
1151 $this->ini->setVariable(
"clients",
"datadir", $datadir_path);
1152 $this->ini->setVariable(
"tools",
"convert", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"convert_path"])));
1153 $this->ini->setVariable(
"tools",
"zip", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"zip_path"])));
1154 $this->ini->setVariable(
"tools",
"unzip", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"unzip_path"])));
1155 $this->ini->setVariable(
"tools",
"ghostscript", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"ghostscript_path"])));
1156 $this->ini->setVariable(
"tools",
"java", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"java_path"])));
1158 $this->ini->setVariable(
"tools",
"ffmpeg", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"ffmpeg_path"])));
1160 $this->ini->setVariable(
"tools",
"vscantype", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"vscanner_type"])));
1161 $this->ini->setVariable(
"tools",
"scancommand", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"scan_command"])));
1162 $this->ini->setVariable(
"tools",
"cleancommand", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"clean_command"])));
1163 $this->ini->setVariable(
"tools",
"enable_system_styles_management", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"enable_system_styles_management"])));
1164 $this->ini->setVariable(
"tools",
"lessc", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"lessc_path"])));
1166 $this->ini->setVariable(
"setup",
"pass", md5($a_formdata[
"setup_pass"]));
1167 $this->ini->setVariable(
"log",
"path", $log_path);
1168 $this->ini->setVariable(
"log",
"file", $log_file);
1169 $this->ini->setVariable(
"log",
"enabled", ($a_formdata[
"chk_log_status"]) ?
"0" : 1);
1170 $this->ini->setVariable(
"log",
"error_path", $error_log_path);
1172 $this->ini->setVariable(
"https",
"auto_https_detect_enabled", ($a_formdata[
"auto_https_detect_enabled"]) ? 1 : 0);
1173 $this->ini->setVariable(
"https",
"auto_https_detect_header_name", $a_formdata[
"auto_https_detect_header_name"]);
1174 $this->ini->setVariable(
"https",
"auto_https_detect_header_value", $a_formdata[
"auto_https_detect_header_value"]);
1176 if (!$this->ini->write())
1178 $this->error = get_class($this).
": ".$this->ini->getError();
1184 $_SESSION[
"auth_path"] = ILIAS_HTTP_PATH;
1200 $ghostscript_path = preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"ghostscript_path"]));
1208 $clean_command = preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"clean_command"]));
1209 $enable_system_styles_management = preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"enable_system_styles_management"]));
1212 $this->ini->setVariable(
"tools",
"convert", $convert_path);
1213 $this->ini->setVariable(
"tools",
"zip", $zip_path);
1214 $this->ini->setVariable(
"tools",
"unzip", $unzip_path);
1215 $this->ini->setVariable(
"tools",
"ghostscript", $ghostscript_path);
1216 $this->ini->setVariable(
"tools",
"java", $java_path);
1218 $this->ini->setVariable(
"tools",
"ffmpeg", $ffmpeg_path);
1219 $this->ini->setVariable(
"tools",
"latex", $latex_url);
1220 $this->ini->setVariable(
"tools",
"fop", $fop_path);
1221 $this->ini->setVariable(
"tools",
"vscantype", $scan_type);
1222 $this->ini->setVariable(
"tools",
"scancommand", $scan_command);
1223 $this->ini->setVariable(
"tools",
"cleancommand", $clean_command);
1224 $this->ini->setVariable(
"tools",
"lessc", $lessc_path);
1225 $this->ini->setVariable(
"tools",
"enable_system_styles_management", $enable_system_styles_management);
1228 $log_path = substr($form_log_path,0,strrpos($form_log_path,
"/"));
1229 $log_file = substr($form_log_path,strlen($log_path)+1);
1233 $this->ini->setVariable(
"log",
"path", $log_path);
1234 $this->ini->setVariable(
"log",
"file", $log_file);
1235 $this->ini->setVariable(
"log",
"enabled", ($a_formdata[
"chk_log_status"]) ?
"0" : 1);
1236 $this->ini->setVariable(
"log",
"error_path", $error_log_path);
1237 $this->ini->setVariable(
"server",
"timezone",preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"time_zone"])));
1239 $this->ini->setVariable(
"https",
"auto_https_detect_enabled",($a_formdata[
"auto_https_detect_enabled"]) ? 1 : 0);
1240 $this->ini->setVariable(
"https",
"auto_https_detect_header_name", $a_formdata[
"auto_https_detect_header_name"]);
1241 $this->ini->setVariable(
"https",
"auto_https_detect_header_value", $a_formdata[
"auto_https_detect_header_value"]);
1243 if (!$this->ini->write())
1245 $this->error = get_class($this).
": ".$this->ini->getError();
1260 if (!isset($a_formdata[
"chk_convert_path"]))
1265 if (($err = $this->
testConvert($convert_path)) !=
"")
1267 $this->error = $err;
1273 if (!isset($a_formdata[
"chk_zip_path"]))
1278 if (empty($zip_path))
1280 $this->error =
"no_path_zip";
1284 if (!$this->
testZip($zip_path))
1286 $this->error =
"check_failed_zip";
1292 if (!isset($a_formdata[
"chk_unzip_path"]))
1297 if (empty($unzip_path))
1299 $this->error =
"no_path_unzip";
1305 $this->error =
"check_failed_unzip";
1311 if (!isset($a_formdata[
"chk_ghostscript_path"]))
1314 $ghostscript_path = preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"ghostscript_path"]));
1318 $this->error = $err;
1324 if (!isset($a_formdata[
"chk_java_path"]))
1329 if (empty($java_path))
1331 $this->error =
"no_path_java";
1337 $this->error =
"check_failed_java";
1354 if (!isset($a_formdata[
"chk_ffmpeg_path"]))
1359 if (empty($ffmpeg_path))
1361 $this->error =
"no_path_ffmpeg";
1365 if (!$this->testFFMpeg($ffmpeg_path))
1367 $this->error =
"check_failed_ffmpeg";
1373 if (!isset($a_formdata[
"chk_latex_url"]))
1376 if (empty($latex_url))
1378 $this->error =
"no_latex_url";
1384 $this->error =
"check_failed_latex";
1402 if (empty($datadir_path))
1404 $this->error =
"no_path_datadir";
1408 $webspace_dir = ILIAS_ABSOLUTE_PATH .
"/data";
1411 if (strpos($datadir_path,$webspace_dir) !==
false)
1413 $this->error =
"datadir_webspacedir_match";
1418 if ($a_formdata[
"chk_datadir_path"] == 1)
1420 $dir_to_create = substr(strrchr($datadir_path,
"/"), 1);
1421 $dir_to_check = substr($datadir_path,0,- strlen($dir_to_create)-1);
1424 $this->error =
"cannot_create_datadir_inside_webdir";
1428 if (is_writable($datadir_path))
1430 $this->error =
"dir_exists_create";
1434 if (!is_writable($dir_to_check))
1436 $this->error =
"cannot_create_datadir_no_write_access";
1443 $this->error =
"cannot_create_datadir_inside_webdir";
1447 if (!is_writable($datadir_path))
1449 $this->error =
"cannot_create_datadir_no_write_access";
1464 if (!$a_formdata[
"setup_pass"])
1466 $this->error =
"no_setup_pass_given";
1470 if ($a_formdata[
"setup_pass"] != $a_formdata[
"setup_pass2"])
1472 $this->error =
"pass_does_not_match";
1487 if (!$a_formdata[
"chk_log_status"])
1492 if (empty($log_path))
1494 $this->error =
"no_path_log";
1498 if(is_dir($log_path))
1500 $this->error =
'could_not_create_logfile';
1505 $this->error =
"cannot_create_logdir_inside_webdir";
1509 if (!@touch($log_path))
1511 $this->error =
"could_not_create_logfile";
1530 if (!empty($clean_error_log_path)) {
1532 $this->error =
"could_not_create_error_directory";
1546 if (empty($this->error))
1579 if (trim($a_convert_path) ==
"")
1581 return "no_path_convert";
1583 if (!is_file($a_convert_path))
1585 return "check_failed_convert";
1601 if (trim($a_ghostscript_path) ==
"")
1605 if (!is_file($a_ghostscript_path))
1607 return "check_failed_ghostscript";
1622 if (trim($a_java_path) ==
"")
1627 if (!is_file($a_java_path))
1629 return "check_failed_java";
1651 if (trim($a_latex_url) ==
"")
1657 include_once
"./setup/classes/class.ilHttpRequest.php";
1660 if ((strpos((substr(
$result, 0, 5)),
"PNG") !== FALSE) || (strpos((substr(
$result, 0, 5)),
"GIF") !== FALSE))
1666 return "check_failed_latex";;
1678 if (trim($a_zip_path) ==
"")
1680 return "no_path_zip";
1682 if (!is_file($a_zip_path))
1684 return "check_failed_zip";
1731 if (trim($a_unzip_path) ==
"")
1733 return "no_path_unzip";
1735 if (!is_file($a_unzip_path))
1737 return "check_failed_unzip";
1774 function unzip($a_file, $overwrite =
false)
1778 $pathinfo = pathinfo($a_file);
1779 $dir = $pathinfo[
"dirname"];
1780 $file = $pathinfo[
"basename"];
1785 $unzip = $this->ini->readVariable(
"tools",
"unzip");
1787 exec($unzipcmd, $arr);
1790 foreach($arr as $line)
1792 if(is_int(strpos($line,
"/")))
1794 $zdir = substr($line, 0, strrpos($line,
"/"));
1795 $nr = substr_count($zdir,
"/");
1799 $nr = substr_count($zdir,
"/");
1800 $zdirs[$zdir] = $nr;
1802 $zdir = substr($zdir, 0, strrpos($zdir,
"/"));
1809 foreach($zdirs as $zdir => $nr)
1835 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
1837 $db = $this->client->getDB();
1842 foreach($setting_fields as $field)
1844 if( isset($session_settings[$field]) )
1846 $query =
"SELECT keyword FROM settings WHERE module = %s AND keyword = %s";
1848 array(
'text',
'text'),
array(
'common', $field));
1853 if( count(
$row) > 0 )
1858 'value' =>
array(
'text', $session_settings[$field])
1861 'module' =>
array(
'text',
'common'),
1862 'keyword' =>
array(
'text', $field)
1871 'module' =>
array(
'text',
'common'),
1872 'keyword' =>
array(
'text', $field),
1873 'value' =>
array(
'text', $session_settings[$field])
1882 if($i < 4) $message = $this->lng->txt(
"session_settings_not_saved");
1883 else $message = $this->lng->txt(
"settings_saved");
1895 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
1897 $db = $this->client->getDB();
1901 $query =
"SELECT * FROM settings WHERE module = %s " .
1902 "AND ".$db->in(
'keyword', $setting_fields,
false,
'text');
1906 $session_settings =
array();
1909 $session_settings[
$row[
'keyword']] = $row[
'value'];
1912 foreach( $setting_fields as $field )
1914 if( !isset($session_settings[$field]) )
1920 case 'session_max_count':
1925 case 'session_min_idle':
1930 case 'session_max_idle':
1935 case 'session_max_idle_after_first_request':
1940 case 'session_allow_client_maintenance':
1946 $session_settings[$field] = $value;
1950 return $session_settings;
1961 $source =
new ilClient($source_id, $this->db_connections);
1970 $this->error =
"Could not delete data dir $target->getDataDir()";
1977 $this->error =
"could_not_create_base_data_dir :".$target->getDataDir();
1983 $this->error =
"clone_datadircopyfail";
1990 $this->error =
"Could not delete webspace dir $target->getWebspaceDir()";
1997 $this->error =
"could_not_create_base_webspace_dir :".$target->getWebspaceDir();
2003 $this->error =
"clone_websipacedircopyfail";
2017 $this->error =
"Source database connection failed.";
2024 $this->error =
"Target database connection failed.";
2029 $srcTables = $source->db->query(
"SHOW TABLES");
2033 $tarTables =
$target->db->query(
"SHOW TABLES");
2034 foreach($tarTables->fetchAll() as $cTable)
2036 $target->db->query(
"DROP TABLE IF EXISTS " . $cTable[0]);
2039 foreach($srcTables->fetchAll() as $cTable){
2040 $drop =
$target->db->query(
"DROP TABLE IF EXISTS " . $cTable[0]);
2041 $create =
$target->db->query(
"CREATE TABLE " . $cTable[0] .
" LIKE " . $source->getDbName() .
"." . $cTable[0]);
2045 $insert =
$target->db->query(
"INSERT INTO " . $cTable[0] .
" SELECT * FROM ".$source->getDbName().
".".$cTable[0]);
2048 $target->db->query(
"UPDATE settings SET VALUE = ".
$target->db->quote(0,
"integer").
" WHERE keyword = ".
$target->db->quote(
"inst_id",
"text"));
2049 $target->db->query(
"UPDATE settings SET VALUE = ".
$target->db->quote(0,
"integer").
" WHERE keyword = ".
$target->db->quote(
"nic_enabled",
"text"));
2061 require_once
'./Services/Http/exceptions/class.ilProxyException.php';
2062 $settings =
$client->getAllSettings();
2064 if((
bool)$settings[
'proxy_status'] ==
true)
2069 $wait_timeout = 100;
2071 $fp = @fsockopen($settings[
'proxy_host'], $settings[
'proxy_port'],$err_code,$err_str,$wait_timeout);
2093 $db = $this->client->getDB();
2094 $proxy_fields =
array(
'proxy_status',
'proxy_host',
'proxy_port');
2096 foreach($proxy_fields as $field)
2098 if( isset($proxy_settings[$field]) )
2100 $query =
"SELECT keyword FROM settings WHERE module = %s AND keyword = %s";
2102 array(
'text',
'text'),
array(
'common', $field));
2105 while(
$row = $db->fetchAssoc(
$res))
break;
2107 if( count(
$row) > 0 )
2112 'value' =>
array(
'text', $proxy_settings[$field])
2115 'module' =>
array(
'text',
'common'),
2116 'keyword' =>
array(
'text', $field)
2125 'module' =>
array(
'text',
'common'),
2126 'keyword' =>
array(
'text', $field),
2127 'value' =>
array(
'text', $proxy_settings[$field])
2139 $ini_get = ini_get(
'opcache.enable');
2141 return ($ini_get === 1 OR $ini_get ===
'1' OR strtolower($ini_get) ===
'on');
2152 if (!preg_match(
"/^[A-Za-z0-9]+$/", $a_client_id))
2167 $other_directory = $other_directory.
"/";
2169 return !(strpos($directory, $other_directory) !== 0);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const DEFAULT_MAX_COUNT
default value for settings that have not been defined in setup or administration yet ...
static makeDirParents($a_dir)
Create a new directory and all parent directories.
isAuthenticated()
check if current user is authenticated
__construct($a_auth, $a_auth_type)
constructor
checkClientIni(&$client)
check client ini status
isDirectoryInOther($directory, $other_directory)
Checks if directory is subdirectory of other directory.
getStatus($client=0)
coumpute client status
checkClientLanguages(ilClient $client)
checkCreatable($a_dir=".")
check for permission to create new folders in specified directory
Administrates DB connections in setup.
queryPreliminaries()
preliminaries
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
cloneFromSource($source_id)
Clone source client into current client.
checkLogSetup($a_formdata)
check log path
checkWritable()
check for writable directory
isAdmin()
check if current user is admin
testLatex($a_latex_url)
Check latex cgi script.
checkPreliminaries()
check all prliminaries
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
updateNewClient($a_old_client_id)
update client.ini & move data dirs does not work correctly at this time - DISABLED ...
saveProxySettings($proxy_settings)
checkMemoryLimit()
Check Memory Limit.
static getSettingFields()
returns the array of setting fields
Class for proxy related exception handling in ILIAS.
checkIniFileExists()
check if inifile exists
testZip($a_zip_path)
Check zip program.
unzip($a_file, $overwrite=false)
unzip file
testJava($a_java_path)
Check JVM.
checkClientDatabase(ilClient $client)
setPassword($a_password)
set setup master password
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
createDatabase($a_collation="")
create client database
testConvert($a_convert_path)
Check convert program.
isInstalled()
check if client's db is installed
loginAsAdmin($a_password)
process setup admin login
checkErrorLogSetup($error_log_path)
check error log path
getPassword()
get setup master password
deleteTrailingSlash($a_path)
delete trailing slash of path variables
checkClientContact(&$client)
check client contact data status
installDatabase()
set the database data
checkPasswordSetup($a_formdata)
check setup password
setSessionSettings($session_settings)
saves session settings to db
loginAsClient($a_auth_data)
process client login
checkCookiesEnabled()
check cookies enabled
saveMasterSetup($a_formdata)
saves intial settings
printProxyStatus($client)
Print proxy settings.
static createDirectory($a_dir, $a_mod=0755)
create directory
init()
init setup load settings from ilias.ini if exists and sets some constants
getError()
get Error message
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
newClient($a_client_id=0)
creates a client object in $this->client
updateMasterSettings($a_formdata)
updates settings
Class ilObjSetupUser A class derived from ilObjUser for authentication purposes in the ILIAS setup...
getSessionSettings()
reads session settings from db
checkToolsSetup($a_formdata)
check pathes to 3rd party software
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
checkFinish(&$client)
check if client setup was finished
isValidClientId($a_client_id)
Is valid client id.
checkAuth()
check authentication status
checkClientNIC(&$client)
check client nic status
testGhostscript($a_ghostscript_path)
Check ghostscript program.
static escapeShellArg($a_arg)
getSetting($a_keyword)
read one value from settings table
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
checkPHPVersion()
check for PHP version
checkClientProxySettings(ilClient $client)
checkClientSessionSettings(&$client, $a_as_bool=false)
check client session config status
const DEFAULT_ALLOW_CLIENT_MAINTENANCE
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
checkAccess(&$client)
check client access status
static getInstance()
Single method to reduce footprint (included files, created instances)
const DEFAULT_MAX_IDLE_AFTER_FIRST_REQUEST
testUnzip($a_unzip_path)
Check unzip program.
checkDataDirSetup($a_formdata)
check datadir path
saveNewClient()
saves client.ini & updates client list in ilias.ini