function DoLogin() { if (!$this->Username) { $this->Messager("无法登录,用户名或密码不能为空"); } if ('' == $this->Password) { $this->Messager("无法登录,用户名或密码不能为空"); } $loginperm = $this->_logincheck(); if (!$loginperm) { $this->Messager("累计 5 次错误尝试,15 分钟内您将不能登录。", null); } $rets = $UserFields = array(); $rets = jsg_member_login_check($this->Username, $this->Password); if ($rets['uid'] > 0) { $UserFields = jsg_member_login_set_status($rets['uid']); } if ($rets['uid'] < 1 || !$UserFields) { $this->Messager("无法登录,用户名或密码错误,您可以有至多 5 次尝试。", -1); } if ('normal' == $UserFields['role_type']) { $this->Messager("普通用户组成员无权登录后台", null); } $this->_loginfailed(3); if (!$this->Config['close_second_verify_enable']) { $authcode = authcode("{$UserFields['password']}\t{$UserFields['uid']}", 'ENCODE', $this->jsgAuthKey); jsg_setcookie('jsgAuth', $authcode); } $referer = jsg_getcookie('referer'); if (!trim($referer)) { $referer = referer($this->Config['site_url'] . '/admin.php'); } $this->Messager("登录成功,正在进入后台", $referer); }
function _login_check() { $in_ajax = get_param('in_ajax'); if ($in_ajax) { $this->Post = array_iconv('utf-8', $this->Config['charset'], $this->Post, 1); } $username = trim($this->Post['username']); $password = trim($this->Post['password']); $rets = jsg_member_login_check($username, $password); $ret = $rets['uid']; if ($ret < 1) { $rets = array('0' => '未知错误 ', '-1' => '用户名或者密码错误', '-2' => '用户名或者密码错误', '-3' => '累计 ' . jconf::get('failedlogins', 'limit') . ' 次错误尝试,' . jconf::get('failedlogins', 'time') . ' 分钟内您将不能登录'); return $rets[$ret]; } return ''; }
function setVest() { if (MEMBER_ID < 1) { $this->Messager('请登录。。。', 'index.php'); } if (!$this->Config['vest_enable']) { $this->Messager('未开启马甲功能', -1); } $member = jsg_member_info(MEMBER_ID); if ($this->Config['vest_role'] && false == jsg_find($this->Config['vest_role'], $member['role_id'])) { $this->Messager('你所在的用户组没有添加马甲的权限', -1); } $username = jget('username'); $password = jget('password'); $ret = jsg_member_login_check($username, $password); if ($ret['uid'] == MEMBER_ID) { $this->Messager('不能将自己添加添加为马甲。', -1); } if ($ret['uid'] < 1) { $msg_arr = array('0' => '未知错误', '-1' => '用户不存在', '-2' => '密码错误', '-3' => 'IP错误'); $this->Messager($msg_arr[$ret['uid']], -1); } $return = jlogic('member_vest')->setVest($ret['uid'], MEMBER_ID); $return_arr = array('0' => '设置成功', '1' => '用户不存在', '2' => '添加失败:其他人已添加此帐户作为马甲'); if ($return) { $this->Messager($return_arr[$return], -1); } $this->Messager($return_arr[$return], 'index.php?mod=settings&code=vest'); }
function _login_check() { $in_ajax = get_param('in_ajax'); if ($in_ajax) { $this->Post = array_iconv('utf-8', $this->Config['charset'], $this->Post, 1); } $username = trim($this->Post['username']); $password = trim($this->Post['password']); $rets = jsg_member_login_check($username, $password); $ret = $rets['uid']; if ($ret < 1) { $rets = array('0' => '未知错误 ', '-1' => '用户名或者密码错误', '-2' => '用户名或者密码错误', '-3' => '累计 ' . jconf::get('failedlogins', 'limit') . ' 次错误尝试,' . jconf::get('failedlogins', 'time') . ' 分钟内您将不能登录'); return $rets[$ret]; } $this->UserInfo = DB::fetch_first("select * from " . TABLE_PREFIX . "members where `username`='{$username}'"); return ''; }