Introduce Response for Modules to create a testable way for module responses

This commit is contained in:
Philipp
2021-11-21 20:06:36 +01:00
parent ad5b0762b0
commit 561aba18e3
37 changed files with 309 additions and 113 deletions

View File

@@ -47,7 +47,7 @@ function settings_init(App $a)
return;
}
BaseSettings::content();
BaseSettings::createAside();
}
function settings_post(App $a)
@@ -408,7 +408,7 @@ function settings_content(App $a)
if (!empty($_SESSION['submanage'])) {
notice(DI::l10n()->t('Permission denied.'));
return;
return '';
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'oauth')) {
@@ -417,7 +417,7 @@ function settings_content(App $a)
DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => local_user()]);
DI::baseUrl()->redirect('settings/oauth/', true);
return;
return '';
}
$applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => local_user()]);
@@ -577,7 +577,7 @@ function settings_content(App $a)
$profile = DBA::selectFirst('profile', [], ['uid' => local_user()]);
if (!DBA::isResult($profile)) {
notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
return;
return '';
}
$user = User::getById($a->getLoggedInUserId());