CheckUser.php 987 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace WY\app\controller\member;
  3. use WY\app\libs\Controller;
  4. if (!defined('WY_ROOT')) {
  5. exit;
  6. }
  7. class CheckUser extends Controller
  8. {
  9. function __construct()
  10. {
  11. parent::__construct();
  12. $this->tpl = 'view/member/';
  13. if (!$this->req->session('login_userid') || !$this->req->session('login_username')) {
  14. $this->res->redirect('/login');
  15. }
  16. if (!$this->verifyUser->verify()) {
  17. $this->res->redirect('/login/logout');
  18. }
  19. $this->userData = $this->model()->select()->from('users')->where(array('fields' => 'id=?', 'values' => array($this->req->session('login_userid'))))->fetchRow();
  20. if (!$this->userData || $this->userData['is_state'] == '2') {
  21. $this->res->redirect('/login/logout');
  22. }
  23. $this->userInfo = $this->model()->select()->from('userinfo')->where(array('fields' => 'userid=?', 'values' => array($this->req->session('login_userid'))))->fetchRow();
  24. }
  25. }
  26. ?>