示例#1
0
 /**
  * Enter description here...
  *
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     // get the user from the db
     $user = Doctrine::getTable('User')->findOneByEmail($this->username);
     //$user = Doctrine::
     //echo $this->username;
     if (!$user || $this->password != $user->password) {
         return new Zend_Auth_Result(false, $this->username, array("Sorry, it didn't work out"));
     }
     if ($this->action) {
         $this->action->setSession('user', $user);
     }
     return new Zend_Auth_Result(true, $this->username, array("dandy!"));
 }
 /**
  * Init controller plugins
  */
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $this->_manager = new Users_Model_User_Manager();
 }
示例#3
0
 public function preDispatch()
 {
     parent::preDispatch();
     $this->permisos();
     $this->_identity = Zend_Auth::getInstance()->getIdentity();
     $this->view->identity = $this->_identity;
 }
 /**
  * Initialize Controller
  *
  * @return void
  */
 public function init()
 {
     /* Initialize */
     parent::init();
     /* is Dashboard Controller */
     $this->_useDashboard();
 }
 /**
  * Init controller plugins
  *
  * @return closure
  */
 public function init()
 {
     /* Initialize */
     parent::init();
     /* is Dashboard Controller */
     $this->_useDashboard();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
 }
示例#6
0
 public function preDispatch()
 {
     parent::preDispatch();
     $this->view->menu = $this->getMenu();
     $this->view->controller = $this->getRequest()->getControllerName();
     $this->view->action = $this->getRequest()->getActionName();
     $this->view->identity = $this->_identity;
     $this->view->dataYOSON = array('controller' => $this->getRequest()->getControllerName(), 'action' => $this->getRequest()->getActionName(), 'module' => $this->getRequest()->getModuleName());
 }
示例#7
0
 /**
  * Init controller plugins
  */
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     //Set Main config
     if (Zend_Registry::isRegistered('opauthConfig')) {
         $opauthConfig = Zend_Registry::get('opauthConfig');
         if (isset($opauthConfig['path']) && $opauthConfig['path'] && isset($opauthConfig['callback_url']) && $opauthConfig['callback_url'] && isset($opauthConfig['security_salt']) && $opauthConfig['security_salt']) {
             $this->_opauthConfig['path'] = $opauthConfig['path'];
             $this->_opauthConfig['callback_url'] = $opauthConfig['callback_url'];
             $this->_opauthConfig['security_salt'] = $opauthConfig['security_salt'];
         } else {
             throw new Zend_Controller_Action_Exception('Opauth is not configured.');
         }
     }
     //Set Facebook strategy
     if (Zend_Registry::isRegistered('fbConfig')) {
         $fbConfig = Zend_Registry::get('fbConfig');
         if ($fbConfig['appId']) {
             $this->_opauthConfig['Strategy']['Facebook'] = array('app_id' => $fbConfig['appId'], 'app_secret' => $fbConfig['secret'], 'scope' => $fbConfig['scope']);
         }
     }
     //Set Twitter strategy
     if (Zend_Registry::isRegistered('twitterConfig')) {
         $twitterConfig = Zend_Registry::get('twitterConfig');
         if ($twitterConfig['consumerKey']) {
             $this->_opauthConfig['Strategy']['Twitter'] = array('key' => $twitterConfig['consumerKey'], 'secret' => $twitterConfig['consumerSecret']);
         }
     }
     //Set Google strategy
     if (Zend_Registry::isRegistered('googleConfig')) {
         $googleConfig = Zend_Registry::get('googleConfig');
         if ($googleConfig['clientId']) {
             $this->_opauthConfig['Strategy']['Google'] = array('client_id' => $googleConfig['clientId'], 'client_secret' => $googleConfig['clientSecret']);
         }
     }
 }
 public function preDispatch()
 {
     parent::preDispatch();
 }
示例#9
0
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
 }
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
 }
 /**
  * Init Controller
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->_helper->contextSwitch->setActionContext('sitemapxml', 'xml')->initContext('xml');
 }
 public function init()
 {
     /* Initialize */
     parent::init();
 }
示例#13
0
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_module = $this->getRequest()->getModuleName();
 }
示例#14
0
 public function init()
 {
     parent::init();
 }