CheckUser.php 984 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace WY\app\controller\mobile;
  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/mobile/';
  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. }