Advertisement
dragonbe

Modifying response object in Controller Plugin

Oct 10th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. class Application_Model_AuthPlugin extends Zend_Controller_Plugin_Abstract
  4. {
  5.     public function preDispatch(Zend_Controller_Request_Abstract $request)
  6.     {
  7.         $protectedModules = array ('member');
  8.         if (in_array($request->getModuleName(), $protectedModules)) {
  9.             if (!Zend_Auth::getInstance()->hasIdentity()) {
  10.                 $this->getResponse()->setRedirect('/auth/index');
  11.             }
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement