public function preDispatch()
 {
     parent::preDispatch();
     if (!$this->_hasParam('luogo')) {
         $this->_helper->redirector('index', 'index');
     }
     $this->view->luogo = Mappa_Model_Luogo::getByUrl($this->_getParam('luogo'));
 }
Exemplo n.º 2
0
 public function preDispatch()
 {
     parent::preDispatch();
     if (!$this->_hasParam('luogo')) {
         $this->_helper->redirector('index', 'index', 'mappa');
     }
     $this->view->luogo = Mappa_Model_Luogo::getByUrl($this->_getParam('luogo'));
     if (strtotime(Zend_Auth::getInstance()->getIdentity()->PrisonDate) > time() && !$this->view->luogo->IsPrison) {
         $Prison = Mappa_Model_Luogo::get(Zend_Auth::getInstance()->getIdentity()->PrisonLocation);
         $this->_redirect($this->view->url(array('luogo' => $Prison->Url), 'chat'));
     }
 }
Exemplo n.º 3
0
 public static function getUsersOnline($Age = 1)
 {
     $TheOnline = new self();
     $Onlines = $TheOnline->fetchAll("Date + INTERVAL {$Age} MINUTE > NOW()", "IDLocation");
     $Ret = array();
     foreach ($Onlines as $Online) {
         $TheOnline = new self();
         $TheOnline->copyFromDb($Online);
         $TheOnline->User = App_Model_User::getUserById($Online->IDUser);
         if ($TheOnline->IDLocation) {
             $TheOnline->Location = Mappa_Model_Luogo::get($Online->IDLocation);
         }
         $Ret[] = $TheOnline;
     }
     return $Ret;
 }