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