function init() { $checkObj = new CheckRights($this); $checkObj->checkUserRights(); if (ISafe::get('user_id') == '') { $this->redirect('/simple/login'); } }
function init() { if (IReq::get('action') == 'goods_img_upload') { $admin_name = IFilter::act(IReq::get('admin_name')); $admin_pwd = IFilter::act(IReq::get('admin_pwd')); $adminObj = new IModel('admin'); $adminRow = $adminObj->getObj("admin_name = '" . $admin_name . "'", 'password'); if (empty($adminRow) || $adminRow['password'] != $admin_pwd) { exit; } } else { $checkObj = new CheckRights($this); $checkObj->checkAdminRights(); } }
public function init() { CheckRights::checkUserRights(); if (!$this->user) { $this->redirect('/simple/login'); } }
public function init() { CheckRights::checkUserRights(); if (ISafe::get('user_id') == '') { $this->redirect('/simple/login'); } }
public function init() { $checkObj = new CheckRights($this); $checkObj->checkUserRights(); }
function init() { $checkObj = new CheckRights($this); $checkObj->checkAdminRights(); }
public function init() { CheckRights::checkUserRights(); }
/** * @brief 验证邮箱 */ public function check_mail() { $code = IReq::get("code"); list($email, $user_id) = explode('|', base64_decode($code)); $email = IFilter::act($email); $user_id = IFilter::act($user_id, 'int'); $userDB = new IModel("user"); $userRow = $userDB->getObj(" email = '{$email}' and id = " . $user_id); if ($userRow) { CheckRights::loginAfter($userRow); $memberObj = new IModel("member"); $memberObj->setData(array("status" => 1)); $memberObj->update("user_id = " . $user_id); $message = "恭喜,您的邮箱激活成功!"; } else { $message = "验证信息有误,请核实!"; } $this->redirect('/site/success?message=' . urlencode($message)); }
public function bind_exists_user() { $login_info = IReq::get('login_info'); $password = IReq::get('password'); $oauth_id = IFilter::act(ISession::get('oauth_id')); $oauth_userInfo = IFilter::act(ISession::get('oauth_userInfo')); if (!$oauth_id || !isset($oauth_userInfo['id'])) { $this->redirect('login'); exit; } if ($userRow = CheckRights::isValidUser($login_info, md5($password))) { $oauthUserObj = new IModel('oauth_user'); //插入关系表 $oauthUserData = array('oauth_user_id' => $oauth_userInfo['id'], 'oauth_id' => $oauth_id, 'user_id' => $userRow['user_id'], 'datetime' => ITime::getDateTime()); $oauthUserObj->setData($oauthUserData); $oauthUserObj->add(); $this->loginAfter($userRow); //自定义跳转页面 $callback = ISafe::get('callback'); $this->redirect('/simple/success_info/?callback=' . $callback); } else { $this->login_info = $login_info; $this->message = '用户名和密码不匹配'; $_GET['bind_type'] = 'exists'; $this->redirect('bind_user', false); } }
function init() { $checkObj = new CheckRights($this); $checkObj->checkAdminRights(); $this->tablePre = isset(IWeb::$app->config['DB']['tablePre']) ? IWeb::$app->config['DB']['tablePre'] : ''; }