CheckUser.php 847 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace WY\app\controller\agent;
  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/agent/';
  13. if (!$this->req->session('login_agentid') || !$this->req->session('login_agentname')) {
  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_agentid'))))->fetchRow();
  20. if (!$this->userData || $this->userData['is_state'] == '2' || $this->userData['is_agent'] == '0') {
  21. $this->res->redirect('/login/logout');
  22. }
  23. }
  24. }