コード例 #1
0
ファイル: Adapter.php プロジェクト: adnanali/munch
 /**
  * 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!"));
 }
コード例 #2
0
 /**
  * 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
ファイル: ActionAdmin.php プロジェクト: josmel/voy
 public function preDispatch()
 {
     parent::preDispatch();
     $this->permisos();
     $this->_identity = Zend_Auth::getInstance()->getIdentity();
     $this->view->identity = $this->_identity;
 }
コード例 #4
0
 /**
  * Initialize Controller
  *
  * @return void
  */
 public function init()
 {
     /* Initialize */
     parent::init();
     /* is Dashboard Controller */
     $this->_useDashboard();
 }
コード例 #5
0
 /**
  * Init controller plugins
  *
  * @return closure
  */
 public function init()
 {
     /* Initialize */
     parent::init();
     /* is Dashboard Controller */
     $this->_useDashboard();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
 }
コード例 #6
0
ファイル: ActionDefault.php プロジェクト: josmel/HosPot
 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
ファイル: AuthController.php プロジェクト: shahmaulik/zfcore
 /**
  * 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']);
         }
     }
 }
コード例 #8
0
 public function preDispatch()
 {
     parent::preDispatch();
 }
コード例 #9
0
ファイル: IndexController.php プロジェクト: shahmaulik/zfcore
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
 }
コード例 #10
0
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
 }
コード例 #11
0
 /**
  * Init Controller
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->_helper->contextSwitch->setActionContext('sitemapxml', 'xml')->initContext('xml');
 }
コード例 #12
0
 public function init()
 {
     /* Initialize */
     parent::init();
 }
コード例 #13
0
ファイル: PostController.php プロジェクト: shahmaulik/zfcore
 public function init()
 {
     /* Initialize action controller here */
     parent::init();
     $this->_module = $this->getRequest()->getModuleName();
 }
コード例 #14
0
ファイル: AclController.php プロジェクト: josmel/voy
 public function init()
 {
     parent::init();
 }