function display_init(App $a)
{
if (ActivityPub::isRequest()) {
- Objects::rawContent(['guid' => DI::args()->getArgv()[1] ?? null]);
+ (new Objects(['guid' => DI::args()->getArgv()[1] ?? null]))->rawContent();
}
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
$owner = User::getOwnerDataById($uid);
if (!$owner) {
- \Friendica\Module\Security\Logout::init();
+ (new \Friendica\Module\Security\Logout())->init();
// NOTREACHED
}
Core\Hook::callAll($this->module . '_mod_init', $placeholder);
- $this->module_class::init();
+ $this->module_class->init();
$profiler->set(microtime(true) - $timestamp, 'init');
if ($server['REQUEST_METHOD'] === Router::DELETE) {
- $this->module_class::delete();
+ $this->module_class->delete();
}
if ($server['REQUEST_METHOD'] === Router::PATCH) {
- $this->module_class::patch();
+ $this->module_class->patch();
}
if ($server['REQUEST_METHOD'] === Router::POST) {
Core\Hook::callAll($this->module . '_mod_post', $post);
- $this->module_class::post();
+ $this->module_class->post();
}
if ($server['REQUEST_METHOD'] === Router::PUT) {
- $this->module_class::put();
+ $this->module_class->put();
}
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
- $this->module_class::afterpost();
+ $this->module_class->afterpost();
// "rawContent" is especially meant for technical endpoints.
// This endpoint doesn't need any theme initialization or other comparable stuff.
- $this->module_class::rawContent();
+ $this->module_class->rawContent();
}
}
$moduleClass = $module->getClass();
$arr = ['content' => $content];
- Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr);
+ Hook::callAll( $moduleClass->getClassName() . '_mod_content', $arr);
$content = $arr['content'];
- $arr = ['content' => $moduleClass::content()];
- Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr);
+ $arr = ['content' => $moduleClass->content()];
+ Hook::callAll($moduleClass->getClassName() . '_mod_aftercontent', $arr);
$content .= $arr['content'];
} catch (HTTPException $e) {
- $content = ModuleHTTPException::content($e);
+ $content = (new ModuleHTTPException())->content($e);
}
// initialise content region
/**
* {@inheritDoc}
*/
- public static function init()
+ public function init()
{
}
/**
* {@inheritDoc}
*/
- public static function rawContent()
+ public function rawContent()
{
// echo '';
// exit;
/**
* {@inheritDoc}
*/
- public static function content()
+ public function content(): string
{
return '';
}
/**
* {@inheritDoc}
*/
- public static function delete()
+ public function delete()
{
}
/**
* {@inheritDoc}
*/
- public static function patch()
+ public function patch()
{
}
/**
* {@inheritDoc}
*/
- public static function post()
+ public function post()
{
// DI::baseurl()->redirect('module');
}
/**
* {@inheritDoc}
*/
- public static function afterpost()
+ public function afterpost()
{
}
/**
* {@inheritDoc}
*/
- public static function put()
+ public function put()
{
}
/** Gets the name of the current class */
- public static function getClassName(): string
+ public function getClassName(): string
{
return static::class;
}
* Extend this method if you need to do any shared processing before both
* content() or post()
*/
- public static function init();
+ public function init();
/**
* Module GET method to display raw content from technical endpoints
* Extend this method if the module is supposed to return communication data,
* e.g. from protocol implementations.
*/
- public static function rawContent();
+ public function rawContent();
/**
* Module GET method to display any content
* Extend this method if the module is supposed to return any display
* through a GET request. It can be an HTML page through templating or a
* XML feed or a JSON output.
- *
- * @return string
*/
- public static function content();
+ public function content(): string;
/**
* Module DELETE method to process submitted data
* Extend this method if the module is supposed to process DELETE requests.
* Doesn't display any content
*/
- public static function delete();
+ public function delete();
/**
* Module PATCH method to process submitted data
* Extend this method if the module is supposed to process PATCH requests.
* Doesn't display any content
*/
- public static function patch();
+ public function patch();
/**
* Module POST method to process submitted data
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
- public static function post();
+ public function post();
/**
* Called after post()
*
* Unknown purpose
*/
- public static function afterpost();
+ public function afterpost();
/**
* Module PUT method to process submitted data
* Extend this method if the module is supposed to process PUT requests.
* Doesn't display any content
*/
- public static function put();
+ public function put();
- public static function getClassName(): string;
+ public function getClassName(): string;
}
require_once $file_path;
}
- public static function init()
+ public function init()
{
self::runModuleFunction('init', static::$parameters);
}
- public static function content()
+ public function content(): string
{
return self::runModuleFunction('content', static::$parameters);
}
- public static function post()
+ public function post()
{
self::runModuleFunction('post', static::$parameters);
}
- public static function afterpost()
+ public function afterpost()
{
self::runModuleFunction('afterpost', static::$parameters);
}
*/
class AccountManagementControlDocument extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$output = [
'version' => 1,
*/
class Acctlink extends BaseModule
{
- public static function content()
+ public function content(): string
{
$addr = trim($_GET['addr'] ?? '');
exit();
}
}
+
+ return '';
}
}
*/
class Followers extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['nickname'])) {
throw new \Friendica\Network\HTTPException\NotFoundException();
*/
class Following extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['nickname'])) {
throw new \Friendica\Network\HTTPException\NotFoundException();
*/
class Inbox extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$postdata = Network::postdata();
*/
class Objects extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['guid'])) {
throw new HTTPException\BadRequestException();
*/
class Outbox extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['nickname'])) {
throw new \Friendica\Network\HTTPException\NotFoundException();
class Details extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect($redirect);
}
- public static function content()
+ public function content(): string
{
parent::content();
class Index extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Contact extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/blocklist/contact');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Add extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/blocklist/server');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Index extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/blocklist/server');
}
- public static function content()
+ public function content(): string
{
parent::content();
class DBSync extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Features extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/features');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Federation extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Delete extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/item/delete');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Source extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Settings extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/logs');
}
- public static function content()
+ public function content(): string
{
parent::content();
{
const LIMIT = 500;
- public static function content()
+ public function content(): string
{
parent::content();
class PhpInfo extends BaseAdmin
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAdminAccess();
*/
class Queue extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Site extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/site' . $active_panel);
}
- public static function content()
+ public function content(): string
{
parent::content();
class Storage extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/storage');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Summary extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Details extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Embed extends BaseAdmin
{
- public static function init()
+ public function init()
{
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
if (is_file("view/theme/$theme/config.php")) {
}
}
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Index extends BaseAdmin
{
- public static function content()
+ public function content(): string
{
parent::content();
class Tos extends BaseAdmin
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/tos');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Active extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect(DI::args()->getQueryString());
}
- public static function content()
+ public function content(): string
{
parent::content();
class Blocked extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/users/blocked');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Create extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/users/create');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Deleted extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/users/deleted');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Index extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect(DI::args()->getQueryString());
}
- public static function content()
+ public function content(): string
{
parent::content();
class Pending extends BaseUsers
{
- public static function post()
+ public function post()
{
self::checkAdminAccess();
DI::baseUrl()->redirect('admin/users/pending');
}
- public static function content()
+ public function content(): string
{
parent::content();
*/
class Activity extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Setseen extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Index extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Index extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
- public static function rawContent()
+ public function rawContent()
{
echo api_call(DI::app());
exit();
*/
class Notification extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Delete extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Delete extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Update extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Show extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Version extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null);
}
*/
class Test extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
$ok = 'true';
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Block extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
*/
class Follow extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Mute extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Note extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Unblock extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Unfollow extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Unmute extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class UpdateCredentials extends BaseApi
{
- public static function patch()
+ public function patch()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function post()
+ public function post()
{
$request = self::getRequest([
'client_name' => '',
*/
class VerifyCredentials extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$application = self::getCurrentApplication();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Conversations extends BaseApi
{
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Read extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
* @throws \ImagickException
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows
*/
- public static function rawContent()
+ public function rawContent()
{
$emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
* @throws \ImagickException
* @see https://docs.joinmastodon.org/methods/instance/directory/
*/
- public static function rawContent()
+ public function rawContent()
{
$request = self::getRequest([
'offset' => 0, // How many accounts to skip before returning results. Default 0.
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
System::jsonExit([]);
}
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Filters extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow
*/
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
* @throws \ImagickException
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests/
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
System::jsonExit(InstanceEntity::get());
}
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$return = [];
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$rules = [];
$id = 0;
*/
class Lists extends BaseApi
{
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit([]);
}
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit(DI::mstdnList()->createFromGroupId($id));
}
- public static function put()
+ public function put()
{
$request = self::getRequest([
'title' => '', // The title of the list to be updated.
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Accounts extends BaseApi
{
- public static function delete()
+ public function delete()
{
DI::apiResponse()->unsupported(Router::DELETE);
}
- public static function post()
+ public function post()
{
DI::apiResponse()->unsupported(Router::POST);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Markers extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
*/
class Media extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
}
- public static function put()
+ public function put()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Clear extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Dismiss extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
System::jsonError(404, ['error' => 'Record not found']);
}
*/
class PushSubscription extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
}
- public static function put()
+ public function put()
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
}
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
System::jsonExit([]);
}
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
*/
class ScheduledStatuses extends BaseApi
{
- public static function put()
+ public function put()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
DI::apiResponse()->unsupported(Router::PUT);
}
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Statuses extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
DI::mstdnError()->InternalError();
}
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Bookmark extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Favourite extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Mute extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Pin extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Reblog extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
*/
class Unbookmark extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unfavourite extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unmute extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unpin extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unreblog extends BaseApi
{
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$uid = self::getCurrentUserID();
/**
* @throws HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$request = self::getRequest([
'limit' => 20, // Maximum number of results to return. Defaults to 10.
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function delete()
+ public function delete()
{
DI::apiResponse()->unsupported(Router::DELETE);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function patch()
+ public function patch()
{
DI::apiResponse()->unsupported(Router::PATCH);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function post()
+ public function post()
{
DI::apiResponse()->unsupported(Router::POST);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function put()
+ public function put()
{
DI::apiResponse()->unsupported(Router::PUT);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
DI::apiResponse()->unsupported(Router::GET);
}
*/
class RateLimitStatus extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
$hash = [
const DEFAULT_COUNT = 20;
const MAX_COUNT = 200;
- public static function init()
+ public function init()
{
parent::init();
*/
class FollowersIds extends ContactEndpoint
{
- public static function rawContent()
+ public function rawContent()
{
// Expected value for user_id parameter: public/user contact id
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
*/
class FollowersList extends ContactEndpoint
{
- public static function rawContent()
+ public function rawContent()
{
// Expected value for user_id parameter: public/user contact id
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
*/
class FriendsIds extends ContactEndpoint
{
- public static function rawContent()
+ public function rawContent()
{
// Expected value for user_id parameter: public/user contact id
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
*/
class FriendsList extends ContactEndpoint
{
- public static function rawContent()
+ public function rawContent()
{
// Expected value for user_id parameter: public/user contact id
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
*/
class SavedSearches extends BaseApi
{
- public static function rawContent()
+ public function rawContent()
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Apps extends BaseModule
{
- public static function init()
+ public function init()
{
$privateaddons = DI::config()->get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) {
}
}
- public static function content()
+ public function content(): string
{
$apps = Nav::getAppMenu();
/**
* Return to user an attached file given the id
*/
- public static function rawContent()
+ public function rawContent()
{
$a = DI::app();
if (empty(static::$parameters['item'])) {
}
}
- public static function content()
+ public function content(): string
{
self::checkAdminAccess(true);
*/
protected static $request = [];
- public static function delete()
+ public function delete()
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- public static function patch()
+ public function patch()
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- public static function post()
+ public function post()
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- public static function put()
+ public function put()
{
self::checkAllowedScope(self::SCOPE_WRITE);
*/
abstract public static function getNotifications();
- public static function init()
+ public function init()
{
if (!local_user()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
self::$showAll = ($_REQUEST['show'] ?? '') === 'all';
}
- public static function rawContent()
+ public function rawContent()
{
// If the last argument of the query is NOT json, return
if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') {
class BaseSettings extends BaseModule
{
- public static function content()
+ public function content(): string
{
$a = DI::app();
'$class' => 'settings-widget',
'$items' => $tabs,
]);
+
+ return '';
}
}
*/
class Bookmarklet extends BaseModule
{
- public static function content()
+ public function content(): string
{
$_GET['mode'] = 'minimal';
DI::baseUrl()->redirect($redirectUrl);
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
Model\Contact\User::setIgnored($contact_id, local_user(), $ignored);
}
- public static function content($update = 0)
+ public function content($update = 0): string
{
if (!local_user()) {
return Login::form($_SERVER['REQUEST_URI']);
*/
class Advanced extends BaseModule
{
- public static function init()
+ public function init()
{
if (!Session::isAuthenticated()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
}
}
- public static function post()
+ public function post()
{
$cid = static::$parameters['id'];
return;
}
- public static function content()
+ public function content(): string
{
$cid = static::$parameters['id'];
class Contacts extends BaseModule
{
- public static function content()
+ public function content(): string
{
$app = DI::app();
*/
class Hovercard extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$contact_url = $_REQUEST['url'] ?? '';
*/
class Media extends BaseModule
{
- public static function content()
+ public function content(): string
{
$cid = static::$parameters['id'];
class Poke extends BaseModule
{
- public static function post()
+ public function post()
{
if (!local_user() || empty(static::$parameters['id'])) {
return self::postReturn(false);
return $success;
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
/** @var array */
private static $contact;
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException();
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
}
- public static function content(): string
+ public function content(): string
{
if (!local_user()) {
return Login::form($_SERVER['REQUEST_URI']);
protected static $max_id;
protected static $item_id;
- public static function content()
+ public function content(): string
{
self::parseRequest();
/** @var string */
protected static $order;
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form();
*/
class Credits extends BaseModule
{
- public static function content()
+ public function content(): string
{
/* fill the page with credits */
$credits_string = file_get_contents('CREDITS.txt');
*/
class Notify extends BaseModule
{
- public static function post()
+ public function post()
{
$postdata = Network::postdata();
*/
class Poll extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
header("Content-type: application/atom+xml");
$last_update = $_GET['last_update'] ?? '';
class ActivityPubConversion extends BaseModule
{
- public static function content()
+ public function content(): string
{
function visible_whitespace($s)
{
*/
class Babel extends BaseModule
{
- public static function content()
+ public function content(): string
{
function visible_whitespace($s)
{
*/
class Feed extends BaseModule
{
- public static function init()
+ public function init()
{
if (!local_user()) {
notice(DI::l10n()->t('You must be logged in to use this module'));
}
}
- public static function content()
+ public function content(): string
{
$result = [];
if (!empty($_REQUEST['url'])) {
*/
class ItemBody extends BaseModule
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
{
static $mod_localtime = '';
- public static function post()
+ public function post()
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
}
}
- public static function content()
+ public function content(): string
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
*/
class Probe extends BaseModule
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
*/
class WebFinger extends BaseModule
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
*/
class Delegation extends BaseModule
{
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
// NOTREACHED
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
*/
class Fetch extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['guid'])) {
throw new HTTPException\NotFoundException();
/** @var LoggerInterface */
private static $logger;
- public static function init()
+ public function init()
{
self::$logger = DI::logger();
}
- public static function post()
+ public function post()
{
$enabled = DI::config()->get('system', 'diaspora_enabled', false);
if (!$enabled) {
*/
class Directory extends BaseModule
{
- public static function content()
+ public function content(): string
{
$app = DI::app();
$config = DI::config();
class Json extends \Friendica\BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException();
*/
class Feed extends BaseModule
{
- public static function content()
+ public function content(): string
{
$a = DI::app();
*/
class RemoveTag extends BaseModule
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\ForbiddenException();
if ($item_id && strlen($term)) {
$item = Post::selectFirst(['uri-id'], ['id' => $item_id]);
if (!DBA::isResult($item)) {
- return;
+ return '';
}
if (!Post\Category::deleteFileByURIId($item['uri-id'], local_user(), $type, $term)) {
notice(DI::l10n()->t('Item was not removed'));
if ($type == Post\Category::FILE) {
DI::baseUrl()->redirect('filed?file=' . rawurlencode($term));
}
+
+ return '';
}
}
*/
class SaveTag extends BaseModule
{
- public static function init()
+ public function init()
{
if (!local_user()) {
notice(DI::l10n()->t('You must be logged in to use this module'));
}
}
- public static function rawContent()
+ public function rawContent()
{
$logger = DI::logger();
*/
class FollowConfirm extends BaseModule
{
- public static function post()
+ public function post()
{
$uid = local_user();
if (!$uid) {
*/
class FriendSuggest extends BaseModule
{
- public static function init()
+ public function init()
{
if (!local_user()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
}
}
- public static function post()
+ public function post()
{
$cid = intval(static::$parameters['contact']);
info(DI::l10n()->t('Friend suggestion sent.'));
}
- public static function content()
+ public function content(): string
{
$cid = intval(static::$parameters['contact']);
*/
class Friendica extends BaseModule
{
- public static function content()
+ public function content(): string
{
$config = DI::config();
]);
}
- public static function rawContent()
+ public function rawContent()
{
if (ActivityPub::isRequest()) {
try {
class Group extends BaseModule
{
- public static function post()
+ public function post()
{
$a = DI::app();
}
}
- public static function content()
+ public function content(): string
{
$change = false;
*/
class HCard extends BaseModule
{
- public static function content()
+ public function content(): string
{
if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') {
// A logged in user views a profile of a user
class MethodNotAllowed extends BaseModule
{
- public static function content()
+ public function content(): string
{
throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
}
class PageNotFound extends BaseModule
{
- public static function content()
+ public function content(): string
{
throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
}
*/
class Hashtag extends BaseModule
{
- public static function content()
+ public function content(): string
{
$result = [];
DBA::close($taglist);
System::jsonExit($result);
+
+ return '';
}
}
*/
class Help extends BaseModule
{
- public static function content()
+ public function content(): string
{
Nav::setSelected('help');
*/
class Home extends BaseModule
{
- public static function content()
+ public function content(): string
{
$app = DI::app();
$config = DI::config();
*/
private static $installer;
- public static function init()
+ public function init()
{
$a = DI::app();
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
}
- public static function post()
+ public function post()
{
$a = DI::app();
$configCache = $a->getConfigCache();
}
}
- public static function content()
+ public function content(): string
{
$a = DI::app();
$configCache = $a->getConfigCache();
*/
class Invite extends BaseModule
{
- public static function post()
+ public function post()
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
*/
class Activity extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException();
class Compose extends BaseModule
{
- public static function post()
+ public function post()
{
if (!empty($_REQUEST['body'])) {
$_REQUEST['return'] = 'network';
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form('compose', false);
*/
class Follow extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$l10n = DI::l10n();
*/
class Ignore extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$l10n = DI::l10n();
*/
class Pin extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$l10n = DI::l10n();
*/
class Star extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$l10n = DI::l10n();
*/
class Magic extends BaseModule
{
- public static function init()
+ public function init()
{
$a = DI::app();
$ret = ['success' => false, 'url' => '', 'message' => ''];
*/
class Maintenance extends BaseModule
{
- public static function content()
+ public function content(): string
{
$reason = DI::config()->get('system', 'maintenance_reason');
class Manifest extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
*/
class NoScrape extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$a = DI::app();
*/
class NodeInfo110 extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
*/
class NodeInfo120 extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
*/
class NodeInfo210 extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
];
}
- public static function content()
+ public function content(): string
{
Nav::setSelected('introductions');
* @throws \ImagickException
* @throws \Exception
*/
- public static function post()
+ public function post()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
*
* @throws HTTPException\UnauthorizedException
*/
- public static function rawContent()
+ public function rawContent()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
* @throws HTTPException\InternalServerErrorException
* @throws \Exception
*/
- public static function content(): string
+ public function content(): string
{
if (!local_user()) {
notice(DI::l10n()->t('You must be logged in to show this page.'));
];
}
- public static function content()
+ public function content(): string
{
Nav::setSelected('notifications');
*/
class Acknowledge extends BaseApi
{
- public static function post()
+ public function post()
{
DI::session()->set('oauth_acknowledge', true);
DI::app()->redirect(DI::session()->get('return_path'));
}
- public static function content()
+ public function content(): string
{
DI::session()->set('return_path', $_REQUEST['return_path'] ?? '');
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function rawContent()
+ public function rawContent()
{
$request = self::getRequest([
'force_login' => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
self::$oauth_code = $token['code'];
}
- public static function content()
+ public function content(): string
{
if (empty(self::$oauth_code)) {
return '';
*/
class Revoke extends BaseApi
{
- public static function post()
+ public function post()
{
$request = self::getRequest([
'client_id' => '', // Client ID, obtained during app registration
*/
class Token extends BaseApi
{
- public static function post()
+ public function post()
{
$request = self::getRequest([
'client_id' => '', // Client ID, obtained during app registration
*/
class Oembed extends BaseModule
{
- public static function content()
+ public function content(): string
{
// Unused form: /oembed/b2h?url=...
if (DI::args()->getArgv()[1] == 'b2h') {
/**
* @throws \Exception
*/
- public static function rawContent()
+ public function rawContent()
{
header('Content-type: application/opensearchdescription+xml');
*/
class Owa extends BaseModule
{
- public static function init()
+ public function init()
{
$ret = [ 'success' => false ];
class ParseUrl extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
*/
class PermissionTooltip extends \Friendica\BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$type = static::$parameters['type'];
$referenceId = static::$parameters['id'];
* Fetch a photo or an avatar, in optional size, check for permissions and
* return the image
*/
- public static function rawContent()
+ public function rawContent()
{
$totalstamp = microtime(true);
class Common extends BaseProfile
{
- public static function content()
+ public function content(): string
{
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
class Contacts extends Module\BaseProfile
{
- public static function content()
+ public function content(): string
{
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
*/
class Index extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
- Profile::rawContent();
+ (new Profile(static::$parameters))->rawContent();
}
- public static function content()
+ public function content(): string
{
- return Status::content();
+ return (new Status(static::$parameters))->content();
}
}
class Media extends BaseProfile
{
- public static function content()
+ public function content(): string
{
$a = DI::app();
class Profile extends BaseProfile
{
- public static function rawContent()
+ public function rawContent()
{
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
}
}
- public static function content()
+ public function content(): string
{
$a = DI::app();
class Schedule extends BaseProfile
{
- public static function post()
+ public function post()
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
Post\Delayed::deleteById($_REQUEST['delete']);
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
class Status extends BaseProfile
{
- public static function content()
+ public function content(): string
{
$args = DI::args();
/**
* Fetch remote image content
*/
- public static function rawContent()
+ public function rawContent()
{
$request = self::getRequestInfo();
*/
class PublicRSAKey extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (empty(static::$parameters['nick'])) {
throw new BadRequestException();
*/
class RandomProfile extends BaseModule
{
- public static function content()
+ public function content(): string
{
$a = DI::app();
}
DI::baseUrl()->redirect('profile');
+
+ return '';
}
}
*/
class ReallySimpleDiscovery extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
header('Content-Type: text/xml');
*
* @return string
*/
- public static function content()
+ public function content(): string
{
// logged in users can register others (people/pages/groups)
// even with closed registrations, unless specifically prohibited by site policy.
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
- public static function post()
+ public function post()
{
BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
{
static $owner;
- public static function init()
+ public function init()
{
self::$owner = User::getOwnerDataByNick(static::$parameters['profile']);
if (!self::$owner) {
DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
}
- public static function post()
+ public function post()
{
if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
DI::baseUrl()->redirect();
System::externalRedirect($follow_link);
}
- public static function content()
+ public function content(): string
{
if (empty(self::$owner)) {
return '';
*/
class RobotsTxt extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$allDisalloweds = [
'/settings/',
const TYPE_PRIVATE_MESSAGE = 'm';
const TYPE_ANY_CONTACT = 'a';
- public static function rawContent()
+ public function rawContent()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
*/
class Directory extends BaseSearch
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
notice(DI::l10n()->t('Permission denied.'));
class Filed extends BaseSearch
{
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form();
class Index extends BaseSearch
{
- public static function content()
+ public function content(): string
{
$search = (!empty($_GET['q']) ? trim(rawurldecode($_GET['q'])) : '');
class Saved extends BaseModule
{
- public static function init()
+ public function init()
{
$action = DI::args()->get(2, 'none');
$search = trim(rawurldecode($_GET['term'] ?? ''));
*/
class Login extends BaseModule
{
- public static function content()
+ public function content(): string
{
$return_path = $_REQUEST['return_path'] ?? '' ;
return self::form(Session::get('return_path'), intval(DI::config()->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
}
- public static function post()
+ public function post()
{
$return_path = Session::get('return_path');
Session::clear();
/**
* Process logout requests
*/
- public static function init()
+ public function init()
{
$visitor_home = null;
if (remote_user()) {
*/
class OpenID extends BaseModule
{
- public static function content()
+ public function content(): string
{
if (DI::config()->get('system', 'no_openid')) {
DI::baseUrl()->redirect();
DI::baseUrl()->redirect('login');
}
}
+
+ return '';
}
}
*/
class Recovery extends BaseModule
{
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
DI::baseUrl()->redirect();
{
private static $errors = [];
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
DI::baseUrl()->redirect();
*/
class Delegation extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
}
- public static function content()
+ public function content(): string
{
parent::content();
*/
class Display extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('settings/display');
}
- public static function content()
+ public function content(): string
{
parent::content();
class Index extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
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'));
class Crop extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!Session::isAuthenticated()) {
return;
DI::baseUrl()->redirect($path);
}
- public static function content()
+ public function content(): string
{
if (!Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
class Index extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!Session::isAuthenticated()) {
return;
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.'));
{
private static $appSpecificPassword = null;
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form('settings/2fa/app_specific');
class Index extends BaseSettings
{
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form('settings/2fa');
*/
class Recovery extends BaseSettings
{
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form('settings/2fa/recovery');
*/
class Trusted extends BaseSettings
{
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
- public static function content(): string
+ public function content(): string
{
parent::content();
*/
class Verify extends BaseSettings
{
- public static function init()
+ public function init()
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public function post()
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public function content(): string
{
if (!local_user()) {
return Login::form('settings/2fa/verify');
* @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.'));
*
* @throws HTTPException\ForbiddenException
*/
- public static function rawContent()
+ public function rawContent()
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
*/
class Smilies extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!empty(DI::args()->getArgv()[1]) && (DI::args()->getArgv()[1] === "json")) {
$smilies = Content\Smilies::getList();
}
}
- public static function content()
+ public function content(): string
{
$smilies = Content\Smilies::getList();
$count = count($smilies['texts'] ?? []);
* @param \Friendica\Network\HTTPException $e
* @throws \Exception
*/
- public static function rawContent(\Friendica\Network\HTTPException $e)
+ public function rawContent(\Friendica\Network\HTTPException $e)
{
$content = '';
* @return string
* @throws \Exception
*/
- public static function content(\Friendica\Network\HTTPException $e)
+ public function content(\Friendica\Network\HTTPException $e): string
{
header($_SERVER["SERVER_PROTOCOL"] . ' ' . $e->getCode() . ' ' . $e->getDescription());
class Statistics extends BaseModule
{
- public static function init()
+ public function init()
{
if (!DI::config()->get("system", "nodeinfo")) {
throw new NotFoundException();
}
}
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
$logger = DI::logger();
*/
class Theme extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
header('Content-Type: text/css');
*/
class ThemeDetails extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!empty($_REQUEST['theme'])) {
$theme = $_REQUEST['theme'];
*/
class ToggleMobile extends BaseModule
{
- public static function content()
+ public function content(): string
{
$a = DI::app();
}
$a->redirect($address);
+
+ return '';
}
}
* dealings with their own node so a TOS is not necessary.
*
**/
- public static function init()
+ public function init()
{
if (strlen(DI::config()->get('system','singleuser'))) {
DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser'));
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function content() {
+ public function content(): string {
$tpl = Renderer::getMarkupTemplate('tos.tpl');
if (DI::config()->get('system', 'tosdisplay')) {
return Renderer::replaceMacros($tpl, [
*/
class Community extends CommunityModule
{
- public static function rawContent()
+ public function rawContent()
{
self::parseRequest();
class Network extends NetworkModule
{
- public static function rawContent()
+ public function rawContent()
{
if (!isset($_GET['p']) || !isset($_GET['item'])) {
exit();
class Profile extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$a = DI::app();
*/
class Welcome extends BaseModule
{
- public static function content()
+ public function content(): string
{
$config = DI::config();
*/
class HostMeta extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
*/
class NodeInfo extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
self::printWellKnown();
}
*/
class SecurityTxt extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$name = 'security.txt';
$fp = fopen($name, 'rt');
*/
class XSocialRelay extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
$config = DI::config();
*/
class Xrd extends BaseModule
{
- public static function rawContent()
+ public function rawContent()
{
// @TODO: Replace with parameter from router
if (DI::args()->getArgv()[0] == 'xrd') {
$module = (new App\Module($name))->determineClass(new App\Arguments('', $command), $router, $config, $dice);
- self::assertEquals($assert, $module->getClass()::getClassName());
+ self::assertEquals($assert, $module->getClass()->getClassName());
}
/**