From b8e04e3c6a19d1b4633981a5b50f7cf6dfadfe52 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 30 Jul 2017 16:45:54 +0200 Subject: [PATCH] Add tests for methods that let users enable or disable password resets --- tests/index.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/index.php b/tests/index.php index 7529696..ef941dc 100644 --- a/tests/index.php +++ b/tests/index.php @@ -243,6 +243,16 @@ function processRequestData(\Delight\Auth\Auth $auth) { return 'invalid password(s)'; } } + else if ($_POST['action'] === 'setPasswordResetEnabled') { + try { + $auth->setPasswordResetEnabled($_POST['enabled'] == 1); + + return 'ok'; + } + catch (\Delight\Auth\NotLoggedInException $e) { + return 'not logged in'; + } + } else if ($_POST['action'] === 'logout') { $auth->logout(); @@ -523,6 +533,15 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) { echo ''; echo ''; + echo '
'; + echo ''; + echo ' '; + echo ''; + echo '
'; + echo '
'; echo ''; echo '';