代码拉取完成,页面将自动刷新
<?php
/**
* 用户管理
*
* [WeEngine System] Copyright (c) 2013 WE7.CC
*/
define('IN_SYS', true);
require 'source/bootstrap.inc.php';
$actions = array();
$action = $_GET['act'];
if($_W['uid']) {
$actions = array('logout', 'setting', 'wechat', 'module', 'barcode');
if($_W['isfounder']) {
$actions = array_merge($actions, array('create', 'edit', 'display', 'select', 'group', 'fields', 'permission'));
}
if (!in_array($action, $actions)) {
header('Location: ./index.php');
}
} else {
$actions = array('login', 'register', 'code');
$action = in_array($action, $actions) ? $action : 'login';
}
$controller = 'member';
require router($controller, $action);
function _login($forward = '') {
global $_GPC;
require_once IA_ROOT . '/source/model/member.mod.php';
hooks('member:login:before');
$member = array();
$username = trim($_GPC['username']);
if(empty($username)) {
message('请输入要登录的用户名');
}
$member['username'] = $username;
$member['password'] = $_GPC['password'];
if(empty($member['password'])) {
message('请输入密码');
}
$record = member_single($member);
if(!empty($record)) {
if($record['status'] == -1) {
message('您的账号正在核合或是已经被系统禁止,请联系网站管理员解决!');
}
$cookie = array();
$cookie['uid'] = $record['uid'];
$cookie['lastvisit'] = $record['lastvisit'];
$cookie['lastip'] = $record['lastip'];
$cookie['hash'] = md5($record['password'] . $record['salt']);
$session = base64_encode(json_encode($cookie));
isetcookie('__session', $session, !empty($_GPC['rember']) ? 7 * 86400 : 0);
$status = array();
$status['uid'] = $record['uid'];
$status['lastvisit'] = TIMESTAMP;
$status['lastip'] = CLIENT_IP;
member_update($status);
hooks('member:login:success');
if(empty($forward)) {
$forward = $_GPC['forward'];
}
if(empty($forward)) {
$forward = './index.php?refersh';
}
message("欢迎回来,{$record['username']}。", $forward);
} else {
message('登录失败,请检查您输入的用户名和密码!');
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。