]> git.mxchange.org Git - friendica.git/commitdiff
Admin page improvements
authornupplaPhil <admin+github@philipp.info>
Fri, 21 Feb 2020 22:50:17 +0000 (23:50 +0100)
committernupplaPhil <admin+github@philipp.info>
Sat, 29 Feb 2020 16:10:31 +0000 (17:10 +0100)
src/Module/Admin/Users.php

index a264f129c93b496a97db7ddcfdac2c8803ba3355..73a11e65a8de775f2a6db8648de632759c2066cb 100644 (file)
@@ -56,14 +56,14 @@ class Users extends BaseAdmin
 
                if (!empty($_POST['page_users_block'])) {
                        foreach ($users as $uid) {
-                               User::block(Register::getPendingForUser($uid)['hash'] ?? '');
+                               User::block($uid);
                        }
                        notice(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
                }
 
                if (!empty($_POST['page_users_unblock'])) {
                        foreach ($users as $uid) {
-                               User::block(Register::getPendingForUser($uid)['hash'] ?? '', false);
+                               User::block($uid, false);
                        }
                        notice(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
                }
@@ -82,18 +82,16 @@ class Users extends BaseAdmin
 
                if (!empty($_POST['page_users_approve'])) {
                        foreach ($pending as $hash) {
-                               if (User::allow($hash)) {
-                                       info(DI::l10n()->t('Account approved.'));
-                               }
+                               User::allow($hash);
                        }
+                       notice(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
                }
 
                if (!empty($_POST['page_users_deny'])) {
                        foreach ($pending as $hash) {
-                               if (User::deny($hash)) {
-                                       notice(DI::l10n()->t('Registration revoked'));
-                               }
+                               User::deny($hash);
                        }
+                       notice(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
                }
 
                DI::baseUrl()->redirect('admin/users');