Make BaseModule methods dynamic
This commit is contained in:
parent
714f0febc4
commit
489cd0884a
253 changed files with 397 additions and 385 deletions
|
|
@ -40,7 +40,7 @@ use Friendica\Protocol\DFRN;
|
||||||
function display_init(App $a)
|
function display_init(App $a)
|
||||||
{
|
{
|
||||||
if (ActivityPub::isRequest()) {
|
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()) {
|
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ function unfollow_process(string $url)
|
||||||
|
|
||||||
$owner = User::getOwnerDataById($uid);
|
$owner = User::getOwnerDataById($uid);
|
||||||
if (!$owner) {
|
if (!$owner) {
|
||||||
\Friendica\Module\Security\Logout::init();
|
(new \Friendica\Module\Security\Logout())->init();
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,32 +297,32 @@ class Module
|
||||||
|
|
||||||
Core\Hook::callAll($this->module . '_mod_init', $placeholder);
|
Core\Hook::callAll($this->module . '_mod_init', $placeholder);
|
||||||
|
|
||||||
$this->module_class::init();
|
$this->module_class->init();
|
||||||
|
|
||||||
$profiler->set(microtime(true) - $timestamp, 'init');
|
$profiler->set(microtime(true) - $timestamp, 'init');
|
||||||
|
|
||||||
if ($server['REQUEST_METHOD'] === Router::DELETE) {
|
if ($server['REQUEST_METHOD'] === Router::DELETE) {
|
||||||
$this->module_class::delete();
|
$this->module_class->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server['REQUEST_METHOD'] === Router::PATCH) {
|
if ($server['REQUEST_METHOD'] === Router::PATCH) {
|
||||||
$this->module_class::patch();
|
$this->module_class->patch();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server['REQUEST_METHOD'] === Router::POST) {
|
if ($server['REQUEST_METHOD'] === Router::POST) {
|
||||||
Core\Hook::callAll($this->module . '_mod_post', $post);
|
Core\Hook::callAll($this->module . '_mod_post', $post);
|
||||||
$this->module_class::post();
|
$this->module_class->post();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server['REQUEST_METHOD'] === Router::PUT) {
|
if ($server['REQUEST_METHOD'] === Router::PUT) {
|
||||||
$this->module_class::put();
|
$this->module_class->put();
|
||||||
}
|
}
|
||||||
|
|
||||||
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
|
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
|
||||||
$this->module_class::afterpost();
|
$this->module_class->afterpost();
|
||||||
|
|
||||||
// "rawContent" is especially meant for technical endpoints.
|
// "rawContent" is especially meant for technical endpoints.
|
||||||
// This endpoint doesn't need any theme initialization or other comparable stuff.
|
// This endpoint doesn't need any theme initialization or other comparable stuff.
|
||||||
$this->module_class::rawContent();
|
$this->module_class->rawContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -350,13 +350,13 @@ class Page implements ArrayAccess
|
||||||
$moduleClass = $module->getClass();
|
$moduleClass = $module->getClass();
|
||||||
|
|
||||||
$arr = ['content' => $content];
|
$arr = ['content' => $content];
|
||||||
Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr);
|
Hook::callAll( $moduleClass->getClassName() . '_mod_content', $arr);
|
||||||
$content = $arr['content'];
|
$content = $arr['content'];
|
||||||
$arr = ['content' => $moduleClass::content()];
|
$arr = ['content' => $moduleClass->content()];
|
||||||
Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr);
|
Hook::callAll($moduleClass->getClassName() . '_mod_aftercontent', $arr);
|
||||||
$content .= $arr['content'];
|
$content .= $arr['content'];
|
||||||
} catch (HTTPException $e) {
|
} catch (HTTPException $e) {
|
||||||
$content = ModuleHTTPException::content($e);
|
$content = (new ModuleHTTPException())->content($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialise content region
|
// initialise content region
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,14 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// echo '';
|
// echo '';
|
||||||
// exit;
|
// exit;
|
||||||
|
|
@ -63,7 +63,7 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
@ -71,21 +71,21 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function patch()
|
public function patch()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
// DI::baseurl()->redirect('module');
|
// DI::baseurl()->redirect('module');
|
||||||
}
|
}
|
||||||
|
|
@ -93,19 +93,19 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function afterpost()
|
public function afterpost()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the name of the current class */
|
/** Gets the name of the current class */
|
||||||
public static function getClassName(): string
|
public function getClassName(): string
|
||||||
{
|
{
|
||||||
return static::class;
|
return static::class;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ interface ICanHandleRequests
|
||||||
* Extend this method if you need to do any shared processing before both
|
* Extend this method if you need to do any shared processing before both
|
||||||
* content() or post()
|
* content() or post()
|
||||||
*/
|
*/
|
||||||
public static function init();
|
public function init();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module GET method to display raw content from technical endpoints
|
* Module GET method to display raw content from technical endpoints
|
||||||
|
|
@ -21,7 +21,7 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to return communication data,
|
* Extend this method if the module is supposed to return communication data,
|
||||||
* e.g. from protocol implementations.
|
* e.g. from protocol implementations.
|
||||||
*/
|
*/
|
||||||
public static function rawContent();
|
public function rawContent();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module GET method to display any content
|
* Module GET method to display any content
|
||||||
|
|
@ -29,10 +29,8 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to return any display
|
* 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
|
* through a GET request. It can be an HTML page through templating or a
|
||||||
* XML feed or a JSON output.
|
* XML feed or a JSON output.
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public static function content();
|
public function content(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module DELETE method to process submitted data
|
* Module DELETE method to process submitted data
|
||||||
|
|
@ -40,7 +38,7 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to process DELETE requests.
|
* Extend this method if the module is supposed to process DELETE requests.
|
||||||
* Doesn't display any content
|
* Doesn't display any content
|
||||||
*/
|
*/
|
||||||
public static function delete();
|
public function delete();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module PATCH method to process submitted data
|
* Module PATCH method to process submitted data
|
||||||
|
|
@ -48,7 +46,7 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to process PATCH requests.
|
* Extend this method if the module is supposed to process PATCH requests.
|
||||||
* Doesn't display any content
|
* Doesn't display any content
|
||||||
*/
|
*/
|
||||||
public static function patch();
|
public function patch();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module POST method to process submitted data
|
* Module POST method to process submitted data
|
||||||
|
|
@ -56,14 +54,14 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to process POST requests.
|
* Extend this method if the module is supposed to process POST requests.
|
||||||
* Doesn't display any content
|
* Doesn't display any content
|
||||||
*/
|
*/
|
||||||
public static function post();
|
public function post();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after post()
|
* Called after post()
|
||||||
*
|
*
|
||||||
* Unknown purpose
|
* Unknown purpose
|
||||||
*/
|
*/
|
||||||
public static function afterpost();
|
public function afterpost();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module PUT method to process submitted data
|
* Module PUT method to process submitted data
|
||||||
|
|
@ -71,7 +69,7 @@ interface ICanHandleRequests
|
||||||
* Extend this method if the module is supposed to process PUT requests.
|
* Extend this method if the module is supposed to process PUT requests.
|
||||||
* Doesn't display any content
|
* Doesn't display any content
|
||||||
*/
|
*/
|
||||||
public static function put();
|
public function put();
|
||||||
|
|
||||||
public static function getClassName(): string;
|
public function getClassName(): string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,22 +54,22 @@ class LegacyModule extends BaseModule
|
||||||
require_once $file_path;
|
require_once $file_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
self::runModuleFunction('init', static::$parameters);
|
self::runModuleFunction('init', static::$parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
return self::runModuleFunction('content', static::$parameters);
|
return self::runModuleFunction('content', static::$parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::runModuleFunction('post', static::$parameters);
|
self::runModuleFunction('post', static::$parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function afterpost()
|
public function afterpost()
|
||||||
{
|
{
|
||||||
self::runModuleFunction('afterpost', static::$parameters);
|
self::runModuleFunction('afterpost', static::$parameters);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\BaseModule;
|
||||||
*/
|
*/
|
||||||
class AccountManagementControlDocument extends BaseModule
|
class AccountManagementControlDocument extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$output = [
|
$output = [
|
||||||
'version' => 1,
|
'version' => 1,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class Acctlink extends BaseModule
|
class Acctlink extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$addr = trim($_GET['addr'] ?? '');
|
$addr = trim($_GET['addr'] ?? '');
|
||||||
|
|
||||||
|
|
@ -41,5 +41,7 @@ class Acctlink extends BaseModule
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub;
|
||||||
*/
|
*/
|
||||||
class Followers extends BaseModule
|
class Followers extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (empty(static::$parameters['nickname'])) {
|
if (empty(static::$parameters['nickname'])) {
|
||||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub;
|
||||||
*/
|
*/
|
||||||
class Following extends BaseModule
|
class Following extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (empty(static::$parameters['nickname'])) {
|
if (empty(static::$parameters['nickname'])) {
|
||||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Network;
|
||||||
*/
|
*/
|
||||||
class Inbox extends BaseModule
|
class Inbox extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$postdata = Network::postdata();
|
$postdata = Network::postdata();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Objects extends BaseModule
|
class Objects extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (empty(static::$parameters['guid'])) {
|
if (empty(static::$parameters['guid'])) {
|
||||||
throw new HTTPException\BadRequestException();
|
throw new HTTPException\BadRequestException();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Util\HTTPSignature;
|
||||||
*/
|
*/
|
||||||
class Outbox extends BaseModule
|
class Outbox extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (empty(static::$parameters['nickname'])) {
|
if (empty(static::$parameters['nickname'])) {
|
||||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Details extends BaseAdmin
|
class Details extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ class Details extends BaseAdmin
|
||||||
DI::baseUrl()->redirect($redirect);
|
DI::baseUrl()->redirect($redirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class Index extends BaseAdmin
|
class Index extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Util\Network;
|
||||||
|
|
||||||
class Contact extends BaseAdmin
|
class Contact extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ class Contact extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/blocklist/contact');
|
DI::baseUrl()->redirect('admin/blocklist/contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use GuzzleHttp\Psr7\Uri;
|
||||||
|
|
||||||
class Add extends BaseAdmin
|
class Add extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ class Add extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/blocklist/server');
|
DI::baseUrl()->redirect('admin/blocklist/server');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class Index extends BaseAdmin
|
class Index extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ class Index extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/blocklist/server');
|
DI::baseUrl()->redirect('admin/blocklist/server');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class DBSync extends BaseAdmin
|
class DBSync extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class Features extends BaseAdmin
|
class Features extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ class Features extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/features');
|
DI::baseUrl()->redirect('admin/features');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class Federation extends BaseAdmin
|
class Federation extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Delete extends BaseAdmin
|
class Delete extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ class Delete extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/item/delete');
|
DI::baseUrl()->redirect('admin/item/delete');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
class Source extends BaseAdmin
|
class Source extends BaseAdmin
|
||||||
|
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Psr\Log\LogLevel;
|
||||||
|
|
||||||
class Settings extends BaseAdmin
|
class Settings extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ class Settings extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/logs');
|
DI::baseUrl()->redirect('admin/logs');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class View extends BaseAdmin
|
||||||
{
|
{
|
||||||
const LIMIT = 500;
|
const LIMIT = 500;
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class PhpInfo extends BaseAdmin
|
class PhpInfo extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat;
|
||||||
*/
|
*/
|
||||||
class Queue extends BaseAdmin
|
class Queue extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ require_once __DIR__ . '/../../../boot.php';
|
||||||
|
|
||||||
class Site extends BaseAdmin
|
class Site extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -384,7 +384,7 @@ class Site extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Storage extends BaseAdmin
|
class Storage extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ class Storage extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/storage');
|
DI::baseUrl()->redirect('admin/storage');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
class Summary extends BaseAdmin
|
class Summary extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Details extends BaseAdmin
|
class Details extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Embed extends BaseAdmin
|
class Embed extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
||||||
if (is_file("view/theme/$theme/config.php")) {
|
if (is_file("view/theme/$theme/config.php")) {
|
||||||
|
|
@ -36,7 +36,7 @@ class Embed extends BaseAdmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ class Embed extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
|
DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
class Index extends BaseAdmin
|
class Index extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class Tos extends BaseAdmin
|
class Tos extends BaseAdmin
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ class Tos extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/tos');
|
DI::baseUrl()->redirect('admin/tos');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
|
||||||
|
|
||||||
class Active extends BaseUsers
|
class Active extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ class Active extends BaseUsers
|
||||||
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
class Blocked extends BaseUsers
|
class Blocked extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ class Blocked extends BaseUsers
|
||||||
DI::baseUrl()->redirect('admin/users/blocked');
|
DI::baseUrl()->redirect('admin/users/blocked');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\Module\Admin\BaseUsers;
|
||||||
|
|
||||||
class Create extends BaseUsers
|
class Create extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ class Create extends BaseUsers
|
||||||
DI::baseUrl()->redirect('admin/users/create');
|
DI::baseUrl()->redirect('admin/users/create');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
class Deleted extends BaseUsers
|
class Deleted extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ class Deleted extends BaseUsers
|
||||||
DI::baseUrl()->redirect('admin/users/deleted');
|
DI::baseUrl()->redirect('admin/users/deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
|
||||||
|
|
||||||
class Index extends BaseUsers
|
class Index extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ class Index extends BaseUsers
|
||||||
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
class Pending extends BaseUsers
|
class Pending extends BaseUsers
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ class Pending extends BaseUsers
|
||||||
DI::baseUrl()->redirect('admin/users/pending');
|
DI::baseUrl()->redirect('admin/users/pending');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Activity extends BaseApi
|
class Activity extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Setseen extends BaseApi
|
class Setseen extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Index extends BaseApi
|
class Index extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Index extends BaseApi
|
class Index extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
echo api_call(DI::app());
|
echo api_call(DI::app());
|
||||||
exit();
|
exit();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Object\Api\Friendica\Notification as ApiNotification;
|
||||||
*/
|
*/
|
||||||
class Notification extends BaseApi
|
class Notification extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
*/
|
*/
|
||||||
class Delete extends BaseApi
|
class Delete extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
*/
|
*/
|
||||||
class Delete extends BaseApi
|
class Delete extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
*/
|
*/
|
||||||
class Update extends BaseApi
|
class Update extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Show extends BaseApi
|
class Show extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\DI;
|
||||||
*/
|
*/
|
||||||
class Version extends BaseApi
|
class Version extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null);
|
DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\DI;
|
||||||
*/
|
*/
|
||||||
class Test extends BaseApi
|
class Test extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
|
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
|
||||||
$ok = 'true';
|
$ok = 'true';
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Accounts extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Block extends BaseApi
|
class Block extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class FeaturedTags extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Follow extends BaseApi
|
class Follow extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Followers extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Following extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class IdentityProofs extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Lists extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Mute extends BaseApi
|
class Mute extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Note extends BaseApi
|
class Note extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Relationships extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Search extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class Statuses extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unblock extends BaseApi
|
class Unblock extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unfollow extends BaseApi
|
class Unfollow extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unmute extends BaseApi
|
class Unmute extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Util\HTTPInputData;
|
||||||
*/
|
*/
|
||||||
class UpdateCredentials extends BaseApi
|
class UpdateCredentials extends BaseApi
|
||||||
{
|
{
|
||||||
public static function patch()
|
public function patch()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class VerifyCredentials extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Announcements extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Apps extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'client_name' => '',
|
'client_name' => '',
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class VerifyCredentials extends BaseApi
|
class VerifyCredentials extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$application = self::getCurrentApplication();
|
$application = self::getCurrentApplication();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Blocks extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class Bookmarks extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Conversations extends BaseApi
|
class Conversations extends BaseApi
|
||||||
{
|
{
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -49,7 +49,7 @@ class Conversations extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Read extends BaseApi
|
class Read extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class CustomEmojis extends BaseApi
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows
|
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
|
$emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class Directory extends BaseApi
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
* @see https://docs.joinmastodon.org/methods/instance/directory/
|
* @see https://docs.joinmastodon.org/methods/instance/directory/
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'offset' => 0, // How many accounts to skip before returning results. Default 0.
|
'offset' => 0, // How many accounts to skip before returning results. Default 0.
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Endorsements extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
System::jsonExit([]);
|
System::jsonExit([]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Favourited extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Filters extends BaseApi
|
class Filters extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Filters extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class FollowRequests extends BaseApi
|
||||||
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow
|
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow
|
||||||
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow
|
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow
|
||||||
*/
|
*/
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
self::checkAllowedScope(self::SCOPE_FOLLOW);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -82,7 +82,7 @@ class FollowRequests extends BaseApi
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests/
|
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests/
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class Instance extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
System::jsonExit(InstanceEntity::get());
|
System::jsonExit(InstanceEntity::get());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class Peers extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$return = [];
|
$return = [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class Rules extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$rules = [];
|
$rules = [];
|
||||||
$id = 0;
|
$id = 0;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Model\Group;
|
||||||
*/
|
*/
|
||||||
class Lists extends BaseApi
|
class Lists extends BaseApi
|
||||||
{
|
{
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -51,7 +51,7 @@ class Lists extends BaseApi
|
||||||
System::jsonExit([]);
|
System::jsonExit([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -74,7 +74,7 @@ class Lists extends BaseApi
|
||||||
System::jsonExit(DI::mstdnList()->createFromGroupId($id));
|
System::jsonExit(DI::mstdnList()->createFromGroupId($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'title' => '', // The title of the list to be updated.
|
'title' => '', // The title of the list to be updated.
|
||||||
|
|
@ -91,7 +91,7 @@ class Lists extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,12 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Accounts extends BaseApi
|
class Accounts extends BaseApi
|
||||||
{
|
{
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::DELETE);
|
DI::apiResponse()->unsupported(Router::DELETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::POST);
|
DI::apiResponse()->unsupported(Router::POST);
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +48,7 @@ class Accounts extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Markers extends BaseApi
|
class Markers extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Markers extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Media extends BaseApi
|
class Media extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -53,7 +53,7 @@ class Media extends BaseApi
|
||||||
System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
|
System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -82,7 +82,7 @@ class Media extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Mutes extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class Notifications extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Clear extends BaseApi
|
class Clear extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\ForbiddenException;
|
||||||
*/
|
*/
|
||||||
class Dismiss extends BaseApi
|
class Dismiss extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Preferences extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Proofs extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
System::jsonError(404, ['error' => 'Record not found']);
|
System::jsonError(404, ['error' => 'Record not found']);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Object\Api\Mastodon\Notification;
|
||||||
*/
|
*/
|
||||||
class PushSubscription extends BaseApi
|
class PushSubscription extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_PUSH);
|
self::checkAllowedScope(self::SCOPE_PUSH);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -66,7 +66,7 @@ class PushSubscription extends BaseApi
|
||||||
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
|
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_PUSH);
|
self::checkAllowedScope(self::SCOPE_PUSH);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -99,7 +99,7 @@ class PushSubscription extends BaseApi
|
||||||
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
|
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_PUSH);
|
self::checkAllowedScope(self::SCOPE_PUSH);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -112,7 +112,7 @@ class PushSubscription extends BaseApi
|
||||||
System::jsonExit([]);
|
System::jsonExit([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_PUSH);
|
self::checkAllowedScope(self::SCOPE_PUSH);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class ScheduledStatuses extends BaseApi
|
class ScheduledStatuses extends BaseApi
|
||||||
{
|
{
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -42,7 +42,7 @@ class ScheduledStatuses extends BaseApi
|
||||||
DI::apiResponse()->unsupported(Router::PUT);
|
DI::apiResponse()->unsupported(Router::PUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -63,7 +63,7 @@ class ScheduledStatuses extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class Search extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ use Friendica\Util\Images;
|
||||||
*/
|
*/
|
||||||
class Statuses extends BaseApi
|
class Statuses extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -207,7 +207,7 @@ class Statuses extends BaseApi
|
||||||
DI::mstdnError()->InternalError();
|
DI::mstdnError()->InternalError();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
@ -231,7 +231,7 @@ class Statuses extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Bookmark extends BaseApi
|
class Bookmark extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Card extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Context extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Favourite extends BaseApi
|
class Favourite extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class FavouritedBy extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Mute extends BaseApi
|
class Mute extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Pin extends BaseApi
|
class Pin extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Reblog extends BaseApi
|
class Reblog extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class RebloggedBy extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unbookmark extends BaseApi
|
class Unbookmark extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unfavourite extends BaseApi
|
class Unfavourite extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unmute extends BaseApi
|
class Unmute extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unpin extends BaseApi
|
class Unpin extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Unreblog extends BaseApi
|
class Unreblog extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Suggestions extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Direct extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class Home extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class ListTimeline extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class PublicTimeline extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Tag extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Trends extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'limit' => 20, // Maximum number of results to return. Defaults to 10.
|
'limit' => 20, // Maximum number of results to return. Defaults to 10.
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class Unimplemented extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::DELETE);
|
DI::apiResponse()->unsupported(Router::DELETE);
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +41,7 @@ class Unimplemented extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function patch()
|
public function patch()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::PATCH);
|
DI::apiResponse()->unsupported(Router::PATCH);
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +49,7 @@ class Unimplemented extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::POST);
|
DI::apiResponse()->unsupported(Router::POST);
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +57,7 @@ class Unimplemented extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::PUT);
|
DI::apiResponse()->unsupported(Router::PUT);
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ class Unimplemented extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
DI::apiResponse()->unsupported(Router::GET);
|
DI::apiResponse()->unsupported(Router::GET);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use Friendica\Util\DateTimeFormat;
|
||||||
*/
|
*/
|
||||||
class RateLimitStatus extends BaseApi
|
class RateLimitStatus extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
|
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
|
||||||
$hash = [
|
$hash = [
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ abstract class ContactEndpoint extends BaseApi
|
||||||
const DEFAULT_COUNT = 20;
|
const DEFAULT_COUNT = 20;
|
||||||
const MAX_COUNT = 200;
|
const MAX_COUNT = 200;
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class FollowersIds extends ContactEndpoint
|
class FollowersIds extends ContactEndpoint
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// Expected value for user_id parameter: public/user contact id
|
// Expected value for user_id parameter: public/user contact id
|
||||||
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class FollowersList extends ContactEndpoint
|
class FollowersList extends ContactEndpoint
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// Expected value for user_id parameter: public/user contact id
|
// Expected value for user_id parameter: public/user contact id
|
||||||
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class FriendsIds extends ContactEndpoint
|
class FriendsIds extends ContactEndpoint
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// Expected value for user_id parameter: public/user contact id
|
// Expected value for user_id parameter: public/user contact id
|
||||||
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class FriendsList extends ContactEndpoint
|
class FriendsList extends ContactEndpoint
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// Expected value for user_id parameter: public/user contact id
|
// Expected value for user_id parameter: public/user contact id
|
||||||
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
$contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class SavedSearches extends BaseApi
|
class SavedSearches extends BaseApi
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_READ);
|
self::checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\DI;
|
||||||
*/
|
*/
|
||||||
class Apps extends BaseModule
|
class Apps extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$privateaddons = DI::config()->get('config', 'private_addons');
|
$privateaddons = DI::config()->get('config', 'private_addons');
|
||||||
if ($privateaddons === "1" && !local_user()) {
|
if ($privateaddons === "1" && !local_user()) {
|
||||||
|
|
@ -39,7 +39,7 @@ class Apps extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$apps = Nav::getAppMenu();
|
$apps = Nav::getAppMenu();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Attach extends BaseModule
|
||||||
/**
|
/**
|
||||||
* Return to user an attached file given the id
|
* Return to user an attached file given the id
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
if (empty(static::$parameters['item'])) {
|
if (empty(static::$parameters['item'])) {
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ abstract class BaseAdmin extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
self::checkAdminAccess(true);
|
self::checkAdminAccess(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class BaseApi extends BaseModule
|
||||||
*/
|
*/
|
||||||
protected static $request = [];
|
protected static $request = [];
|
||||||
|
|
||||||
public static function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ class BaseApi extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function patch()
|
public function patch()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ class BaseApi extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ class BaseApi extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function put()
|
public function put()
|
||||||
{
|
{
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ abstract class BaseNotifications extends BaseModule
|
||||||
*/
|
*/
|
||||||
abstract public static function getNotifications();
|
abstract public static function getNotifications();
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
@ -94,7 +94,7 @@ abstract class BaseNotifications extends BaseModule
|
||||||
self::$showAll = ($_REQUEST['show'] ?? '') === 'all';
|
self::$showAll = ($_REQUEST['show'] ?? '') === 'all';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
// If the last argument of the query is NOT json, return
|
// If the last argument of the query is NOT json, return
|
||||||
if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') {
|
if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use Friendica\DI;
|
||||||
|
|
||||||
class BaseSettings extends BaseModule
|
class BaseSettings extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
@ -125,5 +125,7 @@ class BaseSettings extends BaseModule
|
||||||
'$class' => 'settings-widget',
|
'$class' => 'settings-widget',
|
||||||
'$items' => $tabs,
|
'$items' => $tabs,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Bookmarklet extends BaseModule
|
class Bookmarklet extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$_GET['mode'] = 'minimal';
|
$_GET['mode'] = 'minimal';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Contact extends BaseModule
|
||||||
DI::baseUrl()->redirect($redirectUrl);
|
DI::baseUrl()->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -226,7 +226,7 @@ class Contact extends BaseModule
|
||||||
Model\Contact\User::setIgnored($contact_id, local_user(), $ignored);
|
Model\Contact\User::setIgnored($contact_id, local_user(), $ignored);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content($update = 0)
|
public function content($update = 0): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return Login::form($_SERVER['REQUEST_URI']);
|
return Login::form($_SERVER['REQUEST_URI']);
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,14 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Advanced extends BaseModule
|
class Advanced extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!Session::isAuthenticated()) {
|
if (!Session::isAuthenticated()) {
|
||||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$cid = static::$parameters['id'];
|
$cid = static::$parameters['id'];
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Advanced extends BaseModule
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$cid = static::$parameters['id'];
|
$cid = static::$parameters['id'];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
|
||||||
|
|
||||||
class Contacts extends BaseModule
|
class Contacts extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$app = DI::app();
|
$app = DI::app();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Hovercard extends BaseModule
|
class Hovercard extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$contact_url = $_REQUEST['url'] ?? '';
|
$contact_url = $_REQUEST['url'] ?? '';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\BadRequestException;
|
||||||
*/
|
*/
|
||||||
class Media extends BaseModule
|
class Media extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$cid = static::$parameters['id'];
|
$cid = static::$parameters['id'];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use Friendica\Util\XML;
|
||||||
|
|
||||||
class Poke extends BaseModule
|
class Poke extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user() || empty(static::$parameters['id'])) {
|
if (!local_user() || empty(static::$parameters['id'])) {
|
||||||
return self::postReturn(false);
|
return self::postReturn(false);
|
||||||
|
|
@ -123,7 +123,7 @@ class Poke extends BaseModule
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
|
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Revoke extends BaseModule
|
||||||
/** @var array */
|
/** @var array */
|
||||||
private static $contact;
|
private static $contact;
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -63,7 +63,7 @@ class Revoke extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException();
|
throw new HTTPException\UnauthorizedException();
|
||||||
|
|
@ -83,7 +83,7 @@ class Revoke extends BaseModule
|
||||||
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
|
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content(): string
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return Login::form($_SERVER['REQUEST_URI']);
|
return Login::form($_SERVER['REQUEST_URI']);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class Community extends BaseModule
|
||||||
protected static $max_id;
|
protected static $max_id;
|
||||||
protected static $item_id;
|
protected static $item_id;
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
self::parseRequest();
|
self::parseRequest();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class Network extends BaseModule
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected static $order;
|
protected static $order;
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return Login::form();
|
return Login::form();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\DI;
|
||||||
*/
|
*/
|
||||||
class Credits extends BaseModule
|
class Credits extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
/* fill the page with credits */
|
/* fill the page with credits */
|
||||||
$credits_string = file_get_contents('CREDITS.txt');
|
$credits_string = file_get_contents('CREDITS.txt');
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Notify extends BaseModule
|
class Notify extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$postdata = Network::postdata();
|
$postdata = Network::postdata();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use Friendica\Protocol\OStatus;
|
||||||
*/
|
*/
|
||||||
class Poll extends BaseModule
|
class Poll extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
header("Content-type: application/atom+xml");
|
header("Content-type: application/atom+xml");
|
||||||
$last_update = $_GET['last_update'] ?? '';
|
$last_update = $_GET['last_update'] ?? '';
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Util\XML;
|
||||||
|
|
||||||
class ActivityPubConversion extends BaseModule
|
class ActivityPubConversion extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
function visible_whitespace($s)
|
function visible_whitespace($s)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Util\XML;
|
||||||
*/
|
*/
|
||||||
class Babel extends BaseModule
|
class Babel extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
function visible_whitespace($s)
|
function visible_whitespace($s)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Protocol;
|
||||||
*/
|
*/
|
||||||
class Feed extends BaseModule
|
class Feed extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
notice(DI::l10n()->t('You must be logged in to use this module'));
|
notice(DI::l10n()->t('You must be logged in to use this module'));
|
||||||
|
|
@ -40,7 +40,7 @@ class Feed extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
if (!empty($_REQUEST['url'])) {
|
if (!empty($_REQUEST['url'])) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class ItemBody extends BaseModule
|
class ItemBody extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
|
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class Localtime extends BaseModule
|
||||||
{
|
{
|
||||||
static $mod_localtime = '';
|
static $mod_localtime = '';
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$time = ($_REQUEST['time'] ?? '') ?: 'now';
|
$time = ($_REQUEST['time'] ?? '') ?: 'now';
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ class Localtime extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$time = ($_REQUEST['time'] ?? '') ?: 'now';
|
$time = ($_REQUEST['time'] ?? '') ?: 'now';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Network\Probe as NetworkProbe;
|
||||||
*/
|
*/
|
||||||
class Probe extends BaseModule
|
class Probe extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Network\Probe;
|
||||||
*/
|
*/
|
||||||
class WebFinger extends BaseModule
|
class WebFinger extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ use Friendica\Util\Proxy;
|
||||||
*/
|
*/
|
||||||
class Delegation extends BaseModule
|
class Delegation extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -112,7 +112,7 @@ class Delegation extends BaseModule
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Fetch extends BaseModule
|
class Fetch extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (empty(static::$parameters['guid'])) {
|
if (empty(static::$parameters['guid'])) {
|
||||||
throw new HTTPException\NotFoundException();
|
throw new HTTPException\NotFoundException();
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ class Receive extends BaseModule
|
||||||
/** @var LoggerInterface */
|
/** @var LoggerInterface */
|
||||||
private static $logger;
|
private static $logger;
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
self::$logger = DI::logger();
|
self::$logger = DI::logger();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$enabled = DI::config()->get('system', 'diaspora_enabled', false);
|
$enabled = DI::config()->get('system', 'diaspora_enabled', false);
|
||||||
if (!$enabled) {
|
if (!$enabled) {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Directory extends BaseModule
|
class Directory extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$app = DI::app();
|
$app = DI::app();
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
class Json extends \Friendica\BaseModule
|
class Json extends \Friendica\BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException();
|
throw new HTTPException\UnauthorizedException();
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ use Friendica\Protocol\Feed as ProtocolFeed;
|
||||||
*/
|
*/
|
||||||
class Feed extends BaseModule
|
class Feed extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Util\XML;
|
||||||
*/
|
*/
|
||||||
class RemoveTag extends BaseModule
|
class RemoveTag extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\ForbiddenException();
|
throw new HTTPException\ForbiddenException();
|
||||||
|
|
@ -62,7 +62,7 @@ class RemoveTag extends BaseModule
|
||||||
if ($item_id && strlen($term)) {
|
if ($item_id && strlen($term)) {
|
||||||
$item = Post::selectFirst(['uri-id'], ['id' => $item_id]);
|
$item = Post::selectFirst(['uri-id'], ['id' => $item_id]);
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
if (!Post\Category::deleteFileByURIId($item['uri-id'], local_user(), $type, $term)) {
|
if (!Post\Category::deleteFileByURIId($item['uri-id'], local_user(), $type, $term)) {
|
||||||
notice(DI::l10n()->t('Item was not removed'));
|
notice(DI::l10n()->t('Item was not removed'));
|
||||||
|
|
@ -74,5 +74,7 @@ class RemoveTag extends BaseModule
|
||||||
if ($type == Post\Category::FILE) {
|
if ($type == Post\Category::FILE) {
|
||||||
DI::baseUrl()->redirect('filed?file=' . rawurlencode($term));
|
DI::baseUrl()->redirect('filed?file=' . rawurlencode($term));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Util\XML;
|
||||||
*/
|
*/
|
||||||
class SaveTag extends BaseModule
|
class SaveTag extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
notice(DI::l10n()->t('You must be logged in to use this module'));
|
notice(DI::l10n()->t('You must be logged in to use this module'));
|
||||||
|
|
@ -42,7 +42,7 @@ class SaveTag extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$logger = DI::logger();
|
$logger = DI::logger();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ use Friendica\Model\Contact;
|
||||||
*/
|
*/
|
||||||
class FollowConfirm extends BaseModule
|
class FollowConfirm extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$uid = local_user();
|
$uid = local_user();
|
||||||
if (!$uid) {
|
if (!$uid) {
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,14 @@ use Friendica\Worker\Delivery;
|
||||||
*/
|
*/
|
||||||
class FriendSuggest extends BaseModule
|
class FriendSuggest extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$cid = intval(static::$parameters['contact']);
|
$cid = intval(static::$parameters['contact']);
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ class FriendSuggest extends BaseModule
|
||||||
info(DI::l10n()->t('Friend suggestion sent.'));
|
info(DI::l10n()->t('Friend suggestion sent.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$cid = intval(static::$parameters['contact']);
|
$cid = intval(static::$parameters['contact']);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Protocol\ActivityPub;
|
||||||
*/
|
*/
|
||||||
class Friendica extends BaseModule
|
class Friendica extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ class Friendica extends BaseModule
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (ActivityPub::isRequest()) {
|
if (ActivityPub::isRequest()) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ require_once 'boot.php';
|
||||||
|
|
||||||
class Group extends BaseModule
|
class Group extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ class Group extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$change = false;
|
$change = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class HCard extends BaseModule
|
class HCard extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') {
|
if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') {
|
||||||
// A logged in user views a profile of a user
|
// A logged in user views a profile of a user
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use Friendica\Network\HTTPException;
|
||||||
|
|
||||||
class MethodNotAllowed extends BaseModule
|
class MethodNotAllowed extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
|
throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use Friendica\Network\HTTPException;
|
||||||
|
|
||||||
class PageNotFound extends BaseModule
|
class PageNotFound extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
|
throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Hashtag extends BaseModule
|
class Hashtag extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
|
@ -47,5 +47,7 @@ class Hashtag extends BaseModule
|
||||||
DBA::close($taglist);
|
DBA::close($taglist);
|
||||||
|
|
||||||
System::jsonExit($result);
|
System::jsonExit($result);
|
||||||
|
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Help extends BaseModule
|
class Help extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
Nav::setSelected('help');
|
Nav::setSelected('help');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\Security\Login;
|
||||||
*/
|
*/
|
||||||
class Home extends BaseModule
|
class Home extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$app = DI::app();
|
$app = DI::app();
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ class Install extends BaseModule
|
||||||
*/
|
*/
|
||||||
private static $installer;
|
private static $installer;
|
||||||
|
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ class Install extends BaseModule
|
||||||
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
|
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
$configCache = $a->getConfigCache();
|
$configCache = $a->getConfigCache();
|
||||||
|
|
@ -177,7 +177,7 @@ class Install extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
$configCache = $a->getConfigCache();
|
$configCache = $a->getConfigCache();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Invite extends BaseModule
|
class Invite extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
@ -124,7 +124,7 @@ class Invite extends BaseModule
|
||||||
info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
|
info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Activity extends BaseModule
|
class Activity extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!Session::isAuthenticated()) {
|
if (!Session::isAuthenticated()) {
|
||||||
throw new HTTPException\ForbiddenException();
|
throw new HTTPException\ForbiddenException();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
class Compose extends BaseModule
|
class Compose extends BaseModule
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!empty($_REQUEST['body'])) {
|
if (!empty($_REQUEST['body'])) {
|
||||||
$_REQUEST['return'] = 'network';
|
$_REQUEST['return'] = 'network';
|
||||||
|
|
@ -51,7 +51,7 @@ class Compose extends BaseModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return Login::form('compose', false);
|
return Login::form('compose', false);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Follow extends BaseModule
|
class Follow extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$l10n = DI::l10n();
|
$l10n = DI::l10n();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Ignore extends BaseModule
|
class Ignore extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$l10n = DI::l10n();
|
$l10n = DI::l10n();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Pin extends BaseModule
|
class Pin extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$l10n = DI::l10n();
|
$l10n = DI::l10n();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class Star extends BaseModule
|
class Star extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$l10n = DI::l10n();
|
$l10n = DI::l10n();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Magic extends BaseModule
|
class Magic extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
$ret = ['success' => false, 'url' => '', 'message' => ''];
|
$ret = ['success' => false, 'url' => '', 'message' => ''];
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Maintenance extends BaseModule
|
class Maintenance extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
$reason = DI::config()->get('system', 'maintenance_reason');
|
$reason = DI::config()->get('system', 'maintenance_reason');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use Friendica\DI;
|
||||||
|
|
||||||
class Manifest extends BaseModule
|
class Manifest extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ use Friendica\Model\User;
|
||||||
*/
|
*/
|
||||||
class NoScrape extends BaseModule
|
class NoScrape extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
|
||||||
*/
|
*/
|
||||||
class NodeInfo110 extends BaseModule
|
class NodeInfo110 extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
|
||||||
*/
|
*/
|
||||||
class NodeInfo120 extends BaseModule
|
class NodeInfo120 extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
|
||||||
*/
|
*/
|
||||||
class NodeInfo210 extends BaseModule
|
class NodeInfo210 extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class Introductions extends BaseNotifications
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
Nav::setSelected('introductions');
|
Nav::setSelected('introductions');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class Notification extends BaseModule
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
|
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
@ -73,7 +73,7 @@ class Notification extends BaseModule
|
||||||
*
|
*
|
||||||
* @throws HTTPException\UnauthorizedException
|
* @throws HTTPException\UnauthorizedException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
|
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
|
||||||
|
|
@ -101,7 +101,7 @@ class Notification extends BaseModule
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function content(): string
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
notice(DI::l10n()->t('You must be logged in to show this page.'));
|
notice(DI::l10n()->t('You must be logged in to show this page.'));
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class Notifications extends BaseNotifications
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
Nav::setSelected('notifications');
|
Nav::setSelected('notifications');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Acknowledge extends BaseApi
|
class Acknowledge extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
DI::session()->set('oauth_acknowledge', true);
|
DI::session()->set('oauth_acknowledge', true);
|
||||||
DI::app()->redirect(DI::session()->get('return_path'));
|
DI::app()->redirect(DI::session()->get('return_path'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
DI::session()->set('return_path', $_REQUEST['return_path'] ?? '');
|
DI::session()->set('return_path', $_REQUEST['return_path'] ?? '');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Authorize extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'force_login' => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
|
'force_login' => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
|
||||||
|
|
@ -97,7 +97,7 @@ class Authorize extends BaseApi
|
||||||
self::$oauth_code = $token['code'];
|
self::$oauth_code = $token['code'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
if (empty(self::$oauth_code)) {
|
if (empty(self::$oauth_code)) {
|
||||||
return '';
|
return '';
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Revoke extends BaseApi
|
class Revoke extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'client_id' => '', // Client ID, obtained during app registration
|
'client_id' => '', // Client ID, obtained during app registration
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ use Friendica\Security\OAuth;
|
||||||
*/
|
*/
|
||||||
class Token extends BaseApi
|
class Token extends BaseApi
|
||||||
{
|
{
|
||||||
public static function post()
|
public function post()
|
||||||
{
|
{
|
||||||
$request = self::getRequest([
|
$request = self::getRequest([
|
||||||
'client_id' => '', // Client ID, obtained during app registration
|
'client_id' => '', // Client ID, obtained during app registration
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Oembed extends BaseModule
|
class Oembed extends BaseModule
|
||||||
{
|
{
|
||||||
public static function content()
|
public function content(): string
|
||||||
{
|
{
|
||||||
// Unused form: /oembed/b2h?url=...
|
// Unused form: /oembed/b2h?url=...
|
||||||
if (DI::args()->getArgv()[1] == 'b2h') {
|
if (DI::args()->getArgv()[1] == 'b2h') {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class OpenSearch extends BaseModule
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
header('Content-type: application/opensearchdescription+xml');
|
header('Content-type: application/opensearchdescription+xml');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
class Owa extends BaseModule
|
class Owa extends BaseModule
|
||||||
{
|
{
|
||||||
public static function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
|
||||||
$ret = [ 'success' => false ];
|
$ret = [ 'success' => false ];
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use Friendica\Util;
|
||||||
|
|
||||||
class ParseUrl extends BaseModule
|
class ParseUrl extends BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
if (!Session::isAuthenticated()) {
|
if (!Session::isAuthenticated()) {
|
||||||
throw new \Friendica\Network\HTTPException\ForbiddenException();
|
throw new \Friendica\Network\HTTPException\ForbiddenException();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use Friendica\Network\HTTPException;
|
||||||
*/
|
*/
|
||||||
class PermissionTooltip extends \Friendica\BaseModule
|
class PermissionTooltip extends \Friendica\BaseModule
|
||||||
{
|
{
|
||||||
public static function rawContent()
|
public function rawContent()
|
||||||
{
|
{
|
||||||
$type = static::$parameters['type'];
|
$type = static::$parameters['type'];
|
||||||
$referenceId = static::$parameters['id'];
|
$referenceId = static::$parameters['id'];
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue