Example #1
0
 public function init()
 {
     // Get authenticated user
     $auth = Zend_Auth::getInstance()->getIdentity();
     // Store logged ISP. I'm inside admin, se we use only the logged user
     if (isset($auth['isp_id'])) {
         $isp_id = intval($auth['isp_id']);
         $ISP = new Isp();
         Shineisp_Registry::set('ISP', $ISP->find($isp_id));
     }
     // Load all the status in the registry
     $statusreg = Shineisp_Registry::get('Status');
     if (empty($statusreg)) {
         $status = Statuses::getAll();
         Shineisp_Registry::set('Status', $status);
     }
     parent::init();
 }
Example #2
0
 public function init()
 {
     try {
         // Store logged ISP. I'm in the public area, se we use only the URL
         $ISP = Isp::findByUrl($_SERVER['HTTP_HOST']);
         if (!empty($ISP)) {
             Shineisp_Registry::set('ISP', $ISP);
         }
         // Load all the status in the registry
         $statusreg = Shineisp_Registry::get('Status');
         if (empty($statusreg)) {
             $status = Statuses::getAll();
             Shineisp_Registry::set('Status', $status);
         }
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage());
     }
     parent::init();
 }