Check if user is log
This commit is contained in:
parent
97f456f286
commit
a5e453835b
@ -8,7 +8,9 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ( $layout->isEnabled() && $request->getControllerName()!='print' )
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
if ( $user->isLog() && $layout->isEnabled() && $request->getControllerName()!='print' )
|
||||
{
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
@ -39,14 +41,12 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
} else if (is_string($permPage)){
|
||||
$list = (array)$permPage;
|
||||
}
|
||||
$user = new Scores_Utilisateur();
|
||||
foreach($list as $permission){
|
||||
if ($user->checkPerm($permission)){
|
||||
$hasPerm = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( !$hasPerm ) {
|
||||
|
Loading…
Reference in New Issue
Block a user