I wrote this function that checks if you're the admin and you're at the administration panel:
function _checkAdmin(&$event, $param){
global $ACT;
global $INFO;
//prevent if you are at administration panel and you are the admin
if (isset($INFO['userinfo']['pass']) and
$event->data=='admin' and
$INFO['isadmin']==1 and
$INFO['perm']==255){
return true;
} else {
return false;
}
}
The register_hook is:
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_checkAdmin');
It's OK? is there a better way or more efficient else? Thanks!
Xavier