Pages

Thursday 19 July 2012

Zend Framework Central Authentication

Zend Framework Central Authentication


  • Zend Framework  follow MVC Design with Dispatcher.
  • Auth / ACL Implement
  • Validate & Filter the URL with using dispatcher

class FilterPlugin extends Zend_Controller_Plugin_Abstract

public function preDispatch(Zend_Controller_Request_Abstract $request) 

    $params     = $request->getParams(); 
    $controller = $request->getControllerName(); 
    $action     = $request->getActionName(); 
    $filter = $GLOBALS['filters'][$controller][$action]; 
    $validator = $GLOBALS['validators'][$controller][$action]; 
    $inputdata = new Zend_Filter_Input($filter, $validator, $params); 
    if (!$inputdata ->isValid()) { 
        $request->setModuleName('default') 
                ->setControllerName('error') 
                ->setActionName('illegalparam') 
                ->setDispatched(false); 
        return; 
    } 
}


No comments:

Post a Comment

Please add comments only related to zend framework certification.