X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fuimport.php;h=a00bf250873c7165048495c364d8a5470f4475b3;hb=a53add06f2e7fdcc8a0bec852ee61fc8a106007a;hp=8abff0cd997f521fc4559c63c995488a8bc630f9;hpb=c6b45a958e3b09bc8f3950a718c181dfc9e0b910;p=friendica.git diff --git a/mod/uimport.php b/mod/uimport.php index 8abff0cd99..a00bf25087 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -1,6 +1,6 @@ get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { + if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { notice(DI::l10n()->t('Permission denied.')); return; } @@ -41,16 +42,16 @@ function uimport_post(App $a) function uimport_content(App $a) { - if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { + if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.')); return; } $max_dailies = intval(DI::config()->get('system', 'max_daily_registrations')); if ($max_dailies) { - $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); - if ($r && $r[0]['total'] >= $max_dailies) { - Logger::log('max daily registrations exceeded.'); + $total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]); + if ($total >= $max_dailies) { + Logger::notice('max daily registrations exceeded.'); notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); return; }