Hi, 
Here is the function that verifies the login:
PHP Code:
public function verificaLogin($nivelAcesso = 0, $pURL = false)
{
//se nao houver variável de sessão setada ou se o nível de utilizador for menor que o nível de acesso:
if (!isset($_SESSION['idUtilizador']) OR ($_SESSION['nivelUtilizador'] < $nivelAcesso))
{
// Destrói a sessão
session_destroy();
// e redirecciona para url
if ($pURL)
{
Funcao::redirecciona($pURL);
}
$this->_msgErro = 'A página pretendida é de acesso restrito ou a sua sessão expirou. Por favor, faça login novamente.';
return false;
}
else
{
return true;
}
}
Here is what I have on my restrict access page:
PHP Code:
//aqui tem de estar o parametro ?msg
$login->verificaLogin(1, 'index.php?msg=erro');
The user level is 1 and the session is setted.
However, I'm getting the message:
A página pretendida é de acesso restrito ou a sua sessão expirou. Por favor, faça login novamente.
- that is the error message defined on the function.
Is it a logic issue?
If not, what could this be?
Something to do with the return false and return true ?
Thanks in advance,
Márcio
Bookmarks