Limit the number of account / hour / ip

This commit is contained in:
Pierre HUBERT
2018-08-20 14:48:21 +02:00
parent 5bddd624ca
commit 4937e66c71
2 changed files with 11 additions and 1 deletions

View File

@ -225,6 +225,8 @@ class accountController {
*/
public function createAccount(){
api_limit_query(APILimits::ACTION_CREATE_ACCOUNT, false);
//Check post fields existence
if(!check_post_parametres(array("emailAddress", "firstName", "lastName", "password")))
Rest_fatal_error(400, "Please check given parameters");
@ -261,6 +263,8 @@ class accountController {
if(!components()->account->create($newAccount))
Rest_fatal_error(500, "An error occured while trying to create the account !");
api_limit_query(APILimits::ACTION_CREATE_ACCOUNT, true);
//Success
return array(
"success" => "The account has been created !"