@(include './install/install.lang.php'); @(include './install/global.func.php'); @(include './config.inc.php'); @(include './include/db_' . $database . '.class.php'); $inslang = defined('INSTALL_LANG') ? INSTALL_LANG : ''; $version = '6.0.0 ' . $lang[$inslang]; if (!defined('INSTALL_LANG') || !function_exists('instmsg') || !is_readable($sqlfile)) { exit("Please upload all files to install Discuz! Board<br />安装 Discuz! 论坛您必须上传所有文件,否则无法继续"); } elseif (!isset($dbhost) || !isset($cookiepre)) { instmsg('config_nonexistence'); } elseif (!ini_get('short_open_tag')) { instmsg('short_open_tag_invalid'); } elseif (file_exists($lockfile)) { instmsg('lock_exists'); } elseif (!class_exists('dbstuff')) { instmsg('database_nonexistence'); } if (function_exists('instheader')) { instheader(); } if (empty($dbcharset) && in_array(strtolower($charset), array('gbk', 'big5', 'utf-8'))) { $dbcharset = str_replace('-', '', $charset); } $action = $_POST['action'] ? $_POST['action'] : $_GET['action']; if (in_array($action, array('check', 'config'))) { if (is_writeable('./config.inc.php')) { $writeable['config'] = result(1, 0); $write_error = 0; } else { $writeable['config'] = result(0, 0); $write_error = 1;
if ($magic_quotes_gpc) { $_POST = ostripslashes($_POST); $_GET = ostripslashes($_GET); } @(include './config.inc.php'); @(include './include/db_mysql.class.php'); $inslang = defined('INSTALL_LANG') ? INSTALL_LANG : ''; $version = @file_get_contents('version.txt') . ' ' . $lang[$inslang]; if (!defined('INSTALL_LANG') || !function_exists('instmsg') || !is_readable($sqlfile)) { exit("安装软件必须上传所有文件"); } elseif (!isset($dbhost)) { instmsg('config_nonexistence'); } elseif (!ini_get('short_open_tag')) { instmsg('short_open_tag_invalid'); } elseif (file_exists($lockfile)) { instmsg('lock_exists'); } if (function_exists('instheader')) { instheader(); } if (empty($dbcharset) && in_array(strtolower($charset), array('gbk', 'big5', 'utf-8'))) { $dbcharset = str_replace('-', '', $charset); } $action = $_POST['action'] ? $_POST['action'] : $_GET['action']; $Attr = array("config.inc.php", "onezdata"); if (in_array($action, array('check', 'config'))) { foreach ($Attr as $v) { $bool = is_dir($v) ? dir_writeable($v) : is_writeable($v); if ($bool) { $writeable[$v] = result(1, 0); $write_error = 0;
$ucdbhost = $dbhost; $ucdbname = $dbname; $ucdbuser = $dbuser; $ucdbpw = $dbpw; $ucdbcharset = $dbcharset; $uccharset = $charset; $pathinfo = pathinfo($_SERVER['PHP_SELF']); $pathinfo['dirname'] = substr($pathinfo['dirname'], 0, -8); $appurl = 'http://' . preg_replace("/\\:\\d+/", '', $_SERVER['HTTP_HOST']) . ($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '') . $pathinfo['dirname']; $ucapi = $appurl . '/uc_server'; $ucip = '127.0.0.1'; $app_tagtemplates = 'apptagtemplates[template]=' . urlencode('<a href="{url}" target="_blank">{subject}</a>') . '&' . 'apptagtemplates[fields][subject]=' . urlencode($lang['tagtemplates_subject']) . '&' . 'apptagtemplates[fields][uid]=' . urlencode($lang['tagtemplates_uid']) . '&' . 'apptagtemplates[fields][username]=' . urlencode($lang['tagtemplates_username']) . '&' . 'apptagtemplates[fields][dateline]=' . urlencode($lang['tagtemplates_dateline']) . '&' . 'apptagtemplates[fields][url]=' . urlencode($lang['tagtemplates_url']); $db->query("INSERT INTO {$uctablepre}applications SET name='Discuz! Board', url='{$appurl}', ip='{$ucip}', authkey='{$appauthkey}', synlogin='******', charset='{$charset}', dbcharset='{$dbcharset}', type='DISCUZ', recvnote='1', tagtemplates='{$apptagtemplates}'", $link); $appid = $db->insert_id($link); if ($appid < 1) { instmsg('reg_app_to_ucenter_fail'); } $db->query("ALTER TABLE {$uctablepre}notelist ADD COLUMN app{$appid} tinyint NOT NULL"); $config = "{$appauthkey}|{$appid}|{$ucdbhost}|{$ucdbname}|{$ucdbuser}|{$ucdbpw}|{$ucdbcharset}|{$uctablepre}|{$uccharset}|{$ucapi}|{$ucip}"; save_uc_config($config, DISCUZ_ROOT . './config.inc.php'); $username = getgpc('username', 'p'); $email = getgpc('email', 'p'); $password1 = getgpc('password1', 'p'); $password2 = getgpc('password2', 'p'); $uid = 0; if ($username && $email && $password1 && $password2) { if ($password1 != $password2) { $error_admin['password2'] = 'admin_password_invalid'; } elseif (strlen($username) > 15 || preg_match("/^\$|^c:\\con\\con\$|║║|[,\"\\s\t\\<\\>&]|^сн©м|^Guest/is", $username)) { $error_admin['username'] = '******'; } elseif (!strstr($email, '@') || $email != stripslashes($email) || $email != htmlspecialchars($email)) {