mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Limit the number of account / hour / ip
This commit is contained in:
@ -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 !"
|
||||
|
Reference in New Issue
Block a user