Commit 00e6641a authored by GROSS-AMBLARD David's avatar GROSS-AMBLARD David
Browse files

bugfix loginForm

parent 9ab96837
......@@ -40,7 +40,7 @@ class LoginForm extends Action {
if ($_SESSION["mode"]=="login") {
@debug("checking for login ".$_POST['username']." ".$_POST['password']);
$id=checkLogin($_POST['username'], $_POST["password"], $conn);
$id=$this->checkLogin($_POST['username'], $_POST["password"], $conn);
debug("received value $id");
// wrong username/password
......@@ -128,7 +128,7 @@ class LoginForm extends Action {
$stmt->bindParam(':pwd', $pwd, PDO::PARAM_STR);
$pwd=password_hash($_POST["password"], PASSWORD_DEFAULT);
$stmt->execute() or die(mysql_error());
$id=(string)@checkLogin($_POST['username'], $_POST["password"], $conn);
$id=(string)@$this->checkLogin($_POST['username'], $_POST["password"], $conn);
$stmt = $conn->prepare("select id from skilltree");
$stmt->execute();
for ($i=0;$i<7;$i++) {
......@@ -151,7 +151,7 @@ class LoginForm extends Action {
* @param $conn :
* A valid database PDO connection
*/
function loginForm($conn){
function ShowloginForm($conn){
global $VIEW;
$template=file_get_contents("templates/loginForm.tmpl");
......@@ -165,7 +165,7 @@ class LoginForm extends Action {
}
function render(){
$this->loginForm($this->conn);
$this->ShowloginForm($this->conn);
}
}
?>
......@@ -14,6 +14,6 @@ function logout($conn)
// Suppressing automatic connection cookies
setcookie('login', '');
setcookie('pass_hache', '');
loginForm($conn);
(new LoginForm($conn))->render();
}
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment