Ejemplo n.º 1
0
 public function sessionAction()
 {
     $id = Zend_Filter::filterStatic($this->getRequest()->getParam('id'), 'StripTags');
     if (is_numeric($id)) {
         try {
             $session = new SessionModel($id);
             $init = $session->getInitiative();
             $rootLoc = $init->getRootLocation();
             $treeString = LocationModel::walkTree($rootLoc->getMetadata('id'));
             $treeArray = explode(",", $treeString);
             $locations = array();
             foreach ($treeArray as $locId) {
                 $locations[] = new LocationModel($locId);
             }
             $this->view->locations = $locations;
             $this->view->session = $session;
             $this->view->init = $init;
         } catch (Exception $e) {
             $this->view->error = $e->getMessage();
             Globals::getLog()->err('ADMIN sessions error: ' . $this->view->error);
             $this->render('error');
             return false;
         }
     } else {
         $this->view->error = 'Invalid session ID';
         Globals::getLog()->err('ADMIN sessions error: ' . $this->view->error);
         $this->render('error');
         return false;
     }
 }