Beispiel #1
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
require '../../inc/config.php';
require 'defconfig.php';
if (!empty($_POST)) {
    if (isset($_SESSION['eventadm:uid'])) {
        dbconn::go_showmsg('您已完成登入!', '/event/admin');
    }
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    if (empty($username) or empty($password)) {
        dbconn::go_showmsg('帳號或密碼未輸入');
    }
    $member = dbconn::getmemusr($username);
    if (empty($member)) {
        dbconn::go_showmsg('帳號不存在');
        exit;
    }
    if ($member['User_status'] != 'T') {
        dbconn::go_showmsg('帳號未啟用!');
        exit;
    }
    if (md5(md5($password) . $member['User_salt']) != $member['User_passwd']) {
        dbconn::go_showmsg('帳號與密碼不匹配!');
        exit;
    }
    $_SESSION['eventadm:uid'] = $member['id'];
    $_SESSION['eventadm:acc'] = $member['User_acc'];
    dbconn::go_showmsg('', '/event/admin');