From 7a4d11d71feacbb4471d7e7feec089837eba6486 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 21 May 2018 11:17:07 +0200 Subject: [PATCH] API clients can check if an account with an email address links to an account with security questions defined or not. --- RestControllers/accountController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/RestControllers/accountController.php b/RestControllers/accountController.php index 111d43a..15d75a7 100644 --- a/RestControllers/accountController.php +++ b/RestControllers/accountController.php @@ -80,6 +80,23 @@ class accountController { ); } + /** + * Check if an account associated with an email address has set up + * security question or not + * + * @url POST /account/has_security_questions + */ + public function hasSecurityQuestion(){ + + //Get account ID + $userID = $this->getUserIDFromPostEmail("email"); + + //Check if the specified account has defined security questions or not + return array( + "defined" => components()->settings->has_security_questions($userID) + ); + } + /** * Create an account *