/**
  * 
  * @see Zend_Controller_Action::init()
  */
 public function init()
 {
     $this->_setParam('allowedGameTypes', array());
     try {
         $user = new ZtChart_Model_User($this->_getParam('uname', ''));
         if ($user->isActive() && $user->getTokenring() == $this->_getParam('token')) {
             $this->_setParam('allowedGameTypes', array_intersect(explode(',', $this->_getParam('gametype')), $user->getRole()->getGameTypes(true)));
         }
     } catch (ZtChart_Model_User_Exception $e) {
     }
 }
Пример #2
0
 /**
  * 判断登陆的用户是否属于本系统
  *
  * @param string $username
  * @return false|ZtChart_Model_User
  */
 protected function _checkIdentity($username)
 {
     try {
         $user = new ZtChart_Model_User($username);
         if (!$user->isActive()) {
             return false;
         }
     } catch (ZtChart_Model_User_Exception $e) {
         return false;
     }
     return $user;
 }
 /**
  * 
  * @deprecated
  */
 public function gamedataAction()
 {
     $data = array();
     $user = new ZtChart_Model_User($this->_getParam('uname'));
     if ($user->isActive() && $user->getTokenring() == $this->_getParam('token')) {
         $allowedGameTypes = $user->getRole()->getGameTypes(true);
         if (in_array($this->_getParam('gametype'), $allowedGameTypes)) {
             $data = Zend_Json::decode(file_get_contents('http://192.168.102.203:6989/?getnumber&gametype=' . $this->_getParam('gametype') . '&zoneid=' . $this->_getParam('zoneid') . '&first=' . $this->_getParam('first')));
         }
     }
     $this->_helper->json($data);
 }