Commit
This commit is contained in:
parent
bd6bc07a52
commit
22f023b040
@ -95,9 +95,16 @@ class User
|
||||
);
|
||||
$sth->execute([$username, $password]);
|
||||
if ($sth->rowCount())
|
||||
{
|
||||
$row = $sth->fetch(PDO::FETCH_ASSOC);
|
||||
if (
|
||||
$row['Brukernavn'] === $username &&
|
||||
$row['Passord'] === $password
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -97,8 +97,8 @@ class TeamMapper
|
||||
$team->rounds,
|
||||
$team->best_time
|
||||
]);
|
||||
$lastId = $this->dbh->lastInsertId();
|
||||
return $this->get($lastId);
|
||||
$last_id = $this->dbh->lastInsertId();
|
||||
return $this->get($last_id);
|
||||
}
|
||||
|
||||
public function update(Team $team): Team
|
||||
|
@ -5,11 +5,11 @@ if ($app->user->logged_in)
|
||||
$app->redirect('index.php');
|
||||
}
|
||||
|
||||
$username = (string)filter_input(INPUT_POST, 'username');
|
||||
$password = (string)filter_input(INPUT_POST, 'password');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||
{
|
||||
$username = (string)filter_input(INPUT_POST, 'username');
|
||||
$password = (string)filter_input(INPUT_POST, 'password');
|
||||
|
||||
if ($app->user->login($username, $password))
|
||||
{
|
||||
$app->session->flash("Velkommen {$username}!");
|
||||
|
Reference in New Issue
Block a user