]> git.mxchange.org Git - friendica.git/blobdiff - mod/uimport.php
Fixed:
[friendica.git] / mod / uimport.php
index 62bece5e3a2cc0291986339a7358d05e567a2079..da024a56ecc0914548556d3763bb10bc0d196e12 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -29,8 +29,8 @@ use Friendica\DI;
 
 function uimport_post(App $a)
 {
-       if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
-               notice(DI::l10n()->t('Permission denied.'));
+       if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
@@ -42,8 +42,8 @@ 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.'));
+       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;
        }
 
@@ -52,7 +52,7 @@ function uimport_content(App $a)
                $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.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
                        return;
                }
        }