Define some constants to make HTTP input code less wordy

This commit is contained in:
Alex Cabal 2024-05-12 12:29:30 -05:00
parent ee7c8343dd
commit 110c091a7b
36 changed files with 87 additions and 86 deletions

View file

@ -8,8 +8,8 @@ if($GLOBALS['User'] !== null){
exit();
}
$email = HttpInput::Str(HttpVariableSource::Session, 'email');
$redirect = HttpInput::Str(HttpVariableSource::Session, 'redirect') ?? HttpInput::Str(HttpVariableSource::Get, 'redirect');
$email = HttpInput::Str(SESSION, 'email');
$redirect = HttpInput::Str(SESSION, 'redirect') ?? HttpInput::Str(GET, 'redirect');
$exception = $_SESSION['exception'] ?? null;
$passwordRequired = false;

View file

@ -9,9 +9,9 @@ try{
$requestType = HttpInput::RequestType();
$session = new Session();
$email = HttpInput::Str(HttpVariableSource::Post, 'email');
$password = HttpInput::Str(HttpVariableSource::Post, 'password');
$redirect = HttpInput::Str(HttpVariableSource::Post, 'redirect');
$email = HttpInput::Str(POST, 'email');
$password = HttpInput::Str(POST, 'password');
$redirect = HttpInput::Str(POST, 'redirect');
if($redirect === null){
$redirect = '/';