whoami7 - Manager
:
/
home
/
c
/
i
/
d
/
cideo
/
library
/
My
/
Plugin
/
Upload File:
files >> /home/c/i/d/cideo/library/My/Plugin/Auth.php
<?php class My_Plugin_Auth extends Zend_Controller_Plugin_Abstract { private $_auth; private $_acl; //private $_noagreement = array('module'=>'admin', 'controller'=>'index', 'action'=>'connection'); public function __construct($auth, $acl) { $this->_auth = $auth; $this->_acl = $acl; } public function preDispatch(Zend_Controller_Request_Abstract $request) { if ($this->_auth->hasIdentity()) { $role = $this->_auth->getIdentity()->role; } else { $role = 'guest'; } if(($request->getModuleName() != 'site')) { if(($request->getModuleName() =='admin') && ($request->getControllerName() =='index') && ($request->getActionName() =='login')) { } else { if( ($this->_acl->isAllowed($role, "chapitre", 'voir')) || ($this->_acl->isAllowed($role, "editchapitre", 'voir')) ) { } else { $request->setModuleName("admin") ->setControllerName("index") ->setActionName("login") ->setDispatched(true); } } } } }
Copyright ©2021 || Defacer Indonesia