示例#1
1
function DBinit($log_script = 'default')
{
    global $link, $config;
    if ($link) {
        return;
    }
    loadTool('databaseInterface.class.php', 'database/');
    loadTool('statementInterface.class.php', 'database/');
    if ($config['db_driver'] != 'pdo') {
        loadTool('mysqlDriverBase.class.php', 'database/');
        loadTool('mysqlDriverStm.class.php', 'database/');
    }
    loadTool('module.class.php', 'database/' . $config['db_driver'] . '/');
    loadTool('statement.class.php', 'database/' . $config['db_driver'] . '/');
    $class = $config['db_driver'] . 'Driver';
    $link = new $class();
    try {
        if (!empty($config['db_file'])) {
            $link->connect(array('file' => $config['db_file']));
        } else {
            $link->connect(array('host' => $config['db_host'], 'port' => $config['db_port'], 'login' => $config['db_login'], 'password' => $config['db_passw'], 'db' => $config['db_name']));
        }
    } catch (Exception $e) {
        exit($e->getMessage());
    }
    if ($log_script and $config['action_log']) {
        ActionLog($log_script);
    }
    CanAccess(2);
}
示例#2
0
        if ($modifed) {
            $message .= "<br />";
        }
    }
    aExit(2, $message);
}
if ($input['method'] == 2) {
    $tmp_user = new User($input['id']);
    if ($tmp_user->id() and !strcmp($tmp_user->getVerificationStr(), $input['verificate'])) {
        $tmp_user->changeGroup(1);
    }
    exit(View::ShowStaticPage('mail_verification_ok.html', 'other/'));
}
RefreshBans();
$female = $input['female'] ? 1 : 0;
if (!CanAccess()) {
    aExit(11, lng('IP_BANNED'));
}
if (empty($input['login']) || empty($input['pass']) || empty($input['repass'])) {
    aExit(1, lng('INCOMPLETE_FORM'));
}
if (!preg_match("/^[a-zA-Z0-9_-]+\$/", $input['login'])) {
    $rcodes[] = 2;
}
if (!preg_match("/^[a-zA-Z0-9_-]+\$/", $input['pass'])) {
    $rcodes[] = 3;
}
if (!preg_match("/^[a-zA-Z0-9_-]+\$/", $input['repass'])) {
    $rcodes[] = 4;
}
if (!$input['email']) {