aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-20 20:12:29 -0800
committerfriendica <info@friendica.com>2011-12-20 20:12:29 -0800
commitd9ede7f7bd1f2a1ab1bacaf4a37a66fd79fd32e4 (patch)
tree0cf9e50a5262c06417afe92f0ddfd5fe8b57e4a5 /mod
parent2e088aad8daaceae83f9b824df9e9ae9791cc825 (diff)
downloadvolse-hubzilla-d9ede7f7bd1f2a1ab1bacaf4a37a66fd79fd32e4.tar.gz
volse-hubzilla-d9ede7f7bd1f2a1ab1bacaf4a37a66fd79fd32e4.tar.bz2
volse-hubzilla-d9ede7f7bd1f2a1ab1bacaf4a37a66fd79fd32e4.zip
implement max daily registrations
Diffstat (limited to 'mod')
-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']);