Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class Meldels_Controller_Action extends Zend_Controller_Action
- {
- public function preDispatch()
- {
- $action = $this->getFrontController()->getDispatcher()->formatActionName(
- $this->getRequest()->getActionName()
- );
- $classeRefletida = new Zend_Reflection_Class($this);
- $metodoRefletido = $classeRefletida->getMethod($action);
- try {
- $docblockRefletido = $metodoRefletido->getDocblock();
- } catch (Zend_Reflection_Exception $e) {}
- if (isset($docblockRefletido)) {
- if ($docblockRefletido->hasTag('AutenticacaoObrigatoria')) {
- if (!Zend_Auth::getInstance()->hasIdentity()) {
- $this->_helper->redirector->gotoSimple('login', 'autenticacao');
- }
- $gruposPermitidos = array_map(function ($v) {return trim($v);},
- explode(
- ',',
- $docblockRefletido->getTag('AutenticacaoObrigatoria')
- ->getDescription()
- )
- );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement