diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
| commit | bfa238c056f31f36c00faad1c5995cbb8af3bd26 (patch) | |
| tree | e35d6b33fff3e79ae905d7dad699134553a1292d /controllers/register.php | |
| parent | c36f74386bcbb19c13915fe3796cb757aa7d1845 (diff) | |
| download | nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar.gz nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.zip | |
feat!: Rework all views to be used with the router
Diffstat (limited to 'controllers/register.php')
| -rw-r--r-- | controllers/register.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/controllers/register.php b/controllers/register.php index 3e8d416..6c0c105 100644 --- a/controllers/register.php +++ b/controllers/register.php @@ -1,11 +1,15 @@ <?php +namespace Controller; +use Database; +use Exception; function on_post() { - global $status; - $status = ""; + global $user_status; + $user_status = ""; + try { Database\User::fromDB($_POST["username"]); - $status = "User \"" . $_POST["username"] . "\" already exists!"; + $user_status = "User \"" . $_POST["username"] . "\" already exists!"; return; } catch(Exception $e) {} @@ -14,6 +18,6 @@ function on_post() { Database\User::create($_POST["username"], $_POST["password"], "User"); } catch(Exception $e) { - $status = $e; + $user_status = $e; } } |
