Get rid of App->user completely

This commit is contained in:
Michael 2021-08-08 19:30:21 +00:00
parent fc283ab928
commit 28090bd793
39 changed files with 158 additions and 234 deletions

View file

@ -53,7 +53,8 @@ function settings_init(App $a)
function settings_post(App $a)
{
if (!local_user()) {
if (!$a->isLoggedIn()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
@ -61,11 +62,6 @@ function settings_post(App $a)
return;
}
if (empty($a->getUserId()) || $a->getUserId() != local_user()) {
notice(DI::l10n()->t('Permission denied.'));
return;
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] == 'addon')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/addon', 'settings_addon');
@ -752,7 +748,7 @@ function settings_content(App $a)
'$cntunkmail' => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")],
'$group_select' => Group::displayGroupSelection(local_user(), $user['def_gid']),
'$permissions' => DI::l10n()->t('Default Post Permissions'),
'$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
'$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->getUserId()),
'$expire' => [
'label' => DI::l10n()->t('Expiration settings'),