From 7998c9eedc77d7c31c4919b2448d8408173d03db Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Sun, 13 Oct 2019 14:00:41 +0200 Subject: [PATCH] User Creation #2 --- app/controls/setting.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controls/setting.php b/app/controls/setting.php index 63c5e55..dcda809 100644 --- a/app/controls/setting.php +++ b/app/controls/setting.php @@ -5,6 +5,13 @@ if (isset($_POST) && !empty($_POST)){ $newPassword = $_POST['newPassword1']; $newPassword2 = $_POST['newPassword2']; UserManager::changePassword($oldPassword, $newPassword, $newPassword2); - //TODO: pridat odhlášení + header('Location: ' . BASEDIR . 'logout'); + die(); + } else if (isset($_POST['submitCreateUser']) && $_POST['submitCreateUser'] != "") { + $userName = $_POST['userName']; + $password = $_POST['userPassword']; + UserManager::createUser($userName, $password); + header('Location: ' . BASEDIR . 'setting'); + die(); } }