aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-12-21 17:37:35 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-12-21 17:37:35 +0100
commit7f2070ca91aca9e92f3ac4c5b714742c6f9ecc3b (patch)
treeda414eee593cde8cdf631b598671daac22687380 /mod/register.php
parentbf00e4dded7dd90443eafb8fc1c15b82ce723867 (diff)
parent048fcae40b260b04e7b2e1774c1c72b69f790212 (diff)
downloadvolse-hubzilla-7f2070ca91aca9e92f3ac4c5b714742c6f9ecc3b.tar.gz
volse-hubzilla-7f2070ca91aca9e92f3ac4c5b714742c6f9ecc3b.tar.bz2
volse-hubzilla-7f2070ca91aca9e92f3ac4c5b714742c6f9ecc3b.zip
Merge remote-tracking branch 'friendica/master'
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/mod/register.php b/mod/register.php
index 0115ec0d5..89f561642 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -8,6 +8,15 @@ function register_post(&$a) {
$verified = 0;
$blocked = 1;
+
+ $max_dailies = intval(get_config('system','max_daily_registrations'));
+ if($max_dailes) {
+ $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
+ if($r && $r[0]['total'] >= $max_dailies) {
+ return;
+ }
+ }
+
switch($a->config['register_policy']) {
@@ -462,6 +471,16 @@ function register_content(&$a) {
return;
}
+ $max_dailies = intval(get_config('system','max_daily_registrations'));
+ if($max_dailes) {
+ $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
+ if($r && $r[0]['total'] >= $max_dailies) {
+ logger('max daily registrations exceeded.');
+ notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
+ return;
+ }
+ }
+
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);