示例#1
0
文件: login.php 项目: rust1989/edit
<?php

require_once './../inc/init.php';
require_once './language/language.php';
$action = strFilter($_GET['action']);
$username = strFilter($_POST['username']);
$userpass = strFilter($_POST['userpass']);
$securitycode = strFilter($_POST['securitycode']);
$ref = strFilter($_POST['ref']);
if ($ref == "") {
    $ref = "index.php";
}
if ($action == 'exit') {
    uSESSION('isadmin');
    _header_("location:login.php");
}
if (isAdmin()) {
    _header_("location:index.php");
}
if ($action == 'login') {
    if ($lg['groupid'] != GROUP_ADMIN) {
        //exit($_AL['login.webfirst']);
    }
    if ($username == '' || $userpass == '' || $userpass == '') {
        $errtips = 'login_detailsrequired';
    } elseif (strtolower(rSESSION('validationcode')) != strtolower($securitycode)) {
        $errtips = 'login_validationcodeerr';
    } else {
        $userpass = encrypt($username, $userpass);
        $row = $db->row_select_one("users", "username='******' and userpass='******'");
        if ($row == null) {
示例#2
0
    $voltmp = explode("_v", rSESSION('data_file'));
    $volname = $voltmp[0];
    $volnum = explode(".sq", $voltmp[1]);
    $volnum = intval($volnum[0]) + 1;
    $tmpfile = $volname . "_v" . $volnum . ".sql";
    if (file_exists("./{$backdir}/" . $tmpfile)) {
        $msgs[] = _LANG($_AL['database.r2.t4'], array($tmpfile));
        wSESSION('data_file', $tmpfile);
        show_msg($msgs);
        sleep(3);
        echo "<script language='javascript'>";
        echo "location='restore.php';";
        echo "</script>";
    } else {
        $msgs[] = "{$_AL['database.r2.t5']}";
        uSESSION('data_file');
        show_msg($msgs);
    }
    break;
    /************************************** restore END ************************************************/
}
function import($fname)
{
    global $database;
    $sqls = file($fname);
    foreach ($sqls as $sql) {
        str_replace("\r", "", $sql);
        str_replace("\n", "", $sql);
        if (!$database->query(trim($sql))) {
            return false;
        }
示例#3
0
文件: logout.php 项目: rust1989/edit
<?php

require_once 'inc/init.php';
$t = -86400 * 365 * 2;
uSESSION('memberid');
uSESSION('groupid');
//session_destroy();
setCookies('username', '', $t);
setCookies('userpass', '', $t);
setCookies('expire', '', $t);
setCookies('memberauth', '', $t);
printMsg('logout_succeed');