Make BaseModule methods dynamic
This commit is contained in:
@@ -36,7 +36,7 @@ use Friendica\Util\Strings;
|
||||
*/
|
||||
class Delegation extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!DI::app()->isLoggedIn()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
@@ -62,7 +62,7 @@ class Delegation extends BaseSettings
|
||||
DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
parent::content();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Friendica\Network\HTTPException;
|
||||
*/
|
||||
class Display extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!DI::app()->isLoggedIn()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
@@ -112,7 +112,7 @@ class Display extends BaseSettings
|
||||
DI::baseUrl()->redirect('settings/display');
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
parent::content();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use Friendica\Util\Temporal;
|
||||
|
||||
class Index extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -135,7 +135,7 @@ class Index extends BaseSettings
|
||||
DI::baseUrl()->redirect('settings/profile');
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(DI::l10n()->t('You must be logged in to use this module'));
|
||||
|
||||
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
|
||||
|
||||
class Crop extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
return;
|
||||
@@ -160,7 +160,7 @@ class Crop extends BaseSettings
|
||||
DI::baseUrl()->redirect($path);
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
|
||||
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
|
||||
|
||||
class Index extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
return;
|
||||
@@ -106,7 +106,7 @@ class Index extends BaseSettings
|
||||
DI::baseUrl()->redirect('settings/profile/photo/crop/' . $resource_id);
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
|
||||
@@ -36,7 +36,7 @@ class AppSpecific extends BaseSettings
|
||||
{
|
||||
private static $appSpecificPassword = null;
|
||||
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -54,7 +54,7 @@ class AppSpecific extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -97,7 +97,7 @@ class AppSpecific extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form('settings/2fa/app_specific');
|
||||
|
||||
@@ -33,7 +33,7 @@ use PragmaRX\Google2FA\Google2FA;
|
||||
|
||||
class Index extends BaseSettings
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ class Index extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form('settings/2fa');
|
||||
|
||||
@@ -34,7 +34,7 @@ use Friendica\Module\Security\Login;
|
||||
*/
|
||||
class Recovery extends BaseSettings
|
||||
{
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -52,7 +52,7 @@ class Recovery extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -69,7 +69,7 @@ class Recovery extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form('settings/2fa/recovery');
|
||||
|
||||
@@ -14,7 +14,7 @@ use UAParser\Parser;
|
||||
*/
|
||||
class Trusted extends BaseSettings
|
||||
{
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -32,7 +32,7 @@ class Trusted extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -64,7 +64,7 @@ class Trusted extends BaseSettings
|
||||
}
|
||||
|
||||
|
||||
public static function content(): string
|
||||
public function content(): string
|
||||
{
|
||||
parent::content();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use PragmaRX\Google2FA\Google2FA;
|
||||
*/
|
||||
class Verify extends BaseSettings
|
||||
{
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -58,7 +58,7 @@ class Verify extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
@@ -84,7 +84,7 @@ class Verify extends BaseSettings
|
||||
}
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form('settings/2fa/verify');
|
||||
|
||||
@@ -51,7 +51,7 @@ class UserExport extends BaseSettings
|
||||
* @throws HTTPException\ForbiddenException
|
||||
* @throws HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
@@ -85,7 +85,7 @@ class UserExport extends BaseSettings
|
||||
*
|
||||
* @throws HTTPException\ForbiddenException
|
||||
*/
|
||||
public static function rawContent()
|
||||
public function rawContent()
|
||||
{
|
||||
if (!DI::app()->isLoggedIn()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
|
||||
Reference in New Issue
Block a user