From 55a6c74e0a2a78acddd9242fcbb155ede5736ba8 Mon Sep 17 00:00:00 2001 From: Alexander Finkhäuser Date: Sat, 18 Apr 2015 00:27:35 +0200 Subject: Added config option max_invitation_keys --- application/config/config.php | 3 +++ application/controllers/user.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index 633d37f26..9fe49d15f 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -398,6 +398,9 @@ $config['tarball_max_size'] = 1024*1024*50; // 50MiB // Changing this is not recommended $config['tarball_cache_time'] = 60*5; // 5 minutes +// The maximum number of active invitation keys per account. +$config['max_invitation_keys'] = 3; //3 keys + // Possible values: // - apc: needs the apc module and is only useful on long running php processes diff --git a/application/controllers/user.php b/application/controllers/user.php index 33d0efb6b..1e0416c73 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -135,7 +135,7 @@ class User extends MY_Controller { ->where('action', 'invitation') ->count_all_results(); - if ($invitations + 1 > 3) { + if ($invitations + 1 > $this->config->item('max_invitation_keys')) { throw new \exceptions\PublicApiException("user/invitation-limit", "You can't create more invitation keys at this time."); } -- cgit v1.2.3-24-g4f1b