예제 #1
0
파일: globals.php 프로젝트: flyysr/emlog
 */
require_once '../init.php';
define('TEMPLATE_PATH', EMLOG_ROOT . '/admin/views/');
//后台当前模板路径
define('OFFICIAL_SERVICE_HOST', 'http://www.emlog.net/');
//官方服务域名
$sta_cache = $CACHE->readCache('sta');
$user_cache = $CACHE->readCache('user');
$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';
//登录验证
if ($action == 'login') {
    $username = isset($_POST['user']) ? addslashes(trim($_POST['user'])) : '';
    $password = isset($_POST['pw']) ? addslashes(trim($_POST['pw'])) : '';
    $ispersis = isset($_POST['ispersis']) ? intval($_POST['ispersis']) : false;
    $img_code = Option::get('login_code') == 'y' && isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
    $loginAuthRet = LoginAuth::checkUser($username, $password, $img_code);
    if ($loginAuthRet === true) {
        LoginAuth::setAuthCookie($username, $ispersis);
        emDirect("./");
    } else {
        LoginAuth::loginPage($loginAuthRet);
    }
}
//退出
if ($action == 'logout') {
    setcookie(AUTH_COOKIE_NAME, ' ', time() - 31536000, '/');
    emDirect("../");
}
if (ISLOGIN === false) {
    LoginAuth::loginPage();
}
예제 #2
0
파일: xmlrpc.php 프로젝트: szshenjian/JIEWU
function login($username, $password)
{
    $username = addslashes($username);
    $password = addslashes($password);
    // 检查用户权限
    if (true !== LoginAuth::checkUser($username, $password, '', 'n')) {
        error_message(403, '用户名密码错误');
        return false;
    }
    // 返回用户信息
    return LoginAuth::getUserDataByLogin($username);
}
예제 #3
0
파일: index.php 프로젝트: LockGit/emlog
    emDirect("./?action=tw");
}
if ($action == 'login') {
    Option::get('login_code') == 'y' ? $ckcode = "<span>验证码</span>\n    <div class=\"val\"><img src=\"../include/lib/checkcode.php\" /><br />\n\t<input name=\"imgcode\" id=\"imgcode\" type=\"text\" />\n    </div>" : ($ckcode = '');
    include View::getView('header');
    include View::getView('login');
    include View::getView('footer');
    View::output();
}
if ($action == 'auth') {
    session_start();
    $username = addslashes(trim($_POST['user']));
    $password = addslashes(trim($_POST['pw']));
    $img_code = Option::get('login_code') == 'y' && isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
    $ispersis = true;
    if (LoginAuth::checkUser($username, $password, $img_code) === true) {
        loginAuth::setAuthCookie($username, $ispersis);
        emDirect('?tem=' . time());
    } else {
        emDirect("?action=login");
    }
}
if ($action == 'logout') {
    setcookie(AUTH_COOKIE_NAME, ' ', time() - 31536000, '/');
    emDirect('?tem=' . time());
}
function mMsg($msg, $url)
{
    include View::getView('header');
    include View::getView('msg');
    include View::getView('footer');