mirror of
https://github.com/friendica/friendica
synced 2025-02-05 02:18:51 +00:00
New function to handle "get" requests
This commit is contained in:
parent
c2eae676bf
commit
8e76d13a96
9 changed files with 25 additions and 9 deletions
|
@ -164,6 +164,19 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module GET method to process submitted data
|
||||||
|
*
|
||||||
|
* Extend this method if the module is supposed to process GET requests.
|
||||||
|
* Doesn't display any content
|
||||||
|
*
|
||||||
|
* @param string[] $request The $_REQUEST content
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function get(array $request = [])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -221,6 +234,9 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
case Router::PUT:
|
case Router::PUT:
|
||||||
$this->put($request);
|
$this->put($request);
|
||||||
return $this->response->generate();
|
return $this->response->generate();
|
||||||
|
case Router::GET:
|
||||||
|
$this->get($request);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$timestamp = microtime(true);
|
$timestamp = microtime(true);
|
||||||
|
|
|
@ -99,7 +99,7 @@ class Lists extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Accounts extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Markers extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -116,7 +116,7 @@ class Media extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -133,7 +133,7 @@ class PushSubscription extends BaseApi
|
||||||
$this->response->addJsonContent([]);
|
$this->response->addJsonContent([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rawContent(array $request = []): void
|
protected function get(array $request = []): void
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_PUSH);
|
$this->checkAllowedScope(self::SCOPE_PUSH);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -48,7 +48,7 @@ class ScheduledStatuses extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
|
@ -350,7 +350,7 @@ class Statuses extends BaseApi
|
||||||
/**
|
/**
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ use Friendica\Module\BaseApi;
|
||||||
*/
|
*/
|
||||||
class Inbox extends DirectMessagesEndpoint
|
class Inbox extends DirectMessagesEndpoint
|
||||||
{
|
{
|
||||||
protected function rawContent(array $request = [])
|
protected function get(array $request = [])
|
||||||
{
|
{
|
||||||
$this->checkAllowedScope(BaseApi::SCOPE_READ);
|
$this->checkAllowedScope(BaseApi::SCOPE_READ);
|
||||||
$uid = BaseApi::getCurrentUserID();
|
$uid = BaseApi::getCurrentUserID();
|
||||||
|
|
Loading…
Add table
Reference in a new issue