protected function _initViewHelpers()
 {
     $this->bootstrap('layout');
     $layout = $this->getResource('layout');
     $view = $layout->getView();
     if (!Zend_Auth::getInstance()->hasIdentity()) {
         $view->identity = false;
         $detector = new Danil_MobileDetect();
         $view->isMobile = $detector->isMobile() == 1 ? true : false;
     } else {
         $view->identity = Zend_Auth::getInstance()->getIdentity();
         $view->isMobile = $view->identity->isMobile;
         if ($view->identity->showShotcut) {
             $view->identity->showShotcut = false;
             $view->headScript()->appendFile('/js/add2home.js');
             $view->headLink()->appendStylesheet('/css/add2home.css');
         }
     }
     $view->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=EmulateIE7, IE=9')->appendHttpEquiv('content-type', 'text/html; charset=utf-8')->appendHttpEquiv('Author', 'HospitalU')->appendHttpEquiv('omni_page', 'Mac - Index/Tab')->appendHttpEquiv('Description', 'Discover the world of HospitalU.')->appendName('keywords', 'framework, PHP, productivity')->appendName('apple-mobile-web-app-capable', 'yes')->appendName('viewport', 'width = device-width ,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no');
     $view->headScript()->appendFile('/js/jquery-1.8.2.min.js')->appendFile('/js/jwplayer.js');
     $view->headLink()->appendStylesheet('/css/content.css');
     $view->headLink(array('rel' => 'apple-touch-icon', 'href' => '/images/bookmark.png'));
     $view->headLink(array('rel' => 'apple-touch-icon', 'href' => '/images/bookmark72.png', 'extras' => '72x72'));
     $view->headLink(array('rel' => 'apple-touch-icon', 'href' => '/images/bookmark114.png', 'extras' => '114x114'));
     if ($view->isMobile) {
         $view->headLink()->appendStylesheet('/css/style_mobile_portret.css');
     } else {
         $view->headLink()->appendStylesheet('/css/topnav.css')->appendStylesheet('/css/style.css');
     }
     $view->headLink(array('rel' => 'icon', 'href' => '/images/favicon.ico', 'type' => "image/x-icon"));
     $view->headTitle('MLM')->setSeparator(' :: ');
 }
Ejemplo n.º 2
0
 public function authorize($vUsername, $vPassword)
 {
     $auth = Zend_Auth::getInstance();
     $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter(), 'User', 'vUserName', 'vPassword', 'eStatus=1');
     $authAdapter->setIdentity($vUsername)->setCredential($vPassword);
     $result = $auth->authenticate($authAdapter);
     if ($result->isValid()) {
         $storage = $auth->getStorage();
         $storage->write($authAdapter->getResultRowObject(null, array('vPassword')));
         $auth = $storage->read();
         $detector = new Danil_MobileDetect();
         $auth->isMobile = $detector->isMobile() == 1 ? true : false;
         $auth->showShotcut = true;
         $subgroupid = new Model_SubGroupUserAssign();
         $groupid = $subgroupid->getGroupId($auth->iUserId);
         $company = new Model_Company($groupid);
         $auth->vGoogleAPI = $company->vGoogleAPI;
         $auth->vGoogleAPIvalue = $company->vGoogleAPIvalue;
         $storage->write($auth);
         return true;
     } else {
         return false;
     }
 }