X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fuimport.php;h=da024a56ecc0914548556d3763bb10bc0d196e12;hb=4d3c0e1c57d3d4b3d23b53007b200e544d7e03e0;hp=eb99a366f23968d08107561a867556d5c52a5011;hpb=0e05ff68686270d87447c570e28543a5bcc7e755;p=friendica.git diff --git a/mod/uimport.php b/mod/uimport.php index eb99a366f2..da024a56ec 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -1,6 +1,6 @@ get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { - notice(DI::l10n()->t('Permission denied.') . EOL); + if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -41,17 +42,17 @@ function uimport_post(App $a) function uimport_content(App $a) { - if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) { - notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.') . EOL); + if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { + DI::sysmsg()->addNotice(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.'); - notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL); + $total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]); + if ($total >= $max_dailies) { + Logger::notice('max daily registrations exceeded.'); + DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); return; } }