Admin page improvements
This commit is contained in:
parent
0fade7fc0a
commit
ecf7f40704
|
@ -56,14 +56,14 @@ class Users extends BaseAdmin
|
||||||
|
|
||||||
if (!empty($_POST['page_users_block'])) {
|
if (!empty($_POST['page_users_block'])) {
|
||||||
foreach ($users as $uid) {
|
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)));
|
notice(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['page_users_unblock'])) {
|
if (!empty($_POST['page_users_unblock'])) {
|
||||||
foreach ($users as $uid) {
|
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)));
|
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'])) {
|
if (!empty($_POST['page_users_approve'])) {
|
||||||
foreach ($pending as $hash) {
|
foreach ($pending as $hash) {
|
||||||
if (User::allow($hash)) {
|
User::allow($hash);
|
||||||
info(DI::l10n()->t('Account approved.'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
notice(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['page_users_deny'])) {
|
if (!empty($_POST['page_users_deny'])) {
|
||||||
foreach ($pending as $hash) {
|
foreach ($pending as $hash) {
|
||||||
if (User::deny($hash)) {
|
User::deny($hash);
|
||||||
notice(DI::l10n()->t('Registration revoked'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
notice(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('admin/users');
|
DI::baseUrl()->redirect('admin/users');
|
||||||
|
|
Loading…
Reference in a new issue