function setting_manager($post = false) { $this->sanitizer =& TextSanitizer::getInstance(); if ($post) { $this->readPost(); } else { $this->database = 'mysql'; $this->dbhost = 'localhost'; $this->prefix = 'xoops'; $this->db_pconnect = 0; $this->root_path = str_replace("\\", "/", getcwd()); // " $this->root_path = str_replace("/install", "", $this->root_path); $filepath = !empty($_SERVER['REQUEST_URI']) ? dirname($_SERVER['REQUEST_URI']) : dirname($_SERVER['SCRIPT_NAME']); $filepath = str_replace("\\", "/", $filepath); // " $filepath = str_replace("/install", "", $filepath); if (substr($filepath, 0, 1) == "/") { $filepath = substr($filepath, 1); } if (substr($filepath, -1) == "/") { $filepath = substr($filepath, 0, -1); } $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; $this->xoops_url = !empty($filepath) ? $protocol . $_SERVER['HTTP_HOST'] . "/" . $filepath : $protocol . $_SERVER['HTTP_HOST']; } }
function setting_manager($post = false) { $this->sanitizer =& TextSanitizer::getInstance(); if ($post) { $this->readPost(); } else { $this->dbType = 'pgsql'; $this->dbHost = 'localhost'; $this->dbPort = '5432'; $this->dcl_root = str_replace("\\", "/", getcwd()); // " $this->dcl_root = str_replace("/setup", "/", $this->dcl_root); $filepath = !empty($_SERVER['REQUEST_URI']) ? dirname($_SERVER['REQUEST_URI']) : dirname($_SERVER['SCRIPT_NAME']); $filepath = str_replace("\\", "/", $filepath); // " $filepath = str_replace("/setup", "", $filepath); if (substr($filepath, 0, 1) == "/") { $filepath = substr($filepath, 1); } if (substr($filepath, -1) == "/") { $filepath = substr($filepath, 0, -1); } $this->dcl_www_root = "/" . $filepath . "/"; $this->redirMethod = 'php'; $this->cookieMethod = 'php'; } }
function setting_manager($post = false) { $this->sanitizer =& TextSanitizer::getInstance(); if ($post) { $this->readPost(); } else { $this->database = 'mysql'; $this->dbhost = 'localhost'; // // Generate prefix // srand(microtime() * 10000); do { $this->prefix = substr(md5(rand()), 0, 6); } while (!preg_match("/^[a-z]/", $this->prefix)); $this->salt = substr(md5(rand()), 5, 8); $this->db_pconnect = 0; $this->root_path = str_replace('\\', '/', getcwd()); // " $this->root_path = str_replace('/install', '', $this->root_path); $filepath = !empty($_SERVER['REQUEST_URI']) ? dirname($_SERVER['REQUEST_URI']) : dirname($_SERVER['SCRIPT_NAME']); $filepath = str_replace('\\', '/', $filepath); // " $filepath = str_replace('/install', '', $filepath); if (substr($filepath, 0, 1) == '/') { $filepath = substr($filepath, 1); } if (substr($filepath, -1) == '/') { $filepath = substr($filepath, 0, -1); } $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; $this->xoops_url = !empty($filepath) ? $protocol . $_SERVER['HTTP_HOST'] . '/' . $filepath : $protocol . $_SERVER['HTTP_HOST']; // find xoops_trust_path $path = $this->root_path; while (strlen($path) > 4) { if (is_dir($path . '/xoops_trust_path')) { $this->trust_path = $path . '/xoops_trust_path'; break; } $path = dirname($path); } } }
exit; } else { if (INSTALL_USER != '' && $_SERVER['PHP_AUTH_USER'] != INSTALL_USER) { header('HTTP/1.0 401 Unauthorized'); echo 'You can not access this XOOPS installer.'; exit; } if (INSTALL_PASSWD != $_SERVER['PHP_AUTH_PW']) { header('HTTP/1.0 401 Unauthorized'); echo 'You can not access this XOOPS installer.'; exit; } } } include_once './class/textsanitizer.php'; $myts =& TextSanitizer::getInstance(); if (isset($_POST)) { foreach ($_POST as $k => $v) { ${$k} = $myts->stripSlashesGPC($v); } } $language = 'english'; if (!empty($_POST['lang'])) { $language = $_POST['lang']; } else { if (isset($_COOKIE['install_lang'])) { $language = $_COOKIE['install_lang']; } else { $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'ja,en-us;q=0.7,zh-TW;q=0.6'; if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $accept_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);