diff --git a/tests/index.php b/tests/index.php index 171f692..9ab72eb 100644 --- a/tests/index.php +++ b/tests/index.php @@ -616,7 +616,18 @@ function processRequestData(\Delight\Auth\Auth $auth) { } else if ($_POST['action'] === 'admin.changePasswordForUser') { if (isset($_POST['newPassword'])) { - if (isset($_POST['username'])) { + if (isset($_POST['id'])) { + try { + $auth->admin()->changePasswordForUserById($_POST['id'], $_POST['newPassword']); + } + catch (\Delight\Auth\UnknownIdException $e) { + return 'unknown ID'; + } + catch (\Delight\Auth\InvalidPasswordException $e) { + return 'invalid password'; + } + } + elseif (isset($_POST['username'])) { try { $auth->admin()->changePasswordForUserByUsername($_POST['username'], $_POST['newPassword']); } @@ -631,7 +642,7 @@ function processRequestData(\Delight\Auth\Auth $auth) { } } else { - return 'username required'; + return 'either ID or username required'; } } else { @@ -971,6 +982,13 @@ function showGuestUserForm() { echo ''; echo ''; + echo '
'; + echo ''; + echo ' '; + echo ' '; + echo ''; + echo '
'; + echo '
'; echo ''; echo ' ';