示例#1
0
文件: setpass.php 项目: thu0ng91/jmc
    jieqi_printfail(LANG_NO_USER);
}
if (md5($user->getVar('pass')) != $_REQUEST['checkcode']) {
    jieqi_printfail($jieqiLang['system']['error_checkcode']);
}
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = 'setpass';
}
switch ($_REQUEST['action']) {
    case 'newpass':
        $_REQUEST['uid'] = $_REQUEST['id'];
        $_REQUEST['oldpass'] = $user->getVar('pass', 'n');
        $_REQUEST['jumpurl'] = JIEQI_URL . '/login.php';
        $_REQUEST['lang_failure'] = $jieqiLang['system']['set_password_failure'];
        $_REQUEST['lang_success'] = $jieqiLang['system']['set_password_success'];
        jieqi_useraction('edit', $_REQUEST);
        $_REQUEST['pass'] = trim($_REQUEST['pass']);
        $_REQUEST['repass'] = trim($_REQUEST['repass']);
        $errtext = '';
        //检查密码
        if (strlen($_REQUEST['pass']) == 0 || strlen($_REQUEST['repass']) == 0) {
            $errtext .= $jieqiLang['system']['need_pass_repass'] . '<br />';
        } elseif ($_REQUEST['pass'] != $_REQUEST['repass']) {
            $errtext .= $jieqiLang['system']['password_not_equal'] . '<br />';
        }
        if (empty($errtext)) {
            $user->setVar('pass', $users_handler->encryptPass($_REQUEST['pass']));
            $users_handler->insert($user);
            jieqi_jumppage(JIEQI_USER_URL . '/login.php', LANG_DO_SUCCESS, $jieqiLang['system']['set_password_success']);
        } else {
            jieqi_printfail($errtext);
示例#2
0
文件: register.php 项目: thu0ng91/jmc
}
require_once 'global.php';
//<!--jieqi insert check code-->
//if(JIEQI_LOCAL_URL != JIEQI_USER_URL) header('Location: '.JIEQI_USER_URL.jieqi_addurlvars(array()));
jieqi_loadlang('users', JIEQI_MODULE_NAME);
//是否允许注册
if (!defined("JIEQI_ALLOW_REGISTER") || JIEQI_ALLOW_REGISTER != 1) {
    jieqi_printfail($jieqiLang['system']['user_stop_register']);
}
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = 'register';
}
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
switch ($_REQUEST['action']) {
    case 'newuser':
        jieqi_useraction('register', $_REQUEST);
        break;
    case 'register':
    default:
        include_once JIEQI_ROOT_PATH . '/header.php';
        $jieqiTpl->assign('form_action', JIEQI_USER_URL . '/register.php');
        $jieqiTpl->assign('check_url', JIEQI_USER_URL . '/regcheck.php');
        if (!empty($jieqiConfigs['system']['checkcodelogin'])) {
            $jieqiTpl->assign('show_checkcode', 1);
        } else {
            $jieqiTpl->assign('show_checkcode', 0);
        }
        $jieqiTpl->assign('url_checkcode', JIEQI_USER_URL . '/checkcode.php');
        $jieqiTpl->setCaching(0);
        $jieqiTset['jieqi_contents_template'] = JIEQI_ROOT_PATH . '/templates/register.html';
        include_once JIEQI_ROOT_PATH . '/footer.php';
示例#3
0
文件: login.php 项目: thu0ng91/jmc
    @session_regenerate_id();
}
//载入语言
jieqi_loadlang('users', JIEQI_MODULE_NAME);
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = '';
}
if ($_REQUEST['action'] == 'login' && !empty($_REQUEST['password']) && (!empty($_REQUEST['username']) || !empty($_SESSION['jieqiUserUname']))) {
    if (empty($_REQUEST['username']) && !empty($_SESSION['jieqiUserUname'])) {
        $_REQUEST['username'] = $_SESSION['jieqiUserUname'];
    }
    if (empty($_REQUEST['jumpurl'])) {
        $_REQUEST['jumpurl'] = JIEQI_URL . '/admin/index.php';
    }
    jieqi_useraction('login', $_REQUEST);
    exit;
}
include_once JIEQI_ROOT_PATH . '/admin/header.php';
$self_fname = $_SERVER['PHP_SELF'] ? basename($_SERVER['PHP_SELF']) : basename($_SERVER['SCRIPT_NAME']);
if (!empty($_REQUEST['jumpurl'])) {
    $jieqiTpl->assign('url_login', JIEQI_USER_URL . '/admin/' . $self_fname . '?do=submit&jumpurl=' . urlencode($_REQUEST['jumpurl']));
} else {
    $jieqiTpl->assign('url_login', JIEQI_USER_URL . '/admin/' . $self_fname . '?do=submit');
}
if (empty($_SESSION['jieqiUserId'])) {
    $jieqiTpl->assign('jieqi_userid', 0);
    $jieqiTpl->assign('jieqi_username', '');
} else {
    $jieqiTpl->assign('jieqi_userid', $_SESSION['jieqiUserId']);
    $jieqiTpl->assign('jieqi_username', jieqi_htmlstr($_SESSION['jieqiUserUname']));
示例#4
0
jieqi_loadlang('users', JIEQI_MODULE_NAME);
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$errstr = '';
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login' && !empty($_REQUEST['username']) && !empty($_REQUEST['password'])) {
    $_REQUEST['jumpurl'] = JIEQI_URL . '/loginframe.php';
    $_REQUEST['jumphide'] = true;
    $_REQUEST['return'] = true;
    $islogin = jieqi_useraction('login', $_REQUEST);
    if (!$islogin) {
        $errstr = $_REQUEST['error'];
    }
} elseif ($_REQUEST['action'] == 'logout') {
    $_REQUEST['jumpurl'] = JIEQI_URL . '/loginframe.php';
    $_REQUEST['jumphide'] = true;
    $_REQUEST['return'] = true;
    jieqi_useraction('logout', $_REQUEST);
    $islogin = false;
} else {
    if ($jieqiUsersGroup == JIEQI_GROUP_GUEST) {
        $islogin = false;
    } else {
        $islogin = true;
    }
}
include_once JIEQI_ROOT_PATH . '/lib/template/template.php';
$jieqiTpl =& JieqiTpl::getInstance();
if ($islogin) {
    $jieqiTpl->assign('jieqi_userid', $_SESSION['jieqiUserId']);
    $jieqiTpl->assign('jieqi_username', jieqi_htmlstr($_SESSION['jieqiUserName']));
    $jieqiTpl->assign('jieqi_usergroup', $jieqiGroups[$_SESSION['jieqiUserGroup']]);
    $jieqiTpl->assign('jieqi_groupname', $jieqiGroups[$_SESSION['jieqiUserGroup']]);