UserSession class [5] - Refactor src/Module/ files with DI

This commit is contained in:
Philipp Holzer 2022-10-20 22:59:12 +02:00
commit eecc456e0c
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
78 changed files with 455 additions and 530 deletions

View file

@ -49,7 +49,7 @@ class Blocked extends BaseUsers
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
if (Session::getLocalUser() != $uid) {
if (DI::userSession()->getLocalUserId() != $uid) {
User::remove($uid);
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
@ -80,7 +80,7 @@ class Blocked extends BaseUsers
switch ($action) {
case 'delete':
if (Session::getLocalUser() != $uid) {
if (DI::userSession()->getLocalUserId() != $uid) {
self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
// delete user
User::remove($uid);