template default en HTML5
[mtweb] / mw / app / mods / users / identification.php
index 4be3001..575ca6f 100644 (file)
@@ -6,17 +6,14 @@
     }
 
     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){