diff --git a/RestControllers/accountController.php b/RestControllers/accountController.php index 4e84365..a6c519c 100644 --- a/RestControllers/accountController.php +++ b/RestControllers/accountController.php @@ -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 !" diff --git a/classes/APILimits.php b/classes/APILimits.php index 8207518..23cf8f3 100644 --- a/classes/APILimits.php +++ b/classes/APILimits.php @@ -21,6 +21,7 @@ class APILimits { * Actions list */ const ACTION_LOGIN_FAILED = "failed_login"; + const ACTION_CREATE_ACCOUNT = "create_account"; /** * Actions configruation @@ -30,7 +31,12 @@ class APILimits { //Login failed self::ACTION_LOGIN_FAILED => array( "limit" => 10 - ) + ), + + //Create an account + self::ACTION_CREATE_ACCOUNT => array( + "limit" => 10 + ), ); /**