Browse Source

Added parameters

pull/7819/head
Michael 2 years ago
parent
commit
bd62d548db
  1. 2
      src/App/Page.php
  2. 13
      src/BaseModule.php
  3. 20
      src/LegacyModule.php
  4. 2
      src/Module/Acctlink.php
  5. 8
      src/Module/Admin/Addons/Details.php
  6. 4
      src/Module/Admin/Addons/Index.php
  7. 8
      src/Module/Admin/Blocklist/Contact.php
  8. 8
      src/Module/Admin/Blocklist/Server.php
  9. 4
      src/Module/Admin/DBSync.php
  10. 8
      src/Module/Admin/Features.php
  11. 4
      src/Module/Admin/Federation.php
  12. 8
      src/Module/Admin/Item/Delete.php
  13. 4
      src/Module/Admin/Item/Source.php
  14. 8
      src/Module/Admin/Logs/Settings.php
  15. 4
      src/Module/Admin/Logs/View.php
  16. 4
      src/Module/Admin/Queue.php
  17. 8
      src/Module/Admin/Site.php
  18. 4
      src/Module/Admin/Summary.php
  19. 8
      src/Module/Admin/Themes/Details.php
  20. 10
      src/Module/Admin/Themes/Embed.php
  21. 4
      src/Module/Admin/Themes/Index.php
  22. 8
      src/Module/Admin/Tos.php
  23. 8
      src/Module/Admin/Users.php
  24. 2
      src/Module/AllFriends.php
  25. 4
      src/Module/Apps.php
  26. 4
      src/Module/BaseAdminModule.php
  27. 2
      src/Module/BaseSettingsModule.php
  28. 2
      src/Module/Bookmarklet.php
  29. 2
      src/Module/Contact.php
  30. 2
      src/Module/Credits.php
  31. 2
      src/Module/Debug/Babel.php
  32. 4
      src/Module/Debug/Feed.php
  33. 2
      src/Module/Debug/ItemBody.php
  34. 4
      src/Module/Debug/Localtime.php
  35. 2
      src/Module/Debug/Probe.php
  36. 2
      src/Module/Debug/WebFinger.php
  37. 4
      src/Module/Delegation.php
  38. 4
      src/Module/Diaspora/Receive.php
  39. 2
      src/Module/Directory.php
  40. 2
      src/Module/Feed.php
  41. 2
      src/Module/Filer/RemoveTag.php
  42. 2
      src/Module/Filer/SaveTag.php
  43. 2
      src/Module/FollowConfirm.php
  44. 2
      src/Module/Friendica.php
  45. 4
      src/Module/Group.php
  46. 2
      src/Module/HTTPException/MethodNotAllowed.php
  47. 2
      src/Module/HTTPException/PageNotFound.php
  48. 2
      src/Module/Hashtag.php
  49. 2
      src/Module/Help.php
  50. 2
      src/Module/Home.php
  51. 6
      src/Module/Install.php
  52. 4
      src/Module/Invite.php
  53. 4
      src/Module/Item/Compose.php
  54. 4
      src/Module/Login.php
  55. 2
      src/Module/Logout.php
  56. 2
      src/Module/Magic.php
  57. 2
      src/Module/Maintenance.php
  58. 2
      src/Module/NodeInfo.php
  59. 4
      src/Module/Notifications/Notify.php
  60. 2
      src/Module/Oembed.php
  61. 2
      src/Module/Owa.php
  62. 2
      src/Module/Photo.php
  63. 2
      src/Module/Profile.php
  64. 2
      src/Module/Profile/Contacts.php
  65. 2
      src/Module/Proxy.php
  66. 2
      src/Module/RandomProfile.php
  67. 4
      src/Module/Register.php
  68. 2
      src/Module/Search/Directory.php
  69. 2
      src/Module/Search/Index.php
  70. 2
      src/Module/Search/Saved.php
  71. 6
      src/Module/Settings/Delegation.php
  72. 8
      src/Module/Settings/TwoFactor/AppSpecific.php
  73. 6
      src/Module/Settings/TwoFactor/Index.php
  74. 8
      src/Module/Settings/TwoFactor/Recovery.php
  75. 8
      src/Module/Settings/TwoFactor/Verify.php
  76. 4
      src/Module/Settings/UserExport.php
  77. 2
      src/Module/Smilies.php
  78. 6
      src/Module/Starred.php
  79. 2
      src/Module/Statistics.php
  80. 2
      src/Module/ToggleMobile.php
  81. 4
      src/Module/Tos.php
  82. 6
      src/Module/TwoFactor/Recovery.php
  83. 4
      src/Module/TwoFactor/Verify.php
  84. 2
      src/Module/Welcome.php

2
src/App/Page.php

@ -308,7 +308,7 @@ class Page implements ArrayAccess
$arr = ['content' => $content];
Hook::callAll($moduleClass . '_mod_content', $arr);
$content = $arr['content'];
$arr = ['content' => call_user_func([$moduleClass, 'content'])];
$arr = ['content' => call_user_func([$moduleClass, 'content'], [])];
Hook::callAll($moduleClass . '_mod_aftercontent', $arr);
$content .= $arr['content'];
} catch (HTTPException $e) {

13
src/BaseModule.php

@ -22,7 +22,7 @@ abstract class BaseModule extends BaseObject
* Extend this method if you need to do any shared processing before both
* content() or post()
*/
public static function init()
public static function init($parameters)
{
}
@ -34,8 +34,6 @@ abstract class BaseModule extends BaseObject
*/
public static function rawContent($parameters)
{
// echo '';
// exit;
}
/**
@ -47,7 +45,7 @@ abstract class BaseModule extends BaseObject
*
* @return string
*/
public static function content()
public static function content($parameters)
{
$o = '';
@ -60,10 +58,8 @@ abstract class BaseModule extends BaseObject
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
public static function post()
public static function post($parameters)
{
// $a = self::getApp();
// $a->internalRedirect('module');
}
/**
@ -71,9 +67,8 @@ abstract class BaseModule extends BaseObject
*
* Unknown purpose
*/
public static function afterpost()
public static function afterpost($parameters)
{
}
/*

20
src/LegacyModule.php

@ -35,24 +35,24 @@ class LegacyModule extends BaseModule
require_once $file_path;
}
public static function init()
public static function init($parameters)
{
self::runModuleFunction('init');
self::runModuleFunction('init', $parameters);
}
public static function content()
public static function content($parameters)
{
return self::runModuleFunction('content');
return self::runModuleFunction('content', $parameters);
}
public static function post()
public static function post($parameters)
{
self::runModuleFunction('post');
self::runModuleFunction('post', $parameters);
}
public static function afterpost()
public static function afterpost($parameters)
{
self::runModuleFunction('afterpost');
self::runModuleFunction('afterpost', $parameters);
}
/**
@ -62,7 +62,7 @@ class LegacyModule extends BaseModule
* @return string
* @throws \Exception
*/
private static function runModuleFunction($function_suffix)
private static function runModuleFunction($function_suffix, $parameters)
{
$function_name = static::$moduleName . '_' . $function_suffix;
@ -70,7 +70,7 @@ class LegacyModule extends BaseModule
$a = self::getApp();
return $function_name($a);
} else {
return parent::{$function_suffix}();
return parent::{$function_suffix}($parameters);
}
}
}

2
src/Module/Acctlink.php

@ -11,7 +11,7 @@ use Friendica\Core\System;
*/
class Acctlink extends BaseModule
{
public static function content()
public static function content($parameters)
{
$addr = trim($_GET['addr'] ?? '');

8
src/Module/Admin/Addons/Details.php

@ -11,9 +11,9 @@ use Friendica\Util\Strings;
class Details extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
$a = self::getApp();
@ -35,9 +35,9 @@ class Details extends BaseAdminModule
$a->internalRedirect('admin/addons');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

4
src/Module/Admin/Addons/Index.php

@ -9,9 +9,9 @@ use Friendica\Module\BaseAdminModule;
class Index extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Blocklist/Contact.php

@ -11,9 +11,9 @@ use Friendica\Model;
class Contact extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
$contact_url = $_POST['contact_url'] ?? '';
$block_reason = $_POST['contact_block_reason'] ?? '';
@ -41,9 +41,9 @@ class Contact extends BaseAdminModule
self::getApp()->internalRedirect('admin/blocklist/contact');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Blocklist/Server.php

@ -10,9 +10,9 @@ use Friendica\Util\Strings;
class Server extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
if (empty($_POST['page_blocklist_save']) && empty($_POST['page_blocklist_edit'])) {
return;
@ -50,9 +50,9 @@ class Server extends BaseAdminModule
self::getApp()->internalRedirect('admin/blocklist/server');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

4
src/Module/Admin/DBSync.php

@ -12,9 +12,9 @@ use Friendica\Module\BaseAdminModule;
class DBSync extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Features.php

@ -10,9 +10,9 @@ use Friendica\Module\BaseAdminModule;
class Features extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
parent::checkFormSecurityTokenRedirectOnError('/admin/features', 'admin_manage_features');
@ -42,9 +42,9 @@ class Features extends BaseAdminModule
self::getApp()->internalRedirect('admin/features');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$arr = [];
$features = Feature::get(false);

4
src/Module/Admin/Federation.php

@ -10,9 +10,9 @@ use Friendica\Module\BaseAdminModule;
class Federation extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
// social and statusnet nodes this node is knowing

8
src/Module/Admin/Item/Delete.php

@ -10,9 +10,9 @@ use Friendica\Util\Strings;
class Delete extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
if (empty($_POST['page_deleteitem_submit'])) {
return;
@ -36,9 +36,9 @@ class Delete extends BaseAdminModule
self::getApp()->internalRedirect('admin/item/delete');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/item/delete.tpl');

4
src/Module/Admin/Item/Source.php

@ -13,9 +13,9 @@ use Friendica\Module\BaseAdminModule;
class Source extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Logs/Settings.php

@ -11,9 +11,9 @@ use Psr\Log\LogLevel;
class Settings extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
if (!empty($_POST['page_logs'])) {
parent::checkFormSecurityTokenRedirectOnError('/admin/logs', 'admin_logs');
@ -37,9 +37,9 @@ class Settings extends BaseAdminModule
self::getApp()->internalRedirect('admin/logs');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

4
src/Module/Admin/Logs/View.php

@ -10,9 +10,9 @@ use Friendica\Util\Strings;
class View extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/logs/view.tpl');
$f = Config::get('system', 'logfile');

4
src/Module/Admin/Queue.php

@ -19,9 +19,9 @@ use Friendica\Util\DateTimeFormat;
*/
class Queue extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Site.php

@ -21,9 +21,9 @@ require_once __DIR__ . '/../../../boot.php';
class Site extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
self::checkFormSecurityTokenRedirectOnError('/admin/site', 'admin_site');
@ -412,9 +412,9 @@ class Site extends BaseAdminModule
$a->internalRedirect('admin/site' . $active_panel);
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

4
src/Module/Admin/Summary.php

@ -20,9 +20,9 @@ use Friendica\Util\Network;
class Summary extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Themes/Details.php

@ -11,9 +11,9 @@ use Friendica\Util\Strings;
class Details extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
$a = self::getApp();
@ -39,9 +39,9 @@ class Details extends BaseAdminModule
}
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

10
src/Module/Admin/Themes/Embed.php

@ -9,7 +9,7 @@ use Friendica\Util\Strings;
class Embed extends BaseAdminModule
{
public static function init()
public static function init($parameters)
{
$a = self::getApp();
@ -23,9 +23,9 @@ class Embed extends BaseAdminModule
}
}
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
$a = self::getApp();
@ -53,9 +53,9 @@ class Embed extends BaseAdminModule
}
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

4
src/Module/Admin/Themes/Index.php

@ -11,9 +11,9 @@ use Friendica\Util\Strings;
class Index extends BaseAdminModule
{
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

8
src/Module/Admin/Tos.php

@ -9,9 +9,9 @@ use Friendica\Module\BaseAdminModule;
class Tos extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
parent::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos');
@ -32,9 +32,9 @@ class Tos extends BaseAdminModule
self::getApp()->internalRedirect('admin/tos');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$tos = new \Friendica\Module\Tos();
$t = Renderer::getMarkupTemplate('admin/tos.tpl');

8
src/Module/Admin/Users.php

@ -15,9 +15,9 @@ use Friendica\Util\Temporal;
class Users extends BaseAdminModule
{
public static function post()
public static function post($parameters)
{
parent::post();
parent::post($parameters);
$a = self::getApp();
@ -131,9 +131,9 @@ class Users extends BaseAdminModule
$a->internalRedirect('admin/users');
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
$a = self::getApp();

2
src/Module/AllFriends.php

@ -16,7 +16,7 @@ use Friendica\Util\Proxy as ProxyUtils;
*/
class AllFriends extends BaseModule
{
public static function content()
public static function content($parameters)
{
$app = self::getApp();

4
src/Module/Apps.php

@ -13,7 +13,7 @@ use Friendica\Core\Renderer;
*/
class Apps extends BaseModule
{
public static function init()
public static function init($parameters)
{
$privateaddons = Config::get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) {
@ -21,7 +21,7 @@ class Apps extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
$apps = Nav::getAppMenu();

4
src/Module/BaseAdminModule.php

@ -23,7 +23,7 @@ require_once 'boot.php';
*/
abstract class BaseAdminModule extends BaseModule
{
public static function post()
public static function post($parameters)
{
if (!is_site_admin()) {
return;
@ -48,7 +48,7 @@ abstract class BaseAdminModule extends BaseModule
return '';
}
public static function content()
public static function content($parameters)
{
$a = self::getApp();

2
src/Module/BaseSettingsModule.php

@ -9,7 +9,7 @@ use Friendica\Core\Renderer;
class BaseSettingsModule extends BaseModule
{
public static function content()
public static function content($parameters)
{
$a = self::getApp();

2
src/Module/Bookmarklet.php

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Bookmarklet extends BaseModule
{
public static function content()
public static function content($parameters)
{
$_GET['mode'] = 'minimal';

2
src/Module/Contact.php

@ -75,7 +75,7 @@ class Contact extends BaseModule
$a->internalRedirect('contact');
}
public static function post()
public static function post($parameters)
{
$a = self::getApp();

2
src/Module/Credits.php

@ -13,7 +13,7 @@ use Friendica\Core\Renderer;
*/
class Credits extends BaseModule
{
public static function content()
public static function content($parameters)
{
/* fill the page with credits */
$credits_string = file_get_contents('CREDITS.txt');

2
src/Module/Debug/Babel.php

@ -14,7 +14,7 @@ use Friendica\Util\XML;
*/
class Babel extends BaseModule
{
public static function content()
public static function content($parameters)
{
function visible_whitespace($s)
{

4
src/Module/Debug/Feed.php

@ -14,7 +14,7 @@ use Friendica\Util\Network;
*/
class Feed extends BaseModule
{
public static function init()
public static function init($parameters)
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));
@ -22,7 +22,7 @@ class Feed extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
$result = [];
if (!empty($_REQUEST['url'])) {

2
src/Module/Debug/ItemBody.php

@ -12,7 +12,7 @@ use Friendica\Network\HTTPException;
*/
class ItemBody extends BaseModule
{
public static function content()
public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));

4
src/Module/Debug/Localtime.php

@ -10,7 +10,7 @@ use Friendica\Util\Temporal;
class Localtime extends BaseModule
{
public static function post()
public static function post($parameters)
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
@ -21,7 +21,7 @@ class Localtime extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
$app = self::getApp();

2
src/Module/Debug/Probe.php

@ -13,7 +13,7 @@ use Friendica\Network\Probe as NetworkProbe;
*/
class Probe extends BaseModule
{
public static function content()
public static function content($parameters)
{
if (!local_user()) {
$e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));

2
src/Module/Debug/WebFinger.php

@ -12,7 +12,7 @@ use Friendica\Network\Probe;
*/
class WebFinger extends BaseModule
{
public static function content()
public static function content($parameters)
{
if (!local_user()) {
$e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));

4
src/Module/Delegation.php

@ -17,7 +17,7 @@ use Friendica\Network\HTTPException\ForbiddenException;
*/
class Delegation extends BaseModule
{
public static function post()
public static function post($parameters)
{
if (!local_user()) {
return;
@ -92,7 +92,7 @@ class Delegation extends BaseModule
// NOTREACHED
}
public static function content()
public static function content($parameters)
{
if (!local_user()) {
throw new ForbiddenException(L10n::t('Permission denied.'));

4
src/Module/Diaspora/Receive.php

@ -21,13 +21,13 @@ class Receive extends BaseModule
/** @var LoggerInterface */
private static $logger;
public static function init()
public static function init($parameters)
{
/** @var LoggerInterface $logger */
self::$logger = self::getClass(LoggerInterface::class);
}
public static function post()
public static function post($parameters)
{
/** @var Configuration $config */
$config = self::getClass(Configuration::class);

2
src/Module/Directory.php

@ -21,7 +21,7 @@ use Friendica\Util\Strings;
*/
class Directory extends BaseModule
{
public static function content()
public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();

2
src/Module/Feed.php

@ -23,7 +23,7 @@ use Friendica\Protocol\OStatus;
*/
class Feed extends BaseModule
{
public static function content()
public static function content($parameters)
{
$a = self::getApp();

2
src/Module/Filer/RemoveTag.php

@ -12,7 +12,7 @@ use Friendica\Util\XML;
*/
class RemoveTag extends BaseModule
{
public static function content()
public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException();

2
src/Module/Filer/SaveTag.php

@ -14,7 +14,7 @@ use Friendica\Util\XML;
*/
class SaveTag extends BaseModule
{
public static function init()
public static function init($parameters)
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));

2
src/Module/FollowConfirm.php

@ -18,7 +18,7 @@ use Friendica\Util\DateTimeFormat;
*/
class FollowConfirm extends BaseModule
{
public static function post()
public static function post($parameters)
{
$a = self::getApp();

2
src/Module/Friendica.php

@ -15,7 +15,7 @@ use Friendica\Model\User;
*/
class Friendica extends BaseModule
{
public static function content()
public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();

4
src/Module/Group.php

@ -19,7 +19,7 @@ require_once 'boot.php';
class Group extends BaseModule
{
public static function post()
public static function post($parameters)
{
$a = self::getApp();
@ -132,7 +132,7 @@ class Group extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
$change = false;

2
src/Module/HTTPException/MethodNotAllowed.php

@ -8,7 +8,7 @@ use Friendica\Network\HTTPException;
class MethodNotAllowed extends BaseModule
{
public static function content()
public static function content($parameters)
{
throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.'));
}

2
src/Module/HTTPException/PageNotFound.php

@ -8,7 +8,7 @@ use Friendica\Network\HTTPException;
class PageNotFound extends BaseModule
{
public static function content()
public static function content($parameters)
{
throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
}

2
src/Module/Hashtag.php

@ -15,7 +15,7 @@ use Friendica\Util\Strings;
class Hashtag extends BaseModule
{
public static function content()
public static function content($parameters)
{
$result = [];

2
src/Module/Help.php

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Help extends BaseModule
{
public static function content()
public static function content($parameters)
{
Nav::setSelected('help');

2
src/Module/Home.php

@ -12,7 +12,7 @@ use Friendica\Core\Renderer;
*/
class Home extends BaseModule
{
public static function content()
public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();

6
src/Module/Install.php

@ -46,7 +46,7 @@ class Install extends BaseModule
*/
private static $installer;
public static function init()
public static function init($parameters)
{
$a = self::getApp();
@ -76,7 +76,7 @@ class Install extends BaseModule
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
}
public static function post()
public static function post($parameters)
{
$a = self::getApp();
$configCache = $a->getConfigCache();
@ -149,7 +149,7 @@ class Install extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
$a = self::getApp();
$configCache = $a->getConfigCache();

4
src/Module/Invite.php

@ -16,7 +16,7 @@ use Friendica\Util\Strings;
*/
class Invite extends BaseModule
{
public static function post()
public static function post($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
@ -104,7 +104,7 @@ class Invite extends BaseModule
notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL);
}
public static function content()
public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));

4
src/Module/Item/Compose.php

@ -21,7 +21,7 @@ use Friendica\Util\Crypto;
class Compose extends BaseModule
{
public static function post()
public static function post($parameters)
{
if (!empty($_REQUEST['body'])) {
$_REQUEST['return'] = 'network';
@ -32,7 +32,7 @@ class Compose extends BaseModule
}
}
public static function content()
public static function content($parameters)
{
if (!local_user()) {
return Login::form('compose', false);

4
src/Module/Login.php

@ -30,7 +30,7 @@ use LightOpenID;
*/
class Login extends BaseModule
{
public static function content()
public static function content($parameters)
{
$a = self::getApp();
@ -41,7 +41,7 @@ class Login extends BaseModule
return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
}
public static function post()
public static function post($parameters)
{
$openid_identity = Session::get('openid_identity');
$openid_server = Session::get('openid_server');

2
src/Module/Logout.php

@ -23,7 +23,7 @@ class Logout extends BaseModule
/**
* @brief Process logout requests
*/
public static function init()
public static function init($parameters)
{
$visitor_home = null;
if (remote_user()) {

2
src/Module/Magic.php

@ -20,7 +20,7 @@ use Friendica\Util\Strings;
*/
class Magic extends BaseModule
{
public static function init()
public static function init($parameters)
{
$a = self::getApp();
$ret = ['success' => false, 'url' => '', 'message' => ''];

2
src/Module/Maintenance.php

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Maintenance extends BaseModule
{
public static function content()
public static function content($parameters)
{
$config = self::getApp()->getConfig();

2
src/Module/NodeInfo.php

@ -13,7 +13,7 @@ use Friendica\Core\System;
*/
class NodeInfo extends BaseModule
{
public static function init()
public static function init($parameters)
{
$config = self::getApp()->getConfig();

4
src/Module/Notifications/Notify.php

@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
*/
class Notify extends BaseModule
{
public static function init()
public static function init($parameters)
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.'));
@ -45,7 +45,7 @@ class Notify extends BaseModule
* @return string|void
* @throws HTTPException\InternalServerErrorException
*/
public static function content()
public static function content($parameters)
{
$a = self::getApp();

2
src/Module/Oembed.php

@ -17,7 +17,7 @@ use Friendica\Util\Strings;
*/
class Oembed extends BaseModule
{
public static function content()
public static function content($parameters)
{
$a = self::getApp();

2
src/Module/Owa.php

@ -27,7 +27,7 @@ use Friendica\Util\Strings;
*/
class Owa extends BaseModule
{
public static function init()
public static function init($parameters)
{
$ret = [ 'success' => false ];

2
src/Module/Photo.php

@ -23,7 +23,7 @@ class Photo extends BaseModule
* Fetch a photo or an avatar, in optional size, check for permissions and
* return the image
*/
public static function init()
public static function init($parameters)
{
$a = self::getApp();
// @TODO: Replace with parameter from router

2
src/Module/Profile.php

@ -33,7 +33,7 @@ class Profile extends BaseModule
public static $which = '';
public static $profile = 0;
public static function init()
public static function init($parameters)
{
$a = self::getApp();

2
src/Module/Profile/Contacts.php

@ -18,7 +18,7 @@ use Friendica\Util\Proxy as ProxyUtils;
class Contacts extends BaseModule
{
public static function content()
public static function content($parameters)
{
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.'));

2
src/Module/Proxy.php

@ -30,7 +30,7 @@ class Proxy extends BaseModule
* Sets application instance and checks if /proxy/ path is writable.
*
*/
public static function init()
public static function init($parameters)
{
// Set application instance here
$a = self::getApp();

2
src/Module/RandomProfile.php

@ -11,7 +11,7 @@ use Friendica\Model\GContact;
*/
class RandomProfile extends BaseModule
{
public static function content()
public static function content($parameters)
{
$a = self::getApp();

4
src/Module/Register.php

@ -35,7 +35,7 @@ class Register extends BaseModule
*
* @return string
*/
public static function content()
public static function content($parameters)
{
// logged in users can register others (people/pages/groups)
// even with closed registrations, unless specifically prohibited by site policy.
@ -152,7 +152,7 @@ class Register extends BaseModule
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
public static function post()
public static function post($parameters)
{
BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');

2
src/Module/Search/Directory.php

@ -13,7 +13,7 @@ use Friendica\Util\Strings;
*/
class Directory extends BaseSearchModule
{
public static function content()
public static function content($parameters)
{
if (!local_user()) {
notice(L10n::t('Permission denied.'));

2
src/Module/Search/Index.php

@ -23,7 +23,7 @@ use Friendica\Util\Strings;
class Index extends BaseSearchModule
{
public static function content()
public static function content($parameters)
{
$search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : '');

2
src/Module/Search/Saved.php

@ -10,7 +10,7 @@ use Friendica\Util\Strings;
class Saved extends BaseModule
{
public static function init()
public static function init($parameters)
{
/** @var Arguments $args */
$args = self::getClass(Arguments::class);

6
src/Module/Settings/Delegation.php

@ -20,7 +20,7 @@ use Friendica\Util\Strings;
*/
class Delegation extends BaseSettingsModule
{
public static function post()
public static function post($parameters)
{
if (!local_user() || !empty(self::getApp()->user['uid']) && self::getApp()->user['uid'] != local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
@ -46,9 +46,9 @@ class Delegation extends BaseSettingsModule
DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
}
public static function content()
public static function content($parameters)
{
parent::content();
parent::content($parameters);
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));

8
src/Module/Settings/TwoFactor/AppSpecific.php

@ -20,7 +20,7 @@ class AppSpecific extends BaseSettingsModule
{
private static $appSpecificPassword = null;
public static function init()
public static function init($parameters)
{
if (!local_user()) {
return;
@ -38,7 +38,7 @@ class AppSpecific extends BaseSettingsModule
}
}
public static function post()
public static function post($parameters)
{
if (!local_user()) {
return;
@ -81,13 +81,13 @@ class AppSpecific extends BaseSettingsModule
}
}
public static function content()
public static function content($parameters)
{
if (!local_user()) {
return Login::form('settings/2fa/app_specific');
}
parent::content();
parent::content($parameters);
$appSpecificPasswords = AppSpecificPassword::getListForUser(local_user());

6
src/Module/Settings/TwoFactor/Index.php

@ -17,7 +17,7 @@ use PragmaRX\Google2FA\Google2FA;