Revert "Replace Module::init() with Constructors"

This commit is contained in:
Hypolite Petovan 2021-11-19 07:23:23 -05:00 committed by GitHub
commit 89d6c89b67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 921 additions and 1225 deletions

View file

@ -40,7 +40,7 @@ use Friendica\Protocol\DFRN;
function display_init(App $a) function display_init(App $a)
{ {
if (ActivityPub::isRequest()) { if (ActivityPub::isRequest()) {
(new Objects(DI::l10n(), ['guid' => DI::args()->getArgv()[1] ?? null]))->rawContent(); (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()) {

View file

@ -81,7 +81,7 @@ class ModuleController
private $moduleName; private $moduleName;
/** /**
* @var ?ICanHandleRequests The module object * @var ICanHandleRequests The module object
*/ */
private $module; private $module;
@ -104,9 +104,9 @@ class ModuleController
} }
/** /**
* @return ?ICanHandleRequests The base module object * @return ICanHandleRequests The base module object
*/ */
public function getModule(): ?ICanHandleRequests public function getModule(): ICanHandleRequests
{ {
return $this->module; return $this->module;
} }
@ -120,10 +120,12 @@ class ModuleController
return $this->isBackend; return $this->isBackend;
} }
public function __construct(string $moduleName = self::DEFAULT, ?ICanHandleRequests $module = null, bool $isBackend = false, bool $printNotAllowedAddon = false) public function __construct(string $moduleName = self::DEFAULT, ICanHandleRequests $module = null, bool $isBackend = false, bool $printNotAllowedAddon = false)
{ {
$defaultClass = static::DEFAULT_CLASS;
$this->moduleName = $moduleName; $this->moduleName = $moduleName;
$this->module = $module; $this->module = $module ?? new $defaultClass();
$this->isBackend = $isBackend; $this->isBackend = $isBackend;
$this->printNotAllowedAddon = $printNotAllowedAddon; $this->printNotAllowedAddon = $printNotAllowedAddon;
} }
@ -295,6 +297,8 @@ class ModuleController
Core\Hook::callAll($this->moduleName . '_mod_init', $placeholder); Core\Hook::callAll($this->moduleName . '_mod_init', $placeholder);
$this->module->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) {

View file

@ -22,7 +22,6 @@
namespace Friendica; namespace Friendica;
use Friendica\Capabilities\ICanHandleRequests; use Friendica\Capabilities\ICanHandleRequests;
use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Model\User; use Friendica\Model\User;
@ -40,33 +39,16 @@ abstract class BaseModule implements ICanHandleRequests
/** @var array */ /** @var array */
protected $parameters = []; protected $parameters = [];
/** @var L10n */ public function __construct(array $parameters = [])
protected $l10n;
public function __construct(L10n $l10n, array $parameters = [])
{ {
$this->parameters = $parameters; $this->parameters = $parameters;
$this->l10n = $l10n;
} }
/** /**
* Wraps the L10n::t() function for Modules * {@inheritDoc}
*
* @see L10n::t()
*/ */
protected function t(string $s, ...$args): string public function init()
{ {
return $this->l10n->t($s, $args);
}
/**
* Wraps the L10n::tt() function for Modules
*
* @see L10n::tt()
*/
protected function tt(string $singular, string $plurarl, int $count): string
{
return $this->l10n->tt($singular, $plurarl, $count);
} }
/** /**

View file

@ -7,6 +7,14 @@ namespace Friendica\Capabilities;
*/ */
interface ICanHandleRequests interface ICanHandleRequests
{ {
/**
* Initialization method common to both content() and post()
*
* Extend this method if you need to do any shared processing before either
* content() or post()
*/
public function init();
/** /**
* Module GET method to display raw content from technical endpoints * Module GET method to display raw content from technical endpoints
* *

View file

@ -21,8 +21,6 @@
namespace Friendica; namespace Friendica;
use Friendica\Core\L10n;
/** /**
* This mock module enable class encapsulation of legacy global function modules. * This mock module enable class encapsulation of legacy global function modules.
* After having provided the module file name, all the methods will behave like a normal Module class. * After having provided the module file name, all the methods will behave like a normal Module class.
@ -39,13 +37,11 @@ class LegacyModule extends BaseModule
*/ */
private $moduleName = ''; private $moduleName = '';
public function __construct(L10n $l10n, string $file_path = '', array $parameters = []) public function __construct(string $file_path = '', array $parameters = [])
{ {
parent::__construct($l10n, $parameters); parent::__construct($parameters);
$this->setModuleFile($file_path); $this->setModuleFile($file_path);
$this->runModuleFunction('init');
} }
/** /**
@ -65,6 +61,11 @@ class LegacyModule extends BaseModule
require_once $file_path; require_once $file_path;
} }
public function init()
{
$this->runModuleFunction('init');
}
public function content(): string public function content(): string
{ {
return $this->runModuleFunction('content'); return $this->runModuleFunction('content');

View file

@ -21,32 +21,18 @@
namespace Friendica\Module\Admin\Themes; namespace Friendica\Module\Admin\Themes;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\BaseAdmin; use Friendica\Module\BaseAdmin;
use Friendica\Util\Strings; use Friendica\Util\Strings;
class Embed extends BaseAdmin class Embed extends BaseAdmin
{ {
/** @var App */ public function init()
protected $app;
/** @var App\BaseURL */
protected $baseUrl;
/** @var App\Mode */
protected $mode;
public function __construct(App $app, App\BaseURL $baseUrl, App\Mode $mode, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->app = $app;
$this->baseUrl = $baseUrl;
$this->mode = $mode;
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']); $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (is_file("view/theme/$theme/config.php")) { if (is_file("view/theme/$theme/config.php")) {
$this->app->setCurrentTheme($theme); DI::app()->setCurrentTheme($theme);
} }
} }
@ -59,15 +45,15 @@ class Embed extends BaseAdmin
require_once "view/theme/$theme/config.php"; require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin_post')) { if (function_exists('theme_admin_post')) {
self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings'); self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings');
theme_admin_post($this->app); theme_admin_post(DI::app());
} }
} }
if ($this->mode->isAjax()) { if (DI::mode()->isAjax()) {
return; return;
} }
$this->baseUrl->redirect('admin/themes/' . $theme . '/embed?mode=minimal'); DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
} }
public function content(): string public function content(): string
@ -76,7 +62,7 @@ class Embed extends BaseAdmin
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']); $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (!is_dir("view/theme/$theme")) { if (!is_dir("view/theme/$theme")) {
notice($this->t('Unknown theme.')); notice(DI::l10n()->t('Unknown theme.'));
return ''; return '';
} }
@ -85,7 +71,7 @@ class Embed extends BaseAdmin
require_once "view/theme/$theme/config.php"; require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin')) { if (function_exists('theme_admin')) {
$admin_form = theme_admin($this->app); $admin_form = theme_admin(DI::app());
} }
} }

View file

@ -21,30 +21,12 @@
namespace Friendica\Module\Admin; namespace Friendica\Module\Admin;
use Friendica\App\BaseURL;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\BaseAdmin; use Friendica\Module\BaseAdmin;
class Tos extends BaseAdmin class Tos extends BaseAdmin
{ {
/** @var \Friendica\Module\Tos */
protected $tos;
/** @var IManageConfigValues */
protected $config;
/** @var BaseURL */
protected $baseUrl;
public function __construct(\Friendica\Module\Tos $tos, IManageConfigValues $config, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{
parent::__construct($l10n, $parameters);
$this->tos = $tos;
$this->config = $config;
$this->baseUrl = $baseUrl;
}
public function post() public function post()
{ {
self::checkAdminAccess(); self::checkAdminAccess();
@ -59,28 +41,29 @@ class Tos extends BaseAdmin
$displayprivstatement = !empty($_POST['displayprivstatement']); $displayprivstatement = !empty($_POST['displayprivstatement']);
$tostext = (!empty($_POST['tostext']) ? strip_tags(trim($_POST['tostext'])) : ''); $tostext = (!empty($_POST['tostext']) ? strip_tags(trim($_POST['tostext'])) : '');
$this->config->set('system', 'tosdisplay', $displaytos); DI::config()->set('system', 'tosdisplay', $displaytos);
$this->config->set('system', 'tosprivstatement', $displayprivstatement); DI::config()->set('system', 'tosprivstatement', $displayprivstatement);
$this->config->set('system', 'tostext', $tostext); DI::config()->set('system', 'tostext', $tostext);
$this->baseUrl->redirect('admin/tos'); DI::baseUrl()->redirect('admin/tos');
} }
public function content(): string public function content(): string
{ {
parent::content(); parent::content();
$tos = new \Friendica\Module\Tos($this->parameters);
$t = Renderer::getMarkupTemplate('admin/tos.tpl'); $t = Renderer::getMarkupTemplate('admin/tos.tpl');
return Renderer::replaceMacros($t, [ return Renderer::replaceMacros($t, [
'$title' => $this->t('Administration'), '$title' => DI::l10n()->t('Administration'),
'$page' => $this->t('Terms of Service'), '$page' => DI::l10n()->t('Terms of Service'),
'$displaytos' => ['displaytos', $this->t('Display Terms of Service'), $this->config->get('system', 'tosdisplay'), $this->t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')], '$displaytos' => ['displaytos', DI::l10n()->t('Display Terms of Service'), DI::config()->get('system', 'tosdisplay'), DI::l10n()->t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
'$displayprivstatement' => ['displayprivstatement', $this->t('Display Privacy Statement'), $this->config->get('system', 'tosprivstatement'), $this->t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank" rel="noopener noreferrer">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')], '$displayprivstatement' => ['displayprivstatement', DI::l10n()->t('Display Privacy Statement'), DI::config()->get('system', 'tosprivstatement'), DI::l10n()->t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank" rel="noopener noreferrer">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
'$preview' => $this->t('Privacy Statement Preview'), '$preview' => DI::l10n()->t('Privacy Statement Preview'),
'$privtext' => $this->tos->privacy_complete, '$privtext' => $tos->privacy_complete,
'$tostext' => ['tostext', $this->t('The Terms of Service'), $this->config->get('system', 'tostext'), $this->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')], '$tostext' => ['tostext', DI::l10n()->t('The Terms of Service'), DI::config()->get('system', 'tostext'), DI::l10n()->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
'$form_security_token' => self::getFormSecurityToken('admin_tos'), '$form_security_token' => self::getFormSecurityToken('admin_tos'),
'$submit' => $this->t('Save Settings'), '$submit' => DI::l10n()->t('Save Settings'),
]); ]);
} }
} }

View file

@ -21,7 +21,6 @@
namespace Friendica\Module\Api\Twitter; namespace Friendica\Module\Api\Twitter;
use Friendica\Core\L10n;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -36,9 +35,9 @@ abstract class ContactEndpoint extends BaseApi
const DEFAULT_COUNT = 20; const DEFAULT_COUNT = 20;
const MAX_COUNT = 200; const MAX_COUNT = 200;
public function __construct(L10n $l10n, array $parameters = []) public function init()
{ {
parent::__construct($l10n, $parameters); parent::init();
self::checkAllowedScope(self::SCOPE_READ); self::checkAllowedScope(self::SCOPE_READ);
} }

View file

@ -21,25 +21,21 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
/** /**
* Shows the App menu * Shows the App menu
*/ */
class Apps extends BaseModule class Apps extends BaseModule
{ {
public function __construct(L10n $l10n, IManageConfigValues $config, BaseURL $baseUrl, array $parameters = []) public function init()
{ {
parent::__construct($l10n, $parameters); $privateaddons = DI::config()->get('config', 'private_addons');
$privateaddons = $config->get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) { if ($privateaddons === "1" && !local_user()) {
$baseUrl->redirect(); DI::baseUrl()->redirect();
} }
} }
@ -48,12 +44,12 @@ class Apps extends BaseModule
$apps = Nav::getAppMenu(); $apps = Nav::getAppMenu();
if (count($apps) == 0) { if (count($apps) == 0) {
notice($this->t('No installed applications.')); notice(DI::l10n()->t('No installed applications.'));
} }
$tpl = Renderer::getMarkupTemplate('apps.tpl'); $tpl = Renderer::getMarkupTemplate('apps.tpl');
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$title' => $this->t('Applications'), '$title' => DI::l10n()->t('Applications'),
'$apps' => $apps, '$apps' => $apps,
]); ]);
} }

View file

@ -22,12 +22,11 @@
namespace Friendica\Module; namespace Friendica\Module;
use Exception; use Exception;
use Friendica\App\Arguments;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\DI;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotification; use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Network\HTTPException\ForbiddenException;
@ -71,12 +70,9 @@ abstract class BaseNotifications extends BaseModule
const DEFAULT_PAGE_LIMIT = 80; const DEFAULT_PAGE_LIMIT = 80;
/** @var boolean True, if ALL entries should get shown */ /** @var boolean True, if ALL entries should get shown */
protected $showAll; protected static $showAll;
/** @var int The determined start item of the current page */ /** @var int The determined start item of the current page */
protected $firstItemNum; protected static $firstItemNum;
/** @var Arguments */
protected $args;
/** /**
* Collects all notifications from the backend * Collects all notifications from the backend
@ -84,37 +80,33 @@ abstract class BaseNotifications extends BaseModule
* @return array The determined notification array * @return array The determined notification array
* ['header', 'notifications'] * ['header', 'notifications']
*/ */
abstract public function getNotifications(); abstract public static function getNotifications();
public function __construct(Arguments $args, L10n $l10n, array $parameters = []) public function init()
{ {
parent::__construct($l10n, $parameters);
if (!local_user()) { if (!local_user()) {
throw new ForbiddenException($this->t('Permission denied.')); throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
} }
$page = ($_REQUEST['page'] ?? 0) ?: 1; $page = ($_REQUEST['page'] ?? 0) ?: 1;
$this->firstItemNum = ($page * self::ITEMS_PER_PAGE) - self::ITEMS_PER_PAGE; self::$firstItemNum = ($page * self::ITEMS_PER_PAGE) - self::ITEMS_PER_PAGE;
$this->showAll = ($_REQUEST['show'] ?? '') === 'all'; self::$showAll = ($_REQUEST['show'] ?? '') === 'all';
$this->args = $args;
} }
public 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 ($this->args->get($this->args->getArgc() - 1) !== 'json') { if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') {
return; return;
} }
// Set the pager // Set the pager
$pager = new Pager($this->l10n, $this->args->getQueryString(), self::ITEMS_PER_PAGE); $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), self::ITEMS_PER_PAGE);
// Add additional informations (needed for json output) // Add additional informations (needed for json output)
$notifications = [ $notifications = [
'notifications' => $this->getNotifications(), 'notifications' => static::getNotifications(),
'items_page' => $pager->getItemsPerPage(), 'items_page' => $pager->getItemsPerPage(),
'page' => $pager->getPage(), 'page' => $pager->getPage(),
]; ];
@ -134,17 +126,17 @@ abstract class BaseNotifications extends BaseModule
* *
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
protected function printContent(string $header, array $notifications, string $noContent, array $showLink) protected static function printContent(string $header, array $notifications, string $noContent, array $showLink)
{ {
// Get the nav tabs for the notification pages // Get the nav tabs for the notification pages
$tabs = $this->getTabs(); $tabs = self::getTabs();
// Set the pager // Set the pager
$pager = new Pager($this->l10n, $this->args->getQueryString(), self::ITEMS_PER_PAGE); $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), self::ITEMS_PER_PAGE);
$notif_tpl = Renderer::getMarkupTemplate('notifications/notifications.tpl'); $notif_tpl = Renderer::getMarkupTemplate('notifications/notifications.tpl');
return Renderer::replaceMacros($notif_tpl, [ return Renderer::replaceMacros($notif_tpl, [
'$header' => $header ?? $this->t('Notifications'), '$header' => $header ?? DI::l10n()->t('Notifications'),
'$tabs' => $tabs, '$tabs' => $tabs,
'$notifications' => $notifications, '$notifications' => $notifications,
'$noContent' => $noContent, '$noContent' => $noContent,
@ -159,15 +151,15 @@ abstract class BaseNotifications extends BaseModule
* @return array with with notifications TabBar data * @return array with with notifications TabBar data
* @throws Exception * @throws Exception
*/ */
private function getTabs() private static function getTabs()
{ {
$selected = $this->args->get(1, ''); $selected = DI::args()->get(1, '');
$tabs = []; $tabs = [];
foreach (self::URL_TYPES as $type => $url) { foreach (self::URL_TYPES as $type => $url) {
$tabs[] = [ $tabs[] = [
'label' => $this->t(self::PRINT_TYPES[$type]), 'label' => DI::l10n()->t(self::PRINT_TYPES[$type]),
'url' => 'notifications/' . $url, 'url' => 'notifications/' . $url,
'sel' => (($selected == $url) ? 'active' : ''), 'sel' => (($selected == $url) ? 'active' : ''),
'id' => $type . '-tab', 'id' => $type . '-tab',

View file

@ -21,43 +21,27 @@
namespace Friendica\Module\Contact; namespace Friendica\Module\Contact;
use Friendica\App\Page;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\Database\Database; use Friendica\DI;
use Friendica\Model; use Friendica\Model;
use Friendica\Module\Contact; use Friendica\Module\Contact;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Network\HTTPException\ForbiddenException;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
/** /**
* GUI for advanced contact details manipulation * GUI for advanced contact details manipulation
*/ */
class Advanced extends BaseModule class Advanced extends BaseModule
{ {
/** @var Database */ public function init()
protected $dba;
/** @var LoggerInterface */
protected $logger;
/** @var Page */
protected $page;
public function __construct(Database $dba, LoggerInterface $logger, Page $page, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->dba = $dba;
$this->logger = $logger;
$this->page = $page;
if (!Session::isAuthenticated()) { if (!Session::isAuthenticated()) {
throw new ForbiddenException($this->t('Permission denied.')); throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
} }
} }
@ -67,7 +51,7 @@ class Advanced extends BaseModule
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]); $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) { if (empty($contact)) {
throw new BadRequestException($this->t('Contact not found.')); throw new BadRequestException(DI::l10n()->t('Contact not found.'));
} }
$name = ($_POST['name'] ?? '') ?: $contact['name']; $name = ($_POST['name'] ?? '') ?: $contact['name'];
@ -82,7 +66,7 @@ class Advanced extends BaseModule
$photo = $_POST['photo'] ?? ''; $photo = $_POST['photo'] ?? '';
$nurl = Strings::normaliseLink($url); $nurl = Strings::normaliseLink($url);
$r = $this->dba->update( $r = DI::dba()->update(
'contact', 'contact',
[ [
'name' => $name, 'name' => $name,
@ -100,14 +84,16 @@ class Advanced extends BaseModule
); );
if ($photo) { if ($photo) {
$this->logger->notice('Updating photo.', ['photo' => $photo]); DI::logger()->notice('Updating photo.', ['photo' => $photo]);
Model\Contact::updateAvatar($contact['id'], $photo, true); Model\Contact::updateAvatar($contact['id'], $photo, true);
} }
if (!$r) { if (!$r) {
notice($this->t('Contact update failed.')); notice(DI::l10n()->t('Contact update failed.'));
} }
return;
} }
public function content(): string public function content(): string
@ -116,13 +102,13 @@ class Advanced extends BaseModule
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]); $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) { if (empty($contact)) {
throw new BadRequestException($this->t('Contact not found.')); throw new BadRequestException(DI::l10n()->t('Contact not found.'));
} }
$this->page['aside'] = Widget\VCard::getHTML($contact); DI::page()['aside'] = Widget\VCard::getHTML($contact);
$warning = $this->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.'); $warning = DI::l10n()->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
$info = $this->t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.'); $info = DI::l10n()->t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
$returnaddr = "contact/$cid"; $returnaddr = "contact/$cid";
@ -142,20 +128,20 @@ class Advanced extends BaseModule
'$warning' => $warning, '$warning' => $warning,
'$info' => $info, '$info' => $info,
'$returnaddr' => $returnaddr, '$returnaddr' => $returnaddr,
'$return' => $this->t('Return to contact editor'), '$return' => DI::l10n()->t('Return to contact editor'),
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],
'$lbl_submit' => $this->t('Submit'), '$lbl_submit' => DI::l10n()->t('Submit'),
'$name' => ['name', $this->t('Name'), $contact['name'], '', '', $readonly], '$name' => ['name', DI::l10n()->t('Name'), $contact['name'], '', '', $readonly],
'$nick' => ['nick', $this->t('Account Nickname'), $contact['nick'], '', '', $readonly], '$nick' => ['nick', DI::l10n()->t('Account Nickname'), $contact['nick'], '', '', $readonly],
'$attag' => ['attag', $this->t('@Tagname - overrides Name/Nickname'), $contact['attag']], '$attag' => ['attag', DI::l10n()->t('@Tagname - overrides Name/Nickname'), $contact['attag']],
'$url' => ['url', $this->t('Account URL'), $contact['url'], '', '', $readonly], '$url' => ['url', DI::l10n()->t('Account URL'), $contact['url'], '', '', $readonly],
'$alias' => ['alias', $this->t('Account URL Alias'), $contact['alias'], '', '', $readonly], '$alias' => ['alias', DI::l10n()->t('Account URL Alias'), $contact['alias'], '', '', $readonly],
'$request' => ['request', $this->t('Friend Request URL'), $contact['request'], '', '', $readonly], '$request' => ['request', DI::l10n()->t('Friend Request URL'), $contact['request'], '', '', $readonly],
'confirm' => ['confirm', $this->t('Friend Confirm URL'), $contact['confirm'], '', '', $readonly], 'confirm' => ['confirm', DI::l10n()->t('Friend Confirm URL'), $contact['confirm'], '', '', $readonly],
'notify' => ['notify', $this->t('Notification Endpoint URL'), $contact['notify'], '', '', $readonly], 'notify' => ['notify', DI::l10n()->t('Notification Endpoint URL'), $contact['notify'], '', '', $readonly],
'poll' => ['poll', $this->t('Poll/Feed URL'), $contact['poll'], '', '', $readonly], 'poll' => ['poll', DI::l10n()->t('Poll/Feed URL'), $contact['poll'], '', '', $readonly],
'photo' => ['photo', $this->t('New photo from this URL'), '', '', '', $readonly], 'photo' => ['photo', DI::l10n()->t('New photo from this URL'), '', '', '', $readonly],
]); ]);
} }
} }

View file

@ -21,14 +21,12 @@
namespace Friendica\Module\Contact; namespace Friendica\Module\Contact;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\Database; use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model; use Friendica\Model;
use Friendica\Module\Contact; use Friendica\Module\Contact;
use Friendica\Module\Security\Login; use Friendica\Module\Security\Login;
@ -37,44 +35,31 @@ use Friendica\Network\HTTPException;
class Revoke extends BaseModule class Revoke extends BaseModule
{ {
/** @var array */ /** @var array */
protected $contact; private static $contact;
/** @var Database */ public function init()
protected $dba;
/** @var BaseURL */
protected $baseUrl;
/** @var Arguments */
protected $args;
public function __construct(Database $dba, BaseURL $baseUrl, Arguments $args, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->dba = $dba;
$this->baseUrl = $baseUrl;
$this->args = $args;
if (!local_user()) { if (!local_user()) {
return; return;
} }
$data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], local_user()); $data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], local_user());
if (!$this->dba->isResult($data)) { if (!DBA::isResult($data)) {
throw new HTTPException\NotFoundException($this->t('Unknown contact.')); throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown contact.'));
} }
if (empty($data['user'])) { if (empty($data['user'])) {
throw new HTTPException\ForbiddenException(); throw new HTTPException\ForbiddenException();
} }
$this->contact = Model\Contact::getById($data['user']); self::$contact = Model\Contact::getById($data['user']);
if ($this->contact['deleted']) { if (self::$contact['deleted']) {
throw new HTTPException\NotFoundException($this->t('Contact is deleted.')); throw new HTTPException\NotFoundException(DI::l10n()->t('Contact is deleted.'));
} }
if (!empty($this->contact['network']) && $this->contact['network'] == Protocol::PHANTOM) { if (!empty(self::$contact['network']) && self::$contact['network'] == Protocol::PHANTOM) {
throw new HTTPException\NotFoundException($this->t('Contact is being deleted.')); throw new HTTPException\NotFoundException(DI::l10n()->t('Contact is being deleted.'));
} }
} }
@ -86,16 +71,16 @@ class Revoke extends BaseModule
self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke'); self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke');
$result = Model\Contact::revokeFollow($this->contact); $result = Model\Contact::revokeFollow(self::$contact);
if ($result === true) { if ($result === true) {
notice($this->t('Follow was successfully revoked.')); notice(DI::l10n()->t('Follow was successfully revoked.'));
} elseif ($result === null) { } elseif ($result === null) {
notice($this->t('Follow was successfully revoked, however the remote contact won\'t be aware of this revokation.')); notice(DI::l10n()->t('Follow was successfully revoked, however the remote contact won\'t be aware of this revokation.'));
} else { } else {
notice($this->t('Unable to revoke follow, please try again later or contact the administrator.')); notice(DI::l10n()->t('Unable to revoke follow, please try again later or contact the administrator.'));
} }
$this->baseUrl->redirect('contact/' . $this->parameters['id']); DI::baseUrl()->redirect('contact/' . $this->parameters['id']);
} }
public function content(): string public function content(): string
@ -108,14 +93,14 @@ class Revoke extends BaseModule
return Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_drop_confirm.tpl'), [ return Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_drop_confirm.tpl'), [
'$l10n' => [ '$l10n' => [
'header' => $this->t('Revoke Follow'), 'header' => DI::l10n()->t('Revoke Follow'),
'message' => $this->t('Do you really want to revoke this contact\'s follow? This cannot be undone and they will have to manually follow you back again.'), 'message' => DI::l10n()->t('Do you really want to revoke this contact\'s follow? This cannot be undone and they will have to manually follow you back again.'),
'confirm' => $this->t('Yes'), 'confirm' => DI::l10n()->t('Yes'),
'cancel' => $this->t('Cancel'), 'cancel' => DI::l10n()->t('Cancel'),
], ],
'$contact' => Contact::getContactTemplateVars($this->contact), '$contact' => Contact::getContactTemplateVars(self::$contact),
'$method' => 'post', '$method' => 'post',
'$confirm_url' => $this->args->getCommand(), '$confirm_url' => DI::args()->getCommand(),
'$confirm_name' => 'form_security_token', '$confirm_name' => 'form_security_token',
'$confirm_value' => BaseModule::getFormSecurityToken('contact_revoke'), '$confirm_value' => BaseModule::getFormSecurityToken('contact_revoke'),
]); ]);

View file

@ -21,12 +21,10 @@
namespace Friendica\Module\Debug; namespace Friendica\Module\Debug;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model; use Friendica\Model;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
use Friendica\Protocol; use Friendica\Protocol;
/** /**
@ -34,18 +32,11 @@ use Friendica\Protocol;
*/ */
class Feed extends BaseModule class Feed extends BaseModule
{ {
/** @var ICanSendHttpRequests */ public function init()
protected $httpClient;
public function __construct(BaseURL $baseUrl, ICanSendHttpRequests $httpClient, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->httpClient = $httpClient;
if (!local_user()) { if (!local_user()) {
notice($this->t('You must be logged in to use this module')); notice(DI::l10n()->t('You must be logged in to use this module'));
$baseUrl->redirect(); DI::baseUrl()->redirect();
} }
} }
@ -57,7 +48,7 @@ class Feed extends BaseModule
$contact = Model\Contact::getByURLForUser($url, local_user(), null); $contact = Model\Contact::getByURLForUser($url, local_user(), null);
$xml = $this->httpClient->fetch($contact['poll']); $xml = DI::httpClient()->fetch($contact['poll']);
$import_result = Protocol\Feed::import($xml); $import_result = Protocol\Feed::import($xml);
@ -69,7 +60,7 @@ class Feed extends BaseModule
$tpl = Renderer::getMarkupTemplate('feedtest.tpl'); $tpl = Renderer::getMarkupTemplate('feedtest.tpl');
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$url' => ['url', $this->t('Source URL'), $_REQUEST['url'] ?? '', ''], '$url' => ['url', DI::l10n()->t('Source URL'), $_REQUEST['url'] ?? '', ''],
'$result' => $result '$result' => $result
]); ]);
} }

View file

@ -22,8 +22,7 @@
namespace Friendica\Module\Diaspora; namespace Friendica\Module\Diaspora;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\DI;
use Friendica\Core\L10n;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Protocol\Diaspora; use Friendica\Protocol\Diaspora;
@ -37,30 +36,25 @@ use Psr\Log\LoggerInterface;
class Receive extends BaseModule class Receive extends BaseModule
{ {
/** @var LoggerInterface */ /** @var LoggerInterface */
protected $logger; private static $logger;
/** @var IManageConfigValues */
protected $config;
public function __construct(LoggerInterface $logger, IManageConfigValues $config, L10n $l10n, array $parameters = []) public function init()
{ {
parent::__construct($l10n, $parameters); self::$logger = DI::logger();
$this->logger = $logger;
$this->config = $config;
} }
public function post() public function post()
{ {
$enabled = $this->config->get('system', 'diaspora_enabled', false); $enabled = DI::config()->get('system', 'diaspora_enabled', false);
if (!$enabled) { if (!$enabled) {
$this->logger->info('Diaspora disabled.'); self::$logger->info('Diaspora disabled.');
throw new HTTPException\ForbiddenException($this->t('Access denied.')); throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
} }
if ($this->parameters['type'] === 'public') { if ($this->parameters['type'] === 'public') {
$this->receivePublic(); self::receivePublic();
} else if ($this->parameters['type'] === 'users') { } else if ($this->parameters['type'] === 'users') {
$this->receiveUser(); self::receiveUser($this->parameters['guid']);
} }
} }
@ -70,13 +64,13 @@ class Receive extends BaseModule
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
*/ */
private function receivePublic() private static function receivePublic()
{ {
$this->logger->info('Diaspora: Receiving post.'); self::$logger->info('Diaspora: Receiving post.');
$msg = $this->decodePost(); $msg = self::decodePost();
$this->logger->info('Diaspora: Dispatching.'); self::$logger->info('Diaspora: Dispatching.');
Diaspora::dispatchPublic($msg); Diaspora::dispatchPublic($msg);
} }
@ -84,18 +78,20 @@ class Receive extends BaseModule
/** /**
* Receive a Diaspora posting for a user * Receive a Diaspora posting for a user
* *
* @param string $guid The GUID of the importer
*
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
*/ */
private function receiveUser() private static function receiveUser(string $guid)
{ {
$this->logger->info('Diaspora: Receiving post.'); self::$logger->info('Diaspora: Receiving post.');
$importer = User::getByGuid($this->parameters['guid']); $importer = User::getByGuid($guid);
$msg = $this->decodePost(false, $importer['prvkey'] ?? ''); $msg = self::decodePost(false, $importer['prvkey'] ?? '');
$this->logger->info('Diaspora: Dispatching.'); self::$logger->info('Diaspora: Dispatching.');
if (Diaspora::dispatch($importer, $msg)) { if (Diaspora::dispatch($importer, $msg)) {
throw new HTTPException\OKException(); throw new HTTPException\OKException();
@ -116,7 +112,7 @@ class Receive extends BaseModule
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
*/ */
private function decodePost(bool $public = true, string $privKey = '') private static function decodePost(bool $public = true, string $privKey = '')
{ {
if (empty($_POST['xml'])) { if (empty($_POST['xml'])) {
@ -126,24 +122,24 @@ class Receive extends BaseModule
throw new HTTPException\InternalServerErrorException('Missing postdata.'); throw new HTTPException\InternalServerErrorException('Missing postdata.');
} }
$this->logger->info('Diaspora: Message is in the new format.'); self::$logger->info('Diaspora: Message is in the new format.');
$msg = Diaspora::decodeRaw($postdata, $privKey); $msg = Diaspora::decodeRaw($postdata, $privKey);
} else { } else {
$xml = urldecode($_POST['xml']); $xml = urldecode($_POST['xml']);
$this->logger->info('Diaspora: Decode message in the old format.'); self::$logger->info('Diaspora: Decode message in the old format.');
$msg = Diaspora::decode($xml, $privKey); $msg = Diaspora::decode($xml, $privKey);
if ($public && !$msg) { if ($public && !$msg) {
$this->logger->info('Diaspora: Decode message in the new format.'); self::$logger->info('Diaspora: Decode message in the new format.');
$msg = Diaspora::decodeRaw($xml, $privKey); $msg = Diaspora::decodeRaw($xml, $privKey);
} }
} }
$this->logger->info('Diaspora: Post decoded.'); self::$logger->info('Diaspora: Post decoded.');
$this->logger->debug('Diaspora: Decoded message.', ['msg' => $msg]); self::$logger->debug('Diaspora: Decoded message.', ['msg' => $msg]);
if (!is_array($msg)) { if (!is_array($msg)) {
throw new HTTPException\InternalServerErrorException('Message is not an array.'); throw new HTTPException\InternalServerErrorException('Message is not an array.');

View file

@ -21,43 +21,36 @@
namespace Friendica\Module\Filer; namespace Friendica\Module\Filer;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model; use Friendica\Model;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Util\XML; use Friendica\Util\XML;
use Psr\Log\LoggerInterface;
/** /**
* Shows a dialog for adding tags to a file * Shows a dialog for adding tags to a file
*/ */
class SaveTag extends BaseModule class SaveTag extends BaseModule
{ {
/** @var LoggerInterface */ public function init()
protected $logger;
public function __construct(LoggerInterface $logger, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->logger = $logger;
if (!local_user()) { if (!local_user()) {
notice($this->t('You must be logged in to use this module')); notice(DI::l10n()->t('You must be logged in to use this module'));
$baseUrl->redirect(); DI::baseUrl()->redirect();
} }
} }
public function rawContent() public function rawContent()
{ {
$logger = DI::logger();
$term = XML::unescape(trim($_GET['term'] ?? '')); $term = XML::unescape(trim($_GET['term'] ?? ''));
$item_id = $this->parameters['id'] ?? 0; $item_id = $this->parameters['id'] ?? 0;
$this->logger->info('filer', ['tag' => $term, 'item' => $item_id]); $logger->info('filer', ['tag' => $term, 'item' => $item_id]);
if ($item_id && strlen($term)) { if ($item_id && strlen($term)) {
$item = Model\Post::selectFirst(['uri-id'], ['id' => $item_id]); $item = Model\Post::selectFirst(['uri-id'], ['id' => $item_id]);
@ -72,8 +65,8 @@ class SaveTag extends BaseModule
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl"); $tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
echo Renderer::replaceMacros($tpl, [ echo Renderer::replaceMacros($tpl, [
'$field' => ['term', $this->t("Save to Folder:"), '', '', $filetags, $this->t('- select -')], '$field' => ['term', DI::l10n()->t("Save to Folder:"), '', '', $filetags, DI::l10n()->t('- select -')],
'$submit' => $this->t('Save'), '$submit' => DI::l10n()->t('Save'),
]); ]);
exit; exit;

View file

@ -21,16 +21,15 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\Database; use Friendica\DI;
use Friendica\Model\Contact as ContactModel; use Friendica\Model\Contact as ContactModel;
use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Network\HTTPException\ForbiddenException;
use Friendica\Network\HTTPException\NotFoundException; use Friendica\Network\HTTPException\NotFoundException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Friendica\Worker\Delivery; use Friendica\Worker\Delivery;
@ -39,27 +38,11 @@ use Friendica\Worker\Delivery;
*/ */
class FriendSuggest extends BaseModule class FriendSuggest extends BaseModule
{ {
/** @var BaseURL */ public function init()
protected $baseUrl;
/** @var Database */
protected $dba;
/** @var \Friendica\Contact\FriendSuggest\Repository\FriendSuggest */
protected $friendSuggestRepo;
/** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
protected $friendSuggestFac;
public function __construct(BaseURL $baseUrl, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
if (!local_user()) { if (!local_user()) {
throw new ForbiddenException($this->t('Permission denied.')); throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
} }
$this->baseUrl = $baseUrl;
$this->dba = $dba;
$this->friendSuggestRepo = $friendSuggestRepo;
$this->friendSuggestFac = $friendSuggestFac;
} }
public function post() public function post()
@ -67,8 +50,8 @@ class FriendSuggest extends BaseModule
$cid = intval($this->parameters['contact']); $cid = intval($this->parameters['contact']);
// We do query the "uid" as well to ensure that it is our contact // We do query the "uid" as well to ensure that it is our contact
if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => local_user()])) { if (!DI::dba()->exists('contact', ['id' => $cid, 'uid' => local_user()])) {
throw new NotFoundException($this->t('Contact not found.')); throw new NotFoundException(DI::l10n()->t('Contact not found.'));
} }
$suggest_contact_id = intval($_POST['suggest']); $suggest_contact_id = intval($_POST['suggest']);
@ -77,15 +60,15 @@ class FriendSuggest extends BaseModule
} }
// We do query the "uid" as well to ensure that it is our contact // We do query the "uid" as well to ensure that it is our contact
$contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]); $contact = DI::dba()->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]);
if (empty($contact)) { if (empty($contact)) {
notice($this->t('Suggested contact not found.')); notice(DI::l10n()->t('Suggested contact not found.'));
return; return;
} }
$note = Strings::escapeHtml(trim($_POST['note'] ?? '')); $note = Strings::escapeHtml(trim($_POST['note'] ?? ''));
$suggest = $this->friendSuggestRepo->save($this->friendSuggestFac->createNew( $suggest = DI::fsuggest()->save(DI::fsuggestFactory()->createNew(
local_user(), local_user(),
$cid, $cid,
$contact['name'], $contact['name'],
@ -97,17 +80,17 @@ class FriendSuggest extends BaseModule
Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id); Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id);
info($this->t('Friend suggestion sent.')); info(DI::l10n()->t('Friend suggestion sent.'));
} }
public function content(): string public function content(): string
{ {
$cid = intval($this->parameters['contact']); $cid = intval($this->parameters['contact']);
$contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]); $contact = DI::dba()->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) { if (empty($contact)) {
notice($this->t('Contact not found.')); notice(DI::l10n()->t('Contact not found.'));
$this->baseUrl->redirect(); DI::baseUrl()->redirect();
} }
$suggestableContacts = ContactModel::selectToArray(['id', 'name'], [ $suggestableContacts = ContactModel::selectToArray(['id', 'name'], [
@ -134,15 +117,15 @@ class FriendSuggest extends BaseModule
$tpl = Renderer::getMarkupTemplate('fsuggest.tpl'); $tpl = Renderer::getMarkupTemplate('fsuggest.tpl');
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$contact_id' => $cid, '$contact_id' => $cid,
'$fsuggest_title' => $this->t('Suggest Friends'), '$fsuggest_title' => DI::l10n()->t('Suggest Friends'),
'$fsuggest_select' => [ '$fsuggest_select' => [
'suggest', 'suggest',
$this->t('Suggest a friend for %s', $contact['name']), DI::l10n()->t('Suggest a friend for %s', $contact['name']),
'', '',
'', '',
$formattedContacts, $formattedContacts,
], ],
'$submit' => $this->t('Submit'), '$submit' => DI::l10n()->t('Submit'),
]); ]);
} }
} }

View file

@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core; use Friendica\Core;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Theme; use Friendica\Core\Theme;
use Friendica\DI; use Friendica\DI;
@ -59,119 +58,110 @@ class Install extends BaseModule
/** /**
* @var int The current step of the wizard * @var int The current step of the wizard
*/ */
private $currentWizardStep; private static $currentWizardStep;
/** /**
* @var Core\Installer The installer * @var Core\Installer The installer
*/ */
private $installer; private static $installer;
/** @var App */ public function init()
protected $app;
/** @var App\Mode */
protected $mode;
/** @var App\BaseURL */
protected $baseUrl;
public function __construct(App $app, App\Mode $mode, App\BaseURL $baseUrl, App\Arguments $args, Core\Installer $installer, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters); $a = DI::app();
$this->app = $app; if (!DI::mode()->isInstall()) {
$this->mode = $mode;
$this->baseUrl = $baseUrl;
$this->installer = $installer;
if (!$this->mode->isInstall()) {
throw new HTTPException\ForbiddenException(); throw new HTTPException\ForbiddenException();
} }
// route: install/testrwrite // route: install/testrwrite
// $baseurl/install/testrwrite to test if rewrite in .htaccess is working // $baseurl/install/testrwrite to test if rewrite in .htaccess is working
if ($args->get(1, '') == 'testrewrite') { if (DI::args()->get(1, '') == 'testrewrite') {
// Status Code 204 means that it worked without content // Status Code 204 means that it worked without content
throw new HTTPException\NoContentException(); throw new HTTPException\NoContentException();
} }
self::$installer = new Core\Installer();
// get basic installation information and save them to the config cache // get basic installation information and save them to the config cache
$configCache = $this->app->getConfigCache(); $configCache = $a->getConfigCache();
$basePath = new BasePath($this->app->getBasePath()); $basePath = new BasePath($a->getBasePath());
$this->installer->setUpCache($configCache, $basePath->getPath()); self::$installer->setUpCache($configCache, $basePath->getPath());
// We overwrite current theme css, because during install we may not have a working mod_rewrite // We overwrite current theme css, because during install we may not have a working mod_rewrite
// so we may not have a css at all. Here we set a static css file for the install procedure pages // so we may not have a css at all. Here we set a static css file for the install procedure pages
Renderer::$theme['stylesheet'] = $this->baseUrl->get() . '/view/install/style.css'; Renderer::$theme['stylesheet'] = DI::baseUrl()->get() . '/view/install/style.css';
$this->currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK; self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
} }
public function post() public function post()
{ {
$configCache = $this->app->getConfigCache(); $a = DI::app();
$configCache = $a->getConfigCache();
switch ($this->currentWizardStep) { switch (self::$currentWizardStep) {
case self::SYSTEM_CHECK: case self::SYSTEM_CHECK:
case self::BASE_CONFIG: case self::BASE_CONFIG:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); self::checkSetting($configCache, $_POST, 'config', 'php_path');
break; break;
case self::DATABASE_CONFIG: case self::DATABASE_CONFIG:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); self::checkSetting($configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'config', 'hostname'); self::checkSetting($configCache, $_POST, 'config', 'hostname');
$this->checkSetting($configCache, $_POST, 'system', 'ssl_policy'); self::checkSetting($configCache, $_POST, 'system', 'ssl_policy');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); self::checkSetting($configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'urlpath'); self::checkSetting($configCache, $_POST, 'system', 'urlpath');
break; break;
case self::SITE_SETTINGS: case self::SITE_SETTINGS:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); self::checkSetting($configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'config', 'hostname'); self::checkSetting($configCache, $_POST, 'config', 'hostname');
$this->checkSetting($configCache, $_POST, 'system', 'ssl_policy'); self::checkSetting($configCache, $_POST, 'system', 'ssl_policy');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); self::checkSetting($configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'urlpath'); self::checkSetting($configCache, $_POST, 'system', 'urlpath');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST); self::checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', ''); self::checkSetting($configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', ''); self::checkSetting($configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', ''); self::checkSetting($configCache, $_POST, 'database', 'database', '');
// If we cannot connect to the database, return to the previous step // If we cannot connect to the database, return to the previous step
if (!$this->installer->checkDB(DI::dba())) { if (!self::$installer->checkDB(DI::dba())) {
$this->currentWizardStep = self::DATABASE_CONFIG; self::$currentWizardStep = self::DATABASE_CONFIG;
} }
break; break;
case self::FINISHED: case self::FINISHED:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); self::checkSetting($configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'config', 'hostname'); self::checkSetting($configCache, $_POST, 'config', 'hostname');
$this->checkSetting($configCache, $_POST, 'system', 'ssl_policy'); self::checkSetting($configCache, $_POST, 'system', 'ssl_policy');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); self::checkSetting($configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'urlpath'); self::checkSetting($configCache, $_POST, 'system', 'urlpath');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST); self::checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', ''); self::checkSetting($configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', ''); self::checkSetting($configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', ''); self::checkSetting($configCache, $_POST, 'database', 'database', '');
$this->checkSetting($configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ); self::checkSetting($configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
$this->checkSetting($configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG); self::checkSetting($configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
$this->checkSetting($configCache, $_POST, 'config', 'admin_email', ''); self::checkSetting($configCache, $_POST, 'config', 'admin_email', '');
// If we cannot connect to the database, return to the Database config wizard // If we cannot connect to the database, return to the Database config wizard
if (!$this->installer->checkDB(DI::dba())) { if (!self::$installer->checkDB(DI::dba())) {
$this->currentWizardStep = self::DATABASE_CONFIG; self::$currentWizardStep = self::DATABASE_CONFIG;
return; return;
} }
if (!$this->installer->createConfig($configCache)) { if (!self::$installer->createConfig($configCache)) {
return; return;
} }
$this->installer->installDatabase($configCache->get('system', 'basepath')); self::$installer->installDatabase($configCache->get('system', 'basepath'));
// install allowed themes to register theme hooks // install allowed themes to register theme hooks
// this is same as "Reload active theme" in /admin/themes // this is same as "Reload active theme" in /admin/themes
@ -189,68 +179,69 @@ class Install extends BaseModule
public function content(): string public function content(): string
{ {
$configCache = $this->app->getConfigCache(); $a = DI::app();
$configCache = $a->getConfigCache();
$output = ''; $output = '';
$install_title = $this->t('Friendica Communications Server - Setup'); $install_title = DI::l10n()->t('Friendica Communications Server - Setup');
switch ($this->currentWizardStep) { switch (self::$currentWizardStep) {
case self::SYSTEM_CHECK: case self::SYSTEM_CHECK:
$php_path = $configCache->get('config', 'php_path'); $php_path = $configCache->get('config', 'php_path');
$status = $this->installer->checkEnvironment($this->baseUrl->get(), $php_path); $status = self::$installer->checkEnvironment(DI::baseUrl()->get(), $php_path);
$tpl = Renderer::getMarkupTemplate('install_checks.tpl'); $tpl = Renderer::getMarkupTemplate('install_checks.tpl');
$output .= Renderer::replaceMacros($tpl, [ $output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title, '$title' => $install_title,
'$pass' => $this->t('System check'), '$pass' => DI::l10n()->t('System check'),
'$required' => $this->t('Required'), '$required' => DI::l10n()->t('Required'),
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'), '$requirement_not_satisfied' => DI::l10n()->t('Requirement not satisfied'),
'$optional_requirement_not_satisfied' => $this->t('Optional requirement not satisfied'), '$optional_requirement_not_satisfied' => DI::l10n()->t('Optional requirement not satisfied'),
'$ok' => $this->t('OK'), '$ok' => DI::l10n()->t('OK'),
'$checks' => $this->installer->getChecks(), '$checks' => self::$installer->getChecks(),
'$passed' => $status, '$passed' => $status,
'$see_install' => $this->t('Please see the file "doc/INSTALL.md".'), '$see_install' => DI::l10n()->t('Please see the file "doc/INSTALL.md".'),
'$next' => $this->t('Next'), '$next' => DI::l10n()->t('Next'),
'$reload' => $this->t('Check again'), '$reload' => DI::l10n()->t('Check again'),
'$php_path' => $php_path, '$php_path' => $php_path,
]); ]);
break; break;
case self::BASE_CONFIG: case self::BASE_CONFIG:
$ssl_choices = [ $ssl_choices = [
App\BaseURL::SSL_POLICY_NONE => $this->t("No SSL policy, links will track page SSL state"), App\BaseURL::SSL_POLICY_NONE => DI::l10n()->t("No SSL policy, links will track page SSL state"),
App\BaseURL::SSL_POLICY_FULL => $this->t("Force all links to use SSL"), App\BaseURL::SSL_POLICY_FULL => DI::l10n()->t("Force all links to use SSL"),
App\BaseURL::SSL_POLICY_SELFSIGN => $this->t("Self-signed certificate, use SSL for local links only \x28discouraged\x29") App\BaseURL::SSL_POLICY_SELFSIGN => DI::l10n()->t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
]; ];
$tpl = Renderer::getMarkupTemplate('install_base.tpl'); $tpl = Renderer::getMarkupTemplate('install_base.tpl');
$output .= Renderer::replaceMacros($tpl, [ $output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title, '$title' => $install_title,
'$pass' => $this->t('Base settings'), '$pass' => DI::l10n()->t('Base settings'),
'$ssl_policy' => ['system-ssl_policy', '$ssl_policy' => ['system-ssl_policy',
$this->t("SSL link policy"), DI::l10n()->t("SSL link policy"),
$configCache->get('system', 'ssl_policy'), $configCache->get('system', 'ssl_policy'),
$this->t("Determines whether generated links should be forced to use SSL"), DI::l10n()->t("Determines whether generated links should be forced to use SSL"),
$ssl_choices], $ssl_choices],
'$hostname' => ['config-hostname', '$hostname' => ['config-hostname',
$this->t('Host name'), DI::l10n()->t('Host name'),
$configCache->get('config', 'hostname'), $configCache->get('config', 'hostname'),
$this->t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'), DI::l10n()->t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'),
$this->t('Required')], DI::l10n()->t('Required')],
'$basepath' => ['system-basepath', '$basepath' => ['system-basepath',
$this->t("Base path to installation"), DI::l10n()->t("Base path to installation"),
$configCache->get('system', 'basepath'), $configCache->get('system', 'basepath'),
$this->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."), DI::l10n()->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
$this->t('Required')], DI::l10n()->t('Required')],
'$urlpath' => ['system-urlpath', '$urlpath' => ['system-urlpath',
$this->t('Sub path of the URL'), DI::l10n()->t('Sub path of the URL'),
$configCache->get('system', 'urlpath'), $configCache->get('system', 'urlpath'),
$this->t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'), DI::l10n()->t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'),
''], ''],
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit'), '$submit' => DI::l10n()->t('Submit'),
]); ]);
break; break;
@ -258,54 +249,54 @@ class Install extends BaseModule
$tpl = Renderer::getMarkupTemplate('install_db.tpl'); $tpl = Renderer::getMarkupTemplate('install_db.tpl');
$output .= Renderer::replaceMacros($tpl, [ $output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title, '$title' => $install_title,
'$pass' => $this->t('Database connection'), '$pass' => DI::l10n()->t('Database connection'),
'$info_01' => $this->t('In order to install Friendica we need to know how to connect to your database.'), '$info_01' => DI::l10n()->t('In order to install Friendica we need to know how to connect to your database.'),
'$info_02' => $this->t('Please contact your hosting provider or site administrator if you have questions about these settings.'), '$info_02' => DI::l10n()->t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
'$info_03' => $this->t('The database you specify below should already exist. If it does not, please create it before continuing.'), '$info_03' => DI::l10n()->t('The database you specify below should already exist. If it does not, please create it before continuing.'),
'$required' => $this->t('Required'), '$required' => DI::l10n()->t('Required'),
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'), '$requirement_not_satisfied' => DI::l10n()->t('Requirement not satisfied'),
'$checks' => $this->installer->getChecks(), '$checks' => self::$installer->getChecks(),
'$hostname' => $configCache->get('config', 'hostname'), '$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'), '$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'), '$basepath' => $configCache->get('system', 'basepath'),
'$urlpath' => $configCache->get('system', 'urlpath'), '$urlpath' => $configCache->get('system', 'urlpath'),
'$dbhost' => ['database-hostname', '$dbhost' => ['database-hostname',
$this->t('Database Server Name'), DI::l10n()->t('Database Server Name'),
$configCache->get('database', 'hostname'), $configCache->get('database', 'hostname'),
'', '',
$this->t('Required')], DI::l10n()->t('Required')],
'$dbuser' => ['database-username', '$dbuser' => ['database-username',
$this->t('Database Login Name'), DI::l10n()->t('Database Login Name'),
$configCache->get('database', 'username'), $configCache->get('database', 'username'),
'', '',
$this->t('Required'), DI::l10n()->t('Required'),
'autofocus'], 'autofocus'],
'$dbpass' => ['database-password', '$dbpass' => ['database-password',
$this->t('Database Login Password'), DI::l10n()->t('Database Login Password'),
$configCache->get('database', 'password'), $configCache->get('database', 'password'),
$this->t("For security reasons the password must not be empty"), DI::l10n()->t("For security reasons the password must not be empty"),
$this->t('Required')], DI::l10n()->t('Required')],
'$dbdata' => ['database-database', '$dbdata' => ['database-database',
$this->t('Database Name'), DI::l10n()->t('Database Name'),
$configCache->get('database', 'database'), $configCache->get('database', 'database'),
'', '',
$this->t('Required')], DI::l10n()->t('Required')],
'$lbl_10' => $this->t('Please select a default timezone for your website'), '$lbl_10' => DI::l10n()->t('Please select a default timezone for your website'),
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit') '$submit' => DI::l10n()->t('Submit')
]); ]);
break; break;
case self::SITE_SETTINGS: case self::SITE_SETTINGS:
/* Installed langs */ /* Installed langs */
$lang_choices = $this->l10n->getAvailableLanguages(); $lang_choices = DI::l10n()->getAvailableLanguages();
$tpl = Renderer::getMarkupTemplate('install_settings.tpl'); $tpl = Renderer::getMarkupTemplate('install_settings.tpl');
$output .= Renderer::replaceMacros($tpl, [ $output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title, '$title' => $install_title,
'$required' => $this->t('Required'), '$required' => DI::l10n()->t('Required'),
'$checks' => $this->installer->getChecks(), '$checks' => self::$installer->getChecks(),
'$pass' => $this->t('Site settings'), '$pass' => DI::l10n()->t('Site settings'),
'$hostname' => $configCache->get('config', 'hostname'), '$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'), '$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'), '$basepath' => $configCache->get('system', 'basepath'),
@ -315,41 +306,41 @@ class Install extends BaseModule
'$dbpass' => $configCache->get('database', 'password'), '$dbpass' => $configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'), '$dbdata' => $configCache->get('database', 'database'),
'$adminmail' => ['config-admin_email', '$adminmail' => ['config-admin_email',
$this->t('Site administrator email address'), DI::l10n()->t('Site administrator email address'),
$configCache->get('config', 'admin_email'), $configCache->get('config', 'admin_email'),
$this->t('Your account email address must match this in order to use the web admin panel.'), DI::l10n()->t('Your account email address must match this in order to use the web admin panel.'),
$this->t('Required'), 'autofocus', 'email'], DI::l10n()->t('Required'), 'autofocus', 'email'],
'$timezone' => Temporal::getTimezoneField('system-default_timezone', '$timezone' => Temporal::getTimezoneField('system-default_timezone',
$this->t('Please select a default timezone for your website'), DI::l10n()->t('Please select a default timezone for your website'),
$configCache->get('system', 'default_timezone'), $configCache->get('system', 'default_timezone'),
''), ''),
'$language' => ['system-language', '$language' => ['system-language',
$this->t('System Language:'), DI::l10n()->t('System Language:'),
$configCache->get('system', 'language'), $configCache->get('system', 'language'),
$this->t('Set the default language for your Friendica installation interface and to send emails.'), DI::l10n()->t('Set the default language for your Friendica installation interface and to send emails.'),
$lang_choices], $lang_choices],
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit') '$submit' => DI::l10n()->t('Submit')
]); ]);
break; break;
case self::FINISHED: case self::FINISHED:
$db_return_text = ""; $db_return_text = "";
if (count($this->installer->getChecks()) == 0) { if (count(self::$installer->getChecks()) == 0) {
$txt = '<p style="font-size: 130%;">'; $txt = '<p style="font-size: 130%;">';
$txt .= $this->t('Your Friendica site database has been installed.') . EOL; $txt .= DI::l10n()->t('Your Friendica site database has been installed.') . EOL;
$db_return_text .= $txt; $db_return_text .= $txt;
} }
$tpl = Renderer::getMarkupTemplate('install_finished.tpl'); $tpl = Renderer::getMarkupTemplate('install_finished.tpl');
$output .= Renderer::replaceMacros($tpl, [ $output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title, '$title' => $install_title,
'$required' => $this->t('Required'), '$required' => DI::l10n()->t('Required'),
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'), '$requirement_not_satisfied' => DI::l10n()->t('Requirement not satisfied'),
'$checks' => $this->installer->getChecks(), '$checks' => self::$installer->getChecks(),
'$pass' => $this->t('Installation finished'), '$pass' => DI::l10n()->t('Installation finished'),
'$text' => $db_return_text . $this->whatNext(), '$text' => $db_return_text . self::whatNext(),
]); ]);
break; break;
@ -364,15 +355,15 @@ class Install extends BaseModule
* @return string The text for the next steps * @return string The text for the next steps
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
private function whatNext() private static function whatNext()
{ {
$baseurl = $this->baseUrl->get(); $baseurl = DI::baseUrl()->get();
return return
$this->t('<h1>What next</h1>') DI::l10n()->t('<h1>What next</h1>')
. "<p>" . $this->t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.') . "<p>" . DI::l10n()->t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
. $this->t('Please see the file "doc/INSTALL.md".') . DI::l10n()->t('Please see the file "doc/INSTALL.md".')
. "</p><p>" . "</p><p>"
. $this->t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl) . DI::l10n()->t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl)
. "</p>"; . "</p>";
} }
@ -385,7 +376,7 @@ class Install extends BaseModule
* @param string $key The key of the setting * @param string $key The key of the setting
* @param null|string $default The default value * @param null|string $default The default value
*/ */
private function checkSetting(Cache $configCache, array $post, $cat, $key, $default = null) private static function checkSetting(Cache $configCache, array $post, $cat, $key, $default = null)
{ {
$configCache->set($cat, $key, $configCache->set($cat, $key,
trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?: trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?:

View file

@ -21,18 +21,16 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\Logger;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\Database; use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
use Friendica\Network\HTTPClient\Client\HttpClientOptions; use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\HTTPSignature; use Friendica\Util\HTTPSignature;
use Friendica\Util\Strings; use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
/** /**
* Magic Auth (remote authentication) module. * Magic Auth (remote authentication) module.
@ -41,35 +39,17 @@ use Psr\Log\LoggerInterface;
*/ */
class Magic extends BaseModule class Magic extends BaseModule
{ {
/** @var App */ public function init()
protected $app;
/** @var LoggerInterface */
protected $logger;
/** @var Database */
protected $dba;
/** @var ICanSendHttpRequests */
protected $httpClient;
protected $baseUrl;
public function __construct(App $app, App\BaseURL $baseUrl, LoggerInterface $logger, Database $dba, ICanSendHttpRequests $httpClient, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters); $a = DI::app();
$ret = ['success' => false, 'url' => '', 'message' => ''];
Logger::info('magic mdule: invoked');
$this->app = $app; Logger::debug('args', ['request' => $_REQUEST]);
$this->logger = $logger;
$this->dba = $dba;
$this->httpClient = $httpClient;
$this->baseUrl = $baseUrl;
}
public function rawContent()
{
$this->logger->info('magic module: invoked');
$this->logger->debug('args', ['request' => $_REQUEST]);
$addr = $_REQUEST['addr'] ?? ''; $addr = $_REQUEST['addr'] ?? '';
$dest = $_REQUEST['dest'] ?? ''; $dest = $_REQUEST['dest'] ?? '';
$test = (!empty($_REQUEST['test']) ? intval($_REQUEST['test']) : 0);
$owa = (!empty($_REQUEST['owa']) ? intval($_REQUEST['owa']) : 0); $owa = (!empty($_REQUEST['owa']) ? intval($_REQUEST['owa']) : 0);
$cid = 0; $cid = 0;
@ -80,15 +60,21 @@ class Magic extends BaseModule
} }
if (!$cid) { if (!$cid) {
$this->logger->info('No contact record found', $_REQUEST); Logger::info('No contact record found', $_REQUEST);
// @TODO Finding a more elegant possibility to redirect to either internal or external URL // @TODO Finding a more elegant possibility to redirect to either internal or external URL
$this->app->redirect($dest); $a->redirect($dest);
} }
$contact = $this->dba->selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]); $contact = DBA::selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]);
// Redirect if the contact is already authenticated on this site. // Redirect if the contact is already authenticated on this site.
if ($this->app->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl->get())) !== false) { if ($a->getContactId() && strpos($contact['nurl'], Strings::normaliseLink(DI::baseUrl()->get())) !== false) {
$this->logger->info('Contact is already authenticated'); if ($test) {
$ret['success'] = true;
$ret['message'] .= 'Local site - you are already authenticated.' . EOL;
return $ret;
}
Logger::info('Contact is already authenticated');
System::externalRedirect($dest); System::externalRedirect($dest);
} }
@ -112,11 +98,11 @@ class Magic extends BaseModule
$header = HTTPSignature::createSig( $header = HTTPSignature::createSig(
$header, $header,
$user['prvkey'], $user['prvkey'],
'acct:' . $user['nickname'] . '@' . $this->baseUrl->getHostname() . ($this->baseUrl->getUrlPath() ? '/' . $this->baseUrl->getUrlPath() : '') 'acct:' . $user['nickname'] . '@' . DI::baseUrl()->getHostname() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : '')
); );
// Try to get an authentication token from the other instance. // Try to get an authentication token from the other instance.
$curlResult = $this->httpClient->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]); $curlResult = DI::httpClient()->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]);
if ($curlResult->isSuccess()) { if ($curlResult->isSuccess()) {
$j = json_decode($curlResult->getBody(), true); $j = json_decode($curlResult->getBody(), true);
@ -132,14 +118,19 @@ class Magic extends BaseModule
} }
$args = (strpbrk($dest, '?&') ? '&' : '?') . 'owt=' . $token; $args = (strpbrk($dest, '?&') ? '&' : '?') . 'owt=' . $token;
$this->logger->info('Redirecting', ['path' => $dest . $args]); Logger::info('Redirecting', ['path' => $dest . $args]);
System::externalRedirect($dest . $args); System::externalRedirect($dest . $args);
} }
} }
System::externalRedirect($dest); System::externalRedirect($dest);
} }
if ($test) {
$ret['message'] = 'Not authenticated or invalid arguments' . EOL;
return $ret;
}
// @TODO Finding a more elegant possibility to redirect to either internal or external URL // @TODO Finding a more elegant possibility to redirect to either internal or external URL
$this->app->redirect($dest); $a->redirect($dest);
} }
} }

View file

@ -21,17 +21,14 @@
namespace Friendica\Module\Notifications; namespace Friendica\Module\Notifications;
use Friendica\App\Arguments;
use Friendica\App\Mode;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Module\BaseNotifications; use Friendica\Module\BaseNotifications;
use Friendica\Navigation\Notifications\Factory\Introduction as IntroductionFactory;
use Friendica\Navigation\Notifications\ValueObject\Introduction; use Friendica\Navigation\Notifications\ValueObject\Introduction;
/** /**
@ -39,34 +36,21 @@ use Friendica\Navigation\Notifications\ValueObject\Introduction;
*/ */
class Introductions extends BaseNotifications class Introductions extends BaseNotifications
{ {
/** @var IntroductionFactory */
protected $notificationIntro;
/** @var Mode */
protected $mode;
public function __construct(Mode $mode, IntroductionFactory $notificationIntro, Arguments $args, L10n $l10n, array $parameters = [])
{
parent::__construct($args, $l10n, $parameters);
$this->notificationIntro = $notificationIntro;
$this->mode = $mode;
}
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getNotifications() public static function getNotifications()
{ {
$id = (int)$this->args->get(2, 0); $id = (int)DI::args()->get(2, 0);
$all = $this->args->get(2) == 'all'; $all = DI::args()->get(2) == 'all';
$notifications = [ $notifications = [
'ident' => 'introductions', 'ident' => 'introductions',
'notifications' => $this->notificationIntro->getList($all, $this->firstItemNum, self::ITEMS_PER_PAGE, $id), 'notifications' => DI::notificationIntro()->getList($all, self::$firstItemNum, self::ITEMS_PER_PAGE, $id),
]; ];
return [ return [
'header' => $this->t('Notifications'), 'header' => DI::l10n()->t('Notifications'),
'notifications' => $notifications, 'notifications' => $notifications,
]; ];
} }
@ -75,12 +59,12 @@ class Introductions extends BaseNotifications
{ {
Nav::setSelected('introductions'); Nav::setSelected('introductions');
$all = $this->args->get(2) == 'all'; $all = DI::args()->get(2) == 'all';
$notificationContent = []; $notificationContent = [];
$notificationNoContent = ''; $notificationNoContent = '';
$notificationResult = $this->getNotifications(); $notificationResult = self::getNotifications();
$notifications = $notificationResult['notifications'] ?? []; $notifications = $notificationResult['notifications'] ?? [];
$notificationHeader = $notificationResult['header'] ?? ''; $notificationHeader = $notificationResult['header'] ?? '';
@ -90,7 +74,7 @@ class Introductions extends BaseNotifications
// The link to switch between ignored and normal connection requests // The link to switch between ignored and normal connection requests
$notificationShowLink = [ $notificationShowLink = [
'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros'), 'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros'),
'text' => (!$all ? $this->t('Show Ignored Requests') : $this->t('Hide Ignored Requests')), 'text' => (!$all ? DI::l10n()->t('Show Ignored Requests') : DI::l10n()->t('Hide Ignored Requests')),
]; ];
$owner = User::getOwnerDataById(local_user()); $owner = User::getOwnerDataById(local_user());
@ -106,10 +90,10 @@ class Introductions extends BaseNotifications
case 'friend_suggestion': case 'friend_suggestion':
$notificationContent[] = Renderer::replaceMacros($notificationSuggestions, [ $notificationContent[] = Renderer::replaceMacros($notificationSuggestions, [
'$type' => $Introduction->getLabel(), '$type' => $Introduction->getLabel(),
'$str_notification_type' => $this->t('Notification type:'), '$str_notification_type' => DI::l10n()->t('Notification type:'),
'$str_type' => $Introduction->getType(), '$str_type' => $Introduction->getType(),
'$intro_id' => $Introduction->getIntroId(), '$intro_id' => $Introduction->getIntroId(),
'$lbl_madeby' => $this->t('Suggested by:'), '$lbl_madeby' => DI::l10n()->t('Suggested by:'),
'$madeby' => $Introduction->getMadeBy(), '$madeby' => $Introduction->getMadeBy(),
'$madeby_url' => $Introduction->getMadeByUrl(), '$madeby_url' => $Introduction->getMadeByUrl(),
'$madeby_zrl' => $Introduction->getMadeByZrl(), '$madeby_zrl' => $Introduction->getMadeByZrl(),
@ -120,22 +104,22 @@ class Introductions extends BaseNotifications
'$dfrn_url' => $owner['url'], '$dfrn_url' => $owner['url'],
'$url' => $Introduction->getUrl(), '$url' => $Introduction->getUrl(),
'$zrl' => $Introduction->getZrl(), '$zrl' => $Introduction->getZrl(),
'$lbl_url' => $this->t('Profile URL'), '$lbl_url' => DI::l10n()->t('Profile URL'),
'$addr' => $Introduction->getAddr(), '$addr' => $Introduction->getAddr(),
'$action' => 'follow', '$action' => 'follow',
'$approve' => $this->t('Approve'), '$approve' => DI::l10n()->t('Approve'),
'$note' => $Introduction->getNote(), '$note' => $Introduction->getNote(),
'$ignore' => $this->t('Ignore'), '$ignore' => DI::l10n()->t('Ignore'),
'$discard' => $this->t('Discard'), '$discard' => DI::l10n()->t('Discard'),
'$is_mobile' => $this->mode->isMobile(), '$is_mobile' => DI::mode()->isMobile(),
]); ]);
break; break;
// Normal connection requests // Normal connection requests
default: default:
if ($Introduction->getNetwork() === Protocol::DFRN) { if ($Introduction->getNetwork() === Protocol::DFRN) {
$lbl_knowyou = $this->t('Claims to be known to you: '); $lbl_knowyou = DI::l10n()->t('Claims to be known to you: ');
$knowyou = ($Introduction->getKnowYou() ? $this->t('Yes') : $this->t('No')); $knowyou = ($Introduction->getKnowYou() ? DI::l10n()->t('Yes') : DI::l10n()->t('No'));
} else { } else {
$lbl_knowyou = ''; $lbl_knowyou = '';
$knowyou = ''; $knowyou = '';
@ -143,12 +127,12 @@ class Introductions extends BaseNotifications
$convertedName = BBCode::convert($Introduction->getName()); $convertedName = BBCode::convert($Introduction->getName());
$helptext = $this->t('Shall your connection be bidirectional or not?'); $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?');
$helptext2 = $this->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $convertedName, $convertedName); $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $convertedName, $convertedName);
$helptext3 = $this->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $convertedName); $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $convertedName);
$friend = ['duplex', $this->t('Friend'), '1', $helptext2, true]; $friend = ['duplex', DI::l10n()->t('Friend'), '1', $helptext2, true];
$follower = ['duplex', $this->t('Subscriber'), '0', $helptext3, false]; $follower = ['duplex', DI::l10n()->t('Subscriber'), '0', $helptext3, false];
$action = 'follow_confirm'; $action = 'follow_confirm';
@ -161,7 +145,7 @@ class Introductions extends BaseNotifications
$header .= ' (' . ContactSelector::networkToName($Introduction->getNetwork(), $Introduction->getUrl()) . ')'; $header .= ' (' . ContactSelector::networkToName($Introduction->getNetwork(), $Introduction->getUrl()) . ')';
if ($Introduction->getNetwork() != Protocol::DIASPORA) { if ($Introduction->getNetwork() != Protocol::DIASPORA) {
$discard = $this->t('Discard'); $discard = DI::l10n()->t('Discard');
} else { } else {
$discard = ''; $discard = '';
} }
@ -169,7 +153,7 @@ class Introductions extends BaseNotifications
$notificationContent[] = Renderer::replaceMacros($notificationTemplate, [ $notificationContent[] = Renderer::replaceMacros($notificationTemplate, [
'$type' => $Introduction->getLabel(), '$type' => $Introduction->getLabel(),
'$header' => $header, '$header' => $header,
'$str_notification_type' => $this->t('Notification type:'), '$str_notification_type' => DI::l10n()->t('Notification type:'),
'$str_type' => $Introduction->getType(), '$str_type' => $Introduction->getType(),
'$dfrn_id' => $Introduction->getDfrnId(), '$dfrn_id' => $Introduction->getDfrnId(),
'$uid' => $Introduction->getUid(), '$uid' => $Introduction->getUid(),
@ -178,39 +162,39 @@ class Introductions extends BaseNotifications
'$photo' => $Introduction->getPhoto(), '$photo' => $Introduction->getPhoto(),
'$fullname' => $Introduction->getName(), '$fullname' => $Introduction->getName(),
'$location' => $Introduction->getLocation(), '$location' => $Introduction->getLocation(),
'$lbl_location' => $this->t('Location:'), '$lbl_location' => DI::l10n()->t('Location:'),
'$about' => $Introduction->getAbout(), '$about' => $Introduction->getAbout(),
'$lbl_about' => $this->t('About:'), '$lbl_about' => DI::l10n()->t('About:'),
'$keywords' => $Introduction->getKeywords(), '$keywords' => $Introduction->getKeywords(),
'$lbl_keywords' => $this->t('Tags:'), '$lbl_keywords' => DI::l10n()->t('Tags:'),
'$hidden' => ['hidden', $this->t('Hide this contact from others'), $Introduction->isHidden(), ''], '$hidden' => ['hidden', DI::l10n()->t('Hide this contact from others'), $Introduction->isHidden(), ''],
'$lbl_connection_type' => $helptext, '$lbl_connection_type' => $helptext,
'$friend' => $friend, '$friend' => $friend,
'$follower' => $follower, '$follower' => $follower,
'$url' => $Introduction->getUrl(), '$url' => $Introduction->getUrl(),
'$zrl' => $Introduction->getZrl(), '$zrl' => $Introduction->getZrl(),
'$lbl_url' => $this->t('Profile URL'), '$lbl_url' => DI::l10n()->t('Profile URL'),
'$addr' => $Introduction->getAddr(), '$addr' => $Introduction->getAddr(),
'$lbl_knowyou' => $lbl_knowyou, '$lbl_knowyou' => $lbl_knowyou,
'$lbl_network' => $this->t('Network:'), '$lbl_network' => DI::l10n()->t('Network:'),
'$network' => ContactSelector::networkToName($Introduction->getNetwork(), $Introduction->getUrl()), '$network' => ContactSelector::networkToName($Introduction->getNetwork(), $Introduction->getUrl()),
'$knowyou' => $knowyou, '$knowyou' => $knowyou,
'$approve' => $this->t('Approve'), '$approve' => DI::l10n()->t('Approve'),
'$note' => $Introduction->getNote(), '$note' => $Introduction->getNote(),
'$ignore' => $this->t('Ignore'), '$ignore' => DI::l10n()->t('Ignore'),
'$discard' => $discard, '$discard' => $discard,
'$action' => $action, '$action' => $action,
'$is_mobile' => $this->mode->isMobile(), '$is_mobile' => DI::mode()->isMobile(),
]); ]);
break; break;
} }
} }
if (count($notifications['notifications']) == 0) { if (count($notifications['notifications']) == 0) {
notice($this->t('No introductions.')); notice(DI::l10n()->t('No introductions.'));
$notificationNoContent = $this->t('No more %s notifications.', $notifications['ident']); $notificationNoContent = DI::l10n()->t('No more %s notifications.', $notifications['ident']);
} }
return $this->printContent($notificationHeader, $notificationContent, $notificationNoContent, $notificationShowLink); return self::printContent($notificationHeader, $notificationContent, $notificationNoContent, $notificationShowLink);
} }
} }

View file

@ -21,13 +21,13 @@
namespace Friendica\Module\Notifications; namespace Friendica\Module\Notifications;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\BaseNotifications; use Friendica\Module\BaseNotifications;
use Friendica\Navigation\Notifications\Collection\FormattedNotifications;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotification; use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
use Friendica\Network\HTTPException\InternalServerErrorException;
/** /**
* Prints all notification types except introduction: * Prints all notification types except introduction:
@ -38,56 +38,42 @@ use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
*/ */
class Notifications extends BaseNotifications class Notifications extends BaseNotifications
{ {
/** @var \Friendica\Navigation\Notifications\Factory\FormattedNotification */
protected $formattedNotificationFactory;
/** @var BaseURL */
protected $baseUrl;
public function __construct(BaseURL $baseUrl, \Friendica\Navigation\Notifications\Factory\FormattedNotification $formattedNotificationFactory, Arguments $args, L10n $l10n, array $parameters = [])
{
parent::__construct($args, $l10n, $parameters);
$this->formattedNotificationFactory = $formattedNotificationFactory;
$this->baseUrl = $baseUrl;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getNotifications() public static function getNotifications()
{ {
$notificationHeader = ''; $notificationHeader = '';
$notifications = []; $notifications = [];
$factory = $this->formattedNotificationFactory; $factory = DI::formattedNotificationFactory();
if (($this->args->get(1) == 'network')) { if ((DI::args()->get(1) == 'network')) {
$notificationHeader = $this->t('Network Notifications'); $notificationHeader = DI::l10n()->t('Network Notifications');
$notifications = [ $notifications = [
'ident' => FormattedNotification::NETWORK, 'ident' => FormattedNotification::NETWORK,
'notifications' => $factory->getNetworkList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE), 'notifications' => $factory->getNetworkList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE),
]; ];
} elseif (($this->args->get(1) == 'system')) { } elseif ((DI::args()->get(1) == 'system')) {
$notificationHeader = $this->t('System Notifications'); $notificationHeader = DI::l10n()->t('System Notifications');
$notifications = [ $notifications = [
'ident' => FormattedNotification::SYSTEM, 'ident' => FormattedNotification::SYSTEM,
'notifications' => $factory->getSystemList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE), 'notifications' => $factory->getSystemList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE),
]; ];
} elseif (($this->args->get(1) == 'personal')) { } elseif ((DI::args()->get(1) == 'personal')) {
$notificationHeader = $this->t('Personal Notifications'); $notificationHeader = DI::l10n()->t('Personal Notifications');
$notifications = [ $notifications = [
'ident' => FormattedNotification::PERSONAL, 'ident' => FormattedNotification::PERSONAL,
'notifications' => $factory->getPersonalList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE), 'notifications' => $factory->getPersonalList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE),
]; ];
} elseif (($this->args->get(1) == 'home')) { } elseif ((DI::args()->get(1) == 'home')) {
$notificationHeader = $this->t('Home Notifications'); $notificationHeader = DI::l10n()->t('Home Notifications');
$notifications = [ $notifications = [
'ident' => FormattedNotification::HOME, 'ident' => FormattedNotification::HOME,
'notifications' => $factory->getHomeList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE), 'notifications' => $factory->getHomeList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE),
]; ];
} else { } else {
$this->baseUrl->redirect('notifications'); DI::baseUrl()->redirect('notifications');
} }
return [ return [
@ -103,7 +89,7 @@ class Notifications extends BaseNotifications
$notificationContent = []; $notificationContent = [];
$notificationNoContent = ''; $notificationNoContent = '';
$notificationResult = $this->getNotifications(); $notificationResult = self::getNotifications();
$notifications = $notificationResult['notifications'] ?? []; $notifications = $notificationResult['notifications'] ?? [];
$notificationHeader = $notificationResult['header'] ?? ''; $notificationHeader = $notificationResult['header'] ?? '';
@ -132,14 +118,14 @@ class Notifications extends BaseNotifications
]); ]);
} }
} else { } else {
$notificationNoContent = $this->t('No more %s notifications.', $notificationResult['ident']); $notificationNoContent = DI::l10n()->t('No more %s notifications.', $notificationResult['ident']);
} }
$notificationShowLink = [ $notificationShowLink = [
'href' => ($this->showAll ? 'notifications/' . $notifications['ident'] : 'notifications/' . $notifications['ident'] . '?show=all'), 'href' => (self::$showAll ? 'notifications/' . $notifications['ident'] : 'notifications/' . $notifications['ident'] . '?show=all'),
'text' => ($this->showAll ? $this->t('Show unread') : $this->t('Show all')), 'text' => (self::$showAll ? DI::l10n()->t('Show unread') : DI::l10n()->t('Show all')),
]; ];
return $this->printContent($notificationHeader, $notificationContent, $notificationNoContent, $notificationShowLink); return self::printContent($notificationHeader, $notificationContent, $notificationNoContent, $notificationShowLink);
} }
} }

View file

@ -44,8 +44,9 @@ use Friendica\Util\Strings;
*/ */
class Owa extends BaseModule class Owa extends BaseModule
{ {
public function rawContent() public function init()
{ {
$ret = [ 'success' => false ]; $ret = [ 'success' => false ];
foreach (['REDIRECT_REMOTE_USER', 'HTTP_AUTHORIZATION'] as $head) { foreach (['REDIRECT_REMOTE_USER', 'HTTP_AUTHORIZATION'] as $head) {

View file

@ -22,7 +22,6 @@
namespace Friendica\Module\Profile; namespace Friendica\Module\Profile;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
/** /**
* Profile index router * Profile index router
@ -37,11 +36,11 @@ class Index extends BaseModule
{ {
public function rawContent() public function rawContent()
{ {
(new Profile($this->l10n, $this->parameters))->rawContent(); (new Profile($this->parameters))->rawContent();
} }
public function content(): string public function content(): string
{ {
return (new Status($this->l10n, $this->parameters))->content(); return (new Status($this->parameters))->content();
} }
} }

View file

@ -33,6 +33,7 @@ use Friendica\DI;
use Friendica\Model; use Friendica\Model;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\Proxy; use Friendica\Util\Proxy;
use Friendica\Util\Strings;
/** /**
* @author Hypolite Petovan <hypolite@mrpetovan.com> * @author Hypolite Petovan <hypolite@mrpetovan.com>
@ -43,16 +44,6 @@ class Register extends BaseModule
const APPROVE = 1; const APPROVE = 1;
const OPEN = 2; const OPEN = 2;
/** @var Tos */
protected $tos;
public function __construct(Tos $tos, L10n $l10n, array $parameters = [])
{
parent::__construct($l10n, $parameters);
$this->tos = $tos;
}
/** /**
* Module GET method to display any content * Module GET method to display any content
* *
@ -138,6 +129,8 @@ class Register extends BaseModule
$tpl = $arr['template']; $tpl = $arr['template'];
$tos = new Tos($this->parameters);
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$invitations' => DI::config()->get('system', 'invitation_only'), '$invitations' => DI::config()->get('system', 'invitation_only'),
'$permonly' => intval(DI::config()->get('config', 'register_policy')) === self::APPROVE, '$permonly' => intval(DI::config()->get('config', 'register_policy')) === self::APPROVE,
@ -171,7 +164,7 @@ class Register extends BaseModule
'$showtoslink' => DI::config()->get('system', 'tosdisplay'), '$showtoslink' => DI::config()->get('system', 'tosdisplay'),
'$tostext' => DI::l10n()->t('Terms of Service'), '$tostext' => DI::l10n()->t('Terms of Service'),
'$showprivstatement' => DI::config()->get('system', 'tosprivstatement'), '$showprivstatement' => DI::config()->get('system', 'tosprivstatement'),
'$privstatement'=> $this->tos->privacy_complete, '$privstatement'=> $tos->privacy_complete,
'$form_security_token' => BaseModule::getFormSecurityToken('register'), '$form_security_token' => BaseModule::getFormSecurityToken('register'),
'$explicit_content' => DI::config()->get('system', 'explicit_content', false), '$explicit_content' => DI::config()->get('system', 'explicit_content', false),
'$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'), '$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'),

View file

@ -21,11 +21,9 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\L10n; use Friendica\DI;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -42,64 +40,56 @@ use Friendica\Network\Probe;
*/ */
class RemoteFollow extends BaseModule class RemoteFollow extends BaseModule
{ {
/** @var array */ static $owner;
protected $owner;
/** @var Page */
protected $page;
/** @var BaseURL */
protected $baseUrl;
public function __construct(L10n $l10n, Page $page, BaseURL $baseUrl, array $parameters = []) public function init()
{ {
parent::__construct($l10n, $parameters); self::$owner = User::getOwnerDataByNick($this->parameters['profile']);
if (!self::$owner) {
$this->owner = User::getOwnerDataByNick($this->parameters['profile']); throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
if (!$this->owner) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
} }
$this->baseUrl = $baseUrl; DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
$this->page = $page;
} }
public function post() public function post()
{ {
if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) { if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
$this->baseUrl->redirect(); DI::baseUrl()->redirect();
} }
if (empty($this->owner)) { if (empty(self::$owner)) {
notice($this->t('Profile unavailable.')); notice(DI::l10n()->t('Profile unavailable.'));
return; return;
} }
$url = Probe::cleanURI($_POST['dfrn_url']); $url = Probe::cleanURI($_POST['dfrn_url']);
if (!strlen($url)) { if (!strlen($url)) {
notice($this->t("Invalid locator")); notice(DI::l10n()->t("Invalid locator"));
return; return;
} }
// Detect the network, make sure the provided URL is valid // Detect the network, make sure the provided URL is valid
$data = Contact::getByURL($url); $data = Contact::getByURL($url);
if (!$data) { if (!$data) {
notice($this->t("The provided profile link doesn't seem to be valid")); notice(DI::l10n()->t("The provided profile link doesn't seem to be valid"));
return; return;
} }
if (empty($data['subscribe'])) { if (empty($data['subscribe'])) {
notice($this->t("Remote subscription can't be done for your network. Please subscribe directly on your system.")); notice(DI::l10n()->t("Remote subscription can't be done for your network. Please subscribe directly on your system."));
return; return;
} }
Logger::notice('Remote request', ['url' => $url, 'follow' => $this->owner['url'], 'remote' => $data['subscribe']]); Logger::notice('Remote request', ['url' => $url, 'follow' => self::$owner['url'], 'remote' => $data['subscribe']]);
// Substitute our user's feed URL into $data['subscribe'] // Substitute our user's feed URL into $data['subscribe']
// Send the subscriber home to subscribe // Send the subscriber home to subscribe
// Diaspora needs the uri in the format user@domain.tld // Diaspora needs the uri in the format user@domain.tld
if ($data['network'] == Protocol::DIASPORA) { if ($data['network'] == Protocol::DIASPORA) {
$uri = urlencode($this->owner['addr']); $uri = urlencode(self::$owner['addr']);
} else { } else {
$uri = urlencode($this->owner['url']); $uri = urlencode(self::$owner['url']);
} }
$follow_link = str_replace('{uri}', $uri, $data['subscribe']); $follow_link = str_replace('{uri}', $uri, $data['subscribe']);
@ -108,27 +98,25 @@ class RemoteFollow extends BaseModule
public function content(): string public function content(): string
{ {
if (empty($this->owner)) { if (empty(self::$owner)) {
return ''; return '';
} }
$this->page['aside'] = Widget\VCard::getHTML($this->owner); $target_addr = self::$owner['addr'];
$target_url = self::$owner['url'];
$target_addr = $this->owner['addr'];
$target_url = $this->owner['url'];
$tpl = Renderer::getMarkupTemplate('auto_request.tpl'); $tpl = Renderer::getMarkupTemplate('auto_request.tpl');
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$header' => $this->t('Friend/Connection Request'), '$header' => DI::l10n()->t('Friend/Connection Request'),
'$page_desc' => $this->t('Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system, you have to subscribe to <strong>%s</strong> or <strong>%s</strong> directly on your system.', $target_addr, $target_url), '$page_desc' => DI::l10n()->t('Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system, you have to subscribe to <strong>%s</strong> or <strong>%s</strong> directly on your system.', $target_addr, $target_url),
'$invite_desc' => $this->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica node and join us today</a>.', Search::getGlobalDirectory() . '/servers'), '$invite_desc' => DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica node and join us today</a>.', Search::getGlobalDirectory() . '/servers'),
'$your_address' => $this->t('Your Webfinger address or profile URL:'), '$your_address' => DI::l10n()->t('Your Webfinger address or profile URL:'),
'$pls_answer' => $this->t('Please answer the following:'), '$pls_answer' => DI::l10n()->t('Please answer the following:'),
'$submit' => $this->t('Submit Request'), '$submit' => DI::l10n()->t('Submit Request'),
'$cancel' => $this->t('Cancel'), '$cancel' => DI::l10n()->t('Cancel'),
'$request' => 'remote_follow/' . $this->parameters['profile'], '$request' => 'remote_follow/' . $this->parameters['profile'],
'$name' => $this->owner['name'], '$name' => self::$owner['name'],
'$myaddr' => Profile::getMyURL(), '$myaddr' => Profile::getMyURL(),
]); ]);
return $o; return $o;

View file

@ -21,34 +21,16 @@
namespace Friendica\Module\Search; namespace Friendica\Module\Search;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Search; use Friendica\Core\Search;
use Friendica\Database\Database; use Friendica\Database\DBA;
use Friendica\DI;
class Saved extends BaseModule class Saved extends BaseModule
{ {
/** @var Arguments */ public function init()
protected $args;
/** @var Database */
protected $dba;
/** @var BaseURL */
protected $baseUrl;
public function __construct(BaseURL $baseUrl, Database $dba, Arguments $args, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters); $action = DI::args()->get(2, 'none');
$this->baseUrl = $baseUrl;
$this->dba = $dba;
$this->args = $args;
}
public function rawContent()
{
$action = $this->args->get(2, 'none');
$search = trim(rawurldecode($_GET['term'] ?? '')); $search = trim(rawurldecode($_GET['term'] ?? ''));
$return_url = $_GET['return_url'] ?? Search::getSearchPath($search); $return_url = $_GET['return_url'] ?? Search::getSearchPath($search);
@ -57,23 +39,23 @@ class Saved extends BaseModule
switch ($action) { switch ($action) {
case 'add': case 'add':
$fields = ['uid' => local_user(), 'term' => $search]; $fields = ['uid' => local_user(), 'term' => $search];
if (!$this->dba->exists('search', $fields)) { if (!DBA::exists('search', $fields)) {
if (!$this->dba->insert('search', $fields)) { if (!DBA::insert('search', $fields)) {
notice($this->t('Search term was not saved.')); notice(DI::l10n()->t('Search term was not saved.'));
} }
} else { } else {
notice($this->t('Search term already saved.')); notice(DI::l10n()->t('Search term already saved.'));
} }
break; break;
case 'remove': case 'remove':
if (!$this->dba->delete('search', ['uid' => local_user(), 'term' => $search])) { if (!DBA::delete('search', ['uid' => local_user(), 'term' => $search])) {
notice($this->t('Search term was not removed.')); notice(DI::l10n()->t('Search term was not removed.'));
} }
break; break;
} }
} }
$this->baseUrl->redirect($return_url); DI::baseUrl()->redirect($return_url);
} }
} }

View file

@ -21,15 +21,11 @@
namespace Friendica\Module\Security; namespace Friendica\Module\Security;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use Friendica\Model\User\Cookie;
use Friendica\Security\TwoFactor; use Friendica\Security\TwoFactor;
/** /**
@ -37,55 +33,33 @@ use Friendica\Security\TwoFactor;
*/ */
class Logout extends BaseModule class Logout extends BaseModule
{ {
/** @var ICanCache */
protected $cache;
/** @var Cookie */
protected $cookie;
/** @var IHandleSessions */
protected $session;
/** @var BaseURL */
protected $baseUrl;
/** @var TwoFactor\Repository\TrustedBrowser */
protected $trustedBrowserRepo;
public function __construct(TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, ICanCache $cache, Cookie $cookie, IHandleSessions $session, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{
parent::__construct($l10n, $parameters);
$this->cache = $cache;
$this->cookie = $cookie;
$this->session = $session;
$this->baseUrl = $baseUrl;
$this->trustedBrowserRepo = $trustedBrowserRepo;
}
/** /**
* Process logout requests * Process logout requests
*/ */
public function rawContent() public function init()
{ {
$visitor_home = null; $visitor_home = null;
if (remote_user()) { if (remote_user()) {
$visitor_home = Profile::getMyURL(); $visitor_home = Profile::getMyURL();
$this->cache->delete('zrlInit:' . $visitor_home); DI::cache()->delete('zrlInit:' . $visitor_home);
} }
Hook::callAll("logging_out"); Hook::callAll("logging_out");
// Remove this trusted browser as it won't be able to be used ever again after the cookie is cleared // Remove this trusted browser as it won't be able to be used ever again after the cookie is cleared
if ($this->cookie->get('trusted')) { if (DI::cookie()->get('trusted')) {
$this->trustedBrowserRepo->removeForUser(local_user(), $this->cookie->get('trusted')); $trustedBrowserRepository = new TwoFactor\Repository\TrustedBrowser(DI::dba(), DI::logger());
$trustedBrowserRepository->removeForUser(local_user(), DI::cookie()->get('trusted'));
} }
$this->cookie->clear(); DI::cookie()->clear();
$this->session->clear(); DI::session()->clear();
if ($visitor_home) { if ($visitor_home) {
System::externalRedirect($visitor_home); System::externalRedirect($visitor_home);
} else { } else {
info($this->t('Logged out.')); info(DI::l10n()->t('Logged out.'));
$this->baseUrl->redirect(); DI::baseUrl()->redirect();
} }
} }
} }

View file

@ -21,13 +21,11 @@
namespace Friendica\Module\Security\TwoFactor; namespace Friendica\Module\Security\TwoFactor;
use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Security\Authentication;
use Friendica\Security\TwoFactor\Model\RecoveryCode; use Friendica\Security\TwoFactor\Model\RecoveryCode;
/** /**
@ -37,23 +35,11 @@ use Friendica\Security\TwoFactor\Model\RecoveryCode;
*/ */
class Recovery extends BaseModule class Recovery extends BaseModule
{ {
/** @var IHandleSessions */ public function init()
protected $session;
/** @var App */
protected $app;
/** @var App\BaseURL */
protected $baseUrl;
/** @var Authentication */
protected $auth;
public function __construct(App $app, App\BaseURL $baseUrl, Authentication $auth, IHandleSessions $session, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters); if (!local_user()) {
return;
$this->app = $app; }
$this->baseUrl = $baseUrl;
$this->auth = $auth;
$this->session = $session;
} }
public function post() public function post()
@ -65,16 +51,18 @@ class Recovery extends BaseModule
if (($_POST['action'] ?? '') == 'recover') { if (($_POST['action'] ?? '') == 'recover') {
self::checkFormSecurityTokenRedirectOnError('2fa', 'twofactor_recovery'); self::checkFormSecurityTokenRedirectOnError('2fa', 'twofactor_recovery');
$a = DI::app();
$recovery_code = $_POST['recovery_code'] ?? ''; $recovery_code = $_POST['recovery_code'] ?? '';
if (RecoveryCode::existsForUser(local_user(), $recovery_code)) { if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
RecoveryCode::markUsedForUser(local_user(), $recovery_code); RecoveryCode::markUsedForUser(local_user(), $recovery_code);
$this->session->set('2fa', true); Session::set('2fa', true);
info($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user()))); info(DI::l10n()->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
$this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true); DI::auth()->setForUser($a, User::getById($a->getLoggedInUserId()), true, true);
} else { } else {
notice($this->t('Invalid code, please retry.')); notice(DI::l10n()->t('Invalid code, please retry.'));
} }
} }
} }
@ -82,22 +70,22 @@ class Recovery extends BaseModule
public function content(): string public function content(): string
{ {
if (!local_user()) { if (!local_user()) {
$this->baseUrl->redirect(); DI::baseUrl()->redirect();
} }
// Already authenticated with 2FA token // Already authenticated with 2FA token
if ($this->session->get('2fa')) { if (Session::get('2fa')) {
$this->baseUrl->redirect(); DI::baseUrl()->redirect();
} }
return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [ return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [
'$form_security_token' => self::getFormSecurityToken('twofactor_recovery'), '$form_security_token' => self::getFormSecurityToken('twofactor_recovery'),
'$title' => $this->t('Two-factor recovery'), '$title' => DI::l10n()->t('Two-factor recovery'),
'$message' => $this->t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'), '$message' => DI::l10n()->t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
'$recovery_message' => $this->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'), '$recovery_message' => DI::l10n()->t('Dont have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
'$recovery_code' => ['recovery_code', $this->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'], '$recovery_code' => ['recovery_code', DI::l10n()->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
'$recovery_label' => $this->t('Submit recovery code and complete login'), '$recovery_label' => DI::l10n()->t('Submit recovery code and complete login'),
]); ]);
} }
} }

View file

@ -21,10 +21,8 @@
namespace Friendica\Module\Settings\TwoFactor; namespace Friendica\Module\Settings\TwoFactor;
use Friendica\App\BaseURL;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword; use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
use Friendica\Module\BaseSettings; use Friendica\Module\BaseSettings;
use Friendica\Module\Security\Login; use Friendica\Module\Security\Login;
@ -36,33 +34,23 @@ use Friendica\Module\Security\Login;
*/ */
class AppSpecific extends BaseSettings class AppSpecific extends BaseSettings
{ {
private $appSpecificPassword = null; private static $appSpecificPassword = null;
/** @var IManagePersonalConfigValues */ public function init()
protected $pConfig;
/** @var BaseURL */
protected $baseUrl;
public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->pConfig = $pConfig;
$this->baseUrl = $baseUrl;
if (!local_user()) { if (!local_user()) {
return; return;
} }
$verified = $this->pConfig->get(local_user(), '2fa', 'verified'); $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
if (!$verified) { if (!$verified) {
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
notice($this->t('Please enter your password to access this page.')); notice(DI::l10n()->t('Please enter your password to access this page.'));
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
} }
@ -79,21 +67,21 @@ class AppSpecific extends BaseSettings
case 'generate': case 'generate':
$description = $_POST['description'] ?? ''; $description = $_POST['description'] ?? '';
if (empty($description)) { if (empty($description)) {
notice($this->t('App-specific password generation failed: The description is empty.')); notice(DI::l10n()->t('App-specific password generation failed: The description is empty.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
} elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) { } elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) {
notice($this->t('App-specific password generation failed: This description already exists.')); notice(DI::l10n()->t('App-specific password generation failed: This description already exists.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
} else { } else {
$this->appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? ''); self::$appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? '');
info($this->t('New app-specific password generated.')); info(DI::l10n()->t('New app-specific password generated.'));
} }
break; break;
case 'revoke_all' : case 'revoke_all' :
AppSpecificPassword::deleteAllForUser(local_user()); AppSpecificPassword::deleteAllForUser(local_user());
info($this->t('App-specific passwords successfully revoked.')); info(DI::l10n()->t('App-specific passwords successfully revoked.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
break; break;
} }
} }
@ -102,10 +90,10 @@ class AppSpecific extends BaseSettings
self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific'); self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific');
if (AppSpecificPassword::deleteForUser(local_user(), $_POST['revoke_id'])) { if (AppSpecificPassword::deleteForUser(local_user(), $_POST['revoke_id'])) {
info($this->t('App-specific password successfully revoked.')); info(DI::l10n()->t('App-specific password successfully revoked.'));
} }
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
} }
} }
@ -123,22 +111,22 @@ class AppSpecific extends BaseSettings
'$form_security_token' => self::getFormSecurityToken('settings_2fa_app_specific'), '$form_security_token' => self::getFormSecurityToken('settings_2fa_app_specific'),
'$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
'$title' => $this->t('Two-factor app-specific passwords'), '$title' => DI::l10n()->t('Two-factor app-specific passwords'),
'$help_label' => $this->t('Help'), '$help_label' => DI::l10n()->t('Help'),
'$message' => $this->t('<p>App-specific passwords are randomly generated passwords used instead your regular password to authenticate your account on third-party applications that don\'t support two-factor authentication.</p>'), '$message' => DI::l10n()->t('<p>App-specific passwords are randomly generated passwords used instead your regular password to authenticate your account on third-party applications that don\'t support two-factor authentication.</p>'),
'$generated_message' => $this->t('Make sure to copy your new app-specific password now. You wont be able to see it again!'), '$generated_message' => DI::l10n()->t('Make sure to copy your new app-specific password now. You wont be able to see it again!'),
'$generated_app_specific_password' => $this->appSpecificPassword, '$generated_app_specific_password' => self::$appSpecificPassword,
'$description_label' => $this->t('Description'), '$description_label' => DI::l10n()->t('Description'),
'$last_used_label' => $this->t('Last Used'), '$last_used_label' => DI::l10n()->t('Last Used'),
'$revoke_label' => $this->t('Revoke'), '$revoke_label' => DI::l10n()->t('Revoke'),
'$revoke_all_label' => $this->t('Revoke All'), '$revoke_all_label' => DI::l10n()->t('Revoke All'),
'$app_specific_passwords' => $appSpecificPasswords, '$app_specific_passwords' => $appSpecificPasswords,
'$generate_message' => $this->t('When you generate a new app-specific password, you must use it right away, it will be shown to you once after you generate it.'), '$generate_message' => DI::l10n()->t('When you generate a new app-specific password, you must use it right away, it will be shown to you once after you generate it.'),
'$generate_title' => $this->t('Generate new app-specific password'), '$generate_title' => DI::l10n()->t('Generate new app-specific password'),
'$description_placeholder_label' => $this->t('Friendiqa on my Fairphone 2...'), '$description_placeholder_label' => DI::l10n()->t('Friendiqa on my Fairphone 2...'),
'$generate_label' => $this->t('Generate'), '$generate_label' => DI::l10n()->t('Generate'),
]); ]);
} }
} }

View file

@ -21,10 +21,8 @@
namespace Friendica\Module\Settings\TwoFactor; namespace Friendica\Module\Settings\TwoFactor;
use Friendica\App\BaseURL;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Security\TwoFactor\Model\RecoveryCode; use Friendica\Security\TwoFactor\Model\RecoveryCode;
use Friendica\Module\BaseSettings; use Friendica\Module\BaseSettings;
use Friendica\Module\Security\Login; use Friendica\Module\Security\Login;
@ -36,31 +34,21 @@ use Friendica\Module\Security\Login;
*/ */
class Recovery extends BaseSettings class Recovery extends BaseSettings
{ {
/** @var IManagePersonalConfigValues */ public function init()
protected $pConfig;
/** @var BaseURL */
protected $baseUrl;
public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->pConfig = $pConfig;
$this->baseUrl = $baseUrl;
if (!local_user()) { if (!local_user()) {
return; return;
} }
$secret = $this->pConfig->get(local_user(), '2fa', 'secret'); $secret = DI::pConfig()->get(local_user(), '2fa', 'secret');
if (!$secret) { if (!$secret) {
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
notice($this->t('Please enter your password to access this page.')); notice(DI::l10n()->t('Please enter your password to access this page.'));
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
} }
@ -75,8 +63,8 @@ class Recovery extends BaseSettings
if ($_POST['action'] == 'regenerate') { if ($_POST['action'] == 'regenerate') {
RecoveryCode::regenerateForUser(local_user()); RecoveryCode::regenerateForUser(local_user());
info($this->t('New recovery codes successfully generated.')); info(DI::l10n()->t('New recovery codes successfully generated.'));
$this->baseUrl->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
} }
} }
} }
@ -95,20 +83,20 @@ class Recovery extends BaseSettings
$recoveryCodes = RecoveryCode::getListForUser(local_user()); $recoveryCodes = RecoveryCode::getListForUser(local_user());
$verified = $this->pConfig->get(local_user(), '2fa', 'verified'); $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/recovery.tpl'), [ return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/recovery.tpl'), [
'$form_security_token' => self::getFormSecurityToken('settings_2fa_recovery'), '$form_security_token' => self::getFormSecurityToken('settings_2fa_recovery'),
'$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
'$title' => $this->t('Two-factor recovery codes'), '$title' => DI::l10n()->t('Two-factor recovery codes'),
'$help_label' => $this->t('Help'), '$help_label' => DI::l10n()->t('Help'),
'$message' => $this->t('<p>Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and dont have the recovery codes you will lose access to your account.</p>'), '$message' => DI::l10n()->t('<p>Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and dont have the recovery codes you will lose access to your account.</p>'),
'$recovery_codes' => $recoveryCodes, '$recovery_codes' => $recoveryCodes,
'$regenerate_message' => $this->t('When you generate new recovery codes, you must copy the new codes. Your old codes wont work anymore.'), '$regenerate_message' => DI::l10n()->t('When you generate new recovery codes, you must copy the new codes. Your old codes wont work anymore.'),
'$regenerate_label' => $this->t('Generate new recovery codes'), '$regenerate_label' => DI::l10n()->t('Generate new recovery codes'),
'$verified' => $verified, '$verified' => $verified,
'$verify_label' => $this->t('Next: Verification'), '$verify_label' => DI::l10n()->t('Next: Verification'),
]); ]);
} }
} }

View file

@ -2,10 +2,8 @@
namespace Friendica\Module\Settings\TwoFactor; namespace Friendica\Module\Settings\TwoFactor;
use Friendica\App\BaseURL;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\BaseSettings; use Friendica\Module\BaseSettings;
use Friendica\Security\TwoFactor; use Friendica\Security\TwoFactor;
use Friendica\Util\Temporal; use Friendica\Util\Temporal;
@ -16,34 +14,21 @@ use UAParser\Parser;
*/ */
class Trusted extends BaseSettings class Trusted extends BaseSettings
{ {
/** @var IManagePersonalConfigValues */ public function init()
protected $pConfig;
/** @var BaseURL */
protected $baseUrl;
/** @var TwoFactor\Repository\TrustedBrowser */
protected $trustedBrowserRepo;
public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->pConfig = $pConfig;
$this->baseUrl = $baseUrl;
$this->trustedBrowserRepo = $trustedBrowserRepo;
if (!local_user()) { if (!local_user()) {
return; return;
} }
$verified = $this->pConfig->get(local_user(), '2fa', 'verified'); $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
if (!$verified) { if (!$verified) {
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
notice($this->t('Please enter your password to access this page.')); notice(DI::l10n()->t('Please enter your password to access this page.'));
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
} }
@ -53,14 +38,16 @@ class Trusted extends BaseSettings
return; return;
} }
$trustedBrowserRepository = new TwoFactor\Repository\TrustedBrowser(DI::dba(), DI::logger());
if (!empty($_POST['action'])) { if (!empty($_POST['action'])) {
self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted'); self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted');
switch ($_POST['action']) { switch ($_POST['action']) {
case 'remove_all' : case 'remove_all' :
$this->trustedBrowserRepo->removeAllForUser(local_user()); $trustedBrowserRepository->removeAllForUser(local_user());
info($this->t('Trusted browsers successfully removed.')); info(DI::l10n()->t('Trusted browsers successfully removed.'));
$this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
break; break;
} }
} }
@ -68,11 +55,11 @@ class Trusted extends BaseSettings
if (!empty($_POST['remove_id'])) { if (!empty($_POST['remove_id'])) {
self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted'); self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted');
if ($this->trustedBrowserRepo->removeForUser(local_user(), $_POST['remove_id'])) { if ($trustedBrowserRepository->removeForUser(local_user(), $_POST['remove_id'])) {
info($this->t('Trusted browser successfully removed.')); info(DI::l10n()->t('Trusted browser successfully removed.'));
} }
$this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password')); DI::baseUrl()->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
} }
} }
@ -81,7 +68,8 @@ class Trusted extends BaseSettings
{ {
parent::content(); parent::content();
$trustedBrowsers = $this->trustedBrowserRepo->selectAllByUid(local_user()); $trustedBrowserRepository = new TwoFactor\Repository\TrustedBrowser(DI::dba(), DI::logger());
$trustedBrowsers = $trustedBrowserRepository->selectAllByUid(local_user());
$parser = Parser::create(); $parser = Parser::create();
@ -106,15 +94,15 @@ class Trusted extends BaseSettings
'$form_security_token' => self::getFormSecurityToken('settings_2fa_trusted'), '$form_security_token' => self::getFormSecurityToken('settings_2fa_trusted'),
'$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
'$title' => $this->t('Two-factor Trusted Browsers'), '$title' => DI::l10n()->t('Two-factor Trusted Browsers'),
'$message' => $this->t('Trusted browsers are individual browsers you chose to skip two-factor authentication to access Friendica. Please use this feature sparingly, as it can negate the benefit of two-factor authentication.'), '$message' => DI::l10n()->t('Trusted browsers are individual browsers you chose to skip two-factor authentication to access Friendica. Please use this feature sparingly, as it can negate the benefit of two-factor authentication.'),
'$device_label' => $this->t('Device'), '$device_label' => DI::l10n()->t('Device'),
'$os_label' => $this->t('OS'), '$os_label' => DI::l10n()->t('OS'),
'$browser_label' => $this->t('Browser'), '$browser_label' => DI::l10n()->t('Browser'),
'$created_label' => $this->t('Trusted'), '$created_label' => DI::l10n()->t('Trusted'),
'$last_used_label' => $this->t('Last Use'), '$last_used_label' => DI::l10n()->t('Last Use'),
'$remove_label' => $this->t('Remove'), '$remove_label' => DI::l10n()->t('Remove'),
'$remove_all_label' => $this->t('Remove All'), '$remove_all_label' => DI::l10n()->t('Remove All'),
'$trusted_browsers' => $trustedBrowserDisplay, '$trusted_browsers' => $trustedBrowserDisplay,
]); ]);

View file

@ -25,11 +25,9 @@ use BaconQrCode\Renderer\Image\SvgImageBackEnd;
use BaconQrCode\Renderer\ImageRenderer; use BaconQrCode\Renderer\ImageRenderer;
use BaconQrCode\Renderer\RendererStyle\RendererStyle; use BaconQrCode\Renderer\RendererStyle\RendererStyle;
use BaconQrCode\Writer; use BaconQrCode\Writer;
use Friendica\App\BaseURL;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\BaseSettings; use Friendica\Module\BaseSettings;
use Friendica\Module\Security\Login; use Friendica\Module\Security\Login;
use PragmaRX\Google2FA\Google2FA; use PragmaRX\Google2FA\Google2FA;
@ -41,32 +39,22 @@ use PragmaRX\Google2FA\Google2FA;
*/ */
class Verify extends BaseSettings class Verify extends BaseSettings
{ {
/** @var IManagePersonalConfigValues */ public function init()
protected $pConfig;
/** @var BaseURL */
protected $baseUrl;
public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters);
$this->pConfig = $pConfig;
$this->baseUrl = $baseUrl;
if (!local_user()) { if (!local_user()) {
return; return;
} }
$secret = $this->pConfig->get(local_user(), '2fa', 'secret'); $secret = DI::pConfig()->get(local_user(), '2fa', 'secret');
$verified = $this->pConfig->get(local_user(), '2fa', 'verified'); $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
if ($secret && $verified) { if ($secret && $verified) {
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
notice($this->t('Please enter your password to access this page.')); notice(DI::l10n()->t('Please enter your password to access this page.'));
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} }
} }
@ -81,17 +69,17 @@ class Verify extends BaseSettings
$google2fa = new Google2FA(); $google2fa = new Google2FA();
$valid = $google2fa->verifyKey($this->pConfig->get(local_user(), '2fa', 'secret'), $_POST['verify_code'] ?? ''); $valid = $google2fa->verifyKey(DI::pConfig()->get(local_user(), '2fa', 'secret'), $_POST['verify_code'] ?? '');
if ($valid) { if ($valid) {
$this->pConfig->set(local_user(), '2fa', 'verified', true); DI::pConfig()->set(local_user(), '2fa', 'verified', true);
Session::set('2fa', true); Session::set('2fa', true);
info($this->t('Two-factor authentication successfully activated.')); info(DI::l10n()->t('Two-factor authentication successfully activated.'));
$this->baseUrl->redirect('settings/2fa'); DI::baseUrl()->redirect('settings/2fa');
} else { } else {
notice($this->t('Invalid code, please retry.')); notice(DI::l10n()->t('Invalid code, please retry.'));
} }
} }
} }
@ -106,7 +94,7 @@ class Verify extends BaseSettings
$company = 'Friendica'; $company = 'Friendica';
$holder = Session::get('my_address'); $holder = Session::get('my_address');
$secret = $this->pConfig->get(local_user(), '2fa', 'secret'); $secret = DI::pConfig()->get(local_user(), '2fa', 'secret');
$otpauthUrl = (new Google2FA())->getQRCodeUrl($company, $holder, $secret); $otpauthUrl = (new Google2FA())->getQRCodeUrl($company, $holder, $secret);
@ -120,7 +108,7 @@ class Verify extends BaseSettings
$shortOtpauthUrl = explode('?', $otpauthUrl)[0]; $shortOtpauthUrl = explode('?', $otpauthUrl)[0];
$manual_message = $this->t('<p>Or you can submit the authentication settings manually:</p> $manual_message = DI::l10n()->t('<p>Or you can submit the authentication settings manually:</p>
<dl> <dl>
<dt>Issuer</dt> <dt>Issuer</dt>
<dd>%s</dd> <dd>%s</dd>
@ -140,18 +128,18 @@ class Verify extends BaseSettings
'$form_security_token' => self::getFormSecurityToken('settings_2fa_verify'), '$form_security_token' => self::getFormSecurityToken('settings_2fa_verify'),
'$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
'$title' => $this->t('Two-factor code verification'), '$title' => DI::l10n()->t('Two-factor code verification'),
'$help_label' => $this->t('Help'), '$help_label' => DI::l10n()->t('Help'),
'$message' => $this->t('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'), '$message' => DI::l10n()->t('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'),
'$qrcode_image' => $qrcode_image, '$qrcode_image' => $qrcode_image,
'$qrcode_url_message' => $this->t('<p>Or you can open the following URL in your mobile device:</p><p><a href="%s">%s</a></p>', $otpauthUrl, $shortOtpauthUrl), '$qrcode_url_message' => DI::l10n()->t('<p>Or you can open the following URL in your mobile device:</p><p><a href="%s">%s</a></p>', $otpauthUrl, $shortOtpauthUrl),
'$manual_message' => $manual_message, '$manual_message' => $manual_message,
'$company' => $company, '$company' => $company,
'$holder' => $holder, '$holder' => $holder,
'$secret' => $secret, '$secret' => $secret,
'$verify_code' => ['verify_code', $this->t('Please enter a code from your authentication app'), '', '', $this->t('Required'), 'autofocus autocomplete="off" placeholder="000000"'], '$verify_code' => ['verify_code', DI::l10n()->t('Please enter a code from your authentication app'), '', '', DI::l10n()->t('Required'), 'autofocus autocomplete="off" placeholder="000000"'],
'$verify_label' => $this->t('Verify code and enable two-factor authentication'), '$verify_label' => DI::l10n()->t('Verify code and enable two-factor authentication'),
]); ]);
} }
} }

View file

@ -23,35 +23,26 @@ namespace Friendica\Module;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\DI;
use Friendica\Core\L10n;
use Friendica\Network\HTTPException\NotFoundException; use Friendica\Network\HTTPException\NotFoundException;
use Psr\Log\LoggerInterface;
class Statistics extends BaseModule class Statistics extends BaseModule
{ {
/** @var IManageConfigValues */ public function init()
protected $config;
/** @var LoggerInterface */
protected $logger;
public function __construct(IManageConfigValues $config, LoggerInterface $logger, L10n $l10n, array $parameters = [])
{ {
parent::__construct($l10n, $parameters); if (!DI::config()->get("system", "nodeinfo")) {
$this->logger = $logger;
$this->config = $config;
if (!$this->config->get("system", "nodeinfo")) {
throw new NotFoundException(); throw new NotFoundException();
} }
} }
public function rawContent() public function rawContent()
{ {
$config = DI::config();
$logger = DI::logger();
$registration_open = $registration_open =
intval($this->config->get('config', 'register_policy')) !== Register::CLOSED intval($config->get('config', 'register_policy')) !== Register::CLOSED
&& !$this->config->get('config', 'invitation_only'); && !$config->get('config', 'invitation_only');
/// @todo mark the "service" addons and load them dynamically here /// @todo mark the "service" addons and load them dynamically here
$services = [ $services = [
@ -68,20 +59,20 @@ class Statistics extends BaseModule
]; ];
$statistics = array_merge([ $statistics = array_merge([
'name' => $this->config->get('config', 'sitename'), 'name' => $config->get('config', 'sitename'),
'network' => FRIENDICA_PLATFORM, 'network' => FRIENDICA_PLATFORM,
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
'registrations_open' => $registration_open, 'registrations_open' => $registration_open,
'total_users' => $this->config->get('nodeinfo', 'total_users'), 'total_users' => $config->get('nodeinfo', 'total_users'),
'active_users_halfyear' => $this->config->get('nodeinfo', 'active_users_halfyear'), 'active_users_halfyear' => $config->get('nodeinfo', 'active_users_halfyear'),
'active_users_monthly' => $this->config->get('nodeinfo', 'active_users_monthly'), 'active_users_monthly' => $config->get('nodeinfo', 'active_users_monthly'),
'local_posts' => $this->config->get('nodeinfo', 'local_posts'), 'local_posts' => $config->get('nodeinfo', 'local_posts'),
'services' => $services, 'services' => $services,
], $services); ], $services);
header("Content-Type: application/json"); header("Content-Type: application/json");
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
$this->logger->debug("statistics.", ['statistics' => $statistics]); $logger->debug("statistics.", ['statistics' => $statistics]);
exit(); exit();
} }
} }

View file

@ -21,12 +21,10 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\DI;
class Tos extends BaseModule class Tos extends BaseModule
{ {
@ -36,11 +34,6 @@ class Tos extends BaseModule
public $privacy_delete; public $privacy_delete;
public $privacy_complete; public $privacy_complete;
/** @var IManageConfigValues */
protected $config;
/** @var BaseURL */
protected $baseUrl;
/** /**
* constructor for the module, initializing the text variables * constructor for the module, initializing the text variables
* *
@ -48,20 +41,30 @@ class Tos extends BaseModule
* be properties of the class, however cannot be set directly as the property * be properties of the class, however cannot be set directly as the property
* cannot depend on a function result when declaring the variable. * cannot depend on a function result when declaring the variable.
**/ **/
public function __construct(IManageConfigValues $config, BaseURL $baseUrl, L10n $l10n, array $parameters = []) public function __construct(array $parameters = [])
{ {
parent::__construct($l10n, $parameters); parent::__construct($parameters);
$this->config = $config; $this->privacy_operate = DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
$this->baseUrl = $baseUrl; $this->privacy_distribute = DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
$this->privacy_delete = DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
$this->privacy_operate = $this->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
$this->privacy_distribute = $this->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
$this->privacy_delete = $this->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', $this->baseUrl);
// In some cases we don't need every single one of the above separate, but all in one block. // In some cases we don't need every single one of the above separate, but all in one block.
// So here is an array to look over // So here is an array to look over
$this->privacy_complete = [$this->t('Privacy Statement'), $this->privacy_operate, $this->privacy_complete = [DI::l10n()->t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
$this->privacy_distribute, $this->privacy_delete]; }
/**
* initialize the TOS module.
*
* If this is a single user instance, we expect the user to know their
* dealings with their own node so a TOS is not necessary.
*
**/
public function init()
{
if (strlen(DI::config()->get('system','singleuser'))) {
DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser'));
}
} }
/** /**
@ -76,22 +79,17 @@ class Tos extends BaseModule
* @return string * @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
public function content(): string public function content(): string {
{
if (strlen($this->config->get('system', 'singleuser'))) {
$this->baseUrl->redirect('profile/' . $this->config->get('system', 'singleuser'));
}
$tpl = Renderer::getMarkupTemplate('tos.tpl'); $tpl = Renderer::getMarkupTemplate('tos.tpl');
if ($this->config->get('system', 'tosdisplay')) { if (DI::config()->get('system', 'tosdisplay')) {
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$title' => $this->t('Terms of Service'), '$title' => DI::l10n()->t('Terms of Service'),
'$tostext' => BBCode::convert($this->config->get('system', 'tostext')), '$tostext' => BBCode::convert(DI::config()->get('system', 'tostext')),
'$displayprivstatement' => $this->config->get('system', 'tosprivstatement'), '$displayprivstatement' => DI::config()->get('system', 'tosprivstatement'),
'$privstatementtitle' => $this->t('Privacy Statement'), '$privstatementtitle' => DI::l10n()->t('Privacy Statement'),
'$privacy_operate' => $this->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'), '$privacy_operate' => DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
'$privacy_distribute' => $this->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'), '$privacy_distribute' => DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
'$privacy_delete' => $this->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', $this->baseUrl) '$privacy_delete' => DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
]); ]);
} else { } else {
return ''; return '';

View file

@ -54,7 +54,7 @@ class ModuleControllerTest extends DatabaseTest
self::assertModule([ self::assertModule([
'isBackend' => false, 'isBackend' => false,
'name' => App\ModuleController::DEFAULT, 'name' => App\ModuleController::DEFAULT,
'class' => null, 'class' => new $defaultClass(),
], $module); ], $module);
} }
@ -146,28 +146,28 @@ class ModuleControllerTest extends DatabaseTest
'name' => App\ModuleController::DEFAULT, 'name' => App\ModuleController::DEFAULT,
'command' => App\ModuleController::DEFAULT, 'command' => App\ModuleController::DEFAULT,
'privAdd' => false, 'privAdd' => false,
'args' => [Mockery::mock(L10n::class)], 'args' => [],
], ],
'legacy' => [ 'legacy' => [
'assert' => LegacyModule::class, 'assert' => LegacyModule::class,
'name' => 'display', 'name' => 'display',
'command' => 'display/test/it', 'command' => 'display/test/it',
'privAdd' => false, 'privAdd' => false,
'args' => [Mockery::mock(L10n::class), __DIR__ . '/../../datasets/legacy/legacy.php'], 'args' => [__DIR__ . '/../../datasets/legacy/legacy.php'],
], ],
'new' => [ 'new' => [
'assert' => HostMeta::class, 'assert' => HostMeta::class,
'not_required', 'not_required',
'command' => '.well-known/host-meta', 'command' => '.well-known/host-meta',
'privAdd' => false, 'privAdd' => false,
'args' => [Mockery::mock(L10n::class)], 'args' => [],
], ],
'404' => [ '404' => [
'assert' => PageNotFound::class, 'assert' => PageNotFound::class,
'name' => 'invalid', 'name' => 'invalid',
'command' => 'invalid', 'command' => 'invalid',
'privAdd' => false, 'privAdd' => false,
'args' => [Mockery::mock(L10n::class)], 'args' => [],
] ]
]; ];
} }

View file

@ -67,7 +67,7 @@ class NotificationTest extends ApiTest
</notes> </notes>
XML; XML;
$notification = new Notification(DI::l10n(), ['extension' => 'xml']); $notification = new Notification(['extension' => 'xml']);
$notification->rawContent(); $notification->rawContent();
self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput()); self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput());
@ -75,7 +75,7 @@ XML;
public function testWithJsonResult() public function testWithJsonResult()
{ {
$notification = new Notification(DI::l10n(),['parameter' => 'json']); $notification = new Notification(['parameter' => 'json']);
$notification->rawContent(); $notification->rawContent();
$result = json_encode(ApiResponseDouble::getOutput()); $result = json_encode(ApiResponseDouble::getOutput());

View file

@ -21,7 +21,6 @@
namespace Friendica\Test\src\Module\Api\Friendica\Photo; namespace Friendica\Test\src\Module\Api\Friendica\Photo;
use Friendica\DI;
use Friendica\Module\Api\Friendica\Photo\Delete; use Friendica\Module\Api\Friendica\Photo\Delete;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
@ -31,7 +30,7 @@ class DeleteTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::l10n()))->rawContent(); (new Delete())->rawContent();
} }
public function testWithoutAuthenticatedUser() public function testWithoutAuthenticatedUser()
@ -42,7 +41,7 @@ class DeleteTest extends ApiTest
public function testWrong() public function testWrong()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::l10n(), ['photo_id' => 1]))->rawContent(); (new Delete(['photo_id' => 1]))->rawContent();
} }
public function testWithCorrectPhotoId() public function testWithCorrectPhotoId()

View file

@ -21,7 +21,6 @@
namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum; namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Delete; use Friendica\Module\Api\Friendica\Photoalbum\Delete;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
@ -31,13 +30,13 @@ class DeleteTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::l10n()))->rawContent(); (new Delete())->rawContent();
} }
public function testWrong() public function testWrong()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Delete(DI::l10n(), ['album' => 'album_name']))->rawContent(); (new Delete(['album' => 'album_name']))->rawContent();
} }
public function testValid() public function testValid()

View file

@ -21,7 +21,6 @@
namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum; namespace Friendica\Test\src\Module\Api\Friendica\Photoalbum;
use Friendica\DI;
use Friendica\Module\Api\Friendica\Photoalbum\Update; use Friendica\Module\Api\Friendica\Photoalbum\Update;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
@ -31,19 +30,19 @@ class UpdateTest extends ApiTest
public function testEmpty() public function testEmpty()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::l10n()))->rawContent(); (new Update())->rawContent();
} }
public function testTooFewArgs() public function testTooFewArgs()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::l10n(), ['album' => 'album_name']))->rawContent(); (new Update(['album' => 'album_name']))->rawContent();
} }
public function testWrongUpdate() public function testWrongUpdate()
{ {
$this->expectException(BadRequestException::class); $this->expectException(BadRequestException::class);
(new Update(DI::l10n(), ['album' => 'album_name', 'album_new' => 'album_name']))->rawContent(); (new Update(['album' => 'album_name', 'album_new' => 'album_name']))->rawContent();
} }
public function testWithoutAuthenticatedUser() public function testWithoutAuthenticatedUser()

View file

@ -2,7 +2,6 @@
namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial; namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial;
use Friendica\DI;
use Friendica\Module\Api\GNUSocial\GNUSocial\Version; use Friendica\Module\Api\GNUSocial\GNUSocial\Version;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble; use Friendica\Test\Util\ApiResponseDouble;
@ -11,7 +10,7 @@ class VersionTest extends ApiTest
{ {
public function test() public function test()
{ {
$version = new Version(DI::l10n(), ['extension' => 'json']); $version = new Version(['extension' => 'json']);
$version->rawContent(); $version->rawContent();
$result = json_decode(ApiResponseDouble::getOutput()); $result = json_decode(ApiResponseDouble::getOutput());

View file

@ -2,7 +2,6 @@
namespace Friendica\Test\src\Module\Api\GnuSocial\Help; namespace Friendica\Test\src\Module\Api\GnuSocial\Help;
use Friendica\DI;
use Friendica\Module\Api\GNUSocial\Help\Test; use Friendica\Module\Api\GNUSocial\Help\Test;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble; use Friendica\Test\Util\ApiResponseDouble;
@ -11,7 +10,7 @@ class TestTest extends ApiTest
{ {
public function testJson() public function testJson()
{ {
$test = new Test(DI::l10n(), ['extension' => 'json']); $test = new Test(['extension' => 'json']);
$test->rawContent(); $test->rawContent();
self::assertEquals('"ok"', ApiResponseDouble::getOutput()); self::assertEquals('"ok"', ApiResponseDouble::getOutput());
@ -19,7 +18,7 @@ class TestTest extends ApiTest
public function testXml() public function testXml()
{ {
$test = new Test(DI::l10n(), ['extension' => 'xml']); $test = new Test(['extension' => 'xml']);
$test->rawContent(); $test->rawContent();
self::assertxml(ApiResponseDouble::getOutput(), 'ok'); self::assertxml(ApiResponseDouble::getOutput(), 'ok');

View file

@ -2,7 +2,6 @@
namespace Friendica\Test\src\Module\Api\Twitter\Account; namespace Friendica\Test\src\Module\Api\Twitter\Account;
use Friendica\DI;
use Friendica\Module\Api\Twitter\Account\RateLimitStatus; use Friendica\Module\Api\Twitter\Account\RateLimitStatus;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble; use Friendica\Test\Util\ApiResponseDouble;
@ -11,7 +10,7 @@ class RateLimitStatusTest extends ApiTest
{ {
public function testWithJson() public function testWithJson()
{ {
$rateLimitStatus = new RateLimitStatus(DI::l10n(), ['extension' => 'json']); $rateLimitStatus = new RateLimitStatus(['extension' => 'json']);
$rateLimitStatus->rawContent(); $rateLimitStatus->rawContent();
$result = json_decode(ApiResponseDouble::getOutput()); $result = json_decode(ApiResponseDouble::getOutput());
@ -23,7 +22,7 @@ class RateLimitStatusTest extends ApiTest
public function testWithXml() public function testWithXml()
{ {
$rateLimitStatus = new RateLimitStatus(DI::l10n(),['extension' => 'xml']); $rateLimitStatus = new RateLimitStatus(['extension' => 'xml']);
$rateLimitStatus->rawContent(); $rateLimitStatus->rawContent();
self::assertXml(ApiResponseDouble::getOutput(), 'hash'); self::assertXml(ApiResponseDouble::getOutput(), 'hash');

View file

@ -2,7 +2,6 @@
namespace Friendica\Test\src\Module\Api\Twitter; namespace Friendica\Test\src\Module\Api\Twitter;
use Friendica\DI;
use Friendica\Module\Api\Twitter\SavedSearches; use Friendica\Module\Api\Twitter\SavedSearches;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble; use Friendica\Test\Util\ApiResponseDouble;
@ -11,7 +10,7 @@ class SavedSearchesTest extends ApiTest
{ {
public function test() public function test()
{ {
$savedSearch = new SavedSearches(DI::l10n(), ['extension' => 'json']); $savedSearch = new SavedSearches(['extension' => 'json']);
$savedSearch->rawContent(); $savedSearch->rawContent();
$result = json_decode(ApiResponseDouble::getOutput()); $result = json_decode(ApiResponseDouble::getOutput());

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.12-dev\n" "Project-Id-Version: 2021.12-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-18 21:26+0100\n" "POT-Creation-Date: 2021-11-15 19:02-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,28 +18,28 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: include/api.php:860 src/Module/BaseApi.php:259 #: include/api.php:860 src/Module/BaseApi.php:260
#, php-format #, php-format
msgid "Daily posting limit of %d post reached. The post was rejected." msgid "Daily posting limit of %d post reached. The post was rejected."
msgid_plural "Daily posting limit of %d posts reached. The post was rejected." msgid_plural "Daily posting limit of %d posts reached. The post was rejected."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: include/api.php:874 src/Module/BaseApi.php:275 #: include/api.php:874 src/Module/BaseApi.php:276
#, php-format #, php-format
msgid "Weekly posting limit of %d post reached. The post was rejected." msgid "Weekly posting limit of %d post reached. The post was rejected."
msgid_plural "Weekly posting limit of %d posts reached. The post was rejected." msgid_plural "Weekly posting limit of %d posts reached. The post was rejected."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: include/api.php:888 src/Module/BaseApi.php:291 #: include/api.php:888 src/Module/BaseApi.php:292
#, php-format #, php-format
msgid "Monthly posting limit of %d post reached. The post was rejected." msgid "Monthly posting limit of %d post reached. The post was rejected."
msgstr "" msgstr ""
#: mod/cal.php:44 mod/cal.php:48 mod/follow.php:39 mod/redir.php:34 #: mod/cal.php:44 mod/cal.php:48 mod/follow.php:39 mod/redir.php:34
#: mod/redir.php:175 src/Module/Conversation/Community.php:181 #: mod/redir.php:175 src/Module/Conversation/Community.php:182
#: src/Module/Debug/ItemBody.php:37 src/Module/Diaspora/Receive.php:57 #: src/Module/Debug/ItemBody.php:37 src/Module/Diaspora/Receive.php:51
#: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:41 #: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:41
#: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57 #: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57
#: src/Module/Item/Star.php:43 #: src/Module/Item/Star.php:43
@ -51,7 +51,7 @@ msgstr ""
#: src/Module/Profile/Common.php:41 src/Module/Profile/Common.php:52 #: src/Module/Profile/Common.php:41 src/Module/Profile/Common.php:52
#: src/Module/Profile/Contacts.php:40 src/Module/Profile/Contacts.php:50 #: src/Module/Profile/Contacts.php:40 src/Module/Profile/Contacts.php:50
#: src/Module/Profile/Media.php:38 src/Module/Profile/Status.php:58 #: src/Module/Profile/Media.php:38 src/Module/Profile/Status.php:58
#: src/Module/Register.php:263 src/Module/RemoteFollow.php:58 #: src/Module/Register.php:256 src/Module/RemoteFollow.php:49
msgid "User not found." msgid "User not found."
msgstr "" msgstr ""
@ -76,7 +76,7 @@ msgstr ""
msgid "Previous" msgid "Previous"
msgstr "" msgstr ""
#: mod/cal.php:245 mod/events.php:381 src/Module/Install.php:215 #: mod/cal.php:245 mod/events.php:381 src/Module/Install.php:206
msgid "Next" msgid "Next"
msgstr "" msgstr ""
@ -106,7 +106,7 @@ msgstr ""
#: mod/cal.php:265 src/Console/User.php:182 src/Model/User.php:660 #: mod/cal.php:265 src/Console/User.php:182 src/Model/User.php:660
#: src/Module/Admin/Users/Active.php:73 src/Module/Admin/Users/Blocked.php:74 #: src/Module/Admin/Users/Active.php:73 src/Module/Admin/Users/Blocked.php:74
#: src/Module/Admin/Users/Index.php:80 src/Module/Admin/Users/Pending.php:71 #: src/Module/Admin/Users/Index.php:80 src/Module/Admin/Users/Pending.php:71
#: src/Module/Api/Twitter/ContactEndpoint.php:72 #: src/Module/Api/Twitter/ContactEndpoint.php:71
msgid "User not found" msgid "User not found"
msgstr "" msgstr ""
@ -123,7 +123,7 @@ msgid "calendar"
msgstr "" msgstr ""
#: mod/display.php:165 mod/photos.php:808 #: mod/display.php:165 mod/photos.php:808
#: src/Module/Conversation/Community.php:175 src/Module/Directory.php:48 #: src/Module/Conversation/Community.php:176 src/Module/Directory.php:48
#: src/Module/Search/Index.php:49 #: src/Module/Search/Index.php:49
msgid "Public access denied." msgid "Public access denied."
msgstr "" msgstr ""
@ -147,26 +147,26 @@ msgstr ""
#: mod/wallmessage.php:36 mod/wallmessage.php:55 mod/wallmessage.php:89 #: mod/wallmessage.php:36 mod/wallmessage.php:55 mod/wallmessage.php:89
#: mod/wallmessage.php:109 src/Module/Attach.php:55 src/Module/BaseApi.php:61 #: mod/wallmessage.php:109 src/Module/Attach.php:55 src/Module/BaseApi.php:61
#: src/Module/BaseApi.php:70 src/Module/BaseApi.php:79 #: src/Module/BaseApi.php:70 src/Module/BaseApi.php:79
#: src/Module/BaseApi.php:88 src/Module/BaseNotifications.php:94 #: src/Module/BaseApi.php:88 src/Module/BaseNotifications.php:88
#: src/Module/Contact.php:328 src/Module/Contact/Advanced.php:60 #: src/Module/Contact.php:328 src/Module/Contact/Advanced.php:44
#: src/Module/Delegation.php:118 src/Module/FollowConfirm.php:17 #: src/Module/Delegation.php:118 src/Module/FollowConfirm.php:17
#: src/Module/FriendSuggest.php:56 src/Module/Group.php:44 #: src/Module/FriendSuggest.php:44 src/Module/Group.php:44
#: src/Module/Group.php:89 src/Module/Invite.php:41 src/Module/Invite.php:130 #: src/Module/Group.php:89 src/Module/Invite.php:41 src/Module/Invite.php:130
#: src/Module/Notifications/Notification.php:48 #: src/Module/Notifications/Notification.php:48
#: src/Module/Notifications/Notification.php:79 #: src/Module/Notifications/Notification.php:79
#: src/Module/Profile/Common.php:56 src/Module/Profile/Contacts.php:56 #: src/Module/Profile/Common.php:56 src/Module/Profile/Contacts.php:56
#: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56 #: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56
#: src/Module/Register.php:73 src/Module/Register.php:86 #: src/Module/Register.php:64 src/Module/Register.php:77
#: src/Module/Register.php:202 src/Module/Register.php:241 #: src/Module/Register.php:195 src/Module/Register.php:234
#: src/Module/Search/Directory.php:37 src/Module/Settings/Delegation.php:42 #: src/Module/Search/Directory.php:37 src/Module/Settings/Delegation.php:42
#: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42 #: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42
#: src/Module/Settings/Display.php:120 #: src/Module/Settings/Display.php:120
#: src/Module/Settings/Profile/Photo/Crop.php:166 #: src/Module/Settings/Profile/Photo/Crop.php:166
#: src/Module/Settings/Profile/Photo/Index.php:112 #: src/Module/Settings/Profile/Photo/Index.php:112
#: src/Module/Settings/UserExport.php:57 src/Module/Settings/UserExport.php:91 #: src/Module/Settings/UserExport.php:58 src/Module/Settings/UserExport.php:93
#: src/Module/Settings/UserExport.php:196 #: src/Module/Settings/UserExport.php:198
#: src/Module/Settings/UserExport.php:216 #: src/Module/Settings/UserExport.php:218
#: src/Module/Settings/UserExport.php:281 #: src/Module/Settings/UserExport.php:283
msgid "Permission denied." msgid "Permission denied."
msgstr "" msgstr ""
@ -179,7 +179,7 @@ msgid "Edit post"
msgstr "" msgstr ""
#: mod/editpost.php:91 mod/notes.php:56 src/Content/Text/HTML.php:875 #: mod/editpost.php:91 mod/notes.php:56 src/Content/Text/HTML.php:875
#: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:76 #: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:69
msgid "Save" msgid "Save"
msgstr "" msgstr ""
@ -289,7 +289,7 @@ msgstr ""
#: mod/editpost.php:130 mod/fbrowser.php:100 mod/fbrowser.php:127 #: mod/editpost.php:130 mod/fbrowser.php:100 mod/fbrowser.php:127
#: mod/follow.php:144 mod/photos.php:1010 mod/photos.php:1111 mod/tagrm.php:35 #: mod/follow.php:144 mod/photos.php:1010 mod/photos.php:1111 mod/tagrm.php:35
#: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:373 #: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:373
#: src/Module/Contact/Revoke.php:114 src/Module/RemoteFollow.php:128 #: src/Module/Contact/Revoke.php:99 src/Module/RemoteFollow.php:116
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
@ -335,7 +335,7 @@ msgid "Message"
msgstr "" msgstr ""
#: mod/editpost.php:144 src/Content/Conversation.php:381 #: mod/editpost.php:144 src/Content/Conversation.php:381
#: src/Module/Settings/TwoFactor/Trusted.php:113 #: src/Module/Settings/TwoFactor/Trusted.php:101
msgid "Browser" msgid "Browser"
msgstr "" msgstr ""
@ -379,15 +379,15 @@ msgstr ""
#: src/Module/Admin/Blocklist/Server/Index.php:69 #: src/Module/Admin/Blocklist/Server/Index.php:69
#: src/Module/Admin/Blocklist/Server/Index.php:96 #: src/Module/Admin/Blocklist/Server/Index.php:96
#: src/Module/Admin/Item/Delete.php:70 src/Module/Debug/Probe.php:59 #: src/Module/Admin/Item/Delete.php:70 src/Module/Debug/Probe.php:59
#: src/Module/Install.php:208 src/Module/Install.php:241 #: src/Module/Install.php:199 src/Module/Install.php:232
#: src/Module/Install.php:246 src/Module/Install.php:265 #: src/Module/Install.php:237 src/Module/Install.php:256
#: src/Module/Install.php:276 src/Module/Install.php:281 #: src/Module/Install.php:267 src/Module/Install.php:272
#: src/Module/Install.php:287 src/Module/Install.php:292 #: src/Module/Install.php:278 src/Module/Install.php:283
#: src/Module/Install.php:306 src/Module/Install.php:321 #: src/Module/Install.php:297 src/Module/Install.php:312
#: src/Module/Install.php:348 src/Module/Register.php:144 #: src/Module/Install.php:339 src/Module/Register.php:137
#: src/Module/Security/TwoFactor/Verify.php:100 #: src/Module/Security/TwoFactor/Verify.php:100
#: src/Module/Settings/TwoFactor/Index.php:133 #: src/Module/Settings/TwoFactor/Index.php:133
#: src/Module/Settings/TwoFactor/Verify.php:153 #: src/Module/Settings/TwoFactor/Verify.php:141
msgid "Required" msgid "Required"
msgstr "" msgstr ""
@ -407,7 +407,7 @@ msgstr ""
#: mod/events.php:508 src/Content/Widget/VCard.php:98 src/Model/Event.php:80 #: mod/events.php:508 src/Content/Widget/VCard.php:98 src/Model/Event.php:80
#: src/Model/Event.php:107 src/Model/Event.php:466 src/Model/Event.php:915 #: src/Model/Event.php:107 src/Model/Event.php:466 src/Model/Event.php:915
#: src/Model/Profile.php:368 src/Module/Contact.php:565 #: src/Model/Profile.php:368 src/Module/Contact.php:565
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:181 #: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:165
#: src/Module/Profile/Profile.php:194 #: src/Module/Profile/Profile.php:194
msgid "Location:" msgid "Location:"
msgstr "" msgstr ""
@ -424,13 +424,13 @@ msgstr ""
#: mod/photos.php:927 mod/photos.php:1031 mod/photos.php:1301 #: mod/photos.php:927 mod/photos.php:1031 mod/photos.php:1301
#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 #: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472
#: src/Module/Admin/Item/Source.php:65 src/Module/Contact.php:523 #: src/Module/Admin/Item/Source.php:65 src/Module/Contact.php:523
#: src/Module/Contact/Advanced.php:147 src/Module/Contact/Poke.php:158 #: src/Module/Contact/Advanced.php:133 src/Module/Contact/Poke.php:158
#: src/Module/Debug/ActivityPubConversion.php:141 #: src/Module/Debug/ActivityPubConversion.php:141
#: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64 #: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64
#: src/Module/Debug/Probe.php:54 src/Module/Debug/WebFinger.php:51 #: src/Module/Debug/Probe.php:54 src/Module/Debug/WebFinger.php:51
#: src/Module/Delegation.php:147 src/Module/FriendSuggest.php:145 #: src/Module/Delegation.php:147 src/Module/FriendSuggest.php:128
#: src/Module/Install.php:253 src/Module/Install.php:295 #: src/Module/Install.php:244 src/Module/Install.php:286
#: src/Module/Install.php:332 src/Module/Invite.php:177 #: src/Module/Install.php:323 src/Module/Invite.php:177
#: src/Module/Item/Compose.php:150 src/Module/Profile/Profile.php:247 #: src/Module/Item/Compose.php:150 src/Module/Profile/Profile.php:247
#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:963 #: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:963
#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 #: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160
@ -465,7 +465,7 @@ msgstr ""
msgid "Files" msgid "Files"
msgstr "" msgstr ""
#: mod/follow.php:74 mod/unfollow.php:96 src/Module/RemoteFollow.php:127 #: mod/follow.php:74 mod/unfollow.php:96 src/Module/RemoteFollow.php:115
msgid "Submit Request" msgid "Submit Request"
msgstr "" msgstr ""
@ -491,7 +491,7 @@ msgstr ""
msgid "Connect/Follow" msgid "Connect/Follow"
msgstr "" msgstr ""
#: mod/follow.php:139 src/Module/RemoteFollow.php:126 #: mod/follow.php:139 src/Module/RemoteFollow.php:114
msgid "Please answer the following:" msgid "Please answer the following:"
msgstr "" msgstr ""
@ -501,13 +501,13 @@ msgstr ""
#: mod/follow.php:141 mod/unfollow.php:100 #: mod/follow.php:141 mod/unfollow.php:100
#: src/Module/Admin/Blocklist/Contact.php:116 src/Module/Contact.php:561 #: src/Module/Admin/Blocklist/Contact.php:116 src/Module/Contact.php:561
#: src/Module/Notifications/Introductions.php:123 #: src/Module/Notifications/Introductions.php:107
#: src/Module/Notifications/Introductions.php:192 #: src/Module/Notifications/Introductions.php:176
msgid "Profile URL" msgid "Profile URL"
msgstr "" msgstr ""
#: mod/follow.php:142 src/Module/Contact.php:573 #: mod/follow.php:142 src/Module/Contact.php:573
#: src/Module/Notifications/Introductions.php:185 #: src/Module/Notifications/Introductions.php:169
#: src/Module/Profile/Profile.php:207 #: src/Module/Profile/Profile.php:207
msgid "Tags:" msgid "Tags:"
msgstr "" msgstr ""
@ -726,8 +726,8 @@ msgstr ""
msgid "Message collection failure." msgid "Message collection failure."
msgstr "" msgstr ""
#: mod/message.php:120 src/Module/Notifications/Introductions.php:129 #: mod/message.php:120 src/Module/Notifications/Introductions.php:113
#: src/Module/Notifications/Introductions.php:164 #: src/Module/Notifications/Introductions.php:148
#: src/Module/Notifications/Notification.php:57 #: src/Module/Notifications/Notification.php:57
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
@ -1146,10 +1146,10 @@ msgstr ""
msgid "Bad Request." msgid "Bad Request."
msgstr "" msgstr ""
#: mod/redir.php:55 mod/redir.php:129 src/Module/Contact/Advanced.php:70 #: mod/redir.php:55 mod/redir.php:129 src/Module/Contact/Advanced.php:54
#: src/Module/Contact/Advanced.php:119 src/Module/Contact/Contacts.php:36 #: src/Module/Contact/Advanced.php:105 src/Module/Contact/Contacts.php:36
#: src/Module/Contact/Media.php:43 src/Module/FriendSuggest.php:71 #: src/Module/Contact/Media.php:43 src/Module/FriendSuggest.php:54
#: src/Module/FriendSuggest.php:109 src/Module/Group.php:104 #: src/Module/FriendSuggest.php:92 src/Module/Group.php:104
msgid "Contact not found." msgid "Contact not found."
msgstr "" msgstr ""
@ -1269,7 +1269,7 @@ msgstr ""
#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130 #: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130
#: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88 #: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88
#: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162 #: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162
#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:149 #: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:135
msgid "Name" msgid "Name"
msgstr "" msgstr ""
@ -1300,7 +1300,7 @@ msgstr ""
#: mod/settings.php:475 mod/settings.php:566 mod/settings.php:703 #: mod/settings.php:475 mod/settings.php:566 mod/settings.php:703
#: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87 #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87
#: src/Module/Admin/Logs/Settings.php:82 src/Module/Admin/Site.php:501 #: src/Module/Admin/Logs/Settings.php:82 src/Module/Admin/Site.php:501
#: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:83 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:66
#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:193 #: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:193
msgid "Save Settings" msgid "Save Settings"
msgstr "" msgstr ""
@ -1610,7 +1610,7 @@ msgstr ""
msgid "Password Settings" msgid "Password Settings"
msgstr "" msgstr ""
#: mod/settings.php:710 src/Module/Register.php:158 #: mod/settings.php:710 src/Module/Register.php:151
msgid "New Password:" msgid "New Password:"
msgstr "" msgstr ""
@ -1620,7 +1620,7 @@ msgid ""
"spaces, accentuated letters and colon (:)." "spaces, accentuated letters and colon (:)."
msgstr "" msgstr ""
#: mod/settings.php:711 src/Module/Register.php:159 #: mod/settings.php:711 src/Module/Register.php:152
msgid "Confirm:" msgid "Confirm:"
msgstr "" msgstr ""
@ -2000,7 +2000,7 @@ msgid "Select a tag to remove: "
msgstr "" msgstr ""
#: mod/tagrm.php:126 src/Module/Settings/Delegation.php:179 #: mod/tagrm.php:126 src/Module/Settings/Delegation.php:179
#: src/Module/Settings/TwoFactor/Trusted.php:116 #: src/Module/Settings/TwoFactor/Trusted.php:104
msgid "Remove" msgid "Remove"
msgstr "" msgstr ""
@ -2008,13 +2008,13 @@ msgstr ""
msgid "User imports on closed servers can only be done by an administrator." msgid "User imports on closed servers can only be done by an administrator."
msgstr "" msgstr ""
#: mod/uimport.php:55 src/Module/Register.php:95 #: mod/uimport.php:55 src/Module/Register.php:86
msgid "" msgid ""
"This site has exceeded the number of allowed daily account registrations. " "This site has exceeded the number of allowed daily account registrations. "
"Please try again tomorrow." "Please try again tomorrow."
msgstr "" msgstr ""
#: mod/uimport.php:62 src/Module/Register.php:169 #: mod/uimport.php:62 src/Module/Register.php:162
msgid "Import" msgid "Import"
msgstr "" msgstr ""
@ -2122,11 +2122,11 @@ msgid ""
"your site allow private mail from unknown senders." "your site allow private mail from unknown senders."
msgstr "" msgstr ""
#: src/App.php:470 #: src/App.php:469
msgid "No system theme config value set." msgid "No system theme config value set."
msgstr "" msgstr ""
#: src/App/ModuleController.php:233 #: src/App/Module.php:242
msgid "You must be logged in to use addons. " msgid "You must be logged in to use addons. "
msgstr "" msgstr ""
@ -2153,31 +2153,31 @@ msgstr ""
msgid "Page not found." msgid "Page not found."
msgstr "" msgstr ""
#: src/BaseModule.php:158 #: src/BaseModule.php:180
msgid "" msgid ""
"The form security token was not correct. This probably happened because the " "The form security token was not correct. This probably happened because the "
"form has been opened for too long (>3 hours) before submitting it." "form has been opened for too long (>3 hours) before submitting it."
msgstr "" msgstr ""
#: src/BaseModule.php:185 #: src/BaseModule.php:207
msgid "All contacts" msgid "All contacts"
msgstr "" msgstr ""
#: src/BaseModule.php:190 src/Content/Widget.php:231 src/Core/ACL.php:193 #: src/BaseModule.php:212 src/Content/Widget.php:231 src/Core/ACL.php:193
#: src/Module/Contact.php:756 src/Module/PermissionTooltip.php:79 #: src/Module/Contact.php:756 src/Module/PermissionTooltip.php:79
#: src/Module/PermissionTooltip.php:101 #: src/Module/PermissionTooltip.php:101
msgid "Followers" msgid "Followers"
msgstr "" msgstr ""
#: src/BaseModule.php:195 src/Content/Widget.php:232 src/Module/Contact.php:757 #: src/BaseModule.php:217 src/Content/Widget.php:232 src/Module/Contact.php:757
msgid "Following" msgid "Following"
msgstr "" msgstr ""
#: src/BaseModule.php:200 src/Content/Widget.php:233 src/Module/Contact.php:758 #: src/BaseModule.php:222 src/Content/Widget.php:233 src/Module/Contact.php:758
msgid "Mutual friends" msgid "Mutual friends"
msgstr "" msgstr ""
#: src/BaseModule.php:208 #: src/BaseModule.php:230
msgid "Common" msgid "Common"
msgstr "" msgstr ""
@ -2499,7 +2499,7 @@ msgstr ""
msgid "Tag term:" msgid "Tag term:"
msgstr "" msgstr ""
#: src/Content/Conversation.php:310 src/Module/Filer/SaveTag.php:75 #: src/Content/Conversation.php:310 src/Module/Filer/SaveTag.php:68
msgid "Save to Folder:" msgid "Save to Folder:"
msgstr "" msgstr ""
@ -2773,8 +2773,8 @@ msgstr ""
#: src/Content/Item.php:450 src/Module/Contact.php:545 #: src/Content/Item.php:450 src/Module/Contact.php:545
#: src/Module/Contact.php:788 src/Module/Contact.php:1072 #: src/Module/Contact.php:788 src/Module/Contact.php:1072
#: src/Module/Notifications/Introductions.php:128 #: src/Module/Notifications/Introductions.php:112
#: src/Module/Notifications/Introductions.php:200 #: src/Module/Notifications/Introductions.php:184
#: src/Module/Notifications/Notification.php:61 #: src/Module/Notifications/Notification.php:61
msgid "Ignore" msgid "Ignore"
msgstr "" msgstr ""
@ -2872,7 +2872,7 @@ msgstr ""
msgid "Home" msgid "Home"
msgstr "" msgstr ""
#: src/Content/Nav.php:216 src/Module/Register.php:164 #: src/Content/Nav.php:216 src/Module/Register.php:157
#: src/Module/Security/Login.php:105 #: src/Module/Security/Login.php:105
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -2881,11 +2881,11 @@ msgstr ""
msgid "Create an account" msgid "Create an account"
msgstr "" msgstr ""
#: src/Content/Nav.php:222 src/Module/Help.php:67 #: src/Content/Nav.php:222 src/Module/Help.php:68
#: src/Module/Settings/TwoFactor/AppSpecific.php:127 #: src/Module/Settings/TwoFactor/AppSpecific.php:115
#: src/Module/Settings/TwoFactor/Index.php:111 #: src/Module/Settings/TwoFactor/Index.php:111
#: src/Module/Settings/TwoFactor/Recovery.php:105 #: src/Module/Settings/TwoFactor/Recovery.php:93
#: src/Module/Settings/TwoFactor/Verify.php:144 view/theme/vier/theme.php:217 #: src/Module/Settings/TwoFactor/Verify.php:132 view/theme/vier/theme.php:217
msgid "Help" msgid "Help"
msgstr "" msgstr ""
@ -2955,9 +2955,9 @@ msgstr ""
msgid "Information about this friendica instance" msgid "Information about this friendica instance"
msgstr "" msgstr ""
#: src/Content/Nav.php:266 src/Module/Admin/Tos.php:76 #: src/Content/Nav.php:266 src/Module/Admin/Tos.php:59
#: src/Module/BaseAdmin.php:96 src/Module/Register.php:172 #: src/Module/BaseAdmin.php:96 src/Module/Register.php:165
#: src/Module/Tos.php:88 #: src/Module/Tos.php:84
msgid "Terms of Service" msgid "Terms of Service"
msgstr "" msgstr ""
@ -2981,8 +2981,8 @@ msgstr ""
msgid "Friend Requests" msgid "Friend Requests"
msgstr "" msgstr ""
#: src/Content/Nav.php:278 src/Module/BaseNotifications.php:147 #: src/Content/Nav.php:278 src/Module/BaseNotifications.php:139
#: src/Module/Notifications/Introductions.php:69 #: src/Module/Notifications/Introductions.php:53
msgid "Notifications" msgid "Notifications"
msgstr "" msgstr ""
@ -3300,7 +3300,7 @@ msgid "Matrix:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:101 src/Model/Profile.php:466 #: src/Content/Widget/VCard.php:101 src/Model/Profile.php:466
#: src/Module/Notifications/Introductions.php:195 #: src/Module/Notifications/Introductions.php:179
msgid "Network:" msgid "Network:"
msgstr "" msgstr ""
@ -3367,8 +3367,8 @@ msgid ""
"or mysql." "or mysql."
msgstr "" msgstr ""
#: src/Core/Installer.php:203 src/Module/Install.php:214 #: src/Core/Installer.php:203 src/Module/Install.php:205
#: src/Module/Install.php:373 #: src/Module/Install.php:364
msgid "Please see the file \"doc/INSTALL.md\"." msgid "Please see the file \"doc/INSTALL.md\"."
msgstr "" msgstr ""
@ -4053,7 +4053,7 @@ msgstr ""
msgid "Internal Server Error" msgid "Internal Server Error"
msgstr "" msgstr ""
#: src/LegacyModule.php:60 #: src/LegacyModule.php:49
#, php-format #, php-format
msgid "Legacy module file not found: %s" msgid "Legacy module file not found: %s"
msgstr "" msgstr ""
@ -4063,8 +4063,8 @@ msgid "UnFollow"
msgstr "" msgstr ""
#: src/Model/Contact.php:1061 src/Module/Admin/Users/Pending.php:107 #: src/Model/Contact.php:1061 src/Module/Admin/Users/Pending.php:107
#: src/Module/Notifications/Introductions.php:126 #: src/Module/Notifications/Introductions.php:110
#: src/Module/Notifications/Introductions.php:198 #: src/Module/Notifications/Introductions.php:182
msgid "Approve" msgid "Approve"
msgstr "" msgstr ""
@ -4301,7 +4301,7 @@ msgid "Homepage:"
msgstr "" msgstr ""
#: src/Model/Profile.php:372 src/Module/Contact.php:571 #: src/Model/Profile.php:372 src/Module/Contact.php:571
#: src/Module/Notifications/Introductions.php:183 #: src/Module/Notifications/Introductions.php:167
msgid "About:" msgid "About:"
msgstr "" msgstr ""
@ -4713,7 +4713,7 @@ msgstr ""
#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:498 #: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:498
#: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:232 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:232
#: src/Module/Admin/Themes/Details.php:90 src/Module/Admin/Themes/Index.php:111 #: src/Module/Admin/Themes/Details.php:90 src/Module/Admin/Themes/Index.php:111
#: src/Module/Admin/Tos.php:75 src/Module/Admin/Users/Active.php:136 #: src/Module/Admin/Tos.php:58 src/Module/Admin/Users/Active.php:136
#: src/Module/Admin/Users/Blocked.php:137 src/Module/Admin/Users/Create.php:61 #: src/Module/Admin/Users/Blocked.php:137 src/Module/Admin/Users/Create.php:61
#: src/Module/Admin/Users/Deleted.php:85 src/Module/Admin/Users/Index.php:149 #: src/Module/Admin/Users/Deleted.php:85 src/Module/Admin/Users/Index.php:149
#: src/Module/Admin/Users/Pending.php:101 #: src/Module/Admin/Users/Pending.php:101
@ -5303,7 +5303,7 @@ msgid "Search in logs"
msgstr "" msgstr ""
#: src/Module/Admin/Logs/View.php:88 #: src/Module/Admin/Logs/View.php:88
#: src/Module/Notifications/Notifications.php:140 #: src/Module/Notifications/Notifications.php:126
msgid "Show all" msgid "Show all"
msgstr "" msgstr ""
@ -5448,15 +5448,15 @@ msgstr ""
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:475 src/Module/Install.php:223 #: src/Module/Admin/Site.php:475 src/Module/Install.php:214
msgid "No SSL policy, links will track page SSL state" msgid "No SSL policy, links will track page SSL state"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:476 src/Module/Install.php:224 #: src/Module/Admin/Site.php:476 src/Module/Install.php:215
msgid "Force all links to use SSL" msgid "Force all links to use SSL"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:477 src/Module/Install.php:225 #: src/Module/Admin/Site.php:477 src/Module/Install.php:216
msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgid "Self-signed certificate, use SSL for local links only (discouraged)"
msgstr "" msgstr ""
@ -5496,7 +5496,7 @@ msgstr ""
msgid "Republish users to directory" msgid "Republish users to directory"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:503 src/Module/Register.php:148 #: src/Module/Admin/Site.php:503 src/Module/Register.php:141
msgid "Registration" msgid "Registration"
msgstr "" msgstr ""
@ -5629,11 +5629,11 @@ msgstr ""
msgid "Theme for mobile devices" msgid "Theme for mobile devices"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:531 src/Module/Install.php:233 #: src/Module/Admin/Site.php:531 src/Module/Install.php:224
msgid "SSL link policy" msgid "SSL link policy"
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:531 src/Module/Install.php:235 #: src/Module/Admin/Site.php:531 src/Module/Install.php:226
msgid "Determines whether generated links should be forced to use SSL" msgid "Determines whether generated links should be forced to use SSL"
msgstr "" msgstr ""
@ -6551,7 +6551,7 @@ msgstr ""
msgid "Themes" msgid "Themes"
msgstr "" msgstr ""
#: src/Module/Admin/Themes/Embed.php:79 #: src/Module/Admin/Themes/Embed.php:65
msgid "Unknown theme." msgid "Unknown theme."
msgstr "" msgstr ""
@ -6576,21 +6576,21 @@ msgstr ""
msgid "[Unsupported]" msgid "[Unsupported]"
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:77 #: src/Module/Admin/Tos.php:60
msgid "Display Terms of Service" msgid "Display Terms of Service"
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:77 #: src/Module/Admin/Tos.php:60
msgid "" msgid ""
"Enable the Terms of Service page. If this is enabled a link to the terms " "Enable the Terms of Service page. If this is enabled a link to the terms "
"will be added to the registration form and the general information page." "will be added to the registration form and the general information page."
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:78 #: src/Module/Admin/Tos.php:61
msgid "Display Privacy Statement" msgid "Display Privacy Statement"
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:78 #: src/Module/Admin/Tos.php:61
#, php-format #, php-format
msgid "" msgid ""
"Show some informations regarding the needed information to operate the node " "Show some informations regarding the needed information to operate the node "
@ -6598,15 +6598,15 @@ msgid ""
"\">EU-GDPR</a>." "\">EU-GDPR</a>."
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:79 #: src/Module/Admin/Tos.php:62
msgid "Privacy Statement Preview" msgid "Privacy Statement Preview"
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:81 #: src/Module/Admin/Tos.php:64
msgid "The Terms of Service" msgid "The Terms of Service"
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:81 #: src/Module/Admin/Tos.php:64
msgid "" msgid ""
"Enter the Terms of Service for your node here. You can use BBCode. Headers " "Enter the Terms of Service for your node here. You can use BBCode. Headers "
"of sections should be [h2] and below." "of sections should be [h2] and below."
@ -6808,7 +6808,7 @@ msgid ""
"The API endpoint is currently not implemented but might be in the future." "The API endpoint is currently not implemented but might be in the future."
msgstr "" msgstr ""
#: src/Module/Api/Mastodon/Apps.php:57 #: src/Module/Api/Mastodon/Apps.php:58
msgid "Missing parameters" msgid "Missing parameters"
msgstr "" msgstr ""
@ -6843,20 +6843,20 @@ msgstr ""
msgid "Posts from %s can't be unshared" msgid "Posts from %s can't be unshared"
msgstr "" msgstr ""
#: src/Module/Api/Twitter/ContactEndpoint.php:64 src/Module/Contact.php:343 #: src/Module/Api/Twitter/ContactEndpoint.php:63 src/Module/Contact.php:343
#: src/Module/Contact.php:358 #: src/Module/Contact.php:358
msgid "Contact not found" msgid "Contact not found"
msgstr "" msgstr ""
#: src/Module/Api/Twitter/ContactEndpoint.php:134 #: src/Module/Api/Twitter/ContactEndpoint.php:133
msgid "Profile not found" msgid "Profile not found"
msgstr "" msgstr ""
#: src/Module/Apps.php:51 #: src/Module/Apps.php:47
msgid "No installed applications." msgid "No installed applications."
msgstr "" msgstr ""
#: src/Module/Apps.php:56 #: src/Module/Apps.php:52
msgid "Applications" msgid "Applications"
msgstr "" msgstr ""
@ -6950,8 +6950,8 @@ msgstr ""
msgid "User registrations waiting for confirmation" msgid "User registrations waiting for confirmation"
msgstr "" msgstr ""
#: src/Module/BaseApi.php:258 src/Module/BaseApi.php:274 #: src/Module/BaseApi.php:259 src/Module/BaseApi.php:275
#: src/Module/BaseApi.php:290 #: src/Module/BaseApi.php:291
msgid "Too Many Requests" msgid "Too Many Requests"
msgstr "" msgstr ""
@ -7006,7 +7006,7 @@ msgstr ""
msgid "Connected apps" msgid "Connected apps"
msgstr "" msgstr ""
#: src/Module/BaseSettings.php:108 src/Module/Settings/UserExport.php:75 #: src/Module/BaseSettings.php:108 src/Module/Settings/UserExport.php:76
msgid "Export personal data" msgid "Export personal data"
msgstr "" msgstr ""
@ -7216,7 +7216,7 @@ msgstr ""
msgid "Awaiting connection acknowledge" msgid "Awaiting connection acknowledge"
msgstr "" msgstr ""
#: src/Module/Contact.php:553 src/Module/Notifications/Introductions.php:186 #: src/Module/Contact.php:553 src/Module/Notifications/Introductions.php:170
msgid "Hide this contact from others" msgid "Hide this contact from others"
msgstr "" msgstr ""
@ -7367,7 +7367,7 @@ msgstr ""
msgid "Toggle Ignored status" msgid "Toggle Ignored status"
msgstr "" msgstr ""
#: src/Module/Contact.php:1081 src/Module/Contact/Revoke.php:111 #: src/Module/Contact.php:1081 src/Module/Contact/Revoke.php:96
msgid "Revoke Follow" msgid "Revoke Follow"
msgstr "" msgstr ""
@ -7375,59 +7375,59 @@ msgstr ""
msgid "Revoke the follow from this contact" msgid "Revoke the follow from this contact"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:109 #: src/Module/Contact/Advanced.php:93
msgid "Contact update failed." msgid "Contact update failed."
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:124 #: src/Module/Contact/Advanced.php:110
msgid "" msgid ""
"<strong>WARNING: This is highly advanced</strong> and if you enter incorrect " "<strong>WARNING: This is highly advanced</strong> and if you enter incorrect "
"information your communications with this contact may stop working." "information your communications with this contact may stop working."
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:125 #: src/Module/Contact/Advanced.php:111
msgid "" msgid ""
"Please use your browser 'Back' button <strong>now</strong> if you are " "Please use your browser 'Back' button <strong>now</strong> if you are "
"uncertain what to do on this page." "uncertain what to do on this page."
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:145 #: src/Module/Contact/Advanced.php:131
msgid "Return to contact editor" msgid "Return to contact editor"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:150 #: src/Module/Contact/Advanced.php:136
msgid "Account Nickname" msgid "Account Nickname"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:151 #: src/Module/Contact/Advanced.php:137
msgid "@Tagname - overrides Name/Nickname" msgid "@Tagname - overrides Name/Nickname"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:152 #: src/Module/Contact/Advanced.php:138
msgid "Account URL" msgid "Account URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:153 #: src/Module/Contact/Advanced.php:139
msgid "Account URL Alias" msgid "Account URL Alias"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:154 #: src/Module/Contact/Advanced.php:140
msgid "Friend Request URL" msgid "Friend Request URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:155 #: src/Module/Contact/Advanced.php:141
msgid "Friend Confirm URL" msgid "Friend Confirm URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:156 #: src/Module/Contact/Advanced.php:142
msgid "Notification Endpoint URL" msgid "Notification Endpoint URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:157 #: src/Module/Contact/Advanced.php:143
msgid "Poll/Feed URL" msgid "Poll/Feed URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:158 #: src/Module/Contact/Advanced.php:144
msgid "New photo from this URL" msgid "New photo from this URL"
msgstr "" msgstr ""
@ -7514,42 +7514,42 @@ msgstr ""
msgid "Make this post private" msgid "Make this post private"
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:63 #: src/Module/Contact/Revoke.php:48
msgid "Unknown contact." msgid "Unknown contact."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:73 src/Module/Group.php:108 #: src/Module/Contact/Revoke.php:58 src/Module/Group.php:108
msgid "Contact is deleted." msgid "Contact is deleted."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:77 #: src/Module/Contact/Revoke.php:62
msgid "Contact is being deleted." msgid "Contact is being deleted."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:91 #: src/Module/Contact/Revoke.php:76
msgid "Follow was successfully revoked." msgid "Follow was successfully revoked."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:93 #: src/Module/Contact/Revoke.php:78
msgid "" msgid ""
"Follow was successfully revoked, however the remote contact won't be aware " "Follow was successfully revoked, however the remote contact won't be aware "
"of this revokation." "of this revokation."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:95 #: src/Module/Contact/Revoke.php:80
msgid "" msgid ""
"Unable to revoke follow, please try again later or contact the administrator." "Unable to revoke follow, please try again later or contact the administrator."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:112 #: src/Module/Contact/Revoke.php:97
msgid "" msgid ""
"Do you really want to revoke this contact's follow? This cannot be undone " "Do you really want to revoke this contact's follow? This cannot be undone "
"and they will have to manually follow you back again." "and they will have to manually follow you back again."
msgstr "" msgstr ""
#: src/Module/Contact/Revoke.php:113 #: src/Module/Contact/Revoke.php:98
#: src/Module/Notifications/Introductions.php:138 #: src/Module/Notifications/Introductions.php:122
#: src/Module/OAuth/Acknowledge.php:47 src/Module/Register.php:126 #: src/Module/OAuth/Acknowledge.php:47 src/Module/Register.php:117
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
@ -7592,11 +7592,11 @@ msgid ""
"not reflect the opinions of this nodes users." "not reflect the opinions of this nodes users."
msgstr "" msgstr ""
#: src/Module/Conversation/Community.php:199 #: src/Module/Conversation/Community.php:200
msgid "Community option not available." msgid "Community option not available."
msgstr "" msgstr ""
#: src/Module/Conversation/Community.php:215 #: src/Module/Conversation/Community.php:216
msgid "Not available." msgid "Not available."
msgstr "" msgstr ""
@ -7849,12 +7849,12 @@ msgstr ""
msgid "Twitter Source / Tweet URL (requires API key)" msgid "Twitter Source / Tweet URL (requires API key)"
msgstr "" msgstr ""
#: src/Module/Debug/Feed.php:47 src/Module/Filer/SaveTag.php:49 #: src/Module/Debug/Feed.php:38 src/Module/Filer/SaveTag.php:40
#: src/Module/Settings/Profile/Index.php:141 #: src/Module/Settings/Profile/Index.php:141
msgid "You must be logged in to use this module" msgid "You must be logged in to use this module"
msgstr "" msgstr ""
#: src/Module/Debug/Feed.php:72 #: src/Module/Debug/Feed.php:63
msgid "Source URL" msgid "Source URL"
msgstr "" msgstr ""
@ -7953,23 +7953,23 @@ msgstr ""
msgid "Item was not deleted" msgid "Item was not deleted"
msgstr "" msgstr ""
#: src/Module/Filer/SaveTag.php:75 #: src/Module/Filer/SaveTag.php:68
msgid "- select -" msgid "- select -"
msgstr "" msgstr ""
#: src/Module/FriendSuggest.php:82 #: src/Module/FriendSuggest.php:65
msgid "Suggested contact not found." msgid "Suggested contact not found."
msgstr "" msgstr ""
#: src/Module/FriendSuggest.php:100 #: src/Module/FriendSuggest.php:83
msgid "Friend suggestion sent." msgid "Friend suggestion sent."
msgstr "" msgstr ""
#: src/Module/FriendSuggest.php:137 #: src/Module/FriendSuggest.php:120
msgid "Suggest Friends" msgid "Suggest Friends"
msgstr "" msgstr ""
#: src/Module/FriendSuggest.php:140 #: src/Module/FriendSuggest.php:123
#, php-format #, php-format
msgid "Suggest a friend for %s" msgid "Suggest a friend for %s"
msgstr "" msgstr ""
@ -8109,7 +8109,7 @@ msgstr ""
msgid "Method Not Allowed." msgid "Method Not Allowed."
msgstr "" msgstr ""
#: src/Module/Help.php:60 #: src/Module/Help.php:61
msgid "Help:" msgid "Help:"
msgstr "" msgstr ""
@ -8118,155 +8118,155 @@ msgstr ""
msgid "Welcome to %s" msgid "Welcome to %s"
msgstr "" msgstr ""
#: src/Module/Install.php:196 #: src/Module/Install.php:187
msgid "Friendica Communications Server - Setup" msgid "Friendica Communications Server - Setup"
msgstr "" msgstr ""
#: src/Module/Install.php:207 #: src/Module/Install.php:198
msgid "System check" msgid "System check"
msgstr "" msgstr ""
#: src/Module/Install.php:209 src/Module/Install.php:266 #: src/Module/Install.php:200 src/Module/Install.php:257
#: src/Module/Install.php:349 #: src/Module/Install.php:340
msgid "Requirement not satisfied" msgid "Requirement not satisfied"
msgstr "" msgstr ""
#: src/Module/Install.php:210 #: src/Module/Install.php:201
msgid "Optional requirement not satisfied" msgid "Optional requirement not satisfied"
msgstr "" msgstr ""
#: src/Module/Install.php:211 #: src/Module/Install.php:202
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: src/Module/Install.php:216 #: src/Module/Install.php:207
msgid "Check again" msgid "Check again"
msgstr "" msgstr ""
#: src/Module/Install.php:231 #: src/Module/Install.php:222
msgid "Base settings" msgid "Base settings"
msgstr "" msgstr ""
#: src/Module/Install.php:238 #: src/Module/Install.php:229
msgid "Host name" msgid "Host name"
msgstr "" msgstr ""
#: src/Module/Install.php:240 #: src/Module/Install.php:231
msgid "" msgid ""
"Overwrite this field in case the determinated hostname isn't right, " "Overwrite this field in case the determinated hostname isn't right, "
"otherweise leave it as is." "otherweise leave it as is."
msgstr "" msgstr ""
#: src/Module/Install.php:243 #: src/Module/Install.php:234
msgid "Base path to installation" msgid "Base path to installation"
msgstr "" msgstr ""
#: src/Module/Install.php:245 #: src/Module/Install.php:236
msgid "" msgid ""
"If the system cannot detect the correct path to your installation, enter the " "If the system cannot detect the correct path to your installation, enter the "
"correct path here. This setting should only be set if you are using a " "correct path here. This setting should only be set if you are using a "
"restricted system and symbolic links to your webroot." "restricted system and symbolic links to your webroot."
msgstr "" msgstr ""
#: src/Module/Install.php:248 #: src/Module/Install.php:239
msgid "Sub path of the URL" msgid "Sub path of the URL"
msgstr "" msgstr ""
#: src/Module/Install.php:250 #: src/Module/Install.php:241
msgid "" msgid ""
"Overwrite this field in case the sub path determination isn't right, " "Overwrite this field in case the sub path determination isn't right, "
"otherwise leave it as is. Leaving this field blank means the installation is " "otherwise leave it as is. Leaving this field blank means the installation is "
"at the base URL without sub path." "at the base URL without sub path."
msgstr "" msgstr ""
#: src/Module/Install.php:261 #: src/Module/Install.php:252
msgid "Database connection" msgid "Database connection"
msgstr "" msgstr ""
#: src/Module/Install.php:262 #: src/Module/Install.php:253
msgid "" msgid ""
"In order to install Friendica we need to know how to connect to your " "In order to install Friendica we need to know how to connect to your "
"database." "database."
msgstr "" msgstr ""
#: src/Module/Install.php:263 #: src/Module/Install.php:254
msgid "" msgid ""
"Please contact your hosting provider or site administrator if you have " "Please contact your hosting provider or site administrator if you have "
"questions about these settings." "questions about these settings."
msgstr "" msgstr ""
#: src/Module/Install.php:264 #: src/Module/Install.php:255
msgid "" msgid ""
"The database you specify below should already exist. If it does not, please " "The database you specify below should already exist. If it does not, please "
"create it before continuing." "create it before continuing."
msgstr "" msgstr ""
#: src/Module/Install.php:273 #: src/Module/Install.php:264
msgid "Database Server Name" msgid "Database Server Name"
msgstr "" msgstr ""
#: src/Module/Install.php:278 #: src/Module/Install.php:269
msgid "Database Login Name" msgid "Database Login Name"
msgstr "" msgstr ""
#: src/Module/Install.php:284 #: src/Module/Install.php:275
msgid "Database Login Password" msgid "Database Login Password"
msgstr "" msgstr ""
#: src/Module/Install.php:286 #: src/Module/Install.php:277
msgid "For security reasons the password must not be empty" msgid "For security reasons the password must not be empty"
msgstr "" msgstr ""
#: src/Module/Install.php:289 #: src/Module/Install.php:280
msgid "Database Name" msgid "Database Name"
msgstr "" msgstr ""
#: src/Module/Install.php:293 src/Module/Install.php:323 #: src/Module/Install.php:284 src/Module/Install.php:314
msgid "Please select a default timezone for your website" msgid "Please select a default timezone for your website"
msgstr "" msgstr ""
#: src/Module/Install.php:308 #: src/Module/Install.php:299
msgid "Site settings" msgid "Site settings"
msgstr "" msgstr ""
#: src/Module/Install.php:318 #: src/Module/Install.php:309
msgid "Site administrator email address" msgid "Site administrator email address"
msgstr "" msgstr ""
#: src/Module/Install.php:320 #: src/Module/Install.php:311
msgid "" msgid ""
"Your account email address must match this in order to use the web admin " "Your account email address must match this in order to use the web admin "
"panel." "panel."
msgstr "" msgstr ""
#: src/Module/Install.php:327 #: src/Module/Install.php:318
msgid "System Language:" msgid "System Language:"
msgstr "" msgstr ""
#: src/Module/Install.php:329 #: src/Module/Install.php:320
msgid "" msgid ""
"Set the default language for your Friendica installation interface and to " "Set the default language for your Friendica installation interface and to "
"send emails." "send emails."
msgstr "" msgstr ""
#: src/Module/Install.php:341 #: src/Module/Install.php:332
msgid "Your Friendica site database has been installed." msgid "Your Friendica site database has been installed."
msgstr "" msgstr ""
#: src/Module/Install.php:351 #: src/Module/Install.php:342
msgid "Installation finished" msgid "Installation finished"
msgstr "" msgstr ""
#: src/Module/Install.php:371 #: src/Module/Install.php:362
msgid "<h1>What next</h1>" msgid "<h1>What next</h1>"
msgstr "" msgstr ""
#: src/Module/Install.php:372 #: src/Module/Install.php:363
msgid "" msgid ""
"IMPORTANT: You will need to [manually] setup a scheduled task for the worker." "IMPORTANT: You will need to [manually] setup a scheduled task for the worker."
msgstr "" msgstr ""
#: src/Module/Install.php:375 #: src/Module/Install.php:366
#, php-format #, php-format
msgid "" msgid ""
"Go to your new Friendica node <a href=\"%s/register\">registration page</a> " "Go to your new Friendica node <a href=\"%s/register\">registration page</a> "
@ -8431,64 +8431,64 @@ msgstr ""
msgid "A Decentralized Social Network" msgid "A Decentralized Social Network"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:93 #: src/Module/Notifications/Introductions.php:77
msgid "Show Ignored Requests" msgid "Show Ignored Requests"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:93 #: src/Module/Notifications/Introductions.php:77
msgid "Hide Ignored Requests" msgid "Hide Ignored Requests"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:109 #: src/Module/Notifications/Introductions.php:93
#: src/Module/Notifications/Introductions.php:172 #: src/Module/Notifications/Introductions.php:156
msgid "Notification type:" msgid "Notification type:"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:112 #: src/Module/Notifications/Introductions.php:96
msgid "Suggested by:" msgid "Suggested by:"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:137 #: src/Module/Notifications/Introductions.php:121
msgid "Claims to be known to you: " msgid "Claims to be known to you: "
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:138 #: src/Module/Notifications/Introductions.php:122
#: src/Module/OAuth/Acknowledge.php:48 src/Module/Register.php:127 #: src/Module/OAuth/Acknowledge.php:48 src/Module/Register.php:118
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:146 #: src/Module/Notifications/Introductions.php:130
msgid "Shall your connection be bidirectional or not?" msgid "Shall your connection be bidirectional or not?"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:147 #: src/Module/Notifications/Introductions.php:131
#, php-format #, php-format
msgid "" msgid ""
"Accepting %s as a friend allows %s to subscribe to your posts, and you will " "Accepting %s as a friend allows %s to subscribe to your posts, and you will "
"also receive updates from them in your news feed." "also receive updates from them in your news feed."
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:148 #: src/Module/Notifications/Introductions.php:132
#, php-format #, php-format
msgid "" msgid ""
"Accepting %s as a subscriber allows them to subscribe to your posts, but you " "Accepting %s as a subscriber allows them to subscribe to your posts, but you "
"will not receive updates from them in your news feed." "will not receive updates from them in your news feed."
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:150 #: src/Module/Notifications/Introductions.php:134
msgid "Friend" msgid "Friend"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:151 #: src/Module/Notifications/Introductions.php:135
msgid "Subscriber" msgid "Subscriber"
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:210 #: src/Module/Notifications/Introductions.php:194
msgid "No introductions." msgid "No introductions."
msgstr "" msgstr ""
#: src/Module/Notifications/Introductions.php:211 #: src/Module/Notifications/Introductions.php:195
#: src/Module/Notifications/Notifications.php:135 #: src/Module/Notifications/Notifications.php:121
#, php-format #, php-format
msgid "No more %s notifications." msgid "No more %s notifications."
msgstr "" msgstr ""
@ -8497,23 +8497,23 @@ msgstr ""
msgid "You must be logged in to show this page." msgid "You must be logged in to show this page."
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:66 #: src/Module/Notifications/Notifications.php:52
msgid "Network Notifications" msgid "Network Notifications"
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:72 #: src/Module/Notifications/Notifications.php:58
msgid "System Notifications" msgid "System Notifications"
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:78 #: src/Module/Notifications/Notifications.php:64
msgid "Personal Notifications" msgid "Personal Notifications"
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:84 #: src/Module/Notifications/Notifications.php:70
msgid "Home Notifications" msgid "Home Notifications"
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:140 #: src/Module/Notifications/Notifications.php:126
msgid "Show unread" msgid "Show unread"
msgstr "" msgstr ""
@ -8527,15 +8527,15 @@ msgid ""
"and/or create new posts for you?" "and/or create new posts for you?"
msgstr "" msgstr ""
#: src/Module/OAuth/Authorize.php:54 #: src/Module/OAuth/Authorize.php:55
msgid "Unsupported or missing response type" msgid "Unsupported or missing response type"
msgstr "" msgstr ""
#: src/Module/OAuth/Authorize.php:59 src/Module/OAuth/Token.php:65 #: src/Module/OAuth/Authorize.php:60 src/Module/OAuth/Token.php:65
msgid "Incomplete request data" msgid "Incomplete request data"
msgstr "" msgstr ""
#: src/Module/OAuth/Authorize.php:106 #: src/Module/OAuth/Authorize.php:107
#, php-format #, php-format
msgid "" msgid ""
"Please copy the following authentication code into your application and " "Please copy the following authentication code into your application and "
@ -8669,163 +8669,163 @@ msgstr ""
msgid "Remove post" msgid "Remove post"
msgstr "" msgstr ""
#: src/Module/Register.php:80 #: src/Module/Register.php:71
msgid "Only parent users can create additional accounts." msgid "Only parent users can create additional accounts."
msgstr "" msgstr ""
#: src/Module/Register.php:112 #: src/Module/Register.php:103
msgid "" msgid ""
"You may (optionally) fill in this form via OpenID by supplying your OpenID " "You may (optionally) fill in this form via OpenID by supplying your OpenID "
"and clicking \"Register\"." "and clicking \"Register\"."
msgstr "" msgstr ""
#: src/Module/Register.php:113 #: src/Module/Register.php:104
msgid "" msgid ""
"If you are not familiar with OpenID, please leave that field blank and fill " "If you are not familiar with OpenID, please leave that field blank and fill "
"in the rest of the items." "in the rest of the items."
msgstr "" msgstr ""
#: src/Module/Register.php:114 #: src/Module/Register.php:105
msgid "Your OpenID (optional): " msgid "Your OpenID (optional): "
msgstr "" msgstr ""
#: src/Module/Register.php:123 #: src/Module/Register.php:114
msgid "Include your profile in member directory?" msgid "Include your profile in member directory?"
msgstr "" msgstr ""
#: src/Module/Register.php:144 #: src/Module/Register.php:137
msgid "Note for the admin" msgid "Note for the admin"
msgstr "" msgstr ""
#: src/Module/Register.php:144 #: src/Module/Register.php:137
msgid "Leave a message for the admin, why you want to join this node" msgid "Leave a message for the admin, why you want to join this node"
msgstr "" msgstr ""
#: src/Module/Register.php:145 #: src/Module/Register.php:138
msgid "Membership on this site is by invitation only." msgid "Membership on this site is by invitation only."
msgstr "" msgstr ""
#: src/Module/Register.php:146 #: src/Module/Register.php:139
msgid "Your invitation code: " msgid "Your invitation code: "
msgstr "" msgstr ""
#: src/Module/Register.php:154 #: src/Module/Register.php:147
msgid "Your Full Name (e.g. Joe Smith, real or real-looking): " msgid "Your Full Name (e.g. Joe Smith, real or real-looking): "
msgstr "" msgstr ""
#: src/Module/Register.php:155 #: src/Module/Register.php:148
msgid "" msgid ""
"Your Email Address: (Initial information will be send there, so this has to " "Your Email Address: (Initial information will be send there, so this has to "
"be an existing address.)" "be an existing address.)"
msgstr "" msgstr ""
#: src/Module/Register.php:156 #: src/Module/Register.php:149
msgid "Please repeat your e-mail address:" msgid "Please repeat your e-mail address:"
msgstr "" msgstr ""
#: src/Module/Register.php:158 #: src/Module/Register.php:151
msgid "Leave empty for an auto generated password." msgid "Leave empty for an auto generated password."
msgstr "" msgstr ""
#: src/Module/Register.php:160 #: src/Module/Register.php:153
#, php-format #, php-format
msgid "" msgid ""
"Choose a profile nickname. This must begin with a text character. Your " "Choose a profile nickname. This must begin with a text character. Your "
"profile address on this site will then be \"<strong>nickname@%s</strong>\"." "profile address on this site will then be \"<strong>nickname@%s</strong>\"."
msgstr "" msgstr ""
#: src/Module/Register.php:161 #: src/Module/Register.php:154
msgid "Choose a nickname: " msgid "Choose a nickname: "
msgstr "" msgstr ""
#: src/Module/Register.php:170 #: src/Module/Register.php:163
msgid "Import your profile to this friendica instance" msgid "Import your profile to this friendica instance"
msgstr "" msgstr ""
#: src/Module/Register.php:177 #: src/Module/Register.php:170
msgid "Note: This node explicitly contains adult content" msgid "Note: This node explicitly contains adult content"
msgstr "" msgstr ""
#: src/Module/Register.php:179 src/Module/Settings/Delegation.php:155 #: src/Module/Register.php:172 src/Module/Settings/Delegation.php:155
msgid "Parent Password:" msgid "Parent Password:"
msgstr "" msgstr ""
#: src/Module/Register.php:179 src/Module/Settings/Delegation.php:155 #: src/Module/Register.php:172 src/Module/Settings/Delegation.php:155
msgid "" msgid ""
"Please enter the password of the parent account to legitimize your request." "Please enter the password of the parent account to legitimize your request."
msgstr "" msgstr ""
#: src/Module/Register.php:208 #: src/Module/Register.php:201
msgid "Password doesn't match." msgid "Password doesn't match."
msgstr "" msgstr ""
#: src/Module/Register.php:214 #: src/Module/Register.php:207
msgid "Please enter your password." msgid "Please enter your password."
msgstr "" msgstr ""
#: src/Module/Register.php:256 #: src/Module/Register.php:249
msgid "You have entered too much information." msgid "You have entered too much information."
msgstr "" msgstr ""
#: src/Module/Register.php:279 #: src/Module/Register.php:272
msgid "Please enter the identical mail address in the second field." msgid "Please enter the identical mail address in the second field."
msgstr "" msgstr ""
#: src/Module/Register.php:306 #: src/Module/Register.php:299
msgid "The additional account was created." msgid "The additional account was created."
msgstr "" msgstr ""
#: src/Module/Register.php:331 #: src/Module/Register.php:324
msgid "" msgid ""
"Registration successful. Please check your email for further instructions." "Registration successful. Please check your email for further instructions."
msgstr "" msgstr ""
#: src/Module/Register.php:335 #: src/Module/Register.php:328
#, php-format #, php-format
msgid "" msgid ""
"Failed to send email message. Here your accout details:<br> login: %s<br> " "Failed to send email message. Here your accout details:<br> login: %s<br> "
"password: %s<br><br>You can change your password after login." "password: %s<br><br>You can change your password after login."
msgstr "" msgstr ""
#: src/Module/Register.php:341 #: src/Module/Register.php:334
msgid "Registration successful." msgid "Registration successful."
msgstr "" msgstr ""
#: src/Module/Register.php:346 src/Module/Register.php:353 #: src/Module/Register.php:339 src/Module/Register.php:346
msgid "Your registration can not be processed." msgid "Your registration can not be processed."
msgstr "" msgstr ""
#: src/Module/Register.php:352 #: src/Module/Register.php:345
msgid "You have to leave a request note for the admin." msgid "You have to leave a request note for the admin."
msgstr "" msgstr ""
#: src/Module/Register.php:398 #: src/Module/Register.php:391
msgid "Your registration is pending approval by the site owner." msgid "Your registration is pending approval by the site owner."
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:72 #: src/Module/RemoteFollow.php:62
msgid "Profile unavailable." msgid "Profile unavailable."
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:78 #: src/Module/RemoteFollow.php:68
msgid "Invalid locator" msgid "Invalid locator"
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:85 #: src/Module/RemoteFollow.php:75
msgid "The provided profile link doesn't seem to be valid" msgid "The provided profile link doesn't seem to be valid"
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:90 #: src/Module/RemoteFollow.php:80
msgid "" msgid ""
"Remote subscription can't be done for your network. Please subscribe " "Remote subscription can't be done for your network. Please subscribe "
"directly on your system." "directly on your system."
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:122 #: src/Module/RemoteFollow.php:110
msgid "Friend/Connection Request" msgid "Friend/Connection Request"
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:123 #: src/Module/RemoteFollow.php:111
#, php-format #, php-format
msgid "" msgid ""
"Enter your Webfinger address (user@domain.tld) or profile URL here. If this " "Enter your Webfinger address (user@domain.tld) or profile URL here. If this "
@ -8833,14 +8833,14 @@ msgid ""
"or <strong>%s</strong> directly on your system." "or <strong>%s</strong> directly on your system."
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:124 #: src/Module/RemoteFollow.php:112
#, php-format #, php-format
msgid "" msgid ""
"If you are not yet a member of the free social web, <a href=\"%s\">follow " "If you are not yet a member of the free social web, <a href=\"%s\">follow "
"this link to find a public Friendica node and join us today</a>." "this link to find a public Friendica node and join us today</a>."
msgstr "" msgstr ""
#: src/Module/RemoteFollow.php:125 #: src/Module/RemoteFollow.php:113
msgid "Your Webfinger address or profile URL:" msgid "Your Webfinger address or profile URL:"
msgstr "" msgstr ""
@ -8857,15 +8857,15 @@ msgstr ""
msgid "Items tagged with: %s" msgid "Items tagged with: %s"
msgstr "" msgstr ""
#: src/Module/Search/Saved.php:62 #: src/Module/Search/Saved.php:44
msgid "Search term was not saved." msgid "Search term was not saved."
msgstr "" msgstr ""
#: src/Module/Search/Saved.php:65 #: src/Module/Search/Saved.php:47
msgid "Search term already saved." msgid "Search term already saved."
msgstr "" msgstr ""
#: src/Module/Search/Saved.php:71 #: src/Module/Search/Saved.php:53
msgid "Search term was not removed." msgid "Search term was not removed."
msgstr "" msgstr ""
@ -8915,7 +8915,7 @@ msgstr ""
msgid "privacy policy" msgid "privacy policy"
msgstr "" msgstr ""
#: src/Module/Security/Logout.php:87 #: src/Module/Security/Logout.php:61
msgid "Logged out." msgid "Logged out."
msgstr "" msgstr ""
@ -8935,39 +8935,39 @@ msgid ""
"account to add the OpenID to it." "account to add the OpenID to it."
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:73 #: src/Module/Security/TwoFactor/Recovery.php:61
#, php-format #, php-format
msgid "Remaining recovery codes: %d" msgid "Remaining recovery codes: %d"
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:77 #: src/Module/Security/TwoFactor/Recovery.php:65
#: src/Module/Security/TwoFactor/Verify.php:76 #: src/Module/Security/TwoFactor/Verify.php:76
#: src/Module/Settings/TwoFactor/Verify.php:94 #: src/Module/Settings/TwoFactor/Verify.php:82
msgid "Invalid code, please retry." msgid "Invalid code, please retry."
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:96 #: src/Module/Security/TwoFactor/Recovery.php:84
msgid "Two-factor recovery" msgid "Two-factor recovery"
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:97 #: src/Module/Security/TwoFactor/Recovery.php:85
msgid "" msgid ""
"<p>You can enter one of your one-time recovery codes in case you lost access " "<p>You can enter one of your one-time recovery codes in case you lost access "
"to your mobile device.</p>" "to your mobile device.</p>"
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:98 #: src/Module/Security/TwoFactor/Recovery.php:86
#: src/Module/Security/TwoFactor/Verify.php:99 #: src/Module/Security/TwoFactor/Verify.php:99
#, php-format #, php-format
msgid "" msgid ""
"Dont have your phone? <a href=\"%s\">Enter a two-factor recovery code</a>" "Dont have your phone? <a href=\"%s\">Enter a two-factor recovery code</a>"
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:99 #: src/Module/Security/TwoFactor/Recovery.php:87
msgid "Please enter a recovery code" msgid "Please enter a recovery code"
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Recovery.php:100 #: src/Module/Security/TwoFactor/Recovery.php:88
msgid "Submit recovery code and complete login" msgid "Submit recovery code and complete login"
msgstr "" msgstr ""
@ -8978,7 +8978,7 @@ msgid ""
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:100 #: src/Module/Security/TwoFactor/Verify.php:100
#: src/Module/Settings/TwoFactor/Verify.php:153 #: src/Module/Settings/TwoFactor/Verify.php:141
msgid "Please enter a code from your authentication app" msgid "Please enter a code from your authentication app"
msgstr "" msgstr ""
@ -9401,82 +9401,82 @@ msgstr ""
msgid "select a photo from your photo albums" msgid "select a photo from your photo albums"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:64 #: src/Module/Settings/TwoFactor/AppSpecific.php:52
#: src/Module/Settings/TwoFactor/Recovery.php:62 #: src/Module/Settings/TwoFactor/Recovery.php:50
#: src/Module/Settings/TwoFactor/Trusted.php:45 #: src/Module/Settings/TwoFactor/Trusted.php:30
#: src/Module/Settings/TwoFactor/Verify.php:68 #: src/Module/Settings/TwoFactor/Verify.php:56
msgid "Please enter your password to access this page." msgid "Please enter your password to access this page."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:82 #: src/Module/Settings/TwoFactor/AppSpecific.php:70
msgid "App-specific password generation failed: The description is empty." msgid "App-specific password generation failed: The description is empty."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:85 #: src/Module/Settings/TwoFactor/AppSpecific.php:73
msgid "" msgid ""
"App-specific password generation failed: This description already exists." "App-specific password generation failed: This description already exists."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:89 #: src/Module/Settings/TwoFactor/AppSpecific.php:77
msgid "New app-specific password generated." msgid "New app-specific password generated."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:95 #: src/Module/Settings/TwoFactor/AppSpecific.php:83
msgid "App-specific passwords successfully revoked." msgid "App-specific passwords successfully revoked."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:105 #: src/Module/Settings/TwoFactor/AppSpecific.php:93
msgid "App-specific password successfully revoked." msgid "App-specific password successfully revoked."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:126 #: src/Module/Settings/TwoFactor/AppSpecific.php:114
msgid "Two-factor app-specific passwords" msgid "Two-factor app-specific passwords"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:128 #: src/Module/Settings/TwoFactor/AppSpecific.php:116
msgid "" msgid ""
"<p>App-specific passwords are randomly generated passwords used instead your " "<p>App-specific passwords are randomly generated passwords used instead your "
"regular password to authenticate your account on third-party applications " "regular password to authenticate your account on third-party applications "
"that don't support two-factor authentication.</p>" "that don't support two-factor authentication.</p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:129 #: src/Module/Settings/TwoFactor/AppSpecific.php:117
msgid "" msgid ""
"Make sure to copy your new app-specific password now. You wont be able to " "Make sure to copy your new app-specific password now. You wont be able to "
"see it again!" "see it again!"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:132 #: src/Module/Settings/TwoFactor/AppSpecific.php:120
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:133 #: src/Module/Settings/TwoFactor/AppSpecific.php:121
msgid "Last Used" msgid "Last Used"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:134 #: src/Module/Settings/TwoFactor/AppSpecific.php:122
msgid "Revoke" msgid "Revoke"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:135 #: src/Module/Settings/TwoFactor/AppSpecific.php:123
msgid "Revoke All" msgid "Revoke All"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:138 #: src/Module/Settings/TwoFactor/AppSpecific.php:126
msgid "" msgid ""
"When you generate a new app-specific password, you must use it right away, " "When you generate a new app-specific password, you must use it right away, "
"it will be shown to you once after you generate it." "it will be shown to you once after you generate it."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:139 #: src/Module/Settings/TwoFactor/AppSpecific.php:127
msgid "Generate new app-specific password" msgid "Generate new app-specific password"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:140 #: src/Module/Settings/TwoFactor/AppSpecific.php:128
msgid "Friendiqa on my Fairphone 2..." msgid "Friendiqa on my Fairphone 2..."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/AppSpecific.php:141 #: src/Module/Settings/TwoFactor/AppSpecific.php:129
msgid "Generate" msgid "Generate"
msgstr "" msgstr ""
@ -9576,15 +9576,15 @@ msgstr ""
msgid "Finish app configuration" msgid "Finish app configuration"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:78 #: src/Module/Settings/TwoFactor/Recovery.php:66
msgid "New recovery codes successfully generated." msgid "New recovery codes successfully generated."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:104 #: src/Module/Settings/TwoFactor/Recovery.php:92
msgid "Two-factor recovery codes" msgid "Two-factor recovery codes"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:106 #: src/Module/Settings/TwoFactor/Recovery.php:94
msgid "" msgid ""
"<p>Recovery codes can be used to access your account in the event you lose " "<p>Recovery codes can be used to access your account in the event you lose "
"access to your device and cannot receive two-factor authentication codes.</" "access to your device and cannot receive two-factor authentication codes.</"
@ -9592,64 +9592,64 @@ msgid ""
"dont have the recovery codes you will lose access to your account.</p>" "dont have the recovery codes you will lose access to your account.</p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:108 #: src/Module/Settings/TwoFactor/Recovery.php:96
msgid "" msgid ""
"When you generate new recovery codes, you must copy the new codes. Your old " "When you generate new recovery codes, you must copy the new codes. Your old "
"codes wont work anymore." "codes wont work anymore."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:109 #: src/Module/Settings/TwoFactor/Recovery.php:97
msgid "Generate new recovery codes" msgid "Generate new recovery codes"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Recovery.php:111 #: src/Module/Settings/TwoFactor/Recovery.php:99
msgid "Next: Verification" msgid "Next: Verification"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:62 #: src/Module/Settings/TwoFactor/Trusted.php:49
msgid "Trusted browsers successfully removed." msgid "Trusted browsers successfully removed."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:72 #: src/Module/Settings/TwoFactor/Trusted.php:59
msgid "Trusted browser successfully removed." msgid "Trusted browser successfully removed."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:109 #: src/Module/Settings/TwoFactor/Trusted.php:97
msgid "Two-factor Trusted Browsers" msgid "Two-factor Trusted Browsers"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:110 #: src/Module/Settings/TwoFactor/Trusted.php:98
msgid "" msgid ""
"Trusted browsers are individual browsers you chose to skip two-factor " "Trusted browsers are individual browsers you chose to skip two-factor "
"authentication to access Friendica. Please use this feature sparingly, as it " "authentication to access Friendica. Please use this feature sparingly, as it "
"can negate the benefit of two-factor authentication." "can negate the benefit of two-factor authentication."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:111 #: src/Module/Settings/TwoFactor/Trusted.php:99
msgid "Device" msgid "Device"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:112 #: src/Module/Settings/TwoFactor/Trusted.php:100
msgid "OS" msgid "OS"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:114 #: src/Module/Settings/TwoFactor/Trusted.php:102
msgid "Trusted" msgid "Trusted"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:115 #: src/Module/Settings/TwoFactor/Trusted.php:103
msgid "Last Use" msgid "Last Use"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Trusted.php:117 #: src/Module/Settings/TwoFactor/Trusted.php:105
msgid "Remove All" msgid "Remove All"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:90 #: src/Module/Settings/TwoFactor/Verify.php:78
msgid "Two-factor authentication successfully activated." msgid "Two-factor authentication successfully activated."
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:123 #: src/Module/Settings/TwoFactor/Verify.php:111
#, php-format #, php-format
msgid "" msgid ""
"<p>Or you can submit the authentication settings manually:</p>\n" "<p>Or you can submit the authentication settings manually:</p>\n"
@ -9669,53 +9669,53 @@ msgid ""
"</dl>" "</dl>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:143 #: src/Module/Settings/TwoFactor/Verify.php:131
msgid "Two-factor code verification" msgid "Two-factor code verification"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:145 #: src/Module/Settings/TwoFactor/Verify.php:133
msgid "" msgid ""
"<p>Please scan this QR Code with your authenticator app and submit the " "<p>Please scan this QR Code with your authenticator app and submit the "
"provided code.</p>" "provided code.</p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:147 #: src/Module/Settings/TwoFactor/Verify.php:135
#, php-format #, php-format
msgid "" msgid ""
"<p>Or you can open the following URL in your mobile device:</p><p><a href=" "<p>Or you can open the following URL in your mobile device:</p><p><a href="
"\"%s\">%s</a></p>" "\"%s\">%s</a></p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:154 #: src/Module/Settings/TwoFactor/Verify.php:142
msgid "Verify code and enable two-factor authentication" msgid "Verify code and enable two-factor authentication"
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:67 #: src/Module/Settings/UserExport.php:68
msgid "Export account" msgid "Export account"
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:67 #: src/Module/Settings/UserExport.php:68
msgid "" msgid ""
"Export your account info and contacts. Use this to make a backup of your " "Export your account info and contacts. Use this to make a backup of your "
"account and/or to move it to another server." "account and/or to move it to another server."
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:68 #: src/Module/Settings/UserExport.php:69
msgid "Export all" msgid "Export all"
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:68 #: src/Module/Settings/UserExport.php:69
msgid "" msgid ""
"Export your account info, contacts and all your items as json. Could be a " "Export your account info, contacts and all your items as json. Could be a "
"very big file, and could take a lot of time. Use this to make a full backup " "very big file, and could take a lot of time. Use this to make a full backup "
"of your account (photos are not exported)" "of your account (photos are not exported)"
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:69 #: src/Module/Settings/UserExport.php:70
msgid "Export Contacts to CSV" msgid "Export Contacts to CSV"
msgstr "" msgstr ""
#: src/Module/Settings/UserExport.php:69 #: src/Module/Settings/UserExport.php:70
msgid "" msgid ""
"Export the list of the accounts you are following as CSV file. Compatible to " "Export the list of the accounts you are following as CSV file. Compatible to "
"e.g. Mastodon." "e.g. Mastodon."
@ -9730,7 +9730,7 @@ msgstr ""
msgid "Exception thrown in %s:%d" msgid "Exception thrown in %s:%d"
msgstr "" msgstr ""
#: src/Module/Tos.php:58 src/Module/Tos.php:92 #: src/Module/Tos.php:46 src/Module/Tos.php:88
msgid "" msgid ""
"At the time of registration, and for providing communications between the " "At the time of registration, and for providing communications between the "
"user account and their contacts, the user has to provide a display name (pen " "user account and their contacts, the user has to provide a display name (pen "
@ -9743,14 +9743,14 @@ msgid ""
"settings, it is not necessary for communication." "settings, it is not necessary for communication."
msgstr "" msgstr ""
#: src/Module/Tos.php:59 src/Module/Tos.php:93 #: src/Module/Tos.php:47 src/Module/Tos.php:89
msgid "" msgid ""
"This data is required for communication and is passed on to the nodes of the " "This data is required for communication and is passed on to the nodes of the "
"communication partners and is stored there. Users can enter additional " "communication partners and is stored there. Users can enter additional "
"private data that may be transmitted to the communication partners accounts." "private data that may be transmitted to the communication partners accounts."
msgstr "" msgstr ""
#: src/Module/Tos.php:60 src/Module/Tos.php:94 #: src/Module/Tos.php:48 src/Module/Tos.php:90
#, php-format #, php-format
msgid "" msgid ""
"At any point in time a logged in user can export their account data from the " "At any point in time a logged in user can export their account data from the "
@ -9760,7 +9760,7 @@ msgid ""
"data will also be requested from the nodes of the communication partners." "data will also be requested from the nodes of the communication partners."
msgstr "" msgstr ""
#: src/Module/Tos.php:63 src/Module/Tos.php:91 #: src/Module/Tos.php:51 src/Module/Tos.php:87
msgid "Privacy Statement" msgid "Privacy Statement"
msgstr "" msgstr ""