}
function login(&$env){
- if(!$env->user()){
- $data = $env->data();
- if($data->login(trim($_POST['login']), trim($_POST['pass']))){
- $env->redirect(
- isset($_POST["from"]) ? urldecode($_POST["from"]) : $this->env->url(),
- "Vous êtes maintenant identifié en tant que ".$_POST['login']
- );
- }
- else $env->message("Idantifiants incorrects");
+ $data = $env->data();
+ if($data->login(trim($_POST['login']), trim($_POST['pass']))){
+ $env->redirect(
+ isset($_POST["from"]) ? urldecode($_POST["from"]) : $env->url(),
+ "Vous êtes maintenant identifié en tant que ".$_POST['login']
+ );
}
- else $env->message("Vous êtes déjà identifié");
+ else $env->message("Idantifiants incorrects");
}
function logout(&$env){