mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 10:02:02 -04:00
Define some constants to make HTTP input code less wordy
This commit is contained in:
parent
ee7c8343dd
commit
110c091a7b
36 changed files with 87 additions and 86 deletions
|
@ -1,9 +1,6 @@
|
|||
<?
|
||||
use Exceptions\InvalidLoginException;
|
||||
use Exceptions\PasswordRequiredException;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Safe\DateTimeImmutable;
|
||||
use Safe\Exceptions\DatetimeException;
|
||||
|
||||
use function Safe\strtotime;
|
||||
|
||||
|
@ -76,12 +73,12 @@ class Session{
|
|||
self::SetSessionCookie($this->SessionId);
|
||||
}
|
||||
catch(Exceptions\UserNotFoundException){
|
||||
throw new InvalidLoginException();
|
||||
throw new Exceptions\InvalidLoginException();
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetLoggedInUser(): ?User{
|
||||
$sessionId = HttpInput::Str(HttpVariableSource::Cookie, 'sessionid');
|
||||
$sessionId = HttpInput::Str(COOKIE, 'sessionid');
|
||||
|
||||
if($sessionId !== null){
|
||||
$result = Db::Query('
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue