X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fregister.php;h=89f561642af36a329c8908372fafafaec72d163c;hb=1f074cb44c5deda5b480f5ff814ff3640ec843d0;hp=0115ec0d58e12ddac23fa42382ba1c4563ba588c;hpb=102ea901c3de0b8dec707dc01464bfb79f250df0;p=friendica.git diff --git a/mod/register.php b/mod/register.php old mode 100644 new mode 100755 index 0115ec0d58..89f561642a --- 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']);