aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-07-23 09:28:58 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-07-23 09:28:58 +0200
commit28dd652228b8e863cddd3d03613c586c01796204 (patch)
treed6d83d44beb2a31095ca301723fe7ab79ee87e37 /lib/lib_rss.php
parentfa76e863c5622609b944542b0255c30f2f67c97e (diff)
parent1ad36c420e774d6f66b6a7ecf5b37ed1103ea464 (diff)
Merge pull request #914 from marienfressinaud/679-create-accounts
Add account creation feature. To be tested for 1.1.2-beta
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 0118e0f46..c99e2c7e8 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -267,6 +267,22 @@ function listUsers() {
/**
+ * Return if the maximum number of registrations has been reached.
+ *
+ * Note a max_regstrations of 0 means there is no limit.
+ *
+ * @return true if number of users >= max registrations, false else.
+ */
+function max_registrations_reached() {
+ $system_conf = Minz_Configuration::get('system');
+ $limit_registrations = $system_conf->limits['max_registrations'];
+ $number_accounts = count(listUsers());
+
+ return $limit_registrations > 0 && $number_accounts >= $limit_registrations;
+}
+
+
+/**
* Register and return the configuration for a given user.
*
* Note this function has been created to generate temporary configuration