From 5a21458ae993486fa12b056153a69a1399b398df Mon Sep 17 00:00:00 2001
From: Tobias Diekershoff
Date: Thu, 20 Oct 2022 09:46:59 +0200
Subject: [PATCH 01/40] added a breaking note for custom addons to the
CHANGELOG
With the movement of all the function from the boot.php into fitting classes
custom addons will break (e.g. local_user() calls). The note in the CHANGELOG
should be a warning and a reminder for the release notes of 2022.12.
---
CHANGELOG | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGELOG b/CHANGELOG
index 88d28f313..b2e549610 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@ Version 2022.12 (unreleased)
Friendica Core
Friendica Addons
+ BREAKING: The functions from the boot.php file have been moved into better fitting classes
+ this may break your custom addons. See the pull requests #1293 and #1294 in the
+ addon repository about the needed changes to your addons.
Closed Issues
From eaf1485c6fff9f1ee31a67e0cd43e28b3ab33f51 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan
Date: Thu, 20 Oct 2022 09:45:40 -0400
Subject: [PATCH 02/40] Fix using wrong variable in
DomainPatterBlocklist::extractFromCSVFile
- This was clobbering the internal block list structure from an associative array to a simple list
---
src/Moderation/DomainPatternBlocklist.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Moderation/DomainPatternBlocklist.php b/src/Moderation/DomainPatternBlocklist.php
index 923fca88f..96177b48d 100644
--- a/src/Moderation/DomainPatternBlocklist.php
+++ b/src/Moderation/DomainPatternBlocklist.php
@@ -192,7 +192,7 @@ class DomainPatternBlocklist
'reason' => $data[1] ?? '',
];
if (!in_array($item, $blocklist)) {
- $blocklist[] = $data;
+ $blocklist[] = $item;
}
}
From 940619325d9b2109d90b40347607302ebd944bd9 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Tue, 18 Oct 2022 22:20:04 +0200
Subject: [PATCH 03/40] Add SessionUsers class including tests
---
.../Capability/IHandleUserSessions.php | 81 +++++++
src/Core/Session/Handler/Cache.php | 2 +-
src/Core/Session/Handler/Database.php | 8 +-
src/Core/Session/Model/UserSession.php | 121 ++++++++++
src/Core/Session/Type/ArraySession.php | 81 +++++++
src/DI.php | 6 +
src/Model/Contact.php | 26 +++
static/dependencies.config.php | 4 +
tests/src/Core/Session/UserSessionTest.php | 218 ++++++++++++++++++
9 files changed, 542 insertions(+), 5 deletions(-)
create mode 100644 src/Core/Session/Capability/IHandleUserSessions.php
create mode 100644 src/Core/Session/Model/UserSession.php
create mode 100644 src/Core/Session/Type/ArraySession.php
create mode 100644 tests/src/Core/Session/UserSessionTest.php
diff --git a/src/Core/Session/Capability/IHandleUserSessions.php b/src/Core/Session/Capability/IHandleUserSessions.php
new file mode 100644
index 000000000..9cd8de345
--- /dev/null
+++ b/src/Core/Session/Capability/IHandleUserSessions.php
@@ -0,0 +1,81 @@
+.
+ *
+ */
+
+namespace Friendica\Core\Session\Capability;
+
+/**
+ * Handles user infos based on session infos
+ */
+interface IHandleUserSessions
+{
+ /**
+ * Returns the user id of locally logged-in user or false.
+ *
+ * @return int|bool user id or false
+ */
+ public function getLocalUserId();
+
+ /**
+ * Returns the public contact id of logged-in user or false.
+ *
+ * @return int|bool public contact id or false
+ */
+ public function getPublicContactId();
+
+ /**
+ * Returns public contact id of authenticated site visitor or false
+ *
+ * @return int|bool visitor_id or false
+ */
+ public function getRemoteUserId();
+
+ /**
+ * Return the user contact ID of a visitor for the given user ID they are visiting
+ *
+ * @param int $uid User ID
+ *
+ * @return int
+ */
+ public function getRemoteContactID(int $uid): int;
+
+ /**
+ * Returns User ID for given contact ID of the visitor
+ *
+ * @param int $cid Contact ID
+ *
+ * @return int User ID for given contact ID of the visitor
+ */
+ public function getUserIDForVisitorContactID(int $cid): int;
+
+ /**
+ * Returns if the current visitor is authenticated
+ *
+ * @return bool "true" when visitor is either a local or remote user
+ */
+ public function isAuthenticated(): bool;
+
+ /**
+ * Set the session variable that contains the contact IDs for the visitor's contact URL
+ *
+ * @param string $url Contact URL
+ */
+ public function setVisitorsContacts();
+}
diff --git a/src/Core/Session/Handler/Cache.php b/src/Core/Session/Handler/Cache.php
index 671fd7ebe..519bad222 100644
--- a/src/Core/Session/Handler/Cache.php
+++ b/src/Core/Session/Handler/Cache.php
@@ -61,7 +61,7 @@ class Cache implements SessionHandlerInterface
return $data;
}
} catch (CachePersistenceException $exception) {
- $this->logger->warning('Cannot read session.'. ['id' => $id, 'exception' => $exception]);
+ $this->logger->warning('Cannot read session.', ['id' => $id, 'exception' => $exception]);
return '';
}
diff --git a/src/Core/Session/Handler/Database.php b/src/Core/Session/Handler/Database.php
index 46311dda2..714471f9f 100644
--- a/src/Core/Session/Handler/Database.php
+++ b/src/Core/Session/Handler/Database.php
@@ -70,7 +70,7 @@ class Database implements SessionHandlerInterface
return $session['data'];
}
} catch (\Exception $exception) {
- $this->logger->warning('Cannot read session.'. ['id' => $id, 'exception' => $exception]);
+ $this->logger->warning('Cannot read session.', ['id' => $id, 'exception' => $exception]);
return '';
}
@@ -114,7 +114,7 @@ class Database implements SessionHandlerInterface
$this->dba->insert('session', $fields);
}
} catch (\Exception $exception) {
- $this->logger->warning('Cannot write session.'. ['id' => $id, 'exception' => $exception]);
+ $this->logger->warning('Cannot write session.', ['id' => $id, 'exception' => $exception]);
return false;
}
@@ -131,7 +131,7 @@ class Database implements SessionHandlerInterface
try {
return $this->dba->delete('session', ['sid' => $id]);
} catch (\Exception $exception) {
- $this->logger->warning('Cannot destroy session.'. ['id' => $id, 'exception' => $exception]);
+ $this->logger->warning('Cannot destroy session.', ['id' => $id, 'exception' => $exception]);
return false;
}
}
@@ -141,7 +141,7 @@ class Database implements SessionHandlerInterface
try {
return $this->dba->delete('session', ["`expire` < ?", time()]);
} catch (\Exception $exception) {
- $this->logger->warning('Cannot use garbage collector.'. ['exception' => $exception]);
+ $this->logger->warning('Cannot use garbage collector.', ['exception' => $exception]);
return false;
}
}
diff --git a/src/Core/Session/Model/UserSession.php b/src/Core/Session/Model/UserSession.php
new file mode 100644
index 000000000..1b0d14121
--- /dev/null
+++ b/src/Core/Session/Model/UserSession.php
@@ -0,0 +1,121 @@
+.
+ *
+ */
+
+namespace Friendica\Core\Session\Model;
+
+use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Model\Contact;
+
+class UserSession implements IHandleUserSessions
+{
+ /** @var IHandleSessions */
+ private $session;
+ /** @var int|bool saves the public Contact ID for later usage */
+ protected $publicContactId = false;
+
+ public function __construct(IHandleSessions $session)
+ {
+ $this->session = $session;
+ }
+
+ /** {@inheritDoc} */
+ public function getLocalUserId()
+ {
+ if (!empty($this->session->get('authenticated')) && !empty($this->session->get('uid'))) {
+ return intval($this->session->get('uid'));
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public function getPublicContactId()
+ {
+ if (empty($this->publicContactId) && !empty($this->session->get('authenticated'))) {
+ if (!empty($this->session->get('my_address'))) {
+ // Local user
+ $this->publicContactId = Contact::getIdForURL($this->session->get('my_address'), 0, false);
+ } elseif (!empty($this->session->get('visitor_home'))) {
+ // Remote user
+ $this->publicContactId = Contact::getIdForURL($this->session->get('visitor_home'), 0, false);
+ }
+ } elseif (empty($this->session->get('authenticated'))) {
+ $this->publicContactId = false;
+ }
+
+ return $this->publicContactId;
+ }
+
+ /** {@inheritDoc} */
+ public function getRemoteUserId()
+ {
+ if (empty($this->session->get('authenticated'))) {
+ return false;
+ }
+
+ if (!empty($this->session->get('visitor_id'))) {
+ return (int)$this->session->get('visitor_id');
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public function getRemoteContactID(int $uid): int
+ {
+ if (!empty($this->session->get('remote')[$uid])) {
+ $remote = $this->session->get('remote')[$uid];
+ } else {
+ $remote = 0;
+ }
+
+ $local_user = !empty($this->session->get('authenticated')) ? $this->session->get('uid') : 0;
+
+ if (empty($remote) && ($local_user != $uid) && !empty($my_address = $this->session->get('my_address'))) {
+ $remote = Contact::getIdForURL($my_address, $uid, false);
+ }
+
+ return $remote;
+ }
+
+ /** {@inheritDoc} */
+ public function getUserIDForVisitorContactID(int $cid): int
+ {
+ if (empty($this->session->get('remote'))) {
+ return false;
+ }
+
+ return array_search($cid, $this->session->get('remote'));
+ }
+
+ /** {@inheritDoc} */
+ public function isAuthenticated(): bool
+ {
+ return $this->session->get('authenticated', false);
+ }
+
+ /** {@inheritDoc} */
+ public function setVisitorsContacts()
+ {
+ $this->session->set('remote', Contact::getVisitorByUrl($this->session->get('my_url')));
+ }
+}
diff --git a/src/Core/Session/Type/ArraySession.php b/src/Core/Session/Type/ArraySession.php
new file mode 100644
index 000000000..a45b64e68
--- /dev/null
+++ b/src/Core/Session/Type/ArraySession.php
@@ -0,0 +1,81 @@
+.
+ *
+ */
+
+namespace Friendica\Core\Session\Type;
+
+use Friendica\Core\Session\Capability\IHandleSessions;
+
+class ArraySession implements IHandleSessions
+{
+ /** @var array */
+ protected $data = [];
+
+ public function __construct(array $data = [])
+ {
+ $this->data = $data;
+ }
+
+ public function start(): IHandleSessions
+ {
+ return $this;
+ }
+
+ public function exists(string $name): bool
+ {
+ return !empty($this->data[$name]);
+ }
+
+ public function get(string $name, $defaults = null)
+ {
+ return $this->data[$name] ?? $defaults;
+ }
+
+ public function pop(string $name, $defaults = null)
+ {
+ $value = $defaults;
+ if ($this->exists($name)) {
+ $value = $this->get($name);
+ $this->remove($name);
+ }
+
+ return $value;
+ }
+
+ public function set(string $name, $value)
+ {
+ $this->data[$name] = $value;
+ }
+
+ public function setMultiple(array $values)
+ {
+ $this->data = array_merge($values, $this->data);
+ }
+
+ public function remove(string $name)
+ {
+ unset($this->data[$name]);
+ }
+
+ public function clear()
+ {
+ $this->data = [];
+ }
+}
diff --git a/src/DI.php b/src/DI.php
index a28eb707a..b107e8c34 100644
--- a/src/DI.php
+++ b/src/DI.php
@@ -22,6 +22,7 @@
namespace Friendica;
use Dice\Dice;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Navigation\SystemMessages;
use Psr\Log\LoggerInterface;
@@ -219,6 +220,11 @@ abstract class DI
return self::$dice->create(Core\Session\Capability\IHandleSessions::class);
}
+ public static function userSession(): IHandleUserSessions
+ {
+ return self::$dice->create(Core\Session\Capability\IHandleUserSessions::class);
+ }
+
/**
* @return \Friendica\Core\Storage\Repository\StorageManager
*/
diff --git a/src/Model/Contact.php b/src/Model/Contact.php
index d8a5b387f..0f960f160 100644
--- a/src/Model/Contact.php
+++ b/src/Model/Contact.php
@@ -261,6 +261,32 @@ class Contact
return DBA::selectFirst('contact', $fields, ['uri-id' => $uri_id], ['order' => ['uid']]);
}
+ /**
+ * Fetch all remote contacts for a given contact url
+ *
+ * @param string $url The URL of the contact
+ * @param array $fields The wanted fields
+ *
+ * @return array all remote contacts
+ *
+ * @throws \Exception
+ */
+ public static function getVisitorByUrl(string $url, array $fields = ['id', 'uid']): array
+ {
+ $remote = [];
+
+ $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => Strings::normaliseLink($url), 'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'self' => false]);
+ while ($contact = DBA::fetch($remote_contacts)) {
+ if (($contact['uid'] == 0) || Contact\User::isBlocked($contact['id'], $contact['uid'])) {
+ continue;
+ }
+ $remote[$contact['uid']] = $contact['id'];
+ }
+ DBA::close($remote_contacts);
+
+ return $remote;
+ }
+
/**
* Fetches a contact by a given url
*
diff --git a/static/dependencies.config.php b/static/dependencies.config.php
index 5aba529db..f7f98bb67 100644
--- a/static/dependencies.config.php
+++ b/static/dependencies.config.php
@@ -41,6 +41,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\L10n;
use Friendica\Core\Lock;
use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Storage\Repository\StorageManager;
use Friendica\Database\Database;
use Friendica\Database\Definition\DbaDefinition;
@@ -224,6 +225,9 @@ return [
['start', [], Dice::CHAIN_CALL],
],
],
+ IHandleUserSessions::class => [
+ 'instanceOf' => \Friendica\Core\Session\Model\UserSession::class,
+ ],
Cookie::class => [
'constructParams' => [
$_COOKIE
diff --git a/tests/src/Core/Session/UserSessionTest.php b/tests/src/Core/Session/UserSessionTest.php
new file mode 100644
index 000000000..532592387
--- /dev/null
+++ b/tests/src/Core/Session/UserSessionTest.php
@@ -0,0 +1,218 @@
+.
+ *
+ */
+
+namespace Friendica\Test\src\Core\Session;
+
+use Friendica\Core\Session\Model\UserSession;
+use Friendica\Core\Session\Type\ArraySession;
+use Friendica\Test\MockedTest;
+
+class UserSessionTest extends MockedTest
+{
+ public function dataLocalUserId()
+ {
+ return [
+ 'standard' => [
+ 'data' => [
+ 'authenticated' => true,
+ 'uid' => 21,
+ ],
+ 'expected' => 21,
+ ],
+ 'not_auth' => [
+ 'data' => [
+ 'authenticated' => false,
+ 'uid' => 21,
+ ],
+ 'expected' => false,
+ ],
+ 'no_uid' => [
+ 'data' => [
+ 'authenticated' => true,
+ ],
+ 'expected' => false,
+ ],
+ 'no_auth' => [
+ 'data' => [
+ 'uid' => 21,
+ ],
+ 'expected' => false,
+ ],
+ 'invalid' => [
+ 'data' => [
+ 'authenticated' => false,
+ 'uid' => 'test',
+ ],
+ 'expected' => false,
+ ],
+ ];
+ }
+
+ /**
+ * @dataProvider dataLocalUserId
+ */
+ public function testGetLocalUserId(array $data, $expected)
+ {
+ $userSession = new UserSession(new ArraySession($data));
+ $this->assertEquals($expected, $userSession->getLocalUserId());
+ }
+
+ public function testPublicContactId()
+ {
+ $this->markTestSkipped('Needs Contact::getIdForURL testable first');
+ }
+
+ public function dataGetRemoteUserId()
+ {
+ return [
+ 'standard' => [
+ 'data' => [
+ 'authenticated' => true,
+ 'visitor_id' => 21,
+ ],
+ 'expected' => 21,
+ ],
+ 'not_auth' => [
+ 'data' => [
+ 'authenticated' => false,
+ 'visitor_id' => 21,
+ ],
+ 'expected' => false,
+ ],
+ 'no_visitor_id' => [
+ 'data' => [
+ 'authenticated' => true,
+ ],
+ 'expected' => false,
+ ],
+ 'no_auth' => [
+ 'data' => [
+ 'visitor_id' => 21,
+ ],
+ 'expected' => false,
+ ],
+ 'invalid' => [
+ 'data' => [
+ 'authenticated' => false,
+ 'visitor_id' => 'test',
+ ],
+ 'expected' => false,
+ ],
+ ];
+ }
+
+ /**
+ * @dataProvider dataGetRemoteUserId
+ */
+ public function testGetRemoteUserId(array $data, $expected)
+ {
+ $userSession = new UserSession(new ArraySession($data));
+ $this->assertEquals($expected, $userSession->getRemoteUserId());
+ }
+
+ /// @fixme Add more data when Contact::getIdForUrl ist a dynamic class
+ public function dataGetRemoteContactId()
+ {
+ return [
+ 'remote_exists' => [
+ 'uid' => 1,
+ 'data' => [
+ 'remote' => ['1' => '21'],
+ ],
+ 'expected' => 21,
+ ],
+ ];
+ }
+
+ /**
+ * @dataProvider dataGetRemoteContactId
+ */
+ public function testGetRemoteContactId(int $uid, array $data, $expected)
+ {
+ $userSession = new UserSession(new ArraySession($data));
+ $this->assertEquals($expected, $userSession->getRemoteContactID($uid));
+ }
+
+ public function dataGetUserIdForVisitorContactID()
+ {
+ return [
+ 'standard' => [
+ 'cid' => 21,
+ 'data' => [
+ 'remote' => ['3' => '21'],
+ ],
+ 'expected' => 3,
+ ],
+ 'missing' => [
+ 'cid' => 2,
+ 'data' => [
+ 'remote' => ['3' => '21'],
+ ],
+ 'expected' => false,
+ ],
+ 'empty' => [
+ 'cid' => 21,
+ 'data' => [
+ ],
+ 'expected' => false,
+ ],
+ ];
+ }
+
+ /** @dataProvider dataGetUserIdForVisitorContactID */
+ public function testGetUserIdForVisitorContactID(int $cid, array $data, $expected)
+ {
+ $userSession = new UserSession(new ArraySession($data));
+ $this->assertEquals($expected, $userSession->getUserIDForVisitorContactID($cid));
+ }
+
+ public function dataAuthenticated()
+ {
+ return [
+ 'authenticated' => [
+ 'data' => [
+ 'authenticated' => true,
+ ],
+ 'expected' => true,
+ ],
+ 'not_authenticated' => [
+ 'data' => [
+ 'authenticated' => false,
+ ],
+ 'expected' => false,
+ ],
+ 'missing' => [
+ 'data' => [
+ ],
+ 'expected' => false,
+ ],
+ ];
+ }
+
+ /**
+ * @dataProvider dataAuthenticated
+ */
+ public function testIsAuthenticated(array $data, $expected)
+ {
+ $userSession = new UserSession(new ArraySession($data));
+ $this->assertEquals($expected, $userSession->isAuthenticated());
+ }
+}
From 0b66b6e0d5aea495363551be9f1954114883f052 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 20:26:54 +0200
Subject: [PATCH 04/40] Move Session "exists" and "expire" to new class
---
src/Core/Session.php | 3 --
.../Handler/AbstractSessionHandler.php | 28 +++++++++++++++++++
src/Core/Session/Handler/Cache.php | 7 ++---
src/Core/Session/Handler/Database.php | 12 ++++----
4 files changed, 36 insertions(+), 14 deletions(-)
create mode 100644 src/Core/Session/Handler/AbstractSessionHandler.php
diff --git a/src/Core/Session.php b/src/Core/Session.php
index a944cf8f5..d39db4861 100644
--- a/src/Core/Session.php
+++ b/src/Core/Session.php
@@ -31,9 +31,6 @@ use Friendica\Util\Strings;
*/
class Session
{
- public static $exists = false;
- public static $expire = 180000;
-
/**
* Returns the user id of locally logged in user or false.
*
diff --git a/src/Core/Session/Handler/AbstractSessionHandler.php b/src/Core/Session/Handler/AbstractSessionHandler.php
new file mode 100644
index 000000000..a16242be5
--- /dev/null
+++ b/src/Core/Session/Handler/AbstractSessionHandler.php
@@ -0,0 +1,28 @@
+.
+ *
+ */
+
+namespace Friendica\Core\Session\Handler;
+
+abstract class AbstractSessionHandler implements \SessionHandlerInterface
+{
+ /** @var int Duration of the Session */
+ public const EXPIRE = 180000;
+}
diff --git a/src/Core/Session/Handler/Cache.php b/src/Core/Session/Handler/Cache.php
index 519bad222..4fcc51c17 100644
--- a/src/Core/Session/Handler/Cache.php
+++ b/src/Core/Session/Handler/Cache.php
@@ -23,14 +23,12 @@ namespace Friendica\Core\Session\Handler;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Cache\Exception\CachePersistenceException;
-use Friendica\Core\Session;
use Psr\Log\LoggerInterface;
-use SessionHandlerInterface;
/**
* SessionHandler using Friendica Cache
*/
-class Cache implements SessionHandlerInterface
+class Cache extends AbstractSessionHandler
{
/** @var ICanCache */
private $cache;
@@ -57,7 +55,6 @@ class Cache implements SessionHandlerInterface
try {
$data = $this->cache->get('session:' . $id);
if (!empty($data)) {
- Session::$exists = true;
return $data;
}
} catch (CachePersistenceException $exception) {
@@ -91,7 +88,7 @@ class Cache implements SessionHandlerInterface
}
try {
- return $this->cache->set('session:' . $id, $data, Session::$expire);
+ return $this->cache->set('session:' . $id, $data, static::EXPIRE);
} catch (CachePersistenceException $exception) {
$this->logger->warning('Cannot write session', ['id' => $id, 'exception' => $exception]);
return false;
diff --git a/src/Core/Session/Handler/Database.php b/src/Core/Session/Handler/Database.php
index 714471f9f..41ccb6b33 100644
--- a/src/Core/Session/Handler/Database.php
+++ b/src/Core/Session/Handler/Database.php
@@ -21,15 +21,13 @@
namespace Friendica\Core\Session\Handler;
-use Friendica\Core\Session;
use Friendica\Database\Database as DBA;
use Psr\Log\LoggerInterface;
-use SessionHandlerInterface;
/**
* SessionHandler using database
*/
-class Database implements SessionHandlerInterface
+class Database extends AbstractSessionHandler
{
/** @var DBA */
private $dba;
@@ -37,6 +35,8 @@ class Database implements SessionHandlerInterface
private $logger;
/** @var array The $_SERVER variable */
private $server;
+ /** @var bool global check, if the current Session exists */
+ private $sessionExists = false;
/**
* DatabaseSessionHandler constructor.
@@ -66,7 +66,7 @@ class Database implements SessionHandlerInterface
try {
$session = $this->dba->selectFirst('session', ['data'], ['sid' => $id]);
if ($this->dba->isResult($session)) {
- Session::$exists = true;
+ $this->sessionExists = true;
return $session['data'];
}
} catch (\Exception $exception) {
@@ -101,11 +101,11 @@ class Database implements SessionHandlerInterface
return $this->destroy($id);
}
- $expire = time() + Session::$expire;
+ $expire = time() + static::EXPIRE;
$default_expire = time() + 300;
try {
- if (Session::$exists) {
+ if ($this->sessionExists) {
$fields = ['data' => $data, 'expire' => $expire];
$condition = ["`sid` = ? AND (`data` != ? OR `expire` != ?)", $id, $data, $expire];
$this->dba->update('session', $fields, $condition);
From 7c4611af199810bf375329d4aa5d72080180a9da Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 20:47:43 +0200
Subject: [PATCH 05/40] Update tests/src/Core/Session/UserSessionTest.php
Co-authored-by: Hypolite Petovan
---
tests/src/Core/Session/UserSessionTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/src/Core/Session/UserSessionTest.php b/tests/src/Core/Session/UserSessionTest.php
index 532592387..41c503352 100644
--- a/tests/src/Core/Session/UserSessionTest.php
+++ b/tests/src/Core/Session/UserSessionTest.php
@@ -128,7 +128,7 @@ class UserSessionTest extends MockedTest
$this->assertEquals($expected, $userSession->getRemoteUserId());
}
- /// @fixme Add more data when Contact::getIdForUrl ist a dynamic class
+ /// @fixme Add more data when Contact::getIdForUrl is a dynamic class
public function dataGetRemoteContactId()
{
return [
From bfe68702db90271e4e2c79c4ddefd4567b616989 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 21:02:49 +0200
Subject: [PATCH 06/40] UserSession class [2] - Refactor mod/ files
---
mod/cal.php | 8 +++---
mod/display.php | 56 +++++++++++++++++++--------------------
mod/editpost.php | 10 +++----
mod/events.php | 28 ++++++++++----------
mod/fbrowser.php | 8 +++---
mod/follow.php | 8 +++---
mod/item.php | 56 +++++++++++++++++++--------------------
mod/match.php | 12 ++++-----
mod/message.php | 26 +++++++++---------
mod/notes.php | 14 +++++-----
mod/oexchange.php | 4 +--
mod/ostatus_subscribe.php | 4 +--
mod/photos.php | 52 ++++++++++++++++++------------------
mod/redir.php | 12 ++++-----
mod/removeme.php | 6 ++---
mod/repair_ostatus.php | 4 +--
mod/settings.php | 48 ++++++++++++++++-----------------
mod/share.php | 2 +-
mod/suggest.php | 4 +--
mod/tagger.php | 8 +++---
mod/tagrm.php | 8 +++---
mod/unfollow.php | 10 +++----
mod/update_contact.php | 2 +-
mod/wall_attach.php | 6 ++---
mod/wall_upload.php | 6 ++---
25 files changed, 201 insertions(+), 201 deletions(-)
diff --git a/mod/cal.php b/mod/cal.php
index ef2063d0a..9329aac32 100644
--- a/mod/cal.php
+++ b/mod/cal.php
@@ -42,7 +42,7 @@ use Friendica\Util\Temporal;
function cal_init(App $a)
{
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
@@ -112,11 +112,11 @@ function cal_content(App $a)
$owner_uid = intval($owner['uid']);
$nick = $owner['nickname'];
- $contact_id = Session::getRemoteContactID($owner['uid']);
+ $contact_id = DI::userSession()->getRemoteContactID($owner['uid']);
$remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]);
- $is_owner = Session::getLocalUser() == $owner['uid'];
+ $is_owner = DI::userSession()->getLocalUserId() == $owner['uid'];
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
@@ -278,7 +278,7 @@ function cal_content(App $a)
// If it the own calendar return to the events page
// otherwise to the profile calendar page
- if (Session::getLocalUser() === $owner_uid) {
+ if (DI::userSession()->getLocalUserId() === $owner_uid) {
$return_path = "events";
} else {
$return_path = "cal/" . $nick;
diff --git a/mod/display.php b/mod/display.php
index 1a024c768..a2bf21867 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -46,14 +46,14 @@ function display_init(App $a)
(new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run();
}
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
return;
}
$nick = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
$item = null;
- $item_user = Session::getLocalUser();
+ $item_user = DI::userSession()->getLocalUserId();
$fields = ['uri-id', 'parent-uri-id', 'author-id', 'author-link', 'body', 'uid', 'guid', 'gravity'];
@@ -62,18 +62,18 @@ function display_init(App $a)
$nick = '';
// Does the local user have this item?
- if (Session::getLocalUser()) {
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => Session::getLocalUser()]);
+ if (DI::userSession()->getLocalUserId()) {
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => DI::userSession()->getLocalUserId()]);
if (DBA::isResult($item)) {
$nick = $a->getLoggedInUserNickname();
}
}
// Is this item private but could be visible to the remove visitor?
- if (!DBA::isResult($item) && Session::getRemoteUser()) {
+ if (!DBA::isResult($item) && DI::userSession()->getRemoteUserId) {
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
if (DBA::isResult($item)) {
- if (!Contact::isFollower(Session::getRemoteUser(), $item['uid'])) {
+ if (!Contact::isFollower(DI::userSession()->getRemoteUserId, $item['uid'])) {
$item = null;
} else {
$item_user = $item['uid'];
@@ -83,14 +83,14 @@ function display_init(App $a)
// Is it an item with uid=0?
if (!DBA::isResult($item)) {
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
}
} elseif (DI::args()->getArgc() >= 3 && $nick == 'feed-item') {
$uri_id = DI::args()->getArgv()[2];
if (substr($uri_id, -5) == '.atom') {
$uri_id = substr($uri_id, 0, -5);
}
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
}
if (!DBA::isResult($item)) {
@@ -126,7 +126,7 @@ function display_fetchauthor($item)
if (Diaspora::isReshare($item['body'], true)) {
$shared = Item::getShareArray($item);
if (!empty($shared['profile'])) {
- $contact = Contact::getByURLForUser($shared['profile'], Session::getLocalUser());
+ $contact = Contact::getByURLForUser($shared['profile'], DI::userSession()->getLocalUserId());
}
}
@@ -139,7 +139,7 @@ function display_fetchauthor($item)
function display_content(App $a, $update = false, $update_uid = 0)
{
- if (DI::config()->get('system','block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system','block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
}
@@ -181,18 +181,18 @@ function display_content(App $a, $update = false, $update_uid = 0)
if (DI::args()->getArgc() == 2) {
$fields = ['uri-id', 'parent-uri-id', 'uid'];
- if (Session::getLocalUser()) {
- $condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, Session::getLocalUser()]];
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, $condition, ['order' => ['uid' => true]]);
+ if (DI::userSession()->getLocalUserId()) {
+ $condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, DI::userSession()->getLocalUserId()]];
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, $condition, ['order' => ['uid' => true]]);
if (DBA::isResult($item)) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
}
}
- if (($parent_uri_id == 0) && Session::getRemoteUser()) {
+ if (($parent_uri_id == 0) && DI::userSession()->getRemoteUserId) {
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
- if (DBA::isResult($item) && Contact::isFollower(Session::getRemoteUser(), $item['uid'])) {
+ if (DBA::isResult($item) && Contact::isFollower(DI::userSession()->getRemoteUserId, $item['uid'])) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
}
@@ -200,7 +200,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
if ($parent_uri_id == 0) {
$condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => DI::args()->getArgv()[1], 'uid' => 0];
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, $condition);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, $condition);
if (DBA::isResult($item)) {
$uri_id = $item['uri-id'];
$parent_uri_id = $item['parent-uri-id'];
@@ -213,9 +213,9 @@ function display_content(App $a, $update = false, $update_uid = 0)
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
}
- if (!DI::pConfig()->get(Session::getLocalUser(), 'system', 'detailed_notif')) {
- DI::notification()->setAllSeenForUser(Session::getLocalUser(), ['parent-uri-id' => $item['parent-uri-id']]);
- DI::notify()->setAllSeenForUser(Session::getLocalUser(), ['parent-uri-id' => $item['parent-uri-id']]);
+ if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
+ DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['parent-uri-id' => $item['parent-uri-id']]);
+ DI::notify()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['parent-uri-id' => $item['parent-uri-id']]);
}
// We are displaying an "alternate" link if that post was public. See issue 2864
@@ -234,17 +234,17 @@ function display_content(App $a, $update = false, $update_uid = 0)
'$conversation' => $conversation]);
$is_remote_contact = false;
- $item_uid = Session::getLocalUser();
+ $item_uid = DI::userSession()->getLocalUserId();
$page_uid = 0;
$parent = null;
- if (!Session::getLocalUser() && !empty($parent_uri_id)) {
+ if (!DI::userSession()->getLocalUserId() && !empty($parent_uri_id)) {
$parent = Post::selectFirst(['uid'], ['uri-id' => $parent_uri_id, 'wall' => true]);
}
if (DBA::isResult($parent)) {
$page_uid = $page_uid ?? 0 ?: $parent['uid'];
- $is_remote_contact = Session::getRemoteContactID($page_uid);
+ $is_remote_contact = DI::userSession()->getRemoteContactID($page_uid);
if ($is_remote_contact) {
$item_uid = $parent['uid'];
}
@@ -252,11 +252,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
$page_uid = $item['uid'];
}
- if (!empty($page_uid) && ($page_uid != Session::getLocalUser())) {
+ if (!empty($page_uid) && ($page_uid != DI::userSession()->getLocalUserId())) {
$page_user = User::getById($page_uid);
}
- $is_owner = Session::getLocalUser() && (in_array($page_uid, [Session::getLocalUser(), 0]));
+ $is_owner = DI::userSession()->getLocalUserId() && (in_array($page_uid, [DI::userSession()->getLocalUserId(), 0]));
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
@@ -268,8 +268,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
}
$sql_extra = Item::getPermissionsSQLByUserId($page_uid);
- if (Session::getLocalUser() && (Session::getLocalUser() == $page_uid)) {
- $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => Session::getLocalUser(), 'unseen' => true];
+ if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_uid)) {
+ $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => DI::userSession()->getLocalUserId(), 'unseen' => true];
$unseen = Post::exists($condition);
} else {
$unseen = false;
@@ -290,11 +290,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
$item['uri-id'] = $item['parent-uri-id'];
if ($unseen) {
- $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => Session::getLocalUser(), 'unseen' => true];
+ $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => DI::userSession()->getLocalUserId(), 'unseen' => true];
Item::update(['unseen' => false], $condition);
}
- if (!$update && Session::getLocalUser()) {
+ if (!$update && DI::userSession()->getLocalUserId()) {
$o .= "";
}
diff --git a/mod/editpost.php b/mod/editpost.php
index 8b25f66be..0c0002bc5 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -35,7 +35,7 @@ function editpost_content(App $a)
{
$o = '';
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@@ -50,14 +50,14 @@ function editpost_content(App $a)
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
- $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['id' => $post_id, 'uid' => Session::getLocalUser()]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['id' => $post_id, 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($item)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
return;
}
- $user = User::getById(Session::getLocalUser());
+ $user = User::getById(DI::userSession()->getLocalUserId());
$geotag = '';
@@ -119,8 +119,8 @@ function editpost_content(App $a)
'$jotnets' => $jotnets,
'$title' => $item['title'],
'$placeholdertitle' => DI::l10n()->t('Set title'),
- '$category' => Post\Category::getCSVByURIId($item['uri-id'], Session::getLocalUser(), Post\Category::CATEGORY),
- '$placeholdercategory' => (Feature::isEnabled(Session::getLocalUser(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
+ '$category' => Post\Category::getCSVByURIId($item['uri-id'], DI::userSession()->getLocalUserId(), Post\Category::CATEGORY),
+ '$placeholdercategory' => (Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
diff --git a/mod/events.php b/mod/events.php
index ac2a08afc..5899302cc 100644
--- a/mod/events.php
+++ b/mod/events.php
@@ -47,7 +47,7 @@ use Friendica\Worker\Delivery;
function events_init(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -55,7 +55,7 @@ function events_init(App $a)
DI::page()['aside'] = '';
}
- $cal_widget = CalendarExport::getHTML(Session::getLocalUser());
+ $cal_widget = CalendarExport::getHTML(DI::userSession()->getLocalUserId());
DI::page()['aside'] .= $cal_widget;
@@ -65,13 +65,13 @@ function events_init(App $a)
function events_post(App $a)
{
Logger::debug('post', ['request' => $_REQUEST]);
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
$event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0;
$cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0;
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$start_text = Strings::escapeHtml($_REQUEST['start_text'] ?? '');
$finish_text = Strings::escapeHtml($_REQUEST['finish_text'] ?? '');
@@ -215,7 +215,7 @@ function events_post(App $a)
function events_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@@ -225,11 +225,11 @@ function events_content(App $a)
}
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'ignore') && intval(DI::args()->getArgv()[2])) {
- DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]);
+ DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
}
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'unignore') && intval(DI::args()->getArgv()[2])) {
- DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]);
+ DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
}
if ($a->getThemeInfoValue('events_in_profile')) {
@@ -324,9 +324,9 @@ function events_content(App $a)
// get events by id or by date
if ($event_params['event_id']) {
- $r = Event::getListById(Session::getLocalUser(), $event_params['event_id']);
+ $r = Event::getListById(DI::userSession()->getLocalUserId(), $event_params['event_id']);
} else {
- $r = Event::getListByDate(Session::getLocalUser(), $event_params);
+ $r = Event::getListByDate(DI::userSession()->getLocalUserId(), $event_params);
}
$links = [];
@@ -397,7 +397,7 @@ function events_content(App $a)
}
if (($mode === 'edit' || $mode === 'copy') && $event_id) {
- $orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => Session::getLocalUser()]);
+ $orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => DI::userSession()->getLocalUserId()]);
}
// Passed parameters overrides anything found in the DB
@@ -406,8 +406,8 @@ function events_content(App $a)
$share_disabled = '';
if (empty($orig_event)) {
- $orig_event = User::getById(Session::getLocalUser(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);;
- } elseif ($orig_event['allow_cid'] !== '<' . Session::getLocalUser() . '>'
+ $orig_event = User::getById(DI::userSession()->getLocalUserId(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);;
+ } elseif ($orig_event['allow_cid'] !== '<' . DI::userSession()->getLocalUserId() . '>'
|| $orig_event['allow_gid']
|| $orig_event['deny_cid']
|| $orig_event['deny_gid']) {
@@ -525,11 +525,11 @@ function events_content(App $a)
// Remove an event from the calendar and its related items
if ($mode === 'drop' && $event_id) {
- $ev = Event::getListById(Session::getLocalUser(), $event_id);
+ $ev = Event::getListById(DI::userSession()->getLocalUserId(), $event_id);
// Delete only real events (no birthdays)
if (DBA::isResult($ev) && $ev[0]['type'] == 'event') {
- Item::deleteForUser(['id' => $ev[0]['itemid']], Session::getLocalUser());
+ Item::deleteForUser(['id' => $ev[0]['itemid']], DI::userSession()->getLocalUserId());
}
if (Post::exists(['id' => $ev[0]['itemid']])) {
diff --git a/mod/fbrowser.php b/mod/fbrowser.php
index a2457575a..137d664f3 100644
--- a/mod/fbrowser.php
+++ b/mod/fbrowser.php
@@ -39,7 +39,7 @@ use Friendica\Util\Strings;
*/
function fbrowser_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
System::exit();
}
@@ -66,7 +66,7 @@ function fbrowser_content(App $a)
if (DI::args()->getArgc() == 2) {
$photos = DBA::toArray(DBA::p("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
Photo::CONTACT_AVATAR,
Photo::CONTACT_BANNER
));
@@ -85,7 +85,7 @@ function fbrowser_content(App $a)
min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created`
FROM `photo` WHERE `uid` = ? $sql_extra AND NOT `photo-type` IN (?, ?)
GROUP BY `resource-id` $sql_extra2",
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
Photo::CONTACT_AVATAR,
Photo::CONTACT_BANNER
));
@@ -125,7 +125,7 @@ function fbrowser_content(App $a)
break;
case "file":
if (DI::args()->getArgc()==2) {
- $files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => Session::getLocalUser()]);
+ $files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => DI::userSession()->getLocalUserId()]);
function _map_files2($rr)
{
diff --git a/mod/follow.php b/mod/follow.php
index 8e08d7a72..19e55123c 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -36,7 +36,7 @@ use Friendica\Util\Strings;
function follow_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
@@ -53,13 +53,13 @@ function follow_content(App $a)
{
$return_path = 'contact';
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect($return_path);
// NOTREACHED
}
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
@@ -196,7 +196,7 @@ function follow_process(App $a, string $url)
function follow_remote_item($url)
{
- $item_id = Item::fetchByLink($url, Session::getLocalUser());
+ $item_id = Item::fetchByLink($url, DI::userSession()->getLocalUserId());
if (!$item_id) {
// If the user-specific search failed, we search and probe a public post
$item_id = Item::fetchByLink($url);
diff --git a/mod/item.php b/mod/item.php
index e36853acc..0490e43a8 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -58,11 +58,11 @@ use Friendica\Util\DateTimeFormat;
use Friendica\Util\ParseUrl;
function item_post(App $a) {
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException();
}
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
if (!empty($_REQUEST['dropitems'])) {
$arr_drop = explode(',', $_REQUEST['dropitems']);
@@ -107,7 +107,7 @@ function item_post(App $a) {
$toplevel_user_id = null;
$objecttype = null;
- $profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: Session::getLocalUser();
+ $profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: DI::userSession()->getLocalUserId();
$posttype = ($_REQUEST['post_type'] ?? '') ?: Item::PT_ARTICLE;
if ($parent_item_id || $thr_parent_uri) {
@@ -139,7 +139,7 @@ function item_post(App $a) {
// When commenting on a public post then store the post for the current user
// This enables interaction like starring and saving into folders
if ($toplevel_item['uid'] == 0) {
- $stored = Item::storeForUserByUriId($toplevel_item['uri-id'], Session::getLocalUser(), ['post-reason' => Item::PR_ACTIVITY]);
+ $stored = Item::storeForUserByUriId($toplevel_item['uri-id'], DI::userSession()->getLocalUserId(), ['post-reason' => Item::PR_ACTIVITY]);
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $uid, 'stored' => $stored]);
if ($stored) {
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $stored]);
@@ -169,16 +169,16 @@ function item_post(App $a) {
}
// Ensure that the user id in a thread always stay the same
- if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [Session::getLocalUser(), 0])) {
+ if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [DI::userSession()->getLocalUserId(), 0])) {
$profile_uid = $toplevel_user_id;
}
// Allow commenting if it is an answer to a public post
- $allow_comment = Session::getLocalUser() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
+ $allow_comment = DI::userSession()->getLocalUserId() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
- Logger::warning('Permission denied.', ['local' => Session::getLocalUser(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
+ Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
@@ -324,9 +324,9 @@ function item_post(App $a) {
$pubmail_enabled = ($_REQUEST['pubmail_enable'] ?? false) && !$private;
// if using the API, we won't see pubmail_enable - figure out if it should be set
- if ($api_source && $profile_uid && $profile_uid == Session::getLocalUser() && !$private) {
+ if ($api_source && $profile_uid && $profile_uid == DI::userSession()->getLocalUserId() && !$private) {
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
- $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", Session::getLocalUser(), '']);
+ $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", DI::userSession()->getLocalUserId(), '']);
}
}
@@ -363,11 +363,11 @@ function item_post(App $a) {
$self = false;
$contact_id = 0;
- if (Session::getLocalUser() && ((Session::getLocalUser() == $profile_uid) || $allow_comment)) {
+ if (DI::userSession()->getLocalUserId() && ((DI::userSession()->getLocalUserId() == $profile_uid) || $allow_comment)) {
$self = true;
- $author = DBA::selectFirst('contact', [], ['uid' => Session::getLocalUser(), 'self' => true]);
- } elseif (!empty(Session::getRemoteContactID($profile_uid))) {
- $author = DBA::selectFirst('contact', [], ['id' => Session::getRemoteContactID($profile_uid)]);
+ $author = DBA::selectFirst('contact', [], ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
+ } elseif (!empty(DI::userSession()->getRemoteContactID($profile_uid))) {
+ $author = DBA::selectFirst('contact', [], ['id' => DI::userSession()->getRemoteContactID($profile_uid)]);
}
if (DBA::isResult($author)) {
@@ -375,7 +375,7 @@ function item_post(App $a) {
}
// get contact info for owner
- if ($profile_uid == Session::getLocalUser() || $allow_comment) {
+ if ($profile_uid == DI::userSession()->getLocalUserId() || $allow_comment) {
$contact_record = $author ?: [];
} else {
$contact_record = DBA::selectFirst('contact', [], ['uid' => $profile_uid, 'self' => true]) ?: [];
@@ -385,7 +385,7 @@ function item_post(App $a) {
if ($posttype != Item::PT_PERSONAL_NOTE) {
// Look for any tags and linkify them
$item = [
- 'uid' => Session::getLocalUser() ? Session::getLocalUser() : $profile_uid,
+ 'uid' => DI::userSession()->getLocalUserId() ? DI::userSession()->getLocalUserId() : $profile_uid,
'gravity' => $toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT,
'network' => $network,
'body' => $body,
@@ -734,7 +734,7 @@ function item_post(App $a) {
Hook::callAll('post_local_end', $datarray);
- if (strlen($emailcc) && $profile_uid == Session::getLocalUser()) {
+ if (strlen($emailcc) && $profile_uid == DI::userSession()->getLocalUserId()) {
$recipients = explode(',', $emailcc);
if (count($recipients)) {
foreach ($recipients as $recipient) {
@@ -780,7 +780,7 @@ function item_post_return($baseurl, $api_source, $return_path)
function item_content(App $a)
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\UnauthorizedException();
}
@@ -794,9 +794,9 @@ function item_content(App $a)
switch ($args->get(1)) {
case 'drop':
if (DI::mode()->isAjax()) {
- Item::deleteForUser(['id' => $args->get(2)], Session::getLocalUser());
+ Item::deleteForUser(['id' => $args->get(2)], DI::userSession()->getLocalUserId());
// ajax return: [- , 0 (no perm) |
]
- System::jsonExit([intval($args->get(2)), Session::getLocalUser()]);
+ System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
} else {
if (!empty($args->get(3))) {
$o = drop_item($args->get(2), $args->get(3));
@@ -807,16 +807,16 @@ function item_content(App $a)
break;
case 'block':
- $item = Post::selectFirstForUser(Session::getLocalUser(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
if (empty($item['author-id'])) {
throw new HTTPException\NotFoundException('Item not found');
}
- Contact\User::setBlocked($item['author-id'], Session::getLocalUser(), true);
+ Contact\User::setBlocked($item['author-id'], DI::userSession()->getLocalUserId(), true);
if (DI::mode()->isAjax()) {
// ajax return: [- , 0 (no perm) |
]
- System::jsonExit([intval($args->get(2)), Session::getLocalUser()]);
+ System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
} else {
item_redirect_after_action($item, $args->get(3));
}
@@ -835,7 +835,7 @@ function item_content(App $a)
function drop_item(int $id, string $return = ''): string
{
// Locate item to be deleted
- $item = Post::selectFirstForUser(Session::getLocalUser(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
if (!DBA::isResult($item)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
@@ -850,18 +850,18 @@ function drop_item(int $id, string $return = ''): string
$contact_id = 0;
// check if logged in user is either the author or owner of this item
- if (Session::getRemoteContactID($item['uid']) == $item['contact-id']) {
+ if (DI::userSession()->getRemoteContactID($item['uid']) == $item['contact-id']) {
$contact_id = $item['contact-id'];
}
- if ((Session::getLocalUser() == $item['uid']) || $contact_id) {
+ if ((DI::userSession()->getLocalUserId() == $item['uid']) || $contact_id) {
// delete the item
- Item::deleteForUser(['id' => $item['id']], Session::getLocalUser());
+ Item::deleteForUser(['id' => $item['id']], DI::userSession()->getLocalUserId());
item_redirect_after_action($item, $return);
//NOTREACHED
} else {
- Logger::warning('Permission denied.', ['local' => Session::getLocalUser(), 'uid' => $item['uid'], 'cid' => $contact_id]);
+ Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED
@@ -880,7 +880,7 @@ function item_redirect_after_action(array $item, string $returnUrlHex)
// Check if delete a comment
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
if (!empty($item['parent'])) {
- $parentitem = Post::selectFirstForUser(Session::getLocalUser(), ['guid'], ['id' => $item['parent']]);
+ $parentitem = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid'], ['id' => $item['parent']]);
}
// Return to parent guid
diff --git a/mod/match.php b/mod/match.php
index 860d60f56..5b87c6870 100644
--- a/mod/match.php
+++ b/mod/match.php
@@ -45,7 +45,7 @@ use Friendica\Module\Contact as ModuleContact;
*/
function match_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -54,7 +54,7 @@ function match_content(App $a)
$_SESSION['return_path'] = DI::args()->getCommand();
- $profile = Profile::getByUID(Session::getLocalUser());
+ $profile = Profile::getByUID(DI::userSession()->getLocalUserId());
if (!DBA::isResult($profile)) {
return '';
@@ -68,10 +68,10 @@ function match_content(App $a)
$tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']);
if (DI::mode()->isMobile()) {
- $limit = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $limit = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $limit = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $limit = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -115,12 +115,12 @@ function match_get_contacts($msearch, $entries, $limit)
}
// Already known contact
- $contact = Contact::getByURL($profile->url, null, ['rel'], Session::getLocalUser());
+ $contact = Contact::getByURL($profile->url, null, ['rel'], DI::userSession()->getLocalUserId());
if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
continue;
}
- $contact = Contact::getByURLForUser($profile->url, Session::getLocalUser());
+ $contact = Contact::getByURLForUser($profile->url, DI::userSession()->getLocalUserId());
if (!empty($contact)) {
$entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact);
}
diff --git a/mod/message.php b/mod/message.php
index 8d379f4e9..9fb8d7cbc 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -40,7 +40,7 @@ function message_init(App $a)
$tabs = '';
if (DI::args()->getArgc() > 1 && is_numeric(DI::args()->getArgv()[1])) {
- $tabs = render_messages(get_messages(Session::getLocalUser(), 0, 5), 'mail_list.tpl');
+ $tabs = render_messages(get_messages(DI::userSession()->getLocalUserId(), 0, 5), 'mail_list.tpl');
}
$new = [
@@ -66,7 +66,7 @@ function message_init(App $a)
function message_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@@ -111,7 +111,7 @@ function message_content(App $a)
$o = '';
Nav::setSelected('messages');
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@@ -145,28 +145,28 @@ function message_content(App $a)
$cmd = DI::args()->getArgv()[1];
if ($cmd === 'drop') {
- $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]);
+ $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
if(!DBA::isResult($message)){
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.'));
DI::baseUrl()->redirect('message');
}
- if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()])) {
+ if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.'));
}
- $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => Session::getLocalUser()]);
+ $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => DI::userSession()->getLocalUserId()]);
if(!DBA::isResult($conversation)){
DI::baseUrl()->redirect('message');
}
DI::baseUrl()->redirect('message/' . $conversation['id'] );
} else {
- $parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]);
+ $parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
if (DBA::isResult($parentmail)) {
$parent = $parentmail['parent-uri'];
- if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => Session::getLocalUser()])) {
+ if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => DI::userSession()->getLocalUserId()])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.'));
}
}
@@ -216,11 +216,11 @@ function message_content(App $a)
$o .= $header;
- $total = DBA::count('mail', ['uid' => Session::getLocalUser()], ['distinct' => true, 'expression' => 'parent-uri']);
+ $total = DBA::count('mail', ['uid' => DI::userSession()->getLocalUserId()], ['distinct' => true, 'expression' => 'parent-uri']);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
- $r = get_messages(Session::getLocalUser(), $pager->getStart(), $pager->getItemsPerPage());
+ $r = get_messages(DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage());
if (!DBA::isResult($r)) {
DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
@@ -244,14 +244,14 @@ function message_content(App $a)
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
WHERE `mail`.`uid` = ? AND `mail`.`id` = ?
LIMIT 1",
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
DI::args()->getArgv()[1]
);
if (DBA::isResult($message)) {
$contact_id = $message['contact-id'];
$params = [
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$message['parent-uri']
];
@@ -273,7 +273,7 @@ function message_content(App $a)
$messages = DBA::toArray($messages_stmt);
- DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => Session::getLocalUser()]);
+ DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => DI::userSession()->getLocalUserId()]);
} else {
$messages = false;
}
diff --git a/mod/notes.php b/mod/notes.php
index 9363e51b8..84c0711eb 100644
--- a/mod/notes.php
+++ b/mod/notes.php
@@ -31,7 +31,7 @@ use Friendica\Module\BaseProfile;
function notes_init(App $a)
{
- if (! Session::getLocalUser()) {
+ if (! DI::userSession()->getLocalUserId()) {
return;
}
@@ -41,7 +41,7 @@ function notes_init(App $a)
function notes_content(App $a, bool $update = false)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@@ -53,7 +53,7 @@ function notes_content(App $a, bool $update = false)
$x = [
'lockstate' => 'lock',
- 'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(Session::getLocalUser(), DI::l10n()->t('Personal notes are visible only by yourself.')),
+ 'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(DI::userSession()->getLocalUserId(), DI::l10n()->t('Personal notes are visible only by yourself.')),
'button' => DI::l10n()->t('Save'),
'acl_data' => '',
];
@@ -61,14 +61,14 @@ function notes_content(App $a, bool $update = false)
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
}
- $condition = ['uid' => Session::getLocalUser(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
+ $condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
'contact-id'=> $a->getContactId()];
if (DI::mode()->isMobile()) {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -76,7 +76,7 @@ function notes_content(App $a, bool $update = false)
$params = ['order' => ['created' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
- $r = Post::selectThreadForUser(Session::getLocalUser(), ['uri-id'], $condition, $params);
+ $r = Post::selectThreadForUser(DI::userSession()->getLocalUserId(), ['uri-id'], $condition, $params);
$count = 0;
diff --git a/mod/oexchange.php b/mod/oexchange.php
index 0970af2fd..4bc25e6fd 100644
--- a/mod/oexchange.php
+++ b/mod/oexchange.php
@@ -98,7 +98,7 @@ function oexchange_init(App $a)
function oexchange_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$o = Login::form();
return $o;
}
@@ -120,7 +120,7 @@ function oexchange_content(App $a)
$post = [];
- $post['profile_uid'] = Session::getLocalUser();
+ $post['profile_uid'] = DI::userSession()->getLocalUserId();
$post['return'] = '/oexchange/done';
$post['body'] = HTML::toBBCode($s);
diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php
index 50ff44569..31564ad32 100644
--- a/mod/ostatus_subscribe.php
+++ b/mod/ostatus_subscribe.php
@@ -30,7 +30,7 @@ use Friendica\Protocol\ActivityPub;
function ostatus_subscribe_content(App $a): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_subscribe');
// NOTREACHED
@@ -38,7 +38,7 @@ function ostatus_subscribe_content(App $a): string
$o = '' . DI::l10n()->t('Subscribing to contacts') . ' ';
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$counter = intval($_REQUEST['counter'] ?? 0);
diff --git a/mod/photos.php b/mod/photos.php
index f47456a0b..56b722e8f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -57,7 +57,7 @@ use Friendica\Network\HTTPException;
function photos_init(App $a)
{
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
return;
}
@@ -69,11 +69,11 @@ function photos_init(App $a)
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
- $is_owner = (Session::getLocalUser() && (Session::getLocalUser() == $owner['uid']));
+ $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner['uid']));
$albums = Photo::getAlbums($owner['uid']);
- $albums_visible = ((intval($owner['hidewall']) && !Session::isAuthenticated()) ? false : true);
+ $albums_visible = ((intval($owner['hidewall']) && !DI::userSession()->isAuthenticated()) ? false : true);
// add various encodings to the array so we can just loop through and pick them out in a template
$ret = ['success' => false];
@@ -96,7 +96,7 @@ function photos_init(App $a)
}
}
- if (Session::getLocalUser() && $owner['uid'] == Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId() && $owner['uid'] == DI::userSession()->getLocalUserId()) {
$can_post = true;
} else {
$can_post = false;
@@ -148,10 +148,10 @@ function photos_post(App $a)
$page_owner_uid = intval($user['uid']);
$community_page = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
- if (Session::getLocalUser() && (Session::getLocalUser() == $page_owner_uid)) {
+ if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
$can_post = true;
- } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
- $contact_id = Session::getRemoteContactID($page_owner_uid);
+ } elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
+ $contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
$can_post = true;
$visitor = $contact_id;
}
@@ -229,7 +229,7 @@ function photos_post(App $a)
));
} else {
$r = DBA::toArray(DBA::p("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = ? AND `album` = ?",
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$album
));
}
@@ -268,7 +268,7 @@ function photos_post(App $a)
$condition = ['contact-id' => $visitor, 'uid' => $page_owner_uid, 'resource-id' => DI::args()->getArgv()[3]];
} else {
- $condition = ['uid' => Session::getLocalUser(), 'resource-id' => DI::args()->getArgv()[3]];
+ $condition = ['uid' => DI::userSession()->getLocalUserId(), 'resource-id' => DI::args()->getArgv()[3]];
}
$photo = DBA::selectFirst('photo', ['resource-id'], $condition);
@@ -794,7 +794,7 @@ function photos_content(App $a)
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
return;
}
@@ -840,10 +840,10 @@ function photos_content(App $a)
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
- if (Session::getLocalUser() && (Session::getLocalUser() == $owner_uid)) {
+ if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid)) {
$can_post = true;
- } elseif ($community_page && !empty(Session::getRemoteContactID($owner_uid))) {
- $contact_id = Session::getRemoteContactID($owner_uid);
+ } elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($owner_uid))) {
+ $contact_id = DI::userSession()->getRemoteContactID($owner_uid);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
if (DBA::isResult($contact)) {
@@ -854,21 +854,21 @@ function photos_content(App $a)
}
// perhaps they're visiting - but not a community page, so they wouldn't have write access
- if (!empty(Session::getRemoteContactID($owner_uid)) && !$visitor) {
- $contact_id = Session::getRemoteContactID($owner_uid);
+ if (!empty(DI::userSession()->getRemoteContactID($owner_uid)) && !$visitor) {
+ $contact_id = DI::userSession()->getRemoteContactID($owner_uid);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
$remote_contact = DBA::isResult($contact);
}
- if (!$remote_contact && Session::getLocalUser()) {
+ if (!$remote_contact && DI::userSession()->getLocalUserId()) {
$contact_id = $_SESSION['cid'];
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
}
- if ($user['hidewall'] && (Session::getLocalUser() != $owner_uid) && !$remote_contact) {
+ if ($user['hidewall'] && (DI::userSession()->getLocalUserId() != $owner_uid) && !$remote_contact) {
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.'));
return;
}
@@ -878,7 +878,7 @@ function photos_content(App $a)
$o = "";
// tabs
- $is_owner = (Session::getLocalUser() && (Session::getLocalUser() == $owner_uid));
+ $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid));
$o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
// Display upload form
@@ -1197,7 +1197,7 @@ function photos_content(App $a)
}
if (
- $ph[0]['uid'] == Session::getLocalUser()
+ $ph[0]['uid'] == DI::userSession()->getLocalUserId()
&& (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
) {
$tools['lock'] = DI::l10n()->t('Private Photo');
@@ -1237,7 +1237,7 @@ function photos_content(App $a)
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params));
- if (Session::getLocalUser() == $link_item['uid']) {
+ if (DI::userSession()->getLocalUserId() == $link_item['uid']) {
Item::update(['unseen' => false], ['parent' => $link_item['parent']]);
}
}
@@ -1315,7 +1315,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words');
+ $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@@ -1346,7 +1346,7 @@ function photos_content(App $a)
'attendmaybe' => []
];
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
unset($conv_responses['dislike']);
}
@@ -1371,7 +1371,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words');
+ $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@@ -1413,7 +1413,7 @@ function photos_content(App $a)
$sparkle = '';
}
- $dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == Session::getLocalUser()));
+ $dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == DI::userSession()->getLocalUserId()));
$drop = [
'dropping' => $dropping,
'pagedrop' => false,
@@ -1445,7 +1445,7 @@ function photos_content(App $a)
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words');
+ $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@@ -1484,7 +1484,7 @@ function photos_content(App $a)
'$dislike' => DI::l10n()->t('Dislike'),
'$wait' => DI::l10n()->t('Please wait'),
'$dislike_title' => DI::l10n()->t('I don\'t like this (toggle)'),
- '$hide_dislike' => DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike'),
+ '$hide_dislike' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike'),
'$responses' => $responses,
'$return_path' => DI::args()->getQueryString(),
]);
diff --git a/mod/redir.php b/mod/redir.php
index 6243710b2..afdb20d48 100644
--- a/mod/redir.php
+++ b/mod/redir.php
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\Strings;
function redir_init(App $a) {
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
}
@@ -52,7 +52,7 @@ function redir_init(App $a) {
}
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name'];
- $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, Session::getLocalUser()]]);
+ $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, DI::userSession()->getLocalUserId()]]);
if (!DBA::isResult($contact)) {
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
}
@@ -65,10 +65,10 @@ function redir_init(App $a) {
$a->redirect($url ?: $contact_url);
}
- if ($contact['uid'] == 0 && Session::getLocalUser()) {
+ if ($contact['uid'] == 0 && DI::userSession()->getLocalUserId()) {
// Let's have a look if there is an established connection
// between the public contact we have found and the local user.
- $contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => Session::getLocalUser()]);
+ $contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => DI::userSession()->getLocalUserId()]);
if (DBA::isResult($contact)) {
$cid = $contact['id'];
@@ -83,7 +83,7 @@ function redir_init(App $a) {
}
}
- if (Session::getRemoteUser()) {
+ if (DI::userSession()->getRemoteUserId) {
$host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3);
$remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
@@ -91,7 +91,7 @@ function redir_init(App $a) {
// with the local contact. Otherwise the local user would ask the local contact
// for authentification everytime he/she is visiting a profile page of the local
// contact.
- if (($host == $remotehost) && (Session::getRemoteContactID(DI::session()->get('visitor_visiting')) == DI::session()->get('visitor_id'))) {
+ if (($host == $remotehost) && (DI::userSession()->getRemoteContactID(DI::session()->get('visitor_visiting')) == DI::session()->get('visitor_id'))) {
// Remote user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
diff --git a/mod/removeme.php b/mod/removeme.php
index 5555fcbb7..f962ed07d 100644
--- a/mod/removeme.php
+++ b/mod/removeme.php
@@ -29,7 +29,7 @@ use Friendica\Util\Strings;
function removeme_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -65,7 +65,7 @@ function removeme_post(App $a)
->withMessage(
$l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'),
$l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
- $l10n->t('The user id is %d', Session::getLocalUser()))
+ $l10n->t('The user id is %d', DI::userSession()->getLocalUserId()))
->forUser($admin)
->withRecipient($admin['email'])
->build();
@@ -84,7 +84,7 @@ function removeme_post(App $a)
function removeme_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::baseUrl()->redirect();
}
diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php
index 8ae294a0a..686516a55 100644
--- a/mod/repair_ostatus.php
+++ b/mod/repair_ostatus.php
@@ -28,7 +28,7 @@ use Friendica\Model\Contact;
function repair_ostatus_content(App $a) {
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('ostatus_repair');
// NOTREACHED
@@ -36,7 +36,7 @@ function repair_ostatus_content(App $a) {
$o = '' . DI::l10n()->t('Resubscribing to OStatus contacts') . ' ';
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$counter = intval($_REQUEST['counter'] ?? 0);
diff --git a/mod/settings.php b/mod/settings.php
index 5f3be2767..e24127cbb 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -37,7 +37,7 @@ use Friendica\Protocol\Email;
function settings_init(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@@ -70,12 +70,12 @@ function settings_post(App $a)
BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_connectors');
if (!empty($_POST['general-submit'])) {
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'disable_cw', !intval($_POST['enable_cw']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'simple_shortening', intval($_POST['simple_shortening']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
- DI::pConfig()->set(Session::getLocalUser(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'disable_cw', !intval($_POST['enable_cw']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'simple_shortening', intval($_POST['simple_shortening']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
} elseif (!empty($_POST['mail-submit'])) {
$mail_server = $_POST['mail_server'] ?? '';
$mail_port = $_POST['mail_port'] ?? '';
@@ -88,13 +88,13 @@ function settings_post(App $a)
$mail_pubmail = $_POST['mail_pubmail'] ?? '';
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
- if (!DBA::exists('mailacct', ['uid' => Session::getLocalUser()])) {
- DBA::insert('mailacct', ['uid' => Session::getLocalUser()]);
+ if (!DBA::exists('mailacct', ['uid' => DI::userSession()->getLocalUserId()])) {
+ DBA::insert('mailacct', ['uid' => DI::userSession()->getLocalUserId()]);
}
if (strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass, $pass, $user['pubkey']);
- DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => Session::getLocalUser()]);
+ DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => DI::userSession()->getLocalUserId()]);
}
$r = DBA::update('mailacct', [
@@ -107,10 +107,10 @@ function settings_post(App $a)
'mailbox' => 'INBOX',
'reply_to' => $mail_replyto,
'pubmail' => $mail_pubmail
- ], ['uid' => Session::getLocalUser()]);
+ ], ['uid' => DI::userSession()->getLocalUserId()]);
Logger::debug('updating mailaccount', ['response' => $r]);
- $mailacct = DBA::selectFirst('mailacct', [], ['uid' => Session::getLocalUser()]);
+ $mailacct = DBA::selectFirst('mailacct', [], ['uid' => DI::userSession()->getLocalUserId()]);
if (DBA::isResult($mailacct)) {
$mb = Email::constructMailboxName($mailacct);
@@ -136,7 +136,7 @@ function settings_post(App $a)
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features');
foreach ($_POST as $k => $v) {
if (strpos($k, 'feature_') === 0) {
- DI::pConfig()->set(Session::getLocalUser(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
}
}
return;
@@ -148,7 +148,7 @@ function settings_content(App $a)
$o = '';
Nav::setSelected('settings');
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
//DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
@@ -162,12 +162,12 @@ function settings_content(App $a)
if ((DI::args()->getArgc() > 3) && (DI::args()->getArgv()[2] === 'delete')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
- DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => Session::getLocalUser()]);
+ DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => DI::userSession()->getLocalUserId()]);
DI::baseUrl()->redirect('settings/oauth/', true);
return '';
}
- $applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => Session::getLocalUser()]);
+ $applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => DI::userSession()->getLocalUserId()]);
$tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
$o .= Renderer::replaceMacros($tpl, [
@@ -226,7 +226,7 @@ function settings_content(App $a)
$arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
- $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(Session::getLocalUser(), $f[0]), $f[2]];
+ $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(DI::userSession()->getLocalUserId(), $f[0]), $f[2]];
}
}
@@ -241,12 +241,12 @@ function settings_content(App $a)
}
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors')) {
- $accept_only_sharer = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'accept_only_sharer'));
- $enable_cw = !intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'disable_cw'));
- $enable_smart_shortening = !intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_intelligent_shortening'));
- $simple_shortening = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'simple_shortening'));
- $attach_link_title = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'attach_link_title'));
- $legacy_contact = DI::pConfig()->get(Session::getLocalUser(), 'ostatus', 'legacy_contact');
+ $accept_only_sharer = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'accept_only_sharer'));
+ $enable_cw = !intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'disable_cw'));
+ $enable_smart_shortening = !intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_intelligent_shortening'));
+ $simple_shortening = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'simple_shortening'));
+ $attach_link_title = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'attach_link_title'));
+ $legacy_contact = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ostatus', 'legacy_contact');
if (!empty($legacy_contact)) {
/// @todo Isn't it supposed to be a $a->internalRedirect() call?
@@ -280,7 +280,7 @@ function settings_content(App $a)
$mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1);
if (!$mail_disabled) {
- $mailacct = DBA::selectFirst('mailacct', [], ['uid' => Session::getLocalUser()]);
+ $mailacct = DBA::selectFirst('mailacct', [], ['uid' => DI::userSession()->getLocalUserId()]);
} else {
$mailacct = null;
}
diff --git a/mod/share.php b/mod/share.php
index 1ebce5291..e7d12ab27 100644
--- a/mod/share.php
+++ b/mod/share.php
@@ -31,7 +31,7 @@ use Friendica\Model\Post;
function share_init(App $a) {
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
- if (!$post_id || !Session::getLocalUser()) {
+ if (!$post_id || !DI::userSession()->getLocalUserId()) {
System::exit();
}
diff --git a/mod/suggest.php b/mod/suggest.php
index 207a49e88..19d36735c 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -31,7 +31,7 @@ use Friendica\Network\HTTPException;
function suggest_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -40,7 +40,7 @@ function suggest_content(App $a)
DI::page()['aside'] .= Widget::findPeople();
DI::page()['aside'] .= Widget::follow();
- $contacts = Contact\Relation::getSuggestions(Session::getLocalUser());
+ $contacts = Contact\Relation::getSuggestions(DI::userSession()->getLocalUserId());
if (!DBA::isResult($contacts)) {
return DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.');
}
diff --git a/mod/tagger.php b/mod/tagger.php
index 5e209ec94..05a9418f6 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -37,7 +37,7 @@ use Friendica\Worker\Delivery;
function tagger_content(App $a)
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return;
}
@@ -63,13 +63,13 @@ function tagger_content(App $a)
$owner_uid = $item['uid'];
- if (Session::getLocalUser() != $owner_uid) {
+ if (DI::userSession()->getLocalUserId() != $owner_uid) {
return;
}
- $contact = Contact::selectFirst([], ['self' => true, 'uid' => Session::getLocalUser()]);
+ $contact = Contact::selectFirst([], ['self' => true, 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($contact)) {
- Logger::warning('Self contact not found.', ['uid' => Session::getLocalUser()]);
+ Logger::warning('Self contact not found.', ['uid' => DI::userSession()->getLocalUserId()]);
return;
}
diff --git a/mod/tagrm.php b/mod/tagrm.php
index 7ffa7616b..197650bfa 100644
--- a/mod/tagrm.php
+++ b/mod/tagrm.php
@@ -29,7 +29,7 @@ use Friendica\Model\Tag;
function tagrm_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::baseUrl()->redirect($_SESSION['photo_return']);
}
@@ -62,7 +62,7 @@ function update_tags($item_id, $tags)
return;
}
- $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => Session::getLocalUser()]);
+ $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($item)) {
return;
}
@@ -82,7 +82,7 @@ function tagrm_content(App $a)
$photo_return = $_SESSION['photo_return'] ?? '';
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::baseUrl()->redirect($photo_return);
// NOTREACHED
}
@@ -98,7 +98,7 @@ function tagrm_content(App $a)
// NOTREACHED
}
- $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => Session::getLocalUser()]);
+ $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($item)) {
DI::baseUrl()->redirect($photo_return);
}
diff --git a/mod/unfollow.php b/mod/unfollow.php
index ec8cd4506..04e487936 100644
--- a/mod/unfollow.php
+++ b/mod/unfollow.php
@@ -32,7 +32,7 @@ use Friendica\Util\Strings;
function unfollow_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('login');
// NOTREACHED
@@ -47,17 +47,17 @@ function unfollow_content(App $a)
{
$base_return_path = 'contact';
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('login');
// NOTREACHED
}
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$url = trim($_REQUEST['url']);
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
- Session::getLocalUser(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
+ DI::userSession()->getLocalUserId(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
Strings::normaliseLink($url), $url];
$contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition);
@@ -119,7 +119,7 @@ function unfollow_process(string $url)
{
$base_return_path = 'contact';
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$owner = User::getOwnerDataById($uid);
if (!$owner) {
diff --git a/mod/update_contact.php b/mod/update_contact.php
index 21e46b19d..17fa2b7f8 100644
--- a/mod/update_contact.php
+++ b/mod/update_contact.php
@@ -31,7 +31,7 @@ use Friendica\Model\Contact;
function update_contact_content(App $a)
{
- if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_auto_update'))) {
+ if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update'))) {
$contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']);
if (DBA::isResult($contact) && empty($contact['deleted'])) {
DI::page()['aside'] = '';
diff --git a/mod/wall_attach.php b/mod/wall_attach.php
index 7f12d15e6..402348c4b 100644
--- a/mod/wall_attach.php
+++ b/mod/wall_attach.php
@@ -55,10 +55,10 @@ function wall_attach_post(App $a) {
$page_owner_cid = $owner['id'];
$community_page = $owner['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
- if (Session::getLocalUser() && (Session::getLocalUser() == $page_owner_uid)) {
+ if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
$can_post = true;
- } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
- $contact_id = Session::getRemoteContactID($page_owner_uid);
+ } elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
+ $contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
}
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index d66e2af8f..c5ac89dc4 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -76,10 +76,10 @@ function wall_upload_post(App $a, $desktopmode = true)
$page_owner_nick = $user['nickname'];
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
- if ((Session::getLocalUser()) && (Session::getLocalUser() == $page_owner_uid)) {
+ if ((DI::userSession()->getLocalUserId()) && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
$can_post = true;
- } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
- $contact_id = Session::getRemoteContactID($page_owner_uid);
+ } elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
+ $contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
$visitor = $contact_id;
}
From 8dda6144a937d19de0c15af50b1bda280b5c88a6 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 21:06:06 +0200
Subject: [PATCH 07/40] Remove unnecessary "use"
---
mod/cal.php | 1 -
mod/display.php | 1 -
mod/editpost.php | 1 -
mod/events.php | 1 -
mod/fbrowser.php | 1 -
mod/follow.php | 1 -
mod/item.php | 1 -
mod/match.php | 1 -
mod/message.php | 1 -
mod/notes.php | 1 -
mod/oexchange.php | 1 -
mod/ostatus_subscribe.php | 1 -
mod/photos.php | 1 -
mod/redir.php | 1 -
mod/removeme.php | 1 -
mod/repair_ostatus.php | 1 -
mod/settings.php | 1 -
mod/share.php | 1 -
mod/suggest.php | 1 -
mod/tagger.php | 1 -
mod/tagrm.php | 1 -
mod/unfollow.php | 1 -
mod/update_contact.php | 1 -
mod/wall_attach.php | 1 -
mod/wall_upload.php | 1 -
25 files changed, 25 deletions(-)
diff --git a/mod/cal.php b/mod/cal.php
index 9329aac32..4c22232d2 100644
--- a/mod/cal.php
+++ b/mod/cal.php
@@ -27,7 +27,6 @@ use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/display.php b/mod/display.php
index a2bf21867..d04b878c4 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -24,7 +24,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/editpost.php b/mod/editpost.php
index 0c0002bc5..bec5d3449 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -23,7 +23,6 @@ use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/events.php b/mod/events.php
index 5899302cc..b87120672 100644
--- a/mod/events.php
+++ b/mod/events.php
@@ -27,7 +27,6 @@ use Friendica\Core\ACL;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
diff --git a/mod/fbrowser.php b/mod/fbrowser.php
index 137d664f3..952ab1452 100644
--- a/mod/fbrowser.php
+++ b/mod/fbrowser.php
@@ -24,7 +24,6 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/follow.php b/mod/follow.php
index 19e55123c..db7a52b2c 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -23,7 +23,6 @@ use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
diff --git a/mod/item.php b/mod/item.php
index 0490e43a8..f30798fa3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -34,7 +34,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
diff --git a/mod/match.php b/mod/match.php
index 5b87c6870..e8a0a6605 100644
--- a/mod/match.php
+++ b/mod/match.php
@@ -23,7 +23,6 @@ use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/message.php b/mod/message.php
index 9fb8d7cbc..794d2ace4 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -25,7 +25,6 @@ use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
use Friendica\Core\ACL;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/notes.php b/mod/notes.php
index 84c0711eb..39649d81f 100644
--- a/mod/notes.php
+++ b/mod/notes.php
@@ -22,7 +22,6 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
diff --git a/mod/oexchange.php b/mod/oexchange.php
index 4bc25e6fd..dd3809bc7 100644
--- a/mod/oexchange.php
+++ b/mod/oexchange.php
@@ -22,7 +22,6 @@
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Module\Response;
diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php
index 31564ad32..5344ed845 100644
--- a/mod/ostatus_subscribe.php
+++ b/mod/ostatus_subscribe.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\APContact;
use Friendica\Model\Contact;
diff --git a/mod/photos.php b/mod/photos.php
index 56b722e8f..2d7516be9 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -30,7 +30,6 @@ use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/redir.php b/mod/redir.php
index afdb20d48..cc4dc1c0c 100644
--- a/mod/redir.php
+++ b/mod/redir.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/removeme.php b/mod/removeme.php
index f962ed07d..da946485d 100644
--- a/mod/removeme.php
+++ b/mod/removeme.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php
index 686516a55..cc7eecde2 100644
--- a/mod/repair_ostatus.php
+++ b/mod/repair_ostatus.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/settings.php b/mod/settings.php
index e24127cbb..1de3f5dcf 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -26,7 +26,6 @@ use Friendica\Content\Nav;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
diff --git a/mod/share.php b/mod/share.php
index e7d12ab27..01ef85503 100644
--- a/mod/share.php
+++ b/mod/share.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Content\Text\BBCode;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/suggest.php b/mod/suggest.php
index 19d36735c..9ad11f745 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -22,7 +22,6 @@
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/tagger.php b/mod/tagger.php
index 05a9418f6..dae9cbc2b 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -22,7 +22,6 @@
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
diff --git a/mod/tagrm.php b/mod/tagrm.php
index 197650bfa..26d2c905f 100644
--- a/mod/tagrm.php
+++ b/mod/tagrm.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Content\Text\BBCode;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post;
diff --git a/mod/unfollow.php b/mod/unfollow.php
index 04e487936..8431d04d0 100644
--- a/mod/unfollow.php
+++ b/mod/unfollow.php
@@ -23,7 +23,6 @@ use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
diff --git a/mod/update_contact.php b/mod/update_contact.php
index 17fa2b7f8..c6a49a417 100644
--- a/mod/update_contact.php
+++ b/mod/update_contact.php
@@ -22,7 +22,6 @@
*/
use Friendica\App;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/wall_attach.php b/mod/wall_attach.php
index 402348c4b..83d5338da 100644
--- a/mod/wall_attach.php
+++ b/mod/wall_attach.php
@@ -20,7 +20,6 @@
*/
use Friendica\App;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index c5ac89dc4..c5575da97 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -27,7 +27,6 @@
use Friendica\App;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
From b4ffb0bde082c488d6018e62f33c5493f5c6ef19 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 22:14:50 +0200
Subject: [PATCH 08/40] UserSession class [4] - Refactor src/Model/ files
---
src/Model/Contact.php | 33 ++++++++++++++++-----------------
src/Model/Contact/Group.php | 3 +--
src/Model/Event.php | 7 +++----
src/Model/Group.php | 9 ++++-----
src/Model/Item.php | 17 ++++++++---------
src/Model/Mail.php | 15 +++++++--------
src/Model/Photo.php | 9 ++++-----
src/Model/Post.php | 3 +--
src/Model/Profile.php | 33 ++++++++++++++++-----------------
9 files changed, 60 insertions(+), 69 deletions(-)
diff --git a/src/Model/Contact.php b/src/Model/Contact.php
index 0f960f160..c5b7017a3 100644
--- a/src/Model/Contact.php
+++ b/src/Model/Contact.php
@@ -29,7 +29,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\Database;
@@ -1129,7 +1128,7 @@ class Contact
$photos_link = '';
if ($uid == 0) {
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
}
if (empty($contact['uid']) || ($contact['uid'] != $uid)) {
@@ -1532,10 +1531,10 @@ class Contact
if ($thread_mode) {
$condition = ["((`$contact_field` = ? AND `gravity` = ?) OR (`author-id` = ? AND `gravity` = ? AND `vid` = ? AND `thr-parent-id` = `parent-uri-id`)) AND " . $sql,
- $cid, Item::GRAVITY_PARENT, $cid, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Session::getLocalUser()];
+ $cid, Item::GRAVITY_PARENT, $cid, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), DI::userSession()->getLocalUserId()];
} else {
$condition = ["`$contact_field` = ? AND `gravity` IN (?, ?) AND " . $sql,
- $cid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, Session::getLocalUser()];
+ $cid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, DI::userSession()->getLocalUserId()];
}
if (!empty($parent)) {
@@ -1553,10 +1552,10 @@ class Contact
}
if (DI::mode()->isMobile()) {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -1564,7 +1563,7 @@ class Contact
$params = ['order' => ['received' => true], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$o = Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
} else {
@@ -1573,27 +1572,27 @@ class Contact
if ($thread_mode) {
$fields = ['uri-id', 'thr-parent-id', 'gravity', 'author-id', 'commented'];
- $items = Post::toArray(Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params));
+ $items = Post::toArray(Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params));
if ($pager->getStart() == 0) {
- $cdata = self::getPublicAndUserContactID($cid, Session::getLocalUser());
+ $cdata = self::getPublicAndUserContactID($cid, DI::userSession()->getLocalUserId());
if (!empty($cdata['public'])) {
$pinned = Post\Collection::selectToArrayForContact($cdata['public'], Post\Collection::FEATURED, $fields);
$items = array_merge($items, $pinned);
}
}
- $o .= DI::conversation()->create($items, 'contacts', $update, false, 'pinned_commented', Session::getLocalUser());
+ $o .= DI::conversation()->create($items, 'contacts', $update, false, 'pinned_commented', DI::userSession()->getLocalUserId());
} else {
$fields = array_merge(Item::DISPLAY_FIELDLIST, ['featured']);
- $items = Post::toArray(Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params));
+ $items = Post::toArray(Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params));
if ($pager->getStart() == 0) {
- $cdata = self::getPublicAndUserContactID($cid, Session::getLocalUser());
+ $cdata = self::getPublicAndUserContactID($cid, DI::userSession()->getLocalUserId());
if (!empty($cdata['public'])) {
$condition = ["`uri-id` IN (SELECT `uri-id` FROM `collection-view` WHERE `cid` = ? AND `type` = ?)",
$cdata['public'], Post\Collection::FEATURED];
- $pinned = Post::toArray(Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params));
+ $pinned = Post::toArray(Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params));
$items = array_merge($pinned, $items);
}
}
@@ -1602,7 +1601,7 @@ class Contact
}
if (!$update) {
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$o .= HTML::scrollLoader();
} else {
$o .= $pager->renderMinimal(count($items));
@@ -3257,7 +3256,7 @@ class Contact
*/
public static function magicLink(string $contact_url, string $url = ''): string
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
}
@@ -3303,7 +3302,7 @@ class Contact
{
$destination = $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return $destination;
}
@@ -3312,7 +3311,7 @@ class Contact
return $url;
}
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'stay_local') && ($url == '')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local') && ($url == '')) {
return 'contact/' . $contact['id'] . '/conversations';
}
diff --git a/src/Model/Contact/Group.php b/src/Model/Contact/Group.php
index 838af8a27..f18e344d0 100644
--- a/src/Model/Contact/Group.php
+++ b/src/Model/Contact/Group.php
@@ -21,7 +21,6 @@
namespace Friendica\Model\Contact;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
@@ -54,7 +53,7 @@ class Group
AND NOT `contact`.`pending`
ORDER BY `contact`.`name` ASC',
$gid,
- Session::getLocalUser()
+ DI::userSession()->getLocalUserId()
);
if (DBA::isResult($stmt)) {
diff --git a/src/Model/Event.php b/src/Model/Event.php
index 7437137d0..a738428ea 100644
--- a/src/Model/Event.php
+++ b/src/Model/Event.php
@@ -26,7 +26,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -411,7 +410,7 @@ class Event
public static function getStrings(): array
{
// First day of the week (0 = Sunday).
- $firstDay = DI::pConfig()->get(Session::getLocalUser(), 'system', 'first_day_of_week', 0);
+ $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
$i18n = [
"firstDay" => $firstDay,
@@ -609,7 +608,7 @@ class Event
$edit = null;
$copy = null;
$drop = null;
- if (Session::getLocalUser() && Session::getLocalUser() == $event['uid'] && $event['type'] == 'event') {
+ if (DI::userSession()->getLocalUserId() && DI::userSession()->getLocalUserId() == $event['uid'] && $event['type'] == 'event') {
$edit = !$event['cid'] ? [DI::baseUrl() . '/events/event/' . $event['id'], DI::l10n()->t('Edit event') , '', ''] : null;
$copy = !$event['cid'] ? [DI::baseUrl() . '/events/copy/' . $event['id'] , DI::l10n()->t('Duplicate event'), '', ''] : null;
$drop = [DI::baseUrl() . '/events/drop/' . $event['id'] , DI::l10n()->t('Delete event') , '', ''];
@@ -776,7 +775,7 @@ class Event
// Does the user who requests happen to be the owner of the events
// requested? then show all of your events, otherwise only those that
// don't have limitations set in allow_cid and allow_gid.
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
$conditions += ['allow_cid' => '', 'allow_gid' => ''];
}
diff --git a/src/Model/Group.php b/src/Model/Group.php
index 52aa4bca6..c374125b6 100644
--- a/src/Model/Group.php
+++ b/src/Model/Group.php
@@ -25,7 +25,6 @@ use Friendica\BaseModule;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -188,8 +187,8 @@ class Group
) AS `count`
FROM `group`
WHERE `group`.`uid` = ?;",
- Session::getLocalUser(),
- Session::getLocalUser()
+ DI::userSession()->getLocalUserId(),
+ DI::userSession()->getLocalUserId()
);
return DBA::toArray($stmt);
@@ -527,7 +526,7 @@ class Group
*/
public static function sidebarWidget(string $every = 'contact', string $each = 'group', string $editmode = 'standard', $group_id = '', int $cid = 0)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -545,7 +544,7 @@ class Group
$member_of = self::getIdsByContactId($cid);
}
- $stmt = DBA::select('group', [], ['deleted' => false, 'uid' => Session::getLocalUser(), 'cid' => null], ['order' => ['name']]);
+ $stmt = DBA::select('group', [], ['deleted' => false, 'uid' => DI::userSession()->getLocalUserId(), 'cid' => null], ['order' => ['name']]);
while ($group = DBA::fetch($stmt)) {
$selected = (($group_id == $group['id']) ? ' group-selected' : '');
diff --git a/src/Model/Item.php b/src/Model/Item.php
index e53d64d5e..af6823951 100644
--- a/src/Model/Item.php
+++ b/src/Model/Item.php
@@ -27,7 +27,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Model\Tag;
use Friendica\Core\Worker;
@@ -1066,7 +1065,7 @@ class Item
}
// We have to tell the hooks who we are - this really should be improved
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$_SESSION['authenticated'] = true;
$_SESSION['uid'] = $uid;
$dummy_session = true;
@@ -2775,8 +2774,8 @@ class Item
*/
public static function getPermissionsConditionArrayByUserId(int $owner_id): array
{
- $local_user = Session::getLocalUser();
- $remote_user = Session::getRemoteContactID($owner_id);
+ $local_user = DI::userSession()->getLocalUserId();
+ $remote_user = DI::userSession()->getRemoteContactID($owner_id);
// default permissions - anonymous user
$condition = ["`private` != ?", self::PRIVATE];
@@ -2807,8 +2806,8 @@ class Item
*/
public static function getPermissionsSQLByUserId(int $owner_id, string $table = ''): string
{
- $local_user = Session::getLocalUser();
- $remote_user = Session::getRemoteContactID($owner_id);
+ $local_user = DI::userSession()->getLocalUserId();
+ $remote_user = DI::userSession()->getRemoteContactID($owner_id);
if (!empty($table)) {
$table = DBA::quoteIdentifier($table) . '.';
@@ -3006,8 +3005,8 @@ class Item
// Compile eventual content filter reasons
$filter_reasons = [];
- if (!$is_preview && Session::getPublicContact() != $item['author-id']) {
- if (!empty($item['content-warning']) && (!Session::getLocalUser() || !DI::pConfig()->get(Session::getLocalUser(), 'system', 'disable_cw', false))) {
+ if (!$is_preview && DI::userSession()->getPublicContactId() != $item['author-id']) {
+ if (!empty($item['content-warning']) && (!DI::userSession()->getLocalUserId() || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'disable_cw', false))) {
$filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']);
}
@@ -3443,7 +3442,7 @@ class Item
$plink = $item['uri'];
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$ret = [
'href' => "display/" . $item['guid'],
'orig' => "display/" . $item['guid'],
diff --git a/src/Model/Mail.php b/src/Model/Mail.php
index 84e9ef6a4..6ccce24ba 100644
--- a/src/Model/Mail.php
+++ b/src/Model/Mail.php
@@ -23,7 +23,6 @@ namespace Friendica\Model;
use Friendica\Core\ACL;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
@@ -138,12 +137,12 @@ class Mail
$subject = DI::l10n()->t('[no subject]');
}
- $me = DBA::selectFirst('contact', [], ['uid' => Session::getLocalUser(), 'self' => true]);
+ $me = DBA::selectFirst('contact', [], ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
if (!DBA::isResult($me)) {
return -2;
}
- $contacts = ACL::getValidMessageRecipientsForUser(Session::getLocalUser());
+ $contacts = ACL::getValidMessageRecipientsForUser(DI::userSession()->getLocalUserId());
$contactIndex = array_search($recipient, array_column($contacts, 'id'));
if ($contactIndex === false) {
@@ -152,7 +151,7 @@ class Mail
$contact = $contacts[$contactIndex];
- Photo::setPermissionFromBody($body, Session::getLocalUser(), $me['id'], '<' . $contact['id'] . '>', '', '', '');
+ Photo::setPermissionFromBody($body, DI::userSession()->getLocalUserId(), $me['id'], '<' . $contact['id'] . '>', '', '', '');
$guid = System::createUUID();
$uri = Item::newURI($guid);
@@ -165,7 +164,7 @@ class Mail
if (strlen($replyto)) {
$reply = true;
$condition = ["`uid` = ? AND (`uri` = ? OR `parent-uri` = ?)",
- Session::getLocalUser(), $replyto, $replyto];
+ DI::userSession()->getLocalUserId(), $replyto, $replyto];
$mail = DBA::selectFirst('mail', ['convid'], $condition);
if (DBA::isResult($mail)) {
$convid = $mail['convid'];
@@ -178,7 +177,7 @@ class Mail
$conv_guid = System::createUUID();
$convuri = $contact['addr'] . ':' . $conv_guid;
- $fields = ['uid' => Session::getLocalUser(), 'guid' => $conv_guid, 'creator' => $me['addr'],
+ $fields = ['uid' => DI::userSession()->getLocalUserId(), 'guid' => $conv_guid, 'creator' => $me['addr'],
'created' => DateTimeFormat::utcNow(), 'updated' => DateTimeFormat::utcNow(),
'subject' => $subject, 'recips' => $contact['addr'] . ';' . $me['addr']];
if (DBA::insert('conv', $fields)) {
@@ -197,7 +196,7 @@ class Mail
$post_id = self::insert(
[
- 'uid' => Session::getLocalUser(),
+ 'uid' => DI::userSession()->getLocalUserId(),
'guid' => $guid,
'convid' => $convid,
'from-name' => $me['name'],
@@ -233,7 +232,7 @@ class Mail
foreach ($images as $image) {
$image_rid = Photo::ridFromURI($image);
if (!empty($image_rid)) {
- Photo::update(['allow-cid' => '<' . $recipient . '>'], ['resource-id' => $image_rid, 'album' => 'Wall Photos', 'uid' => Session::getLocalUser()]);
+ Photo::update(['allow-cid' => '<' . $recipient . '>'], ['resource-id' => $image_rid, 'album' => 'Wall Photos', 'uid' => DI::userSession()->getLocalUserId()]);
}
}
}
diff --git a/src/Model/Photo.php b/src/Model/Photo.php
index 035b32b1f..550d802e8 100644
--- a/src/Model/Photo.php
+++ b/src/Model/Photo.php
@@ -23,7 +23,6 @@ namespace Friendica\Model;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -639,10 +638,10 @@ class Photo
{
$sql_extra = Security::getPermissionsSQLByUserId($uid);
- $avatar_type = (Session::getLocalUser() && (Session::getLocalUser() == $uid)) ? self::USER_AVATAR : self::DEFAULT;
- $banner_type = (Session::getLocalUser() && (Session::getLocalUser() == $uid)) ? self::USER_BANNER : self::DEFAULT;
+ $avatar_type = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $uid)) ? self::USER_AVATAR : self::DEFAULT;
+ $banner_type = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $uid)) ? self::USER_BANNER : self::DEFAULT;
- $key = 'photo_albums:' . $uid . ':' . Session::getLocalUser() . ':' . Session::getRemoteUser();
+ $key = 'photo_albums:' . $uid . ':' . DI::userSession()->getLocalUserId() . ':' . DI::userSession()->getRemoteUserId();
$albums = DI::cache()->get($key);
if (is_null($albums) || $update) {
@@ -681,7 +680,7 @@ class Photo
*/
public static function clearAlbumCache(int $uid)
{
- $key = 'photo_albums:' . $uid . ':' . Session::getLocalUser() . ':' . Session::getRemoteUser();
+ $key = 'photo_albums:' . $uid . ':' . DI::userSession()->getLocalUserId() . ':' . DI::userSession()->getRemoteUserId();
DI::cache()->set($key, null, Duration::DAY);
}
diff --git a/src/Model/Post.php b/src/Model/Post.php
index d3e1f2900..2c3f44dde 100644
--- a/src/Model/Post.php
+++ b/src/Model/Post.php
@@ -23,7 +23,6 @@ namespace Friendica\Model;
use BadMethodCallException;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
@@ -509,7 +508,7 @@ class Post
{
$affected = 0;
- Logger::info('Start Update', ['fields' => $fields, 'condition' => $condition, 'uid' => Session::getLocalUser(),'callstack' => System::callstack(10)]);
+ Logger::info('Start Update', ['fields' => $fields, 'condition' => $condition, 'uid' => DI::userSession()->getLocalUserId(),'callstack' => System::callstack(10)]);
// Don't allow changes to fields that are responsible for the relation between the records
unset($fields['id']);
diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index 6574a53ac..96932cdb0 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -30,7 +30,6 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
@@ -239,7 +238,7 @@ class Profile
DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$a->setCurrentTheme($profile['theme']);
$a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme') ?? '');
}
@@ -255,7 +254,7 @@ class Profile
require_once $theme_info_file;
}
- $block = (DI::config()->get('system', 'block_public') && !Session::isAuthenticated());
+ $block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());
/**
* @todo
@@ -295,8 +294,8 @@ class Profile
$profile_contact = [];
- if (Session::getLocalUser() && ($profile['uid'] ?? 0) != Session::getLocalUser()) {
- $profile_contact = Contact::getByURL($profile['nurl'], null, [], Session::getLocalUser());
+ if (DI::userSession()->getLocalUserId() && ($profile['uid'] ?? 0) != DI::userSession()->getLocalUserId()) {
+ $profile_contact = Contact::getByURL($profile['nurl'], null, [], DI::userSession()->getLocalUserId());
}
if (!empty($profile['cid']) && self::getMyURL()) {
$profile_contact = Contact::selectFirst([], ['id' => $profile['cid']]);
@@ -379,7 +378,7 @@ class Profile
$xmpp = !empty($profile['xmpp']) ? DI::l10n()->t('XMPP:') : false;
$matrix = !empty($profile['matrix']) ? DI::l10n()->t('Matrix:') : false;
- if ((!empty($profile['hidewall']) || $block) && !Session::isAuthenticated()) {
+ if ((!empty($profile['hidewall']) || $block) && !DI::userSession()->isAuthenticated()) {
$location = $homepage = $about = false;
}
@@ -413,7 +412,7 @@ class Profile
}
if (!$block && $show_contacts) {
- $contact_block = ContactBlock::getHTML($profile, Session::getLocalUser());
+ $contact_block = ContactBlock::getHTML($profile, DI::userSession()->getLocalUserId());
if (is_array($profile) && !$profile['hide-friends']) {
$contact_count = DBA::count('contact', [
@@ -493,7 +492,7 @@ class Profile
*/
public static function getBirthdays(): string
{
- if (!Session::getLocalUser() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
+ if (!DI::userSession()->getLocalUserId() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
return '';
}
@@ -506,7 +505,7 @@ class Profile
$bd_short = DI::l10n()->t('F d');
- $cacheKey = 'get_birthdays:' . Session::getLocalUser();
+ $cacheKey = 'get_birthdays:' . DI::userSession()->getLocalUserId();
$events = DI::cache()->get($cacheKey);
if (is_null($events)) {
$result = DBA::p(
@@ -523,7 +522,7 @@ class Profile
ORDER BY `start`",
Contact::SHARING,
Contact::FRIEND,
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
DateTimeFormat::utc('now + 6 days'),
DateTimeFormat::utcNow()
);
@@ -595,7 +594,7 @@ class Profile
$a = DI::app();
$o = '';
- if (!Session::getLocalUser() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
+ if (!DI::userSession()->getLocalUserId() || DI::mode()->isMobile() || DI::mode()->isMobile()) {
return $o;
}
@@ -610,7 +609,7 @@ class Profile
$classtoday = '';
$condition = ["`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ?",
- Session::getLocalUser(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utc('now - 1 days')];
+ DI::userSession()->getLocalUserId(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utc('now - 1 days')];
$s = DBA::select('event', [], $condition, ['order' => ['start']]);
$r = [];
@@ -620,7 +619,7 @@ class Profile
$total = 0;
while ($rr = DBA::fetch($s)) {
- $condition = ['parent-uri' => $rr['uri'], 'uid' => $rr['uid'], 'author-id' => Session::getPublicContact(),
+ $condition = ['parent-uri' => $rr['uri'], 'uid' => $rr['uid'], 'author-id' => DI::userSession()->getPublicContactId(),
'vid' => [Verb::getID(Activity::ATTEND), Verb::getID(Activity::ATTENDMAYBE)],
'visible' => true, 'deleted' => false];
if (!Post::exists($condition)) {
@@ -712,7 +711,7 @@ class Profile
$my_url = self::getMyURL();
$my_url = Network::isUrlValid($my_url);
- if (empty($my_url) || Session::getLocalUser()) {
+ if (empty($my_url) || DI::userSession()->getLocalUserId()) {
return;
}
@@ -730,7 +729,7 @@ class Profile
$contact = DBA::selectFirst('contact',['id', 'url'], ['id' => $cid]);
- if (DBA::isResult($contact) && Session::getRemoteUser() && Session::getRemoteUser() == $contact['id']) {
+ if (DBA::isResult($contact) && DI::userSession()->getRemoteUserId() && DI::userSession()->getRemoteUserId() == $contact['id']) {
Logger::info('The visitor ' . $my_url . ' is already authenticated');
return;
}
@@ -797,7 +796,7 @@ class Profile
$_SESSION['my_url'] = $visitor['url'];
$_SESSION['remote_comment'] = $visitor['subscribe'];
- Session::setVisitorsContacts();
+ DI::userSession()->setVisitorsContacts();
$a->setContactId($visitor['id']);
@@ -916,7 +915,7 @@ class Profile
*/
public static function getThemeUid(App $a): int
{
- return Session::getLocalUser() ?: $a->getProfileOwner();
+ return DI::userSession()->getLocalUserId() ?: $a->getProfileOwner();
}
/**
From eecc456e0cbef74665104b4cb46367bc4345f25b Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 22:59:12 +0200
Subject: [PATCH 09/40] UserSession class [5] - Refactor src/Module/ files with
DI
---
src/Module/Admin/BaseUsers.php | 3 +-
src/Module/Admin/Users/Active.php | 5 +-
src/Module/Admin/Users/Blocked.php | 4 +-
src/Module/Admin/Users/Index.php | 4 +-
src/Module/Apps.php | 3 +-
src/Module/BaseAdmin.php | 3 +-
src/Module/BaseSearch.php | 7 +-
src/Module/Bookmarklet.php | 3 +-
src/Module/Contact.php | 35 ++++----
src/Module/Contact/Advanced.php | 9 +-
src/Module/Contact/Contacts.php | 5 +-
src/Module/Contact/Hovercard.php | 9 +-
src/Module/Contact/Profile.php | 26 +++---
src/Module/Contact/Revoke.php | 9 +-
src/Module/Conversation/Community.php | 29 +++----
src/Module/Conversation/Network.php | 33 ++++---
src/Module/Debug/ActivityPubConversion.php | 3 +-
src/Module/Debug/Feed.php | 5 +-
src/Module/Debug/ItemBody.php | 5 +-
src/Module/Debug/Probe.php | 3 +-
src/Module/Debug/WebFinger.php | 3 +-
src/Module/Delegation.php | 9 +-
src/Module/Directory.php | 9 +-
src/Module/Events/Json.php | 7 +-
src/Module/Feed.php | 3 +-
src/Module/Filer/SaveTag.php | 7 +-
src/Module/FollowConfirm.php | 5 +-
src/Module/FriendSuggest.php | 13 ++-
src/Module/Group.php | 29 +++----
src/Module/HCard.php | 5 +-
src/Module/Home.php | 3 +-
src/Module/Invite.php | 17 ++--
src/Module/Item/Activity.php | 9 +-
src/Module/Item/Compose.php | 11 ++-
src/Module/Item/Follow.php | 5 +-
src/Module/Item/Ignore.php | 9 +-
src/Module/Item/Pin.php | 9 +-
src/Module/Item/Star.php | 7 +-
src/Module/NoScrape.php | 3 +-
src/Module/Notifications/Introductions.php | 3 +-
src/Module/Notifications/Notification.php | 21 +++--
src/Module/Notifications/Ping.php | 25 +++---
src/Module/OAuth/Authorize.php | 3 +-
src/Module/PermissionTooltip.php | 5 +-
src/Module/Photo.php | 7 +-
src/Module/Profile/Common.php | 5 +-
src/Module/Profile/Contacts.php | 7 +-
src/Module/Profile/Media.php | 3 +-
src/Module/Profile/Profile.php | 17 ++--
src/Module/Profile/Schedule.php | 9 +-
src/Module/Profile/Status.php | 19 ++--
src/Module/Proxy.php | 7 +-
src/Module/Register.php | 25 +++---
src/Module/Search/Acl.php | 11 ++-
src/Module/Search/Directory.php | 3 +-
src/Module/Search/Filed.php | 19 ++--
src/Module/Search/Index.php | 39 ++++-----
src/Module/Search/Saved.php | 7 +-
src/Module/Security/Login.php | 5 +-
src/Module/Security/Logout.php | 3 +-
src/Module/Security/TwoFactor/Recovery.php | 11 ++-
src/Module/Security/TwoFactor/SignOut.php | 7 +-
src/Module/Security/TwoFactor/Trust.php | 7 +-
src/Module/Settings/Account.php | 87 +++++++++----------
src/Module/Settings/Delegation.php | 21 +++--
src/Module/Settings/Display.php | 57 ++++++------
src/Module/Settings/Profile/Index.php | 17 ++--
src/Module/Settings/Profile/Photo/Crop.php | 31 ++++---
src/Module/Settings/Profile/Photo/Index.php | 11 ++-
src/Module/Settings/TwoFactor/AppSpecific.php | 19 ++--
src/Module/Settings/TwoFactor/Index.php | 27 +++---
src/Module/Settings/TwoFactor/Recovery.php | 19 ++--
src/Module/Settings/TwoFactor/Trusted.php | 13 ++-
src/Module/Settings/TwoFactor/Verify.php | 17 ++--
src/Module/Settings/UserExport.php | 9 +-
src/Module/Update/Community.php | 5 +-
src/Module/Update/Network.php | 3 +-
src/Module/Update/Profile.php | 15 ++--
78 files changed, 455 insertions(+), 530 deletions(-)
diff --git a/src/Module/Admin/BaseUsers.php b/src/Module/Admin/BaseUsers.php
index 6f96ea589..93433efbe 100644
--- a/src/Module/Admin/BaseUsers.php
+++ b/src/Module/Admin/BaseUsers.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Admin;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Register;
@@ -122,7 +121,7 @@ abstract class BaseUsers extends BaseAdmin
$user['login_date'] = Temporal::getRelativeDate($user['login_date']);
$user['lastitem_date'] = Temporal::getRelativeDate($user['last-item']);
$user['is_admin'] = in_array($user['email'], $adminlist);
- $user['is_deletable'] = !$user['account_removed'] && intval($user['uid']) != Session::getLocalUser();
+ $user['is_deletable'] = !$user['account_removed'] && intval($user['uid']) != DI::userSession()->getLocalUserId();
$user['deleted'] = ($user['account_removed'] ? Temporal::getRelativeDate($user['account_expires_on']) : False);
return $user;
diff --git a/src/Module/Admin/Users/Active.php b/src/Module/Admin/Users/Active.php
index 20662a7e2..4e021e298 100644
--- a/src/Module/Admin/Users/Active.php
+++ b/src/Module/Admin/Users/Active.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
@@ -48,7 +47,7 @@ class Active extends BaseUsers
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
User::remove($uid);
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
@@ -79,7 +78,7 @@ class Active extends BaseUsers
switch ($action) {
case 'delete':
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
// delete user
User::remove($uid);
diff --git a/src/Module/Admin/Users/Blocked.php b/src/Module/Admin/Users/Blocked.php
index 5ef9efcff..356d53845 100644
--- a/src/Module/Admin/Users/Blocked.php
+++ b/src/Module/Admin/Users/Blocked.php
@@ -49,7 +49,7 @@ class Blocked extends BaseUsers
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
User::remove($uid);
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
@@ -80,7 +80,7 @@ class Blocked extends BaseUsers
switch ($action) {
case 'delete':
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
// delete user
User::remove($uid);
diff --git a/src/Module/Admin/Users/Index.php b/src/Module/Admin/Users/Index.php
index b381b752e..91ffa97e2 100644
--- a/src/Module/Admin/Users/Index.php
+++ b/src/Module/Admin/Users/Index.php
@@ -55,7 +55,7 @@ class Index extends BaseUsers
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
User::remove($uid);
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
@@ -86,7 +86,7 @@ class Index extends BaseUsers
switch ($action) {
case 'delete':
- if (Session::getLocalUser() != $uid) {
+ if (DI::userSession()->getLocalUserId() != $uid) {
self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get(true), 'admin_users', 't');
// delete user
User::remove($uid);
diff --git a/src/Module/Apps.php b/src/Module/Apps.php
index 36a980c29..51450852b 100644
--- a/src/Module/Apps.php
+++ b/src/Module/Apps.php
@@ -28,7 +28,6 @@ use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
@@ -43,7 +42,7 @@ class Apps extends BaseModule
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$privateaddons = $config->get('config', 'private_addons');
- if ($privateaddons === "1" && !Session::getLocalUser()) {
+ if ($privateaddons === "1" && !DI::userSession()->getLocalUserId()) {
$baseUrl->redirect();
}
}
diff --git a/src/Module/BaseAdmin.php b/src/Module/BaseAdmin.php
index 89357d3a2..7088bd7d6 100644
--- a/src/Module/BaseAdmin.php
+++ b/src/Module/BaseAdmin.php
@@ -24,7 +24,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Network\HTTPException;
@@ -50,7 +49,7 @@ abstract class BaseAdmin extends BaseModule
*/
public static function checkAdminAccess(bool $interactive = false)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
if ($interactive) {
DI::sysmsg()->addNotice(DI::l10n()->t('Please login to continue.'));
DI::session()->set('return_path', DI::args()->getQueryString());
diff --git a/src/Module/BaseSearch.php b/src/Module/BaseSearch.php
index 3aae68f7b..b0f03c17d 100644
--- a/src/Module/BaseSearch.php
+++ b/src/Module/BaseSearch.php
@@ -25,7 +25,6 @@ use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model;
use Friendica\Network\HTTPException;
@@ -83,10 +82,10 @@ class BaseSearch extends BaseModule
$search = Network::convertToIdn($search);
if (DI::mode()->isMobile()) {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -126,7 +125,7 @@ class BaseSearch extends BaseModule
// in case the result is a contact result, add a contact-specific entry
if ($result instanceof ContactResult) {
- $contact = Model\Contact::getByURLForUser($result->getUrl(), Session::getLocalUser());
+ $contact = Model\Contact::getByURLForUser($result->getUrl(), DI::userSession()->getLocalUserId());
if (!empty($contact)) {
$entries[] = Contact::getContactTemplateVars($contact);
}
diff --git a/src/Module/Bookmarklet.php b/src/Module/Bookmarklet.php
index 7a4ea37a7..8d64c97e4 100644
--- a/src/Module/Bookmarklet.php
+++ b/src/Module/Bookmarklet.php
@@ -23,7 +23,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Content\PageInfo;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException;
@@ -41,7 +40,7 @@ class Bookmarklet extends BaseModule
$config = DI::config();
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$output = '' . DI::l10n()->t('Login') . ' ';
$output .= Login::form(DI::args()->getQueryString(), intval($config->get('config', 'register_policy')) === Register::CLOSED ? false : true);
return $output;
diff --git a/src/Module/Contact.php b/src/Module/Contact.php
index 25ced7830..13f48f350 100644
--- a/src/Module/Contact.php
+++ b/src/Module/Contact.php
@@ -28,7 +28,6 @@ use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
@@ -60,12 +59,12 @@ class Contact extends BaseModule
self::checkFormSecurityTokenRedirectOnError($redirectUrl, 'contact_batch_actions');
- $orig_records = Model\Contact::selectToArray(['id', 'uid'], ['id' => $_POST['contact_batch'], 'uid' => [0, Session::getLocalUser()], 'self' => false, 'deleted' => false]);
+ $orig_records = Model\Contact::selectToArray(['id', 'uid'], ['id' => $_POST['contact_batch'], 'uid' => [0, DI::userSession()->getLocalUserId()], 'self' => false, 'deleted' => false]);
$count_actions = 0;
foreach ($orig_records as $orig_record) {
- $cdata = Model\Contact::getPublicAndUserContactID($orig_record['id'], Session::getLocalUser());
- if (empty($cdata) || Session::getPublicContact() === $cdata['public']) {
+ $cdata = Model\Contact::getPublicAndUserContactID($orig_record['id'], DI::userSession()->getLocalUserId());
+ if (empty($cdata) || DI::userSession()->getPublicContactId() === $cdata['public']) {
// No action available on your own contact
continue;
}
@@ -76,7 +75,7 @@ class Contact extends BaseModule
}
if (!empty($_POST['contacts_batch_block'])) {
- self::toggleBlockContact($cdata['public'], Session::getLocalUser());
+ self::toggleBlockContact($cdata['public'], DI::userSession()->getLocalUserId());
$count_actions++;
}
@@ -94,7 +93,7 @@ class Contact extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -114,7 +113,7 @@ class Contact extends BaseModule
*/
public static function updateContactFromPoll(int $contact_id)
{
- $contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => Session::getLocalUser(), 'deleted' => false]);
+ $contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => DI::userSession()->getLocalUserId(), 'deleted' => false]);
if (!DBA::isResult($contact)) {
return;
}
@@ -154,13 +153,13 @@ class Contact extends BaseModule
*/
private static function toggleIgnoreContact(int $contact_id)
{
- $ignored = !Model\Contact\User::isIgnored($contact_id, Session::getLocalUser());
- Model\Contact\User::setIgnored($contact_id, Session::getLocalUser(), $ignored);
+ $ignored = !Model\Contact\User::isIgnored($contact_id, DI::userSession()->getLocalUserId());
+ Model\Contact\User::setIgnored($contact_id, DI::userSession()->getLocalUserId(), $ignored);
}
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form($_SERVER['REQUEST_URI']);
}
@@ -204,7 +203,7 @@ class Contact extends BaseModule
$_SESSION['return_path'] = DI::args()->getQueryString();
- $sql_values = [Session::getLocalUser()];
+ $sql_values = [DI::userSession()->getLocalUserId()];
// @TODO: Replace with parameter from router
$type = DI::args()->getArgv()[1] ?? '';
@@ -230,7 +229,7 @@ class Contact extends BaseModule
$sql_extra = " AND `pending` AND NOT `archive` AND NOT `failed` AND ((`rel` = ?)
OR `id` IN (SELECT `contact-id` FROM `intro` WHERE `intro`.`uid` = ? AND NOT `ignore`))";
$sql_values[] = Model\Contact::SHARING;
- $sql_values[] = Session::getLocalUser();
+ $sql_values[] = DI::userSession()->getLocalUserId();
break;
default:
$sql_extra = " AND NOT `archive` AND NOT `blocked` AND NOT `pending`";
@@ -299,8 +298,8 @@ class Contact extends BaseModule
$stmt = DBA::select('contact', [], $condition, ['order' => ['name'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]]);
while ($contact = DBA::fetch($stmt)) {
- $contact['blocked'] = Model\Contact\User::isBlocked($contact['id'], Session::getLocalUser());
- $contact['readonly'] = Model\Contact\User::isIgnored($contact['id'], Session::getLocalUser());
+ $contact['blocked'] = Model\Contact\User::isBlocked($contact['id'], DI::userSession()->getLocalUserId());
+ $contact['readonly'] = Model\Contact\User::isIgnored($contact['id'], DI::userSession()->getLocalUserId());
$contacts[] = self::getContactTemplateVars($contact);
}
DBA::close($stmt);
@@ -424,7 +423,7 @@ class Contact extends BaseModule
public static function getTabsHTML(array $contact, int $active_tab)
{
$cid = $pcid = $contact['id'];
- $data = Model\Contact::getPublicAndUserContactID($contact['id'], Session::getLocalUser());
+ $data = Model\Contact::getPublicAndUserContactID($contact['id'], DI::userSession()->getLocalUserId());
if (!empty($data['user']) && ($contact['id'] == $data['public'])) {
$cid = $data['user'];
} elseif (!empty($data['public'])) {
@@ -500,8 +499,8 @@ class Contact extends BaseModule
{
$alt_text = '';
- if (!empty($contact['url']) && isset($contact['uid']) && ($contact['uid'] == 0) && Session::getLocalUser()) {
- $personal = Model\Contact::getByURL($contact['url'], false, ['uid', 'rel', 'self'], Session::getLocalUser());
+ if (!empty($contact['url']) && isset($contact['uid']) && ($contact['uid'] == 0) && DI::userSession()->getLocalUserId()) {
+ $personal = Model\Contact::getByURL($contact['url'], false, ['uid', 'rel', 'self'], DI::userSession()->getLocalUserId());
if (!empty($personal)) {
$contact['uid'] = $personal['uid'];
$contact['rel'] = $personal['rel'];
@@ -509,7 +508,7 @@ class Contact extends BaseModule
}
}
- if (!empty($contact['uid']) && !empty($contact['rel']) && Session::getLocalUser() == $contact['uid']) {
+ if (!empty($contact['uid']) && !empty($contact['rel']) && DI::userSession()->getLocalUserId() == $contact['uid']) {
switch ($contact['rel']) {
case Model\Contact::FRIEND:
$alt_text = DI::l10n()->t('Mutual Friendship');
diff --git a/src/Module/Contact/Advanced.php b/src/Module/Contact/Advanced.php
index 2c13800de..5420390aa 100644
--- a/src/Module/Contact/Advanced.php
+++ b/src/Module/Contact/Advanced.php
@@ -28,7 +28,6 @@ use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model;
@@ -57,7 +56,7 @@ class Advanced extends BaseModule
$this->dba = $dba;
$this->page = $page;
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new ForbiddenException($this->t('Permission denied.'));
}
}
@@ -66,7 +65,7 @@ class Advanced extends BaseModule
{
$cid = $this->parameters['id'];
- $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => Session::getLocalUser()]);
+ $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]);
if (empty($contact)) {
throw new BadRequestException($this->t('Contact not found.'));
}
@@ -87,7 +86,7 @@ class Advanced extends BaseModule
'nurl' => $nurl,
'poll' => $poll,
],
- ['id' => $contact['id'], 'uid' => Session::getLocalUser()]
+ ['id' => $contact['id'], 'uid' => DI::userSession()->getLocalUserId()]
);
if ($photo) {
@@ -105,7 +104,7 @@ class Advanced extends BaseModule
{
$cid = $this->parameters['id'];
- $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => Session::getLocalUser()]);
+ $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]);
if (empty($contact)) {
throw new BadRequestException($this->t('Contact not found.'));
}
diff --git a/src/Module/Contact/Contacts.php b/src/Module/Contact/Contacts.php
index 87e107988..92235e854 100644
--- a/src/Module/Contact/Contacts.php
+++ b/src/Module/Contact/Contacts.php
@@ -25,7 +25,6 @@ use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\User;
@@ -36,7 +35,7 @@ class Contacts extends BaseModule
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
@@ -54,7 +53,7 @@ class Contacts extends BaseModule
throw new HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
}
- $localContactId = Model\Contact::getPublicIdByUserId(Session::getLocalUser());
+ $localContactId = Model\Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId());
DI::page()['aside'] = Widget\VCard::getHTML($contact);
diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php
index 43acbdd5f..7f12bf5cb 100644
--- a/src/Module/Contact/Hovercard.php
+++ b/src/Module/Contact/Hovercard.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Contact;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -41,7 +40,7 @@ class Hovercard extends BaseModule
$contact_url = $_REQUEST['url'] ?? '';
// Get out if the system doesn't have public access allowed
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException();
}
@@ -70,8 +69,8 @@ class Hovercard extends BaseModule
// Search for contact data
// Look if the local user has got the contact
- if (Session::isAuthenticated()) {
- $contact = Contact::getByURLForUser($contact_url, Session::getLocalUser());
+ if (DI::userSession()->isAuthenticated()) {
+ $contact = Contact::getByURLForUser($contact_url, DI::userSession()->getLocalUserId());
} else {
$contact = Contact::getByURL($contact_url, false);
}
@@ -81,7 +80,7 @@ class Hovercard extends BaseModule
}
// Get the photo_menu - the menu if possible contact actions
- if (Session::isAuthenticated()) {
+ if (DI::userSession()->isAuthenticated()) {
$actions = Contact::photoMenu($contact);
} else {
$actions = [];
diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php
index 1fc702edf..f63821581 100644
--- a/src/Module/Contact/Profile.php
+++ b/src/Module/Contact/Profile.php
@@ -75,7 +75,7 @@ class Profile extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -83,7 +83,7 @@ class Profile extends BaseModule
// Backward compatibility: The update still needs a user-specific contact ID
// Change to user-contact table check by version 2022.03
- $cdata = Contact::getPublicAndUserContactID($contact_id, Session::getLocalUser());
+ $cdata = Contact::getPublicAndUserContactID($contact_id, DI::userSession()->getLocalUserId());
if (empty($cdata['user']) || !DBA::exists('contact', ['id' => $cdata['user'], 'deleted' => false])) {
return;
}
@@ -125,20 +125,20 @@ class Profile extends BaseModule
$fields['info'] = $_POST['info'];
}
- if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => Session::getLocalUser()])) {
+ if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => DI::userSession()->getLocalUserId()])) {
DI::sysmsg()->addNotice($this->t('Failed to update contact record.'));
}
}
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Module\Security\Login::form($_SERVER['REQUEST_URI']);
}
// Backward compatibility: Ensure to use the public contact when the user contact is provided
// Remove by version 2022.03
- $data = Contact::getPublicAndUserContactID(intval($this->parameters['id']), Session::getLocalUser());
+ $data = Contact::getPublicAndUserContactID(intval($this->parameters['id']), DI::userSession()->getLocalUserId());
if (empty($data)) {
throw new HTTPException\NotFoundException($this->t('Contact not found.'));
}
@@ -153,7 +153,7 @@ class Profile extends BaseModule
throw new HTTPException\NotFoundException($this->t('Contact not found.'));
}
- $localRelationship = $this->localRelationship->getForUserContact(Session::getLocalUser(), $contact['id']);
+ $localRelationship = $this->localRelationship->getForUserContact(DI::userSession()->getLocalUserId(), $contact['id']);
if ($localRelationship->rel === Contact::SELF) {
$this->baseUrl->redirect('profile/' . $contact['nick'] . '/profile');
@@ -174,12 +174,12 @@ class Profile extends BaseModule
if ($cmd === 'block') {
if ($localRelationship->blocked) {
// @TODO Backward compatibility, replace with $localRelationship->unblock()
- Contact\User::setBlocked($contact['id'], Session::getLocalUser(), false);
+ Contact\User::setBlocked($contact['id'], DI::userSession()->getLocalUserId(), false);
$message = $this->t('Contact has been unblocked');
} else {
// @TODO Backward compatibility, replace with $localRelationship->block()
- Contact\User::setBlocked($contact['id'], Session::getLocalUser(), true);
+ Contact\User::setBlocked($contact['id'], DI::userSession()->getLocalUserId(), true);
$message = $this->t('Contact has been blocked');
}
@@ -190,12 +190,12 @@ class Profile extends BaseModule
if ($cmd === 'ignore') {
if ($localRelationship->ignored) {
// @TODO Backward compatibility, replace with $localRelationship->unblock()
- Contact\User::setIgnored($contact['id'], Session::getLocalUser(), false);
+ Contact\User::setIgnored($contact['id'], DI::userSession()->getLocalUserId(), false);
$message = $this->t('Contact has been unignored');
} else {
// @TODO Backward compatibility, replace with $localRelationship->block()
- Contact\User::setIgnored($contact['id'], Session::getLocalUser(), true);
+ Contact\User::setIgnored($contact['id'], DI::userSession()->getLocalUserId(), true);
$message = $this->t('Contact has been ignored');
}
@@ -224,8 +224,8 @@ class Profile extends BaseModule
'$baseurl' => $this->baseUrl->get(true),
]);
- $contact['blocked'] = Contact\User::isBlocked($contact['id'], Session::getLocalUser());
- $contact['readonly'] = Contact\User::isIgnored($contact['id'], Session::getLocalUser());
+ $contact['blocked'] = Contact\User::isBlocked($contact['id'], DI::userSession()->getLocalUserId());
+ $contact['readonly'] = Contact\User::isIgnored($contact['id'], DI::userSession()->getLocalUserId());
switch ($localRelationship->rel) {
case Contact::FRIEND: $relation_text = $this->t('You are mutual friends with %s', $contact['name']); break;
@@ -486,7 +486,7 @@ class Profile extends BaseModule
*/
private static function updateContactFromProbe(int $contact_id)
{
- $contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id, 'uid' => [0, Session::getLocalUser()], 'deleted' => false]);
+ $contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id, 'uid' => [0, DI::userSession()->getLocalUserId()], 'deleted' => false]);
if (!DBA::isResult($contact)) {
return;
}
diff --git a/src/Module/Contact/Revoke.php b/src/Module/Contact/Revoke.php
index d3c594d4c..609ec6584 100644
--- a/src/Module/Contact/Revoke.php
+++ b/src/Module/Contact/Revoke.php
@@ -27,7 +27,6 @@ use Friendica\Content\Nav;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model;
@@ -55,11 +54,11 @@ class Revoke extends BaseModule
$this->dba = $dba;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], Session::getLocalUser());
+ $data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], DI::userSession()->getLocalUserId());
if (!$this->dba->isResult($data)) {
throw new HTTPException\NotFoundException($this->t('Unknown contact.'));
}
@@ -81,7 +80,7 @@ class Revoke extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException();
}
@@ -96,7 +95,7 @@ class Revoke extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form($_SERVER['REQUEST_URI']);
}
diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php
index 2b5583f73..b2cbf1014 100644
--- a/src/Module/Conversation/Community.php
+++ b/src/Module/Conversation/Community.php
@@ -30,7 +30,6 @@ use Friendica\Content\Text\HTML;
use Friendica\Content\Widget;
use Friendica\Content\Widget\TrendingTags;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
@@ -74,7 +73,7 @@ class Community extends BaseModule
'$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
]);
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$o .= Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
}
@@ -82,7 +81,7 @@ class Community extends BaseModule
if (empty($_GET['mode']) || ($_GET['mode'] != 'raw')) {
$tabs = [];
- if ((Session::isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::LOCAL])) && empty(DI::config()->get('system', 'singleuser'))) {
+ if ((DI::userSession()->isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::LOCAL])) && empty(DI::config()->get('system', 'singleuser'))) {
$tabs[] = [
'label' => DI::l10n()->t('Local Community'),
'url' => 'community/local',
@@ -93,7 +92,7 @@ class Community extends BaseModule
];
}
- if (Session::isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::GLOBAL])) {
+ if (DI::userSession()->isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::GLOBAL])) {
$tabs[] = [
'label' => DI::l10n()->t('Global Community'),
'url' => 'community/global',
@@ -111,7 +110,7 @@ class Community extends BaseModule
DI::page()['aside'] .= Widget::accountTypes('community/' . self::$content, self::$accountTypeString);
- if (Session::getLocalUser() && DI::config()->get('system', 'community_no_sharer')) {
+ if (DI::userSession()->getLocalUserId() && DI::config()->get('system', 'community_no_sharer')) {
$path = self::$content;
if (!empty($this->parameters['accounttype'])) {
$path .= '/' . $this->parameters['accounttype'];
@@ -140,12 +139,12 @@ class Community extends BaseModule
]);
}
- if (Feature::isEnabled(Session::getLocalUser(), 'trending_tags')) {
+ if (Feature::isEnabled(DI::userSession()->getLocalUserId(), 'trending_tags')) {
DI::page()['aside'] .= TrendingTags::getHTML(self::$content);
}
// We need the editor here to be able to reshare an item.
- if (Session::isAuthenticated()) {
+ if (DI::userSession()->isAuthenticated()) {
$o .= DI::conversation()->statusEditor([], 0, true);
}
}
@@ -157,7 +156,7 @@ class Community extends BaseModule
return $o;
}
- $o .= DI::conversation()->create($items, 'community', false, false, 'commented', Session::getLocalUser());
+ $o .= DI::conversation()->create($items, 'community', false, false, 'commented', DI::userSession()->getLocalUserId());
$pager = new BoundariesPager(
DI::l10n(),
@@ -167,7 +166,7 @@ class Community extends BaseModule
self::$itemsPerPage
);
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$o .= HTML::scrollLoader();
} else {
$o .= $pager->renderMinimal(count($items));
@@ -184,7 +183,7 @@ class Community extends BaseModule
*/
protected function parseRequest()
{
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
}
@@ -213,7 +212,7 @@ class Community extends BaseModule
}
// Check if we are allowed to display the content to visitors
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
$available = self::$page_style == self::LOCAL_AND_GLOBAL;
if (!$available) {
@@ -230,10 +229,10 @@ class Community extends BaseModule
}
if (DI::mode()->isMobile()) {
- self::$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ self::$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- self::$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ self::$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -335,9 +334,9 @@ class Community extends BaseModule
$condition[0] .= " AND `id` = ?";
$condition[] = $item_id;
} else {
- if (Session::getLocalUser() && !empty($_REQUEST['no_sharer'])) {
+ if (DI::userSession()->getLocalUserId() && !empty($_REQUEST['no_sharer'])) {
$condition[0] .= " AND NOT `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `post-user`.`uid` = ?)";
- $condition[] = Session::getLocalUser();
+ $condition[] = DI::userSession()->getLocalUserId();
}
if (isset($max_id)) {
diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php
index a7696a0ec..ce2afbfc7 100644
--- a/src/Module/Conversation/Network.php
+++ b/src/Module/Conversation/Network.php
@@ -30,7 +30,6 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\ACL;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -78,7 +77,7 @@ class Network extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form();
}
@@ -88,8 +87,8 @@ class Network extends BaseModule
DI::page()['aside'] .= Widget::accountTypes($module, self::$accountTypeString);
DI::page()['aside'] .= Group::sidebarWidget($module, $module . '/group', 'standard', self::$groupId);
- DI::page()['aside'] .= ForumManager::widget($module . '/forum', Session::getLocalUser(), self::$forumContactId);
- DI::page()['aside'] .= Widget::postedByYear($module . '/archive', Session::getLocalUser(), false);
+ DI::page()['aside'] .= ForumManager::widget($module . '/forum', DI::userSession()->getLocalUserId(), self::$forumContactId);
+ DI::page()['aside'] .= Widget::postedByYear($module . '/archive', DI::userSession()->getLocalUserId(), false);
DI::page()['aside'] .= Widget::networks($module, !self::$forumContactId ? self::$network : '');
DI::page()['aside'] .= Widget\SavedSearches::getHTML(DI::args()->getQueryString());
DI::page()['aside'] .= Widget::fileAs('filed', '');
@@ -105,7 +104,7 @@ class Network extends BaseModule
$items = self::getItems($table, $params);
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll') && ($_GET['mode'] ?? '') != 'minimal') {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll') && ($_GET['mode'] ?? '') != 'minimal') {
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$o .= Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
}
@@ -138,7 +137,7 @@ class Network extends BaseModule
$allowedCids[] = (int) self::$forumContactId;
} elseif (self::$network) {
$condition = [
- 'uid' => Session::getLocalUser(),
+ 'uid' => DI::userSession()->getLocalUserId(),
'network' => self::$network,
'self' => false,
'blocked' => false,
@@ -168,7 +167,7 @@ class Network extends BaseModule
}
if (self::$groupId) {
- $group = DBA::selectFirst('group', ['name'], ['id' => self::$groupId, 'uid' => Session::getLocalUser()]);
+ $group = DBA::selectFirst('group', ['name'], ['id' => self::$groupId, 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($group)) {
DI::sysmsg()->addNotice(DI::l10n()->t('No such group'));
}
@@ -199,9 +198,9 @@ class Network extends BaseModule
$ordering = '`commented`';
}
- $o .= DI::conversation()->create($items, 'network', false, false, $ordering, Session::getLocalUser());
+ $o .= DI::conversation()->create($items, 'network', false, false, $ordering, DI::userSession()->getLocalUserId());
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$o .= HTML::scrollLoader();
} else {
$pager = new BoundariesPager(
@@ -307,7 +306,7 @@ class Network extends BaseModule
self::$forumContactId = $this->parameters['contact_id'] ?? 0;
- self::$selectedTab = DI::session()->get('network-tab', DI::pConfig()->get(Session::getLocalUser(), 'network.view', 'selected_tab', ''));
+ self::$selectedTab = DI::session()->get('network-tab', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'network.view', 'selected_tab', ''));
if (!empty($get['star'])) {
self::$selectedTab = 'star';
@@ -346,7 +345,7 @@ class Network extends BaseModule
}
DI::session()->set('network-tab', self::$selectedTab);
- DI::pConfig()->set(Session::getLocalUser(), 'network.view', 'selected_tab', self::$selectedTab);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'network.view', 'selected_tab', self::$selectedTab);
self::$accountTypeString = $get['accounttype'] ?? $this->parameters['accounttype'] ?? '';
self::$accountType = User::getAccountTypeByString(self::$accountTypeString);
@@ -357,10 +356,10 @@ class Network extends BaseModule
self::$dateTo = $this->parameters['to'] ?? '';
if (DI::mode()->isMobile()) {
- self::$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ self::$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- self::$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ self::$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -385,7 +384,7 @@ class Network extends BaseModule
protected static function getItems(string $table, array $params, array $conditionFields = [])
{
- $conditionFields['uid'] = Session::getLocalUser();
+ $conditionFields['uid'] = DI::userSession()->getLocalUserId();
$conditionStrings = [];
if (!is_null(self::$accountType)) {
@@ -414,7 +413,7 @@ class Network extends BaseModule
} elseif (self::$forumContactId) {
$conditionStrings = DBA::mergeConditions($conditionStrings,
["((`contact-id` = ?) OR `uri-id` IN (SELECT `parent-uri-id` FROM `post-user-view` WHERE (`contact-id` = ? AND `gravity` = ? AND `vid` = ? AND `uid` = ?)))",
- self::$forumContactId, self::$forumContactId, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Session::getLocalUser()]);
+ self::$forumContactId, self::$forumContactId, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), DI::userSession()->getLocalUserId()]);
}
// Currently only the order modes "received" and "commented" are in use
@@ -478,10 +477,10 @@ class Network extends BaseModule
// level which items you've seen and which you haven't. If you're looking
// at the top level network page just mark everything seen.
if (!self::$groupId && !self::$forumContactId && !self::$star && !self::$mention) {
- $condition = ['unseen' => true, 'uid' => Session::getLocalUser()];
+ $condition = ['unseen' => true, 'uid' => DI::userSession()->getLocalUserId()];
self::setItemsSeenByCondition($condition);
} elseif (!empty($parents)) {
- $condition = ['unseen' => true, 'uid' => Session::getLocalUser(), 'parent-uri-id' => $parents];
+ $condition = ['unseen' => true, 'uid' => DI::userSession()->getLocalUserId(), 'parent-uri-id' => $parents];
self::setItemsSeenByCondition($condition);
}
diff --git a/src/Module/Debug/ActivityPubConversion.php b/src/Module/Debug/ActivityPubConversion.php
index 310727d2f..0f41dbf17 100644
--- a/src/Module/Debug/ActivityPubConversion.php
+++ b/src/Module/Debug/ActivityPubConversion.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Protocol\ActivityPub;
use Friendica\Util\JsonLD;
@@ -42,7 +41,7 @@ class ActivityPubConversion extends BaseModule
try {
$source = json_decode($_REQUEST['source'], true);
$trust_source = true;
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$push = false;
if (!$source) {
diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php
index 97b572a1c..435245490 100644
--- a/src/Module/Debug/Feed.php
+++ b/src/Module/Debug/Feed.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model;
use Friendica\Module\Response;
@@ -49,7 +48,7 @@ class Feed extends BaseModule
$this->httpClient = $httpClient;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice($this->t('You must be logged in to use this module'));
$baseUrl->redirect();
}
@@ -61,7 +60,7 @@ class Feed extends BaseModule
if (!empty($_REQUEST['url'])) {
$url = $_REQUEST['url'];
- $contact = Model\Contact::getByURLForUser($url, Session::getLocalUser(), null);
+ $contact = Model\Contact::getByURLForUser($url, DI::userSession()->getLocalUserId(), null);
$xml = $this->httpClient->fetch($contact['poll'], HttpClientAccept::FEED_XML);
diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php
index ff3922212..13979a12b 100644
--- a/src/Module/Debug/ItemBody.php
+++ b/src/Module/Debug/ItemBody.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Debug;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Post;
@@ -35,7 +34,7 @@ class ItemBody extends BaseModule
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
}
@@ -45,7 +44,7 @@ class ItemBody extends BaseModule
$itemId = intval($this->parameters['item']);
- $item = Post::selectFirst(['body'], ['uid' => [0, Session::getLocalUser()], 'uri-id' => $itemId]);
+ $item = Post::selectFirst(['body'], ['uid' => [0, DI::userSession()->getLocalUserId()], 'uri-id' => $itemId]);
if (!empty($item)) {
if (DI::mode()->isAjax()) {
diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php
index 2c04fff91..4d30d4289 100644
--- a/src/Module/Debug/Probe.php
+++ b/src/Module/Debug/Probe.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe as NetworkProbe;
@@ -35,7 +34,7 @@ class Probe extends BaseModule
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
}
diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php
index ae0e4446b..f6fae18c1 100644
--- a/src/Module/Debug/WebFinger.php
+++ b/src/Module/Debug/WebFinger.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Network\Probe;
@@ -34,7 +33,7 @@ class WebFinger extends BaseModule
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
}
diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php
index f1e2a792e..c8b5c9d90 100644
--- a/src/Module/Delegation.php
+++ b/src/Module/Delegation.php
@@ -24,7 +24,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Notification;
@@ -39,11 +38,11 @@ class Delegation extends BaseModule
{
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
$orig_record = User::getById(DI::app()->getLoggedInUserId());
if (DI::session()->get('submanage')) {
@@ -115,11 +114,11 @@ class Delegation extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
}
- $identities = User::identities(DI::session()->get('submanage', Session::getLocalUser()));
+ $identities = User::identities(DI::session()->get('submanage', DI::userSession()->getLocalUserId()));
//getting additinal information for each identity
foreach ($identities as $key => $identity) {
diff --git a/src/Module/Directory.php b/src/Module/Directory.php
index 4e62c40ef..19656bb6a 100644
--- a/src/Module/Directory.php
+++ b/src/Module/Directory.php
@@ -26,7 +26,6 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Hook;
-use Friendica\Core\Session;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
use Friendica\DI;
@@ -44,12 +43,12 @@ class Directory extends BaseModule
$app = DI::app();
$config = DI::config();
- if (($config->get('system', 'block_public') && !Session::isAuthenticated()) ||
- ($config->get('system', 'block_local_dir') && !Session::isAuthenticated())) {
+ if (($config->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) ||
+ ($config->get('system', 'block_local_dir') && !DI::userSession()->isAuthenticated())) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
DI::page()['aside'] .= Widget::findPeople();
DI::page()['aside'] .= Widget::follow();
}
@@ -75,7 +74,7 @@ class Directory extends BaseModule
DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).'));
} else {
foreach ($profiles['entries'] as $entry) {
- $contact = Model\Contact::getByURLForUser($entry['url'], Session::getLocalUser());
+ $contact = Model\Contact::getByURLForUser($entry['url'], DI::userSession()->getLocalUserId());
if (!empty($contact)) {
$entries[] = Contact::getContactTemplateVars($contact);
}
diff --git a/src/Module/Events/Json.php b/src/Module/Events/Json.php
index 159504445..2072c4f32 100644
--- a/src/Module/Events/Json.php
+++ b/src/Module/Events/Json.php
@@ -21,7 +21,6 @@
namespace Friendica\Module\Events;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -36,7 +35,7 @@ class Json extends \Friendica\BaseModule
{
protected function rawContent(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException();
}
@@ -70,9 +69,9 @@ class Json extends \Friendica\BaseModule
// get events by id or by date
if ($event_params['event_id']) {
- $r = Event::getListById(Session::getLocalUser(), $event_params['event_id']);
+ $r = Event::getListById(DI::userSession()->getLocalUserId(), $event_params['event_id']);
} else {
- $r = Event::getListByDate(Session::getLocalUser(), $event_params);
+ $r = Event::getListByDate(DI::userSession()->getLocalUserId(), $event_params);
}
$links = [];
diff --git a/src/Module/Feed.php b/src/Module/Feed.php
index 1465e10e7..b24ccbc94 100644
--- a/src/Module/Feed.php
+++ b/src/Module/Feed.php
@@ -22,7 +22,6 @@
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Protocol\Feed as ProtocolFeed;
@@ -47,7 +46,7 @@ class Feed extends BaseModule
protected function rawContent(array $request = [])
{
$last_update = $this->getRequestValue($request, 'last_update', '');
- $nocache = !empty($request['nocache']) && Session::getLocalUser();
+ $nocache = !empty($request['nocache']) && DI::userSession()->getLocalUserId();
$type = null;
// @TODO: Replace with parameter from router
diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php
index 949bddd69..8963d1cb8 100644
--- a/src/Module/Filer/SaveTag.php
+++ b/src/Module/Filer/SaveTag.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
@@ -44,7 +43,7 @@ class SaveTag extends BaseModule
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice($this->t('You must be logged in to use this module'));
$baseUrl->redirect();
}
@@ -63,11 +62,11 @@ class SaveTag extends BaseModule
if (!DBA::isResult($item)) {
throw new HTTPException\NotFoundException();
}
- Model\Post\Category::storeFileByURIId($item['uri-id'], Session::getLocalUser(), Model\Post\Category::FILE, $term);
+ Model\Post\Category::storeFileByURIId($item['uri-id'], DI::userSession()->getLocalUserId(), Model\Post\Category::FILE, $term);
}
// return filer dialog
- $filetags = Model\Post\Category::getArray(Session::getLocalUser(), Model\Post\Category::FILE);
+ $filetags = Model\Post\Category::getArray(DI::userSession()->getLocalUserId(), Model\Post\Category::FILE);
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
echo Renderer::replaceMacros($tpl, [
diff --git a/src/Module/FollowConfirm.php b/src/Module/FollowConfirm.php
index 176466dc4..dabcd6817 100644
--- a/src/Module/FollowConfirm.php
+++ b/src/Module/FollowConfirm.php
@@ -22,7 +22,6 @@
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -34,7 +33,7 @@ class FollowConfirm extends BaseModule
protected function post(array $request = [])
{
parent::post($request);
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
if (!$uid) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
@@ -44,7 +43,7 @@ class FollowConfirm extends BaseModule
$duplex = intval($_POST['duplex'] ?? 0);
$hidden = intval($_POST['hidden'] ?? 0);
- $intro = DI::intro()->selectOneById($intro_id, Session::getLocalUser());
+ $intro = DI::intro()->selectOneById($intro_id, DI::userSession()->getLocalUserId());
Contact\Introduction::confirm($intro, $duplex, $hidden);
DI::intro()->delete($intro);
diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php
index df509885c..71d373000 100644
--- a/src/Module/FriendSuggest.php
+++ b/src/Module/FriendSuggest.php
@@ -26,7 +26,6 @@ use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Worker;
use Friendica\Database\Database;
use Friendica\DI;
@@ -54,7 +53,7 @@ class FriendSuggest extends BaseModule
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new ForbiddenException($this->t('Permission denied.'));
}
@@ -68,7 +67,7 @@ class FriendSuggest extends BaseModule
$cid = intval($this->parameters['contact']);
// We do query the "uid" as well to ensure that it is our contact
- if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => Session::getLocalUser()])) {
+ if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()])) {
throw new NotFoundException($this->t('Contact not found.'));
}
@@ -78,7 +77,7 @@ class FriendSuggest extends BaseModule
}
// 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' => Session::getLocalUser()]);
+ $contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => DI::userSession()->getLocalUserId()]);
if (empty($contact)) {
DI::sysmsg()->addNotice($this->t('Suggested contact not found.'));
return;
@@ -87,7 +86,7 @@ class FriendSuggest extends BaseModule
$note = Strings::escapeHtml(trim($_POST['note'] ?? ''));
$suggest = $this->friendSuggestRepo->save($this->friendSuggestFac->createNew(
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$cid,
$contact['name'],
$contact['url'],
@@ -105,7 +104,7 @@ class FriendSuggest extends BaseModule
{
$cid = intval($this->parameters['contact']);
- $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => Session::getLocalUser()]);
+ $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]);
if (empty($contact)) {
DI::sysmsg()->addNotice($this->t('Contact not found.'));
$this->baseUrl->redirect();
@@ -121,7 +120,7 @@ class FriendSuggest extends BaseModule
AND NOT `archive`
AND NOT `deleted`
AND `notify` != ""',
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$cid,
Protocol::DFRN,
]);
diff --git a/src/Module/Group.php b/src/Module/Group.php
index 930e885c5..3f834173a 100644
--- a/src/Module/Group.php
+++ b/src/Module/Group.php
@@ -23,7 +23,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -37,7 +36,7 @@ class Group extends BaseModule
$this->ajaxPost();
}
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect();
}
@@ -47,9 +46,9 @@ class Group extends BaseModule
BaseModule::checkFormSecurityTokenRedirectOnError('/group/new', 'group_edit');
$name = trim($request['groupname']);
- $r = Model\Group::create(Session::getLocalUser(), $name);
+ $r = Model\Group::create(DI::userSession()->getLocalUserId(), $name);
if ($r) {
- $r = Model\Group::getIdByName(Session::getLocalUser(), $name);
+ $r = Model\Group::getIdByName(DI::userSession()->getLocalUserId(), $name);
if ($r) {
DI::baseUrl()->redirect('group/' . $r);
}
@@ -63,7 +62,7 @@ class Group extends BaseModule
if ((DI::args()->getArgc() == 2) && intval(DI::args()->getArgv()[1])) {
BaseModule::checkFormSecurityTokenRedirectOnError('/group', 'group_edit');
- $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => Session::getLocalUser()]);
+ $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($group)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
DI::baseUrl()->redirect('contact');
@@ -80,7 +79,7 @@ class Group extends BaseModule
public function ajaxPost()
{
try {
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new \Exception(DI::l10n()->t('Permission denied.'), 403);
}
@@ -88,12 +87,12 @@ class Group extends BaseModule
$group_id = $this->parameters['group'];
$contact_id = $this->parameters['contact'];
- if (!Model\Group::exists($group_id, Session::getLocalUser())) {
+ if (!Model\Group::exists($group_id, DI::userSession()->getLocalUserId())) {
throw new \Exception(DI::l10n()->t('Unknown group.'), 404);
}
// @TODO Backward compatibility with user contacts, remove by version 2022.03
- $cdata = Model\Contact::getPublicAndUserContactID($contact_id, Session::getLocalUser());
+ $cdata = Model\Contact::getPublicAndUserContactID($contact_id, DI::userSession()->getLocalUserId());
if (empty($cdata['public'])) {
throw new \Exception(DI::l10n()->t('Contact not found.'), 404);
}
@@ -143,7 +142,7 @@ class Group extends BaseModule
{
$change = false;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
@@ -158,7 +157,7 @@ class Group extends BaseModule
}
// Switch to text mode interface if we have more than 'n' contacts or group members
- $switchtotext = DI::pConfig()->get(Session::getLocalUser(), 'system', 'groupedit_image_limit');
+ $switchtotext = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit');
if (is_null($switchtotext)) {
$switchtotext = DI::config()->get('system', 'groupedit_image_limit', 200);
}
@@ -210,7 +209,7 @@ class Group extends BaseModule
// @TODO: Replace with parameter from router
if (intval(DI::args()->getArgv()[2])) {
- if (!Model\Group::exists(DI::args()->getArgv()[2], Session::getLocalUser())) {
+ if (!Model\Group::exists(DI::args()->getArgv()[2], DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
DI::baseUrl()->redirect('contact');
}
@@ -226,14 +225,14 @@ class Group extends BaseModule
if ((DI::args()->getArgc() > 2) && intval(DI::args()->getArgv()[1]) && intval(DI::args()->getArgv()[2])) {
BaseModule::checkFormSecurityTokenForbiddenOnError('group_member_change', 't');
- if (DBA::exists('contact', ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser(), 'self' => false, 'pending' => false, 'blocked' => false])) {
+ if (DBA::exists('contact', ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId(), 'self' => false, 'pending' => false, 'blocked' => false])) {
$change = intval(DI::args()->getArgv()[2]);
}
}
// @TODO: Replace with parameter from router
if ((DI::args()->getArgc() > 1) && intval(DI::args()->getArgv()[1])) {
- $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => Session::getLocalUser(), 'deleted' => false]);
+ $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => DI::userSession()->getLocalUserId(), 'deleted' => false]);
if (!DBA::isResult($group)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.'));
DI::baseUrl()->redirect('contact');
@@ -316,11 +315,11 @@ class Group extends BaseModule
}
if ($nogroup) {
- $contacts = Model\Contact\Group::listUngrouped(Session::getLocalUser());
+ $contacts = Model\Contact\Group::listUngrouped(DI::userSession()->getLocalUserId());
} else {
$contacts_stmt = DBA::select('contact', [],
['rel' => [Model\Contact::FOLLOWER, Model\Contact::FRIEND, Model\Contact::SHARING],
- 'uid' => Session::getLocalUser(), 'pending' => false, 'blocked' => false, 'failed' => false, 'self' => false],
+ 'uid' => DI::userSession()->getLocalUserId(), 'pending' => false, 'blocked' => false, 'failed' => false, 'self' => false],
['order' => ['name']]
);
$contacts = DBA::toArray($contacts_stmt);
diff --git a/src/Module/HCard.php b/src/Module/HCard.php
index 4a1f0cdfa..a0a0fef1d 100644
--- a/src/Module/HCard.php
+++ b/src/Module/HCard.php
@@ -22,7 +22,6 @@
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Model\User;
@@ -36,7 +35,7 @@ class HCard extends BaseModule
{
protected function content(array $request = []): string
{
- if (Session::getLocalUser() && ($this->parameters['action'] ?? '') === 'view') {
+ if (DI::userSession()->getLocalUserId() && ($this->parameters['action'] ?? '') === 'view') {
// A logged in user views a profile of a user
$nickname = DI::app()->getLoggedInUserNickname();
} elseif (empty($this->parameters['action'])) {
@@ -78,7 +77,7 @@ class HCard extends BaseModule
$page['htmlhead'] .= " get() . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
}
- $block = (DI::config()->get('system', 'block_public') && !Session::isAuthenticated());
+ $block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());
// check if blocked
if ($block) {
diff --git a/src/Module/Home.php b/src/Module/Home.php
index 87de58a15..ca4c4b895 100644
--- a/src/Module/Home.php
+++ b/src/Module/Home.php
@@ -24,7 +24,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\Security\Login;
@@ -43,7 +42,7 @@ class Home extends BaseModule
Hook::callAll('home_init', $ret);
- if (Session::getLocalUser() && ($app->getLoggedInUserNickname())) {
+ if (DI::userSession()->getLocalUserId() && ($app->getLoggedInUserNickname())) {
DI::baseUrl()->redirect('network');
}
diff --git a/src/Module/Invite.php b/src/Module/Invite.php
index 7d502f85e..19519938d 100644
--- a/src/Module/Invite.php
+++ b/src/Module/Invite.php
@@ -24,7 +24,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\User;
@@ -39,7 +38,7 @@ class Invite extends BaseModule
{
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -53,7 +52,7 @@ class Invite extends BaseModule
$max_invites = 50;
}
- $current_invites = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'sent_invites'));
+ $current_invites = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'sent_invites'));
if ($current_invites > $max_invites) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Total invitation limit exceeded.'));
}
@@ -68,13 +67,13 @@ class Invite extends BaseModule
if ($config->get('system', 'invitation_only')) {
$invitation_only = true;
- $invites_remaining = DI::pConfig()->get(Session::getLocalUser(), 'system', 'invites_remaining');
+ $invites_remaining = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'invites_remaining');
if ((!$invites_remaining) && (!$app->isSiteAdmin())) {
throw new HTTPException\ForbiddenException();
}
}
- $user = User::getById(Session::getLocalUser());
+ $user = User::getById(DI::userSession()->getLocalUserId());
foreach ($recipients as $recipient) {
$recipient = trim($recipient);
@@ -91,7 +90,7 @@ class Invite extends BaseModule
if (!$app->isSiteAdmin()) {
$invites_remaining--;
if ($invites_remaining >= 0) {
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'invites_remaining', $invites_remaining);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'invites_remaining', $invites_remaining);
} else {
return;
}
@@ -113,7 +112,7 @@ class Invite extends BaseModule
if ($res) {
$total++;
$current_invites++;
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'sent_invites', $current_invites);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'sent_invites', $current_invites);
if ($current_invites > $max_invites) {
DI::sysmsg()->addNotice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.'));
return;
@@ -128,7 +127,7 @@ class Invite extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -139,7 +138,7 @@ class Invite extends BaseModule
if ($config->get('system', 'invitation_only')) {
$inviteOnly = true;
- $x = DI::pConfig()->get(Session::getLocalUser(), 'system', 'invites_remaining');
+ $x = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'invites_remaining');
if ((!$x) && (!$app->isSiteAdmin())) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('You have no more invitations available'));
}
diff --git a/src/Module/Item/Activity.php b/src/Module/Item/Activity.php
index ed09e8c5d..3fa6d38fc 100644
--- a/src/Module/Item/Activity.php
+++ b/src/Module/Item/Activity.php
@@ -26,7 +26,6 @@ use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Item;
-use Friendica\Core\Session;
use Friendica\Model\Post;
use Friendica\Network\HTTPException;
use Friendica\Protocol\Diaspora;
@@ -39,7 +38,7 @@ class Activity extends BaseModule
{
protected function rawContent(array $request = [])
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException();
}
@@ -51,13 +50,13 @@ class Activity extends BaseModule
$itemId = $this->parameters['id'];
if (in_array($verb, ['announce', 'unannounce'])) {
- $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [Session::getLocalUser(), 0]]);
+ $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [DI::userSession()->getLocalUserId(), 0]]);
if ($item['network'] == Protocol::DIASPORA) {
- Diaspora::performReshare($item['uri-id'], Session::getLocalUser());
+ Diaspora::performReshare($item['uri-id'], DI::userSession()->getLocalUserId());
}
}
- if (!Item::performActivity($itemId, $verb, Session::getLocalUser())) {
+ if (!Item::performActivity($itemId, $verb, DI::userSession()->getLocalUserId())) {
throw new HTTPException\BadRequestException();
}
diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php
index 41d55ad35..723c4ca16 100644
--- a/src/Module/Item/Compose.php
+++ b/src/Module/Item/Compose.php
@@ -31,7 +31,6 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -89,7 +88,7 @@ class Compose extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form('compose');
}
@@ -111,7 +110,7 @@ class Compose extends BaseModule
}
}
- $user = User::getById(Session::getLocalUser(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'default-location']);
+ $user = User::getById(DI::userSession()->getLocalUserId(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'default-location']);
$contact_allow_list = $this->ACLFormatter->expand($user['allow_cid']);
$group_allow_list = $this->ACLFormatter->expand($user['allow_gid']);
@@ -168,7 +167,7 @@ class Compose extends BaseModule
$contact = Contact::getById($a->getContactId());
- if ($this->pConfig->get(Session::getLocalUser(), 'system', 'set_creation_date')) {
+ if ($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'set_creation_date')) {
$created_at = Temporal::getDateTimeField(
new \DateTime(DBA::NULL_DATETIME),
new \DateTime('now'),
@@ -204,8 +203,8 @@ class Compose extends BaseModule
'location_disabled' => $this->l10n->t('Location services are disabled. Please check the website\'s permissions on your device'),
'wait' => $this->l10n->t('Please wait'),
'placeholdertitle' => $this->l10n->t('Set title'),
- 'placeholdercategory' => Feature::isEnabled(Session::getLocalUser(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '',
- 'always_open_compose' => $this->pConfig->get(Session::getLocalUser(), 'frio', 'always_open_compose',
+ 'placeholdercategory' => Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '',
+ 'always_open_compose' => $this->pConfig->get(DI::userSession()->getLocalUserId(), 'frio', 'always_open_compose',
$this->config->get('frio', 'always_open_compose', false)) ? '' :
$this->l10n->t('You can make this page always open when you use the New Post button in the Theme Customization settings .'),
],
diff --git a/src/Module/Item/Follow.php b/src/Module/Item/Follow.php
index 331e5fe76..c28e49c8c 100644
--- a/src/Module/Item/Follow.php
+++ b/src/Module/Item/Follow.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Item;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Item;
@@ -38,7 +37,7 @@ class Follow extends BaseModule
{
$l10n = DI::l10n();
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
@@ -48,7 +47,7 @@ class Follow extends BaseModule
$itemId = intval($this->parameters['id']);
- if (!Item::performActivity($itemId, 'follow', Session::getLocalUser())) {
+ if (!Item::performActivity($itemId, 'follow', DI::userSession()->getLocalUserId())) {
throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
}
diff --git a/src/Module/Item/Ignore.php b/src/Module/Item/Ignore.php
index 86e3172b4..90b2809f2 100644
--- a/src/Module/Item/Ignore.php
+++ b/src/Module/Item/Ignore.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Item;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Item;
@@ -38,7 +37,7 @@ class Ignore extends BaseModule
{
$l10n = DI::l10n();
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
@@ -55,10 +54,10 @@ class Ignore extends BaseModule
throw new HTTPException\NotFoundException();
}
- $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], Session::getLocalUser());
+ $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], DI::userSession()->getLocalUserId());
- if (in_array($thread['uid'], [0, Session::getLocalUser()])) {
- Post\ThreadUser::setIgnored($thread['uri-id'], Session::getLocalUser(), $ignored);
+ if (in_array($thread['uid'], [0, DI::userSession()->getLocalUserId()])) {
+ Post\ThreadUser::setIgnored($thread['uri-id'], DI::userSession()->getLocalUserId(), $ignored);
} else {
throw new HTTPException\BadRequestException();
}
diff --git a/src/Module/Item/Pin.php b/src/Module/Item/Pin.php
index 22e8a2679..a2d44f363 100644
--- a/src/Module/Item/Pin.php
+++ b/src/Module/Item/Pin.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Item;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -38,7 +37,7 @@ class Pin extends BaseModule
{
$l10n = DI::l10n();
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
@@ -53,16 +52,16 @@ class Pin extends BaseModule
throw new HTTPException\NotFoundException();
}
- if (!in_array($item['uid'], [0, Session::getLocalUser()])) {
+ if (!in_array($item['uid'], [0, DI::userSession()->getLocalUserId()])) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
$pinned = !$item['featured'];
if ($pinned) {
- Post\Collection::add($item['uri-id'], Post\Collection::FEATURED, $item['author-id'], Session::getLocalUser());
+ Post\Collection::add($item['uri-id'], Post\Collection::FEATURED, $item['author-id'], DI::userSession()->getLocalUserId());
} else {
- Post\Collection::remove($item['uri-id'], Post\Collection::FEATURED, Session::getLocalUser());
+ Post\Collection::remove($item['uri-id'], Post\Collection::FEATURED, DI::userSession()->getLocalUserId());
}
// See if we've been passed a return path to redirect to
diff --git a/src/Module/Item/Star.php b/src/Module/Item/Star.php
index 02222cb03..6796d7bfc 100644
--- a/src/Module/Item/Star.php
+++ b/src/Module/Item/Star.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Item;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -39,7 +38,7 @@ class Star extends BaseModule
{
$l10n = DI::l10n();
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
}
@@ -50,13 +49,13 @@ class Star extends BaseModule
$itemId = intval($this->parameters['id']);
- $item = Post::selectFirstForUser(Session::getLocalUser(), ['uid', 'uri-id', 'starred'], ['uid' => [0, Session::getLocalUser()], 'id' => $itemId]);
+ $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['uid', 'uri-id', 'starred'], ['uid' => [0, DI::userSession()->getLocalUserId()], 'id' => $itemId]);
if (empty($item)) {
throw new HTTPException\NotFoundException();
}
if ($item['uid'] == 0) {
- $stored = Item::storeForUserByUriId($item['uri-id'], Session::getLocalUser(), ['post-reason' => Item::PR_ACTIVITY]);
+ $stored = Item::storeForUserByUriId($item['uri-id'], DI::userSession()->getLocalUserId(), ['post-reason' => Item::PR_ACTIVITY]);
if (!empty($stored)) {
$item = Post::selectFirst(['starred'], ['id' => $stored]);
if (!DBA::isResult($item)) {
diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php
index a139d85a6..84130bd91 100644
--- a/src/Module/NoScrape.php
+++ b/src/Module/NoScrape.php
@@ -22,7 +22,6 @@
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -43,7 +42,7 @@ class NoScrape extends BaseModule
if (isset($this->parameters['nick'])) {
// Get infos about a specific nick (public)
$which = $this->parameters['nick'];
- } elseif (Session::getLocalUser() && isset($this->parameters['profile']) && DI::args()->get(2) == 'view') {
+ } elseif (DI::userSession()->getLocalUserId() && isset($this->parameters['profile']) && DI::args()->get(2) == 'view') {
// view infos about a known profile (needs a login)
$which = $a->getLoggedInUserNickname();
} else {
diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php
index 776c146de..5b6ccc745 100644
--- a/src/Module/Notifications/Introductions.php
+++ b/src/Module/Notifications/Introductions.php
@@ -30,7 +30,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\BaseNotifications;
@@ -99,7 +98,7 @@ class Introductions extends BaseNotifications
'text' => (!$all ? $this->t('Show Ignored Requests') : $this->t('Hide Ignored Requests')),
];
- $owner = User::getOwnerDataById(Session::getLocalUser());
+ $owner = User::getOwnerDataById(DI::userSession()->getLocalUserId());
// Loop through all introduction notifications.This creates an array with the output html for each
// introduction
diff --git a/src/Module/Notifications/Notification.php b/src/Module/Notifications/Notification.php
index 15364615f..ff33dd41a 100644
--- a/src/Module/Notifications/Notification.php
+++ b/src/Module/Notifications/Notification.php
@@ -26,7 +26,6 @@ use Friendica\BaseModule;
use Friendica\Contact\Introduction\Repository\Introduction;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -73,14 +72,14 @@ class Notification extends BaseModule
*/
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException($this->l10n->t('Permission denied.'));
}
$request_id = $this->parameters['id'] ?? false;
if ($request_id) {
- $intro = $this->introductionRepo->selectOneById($request_id, Session::getLocalUser());
+ $intro = $this->introductionRepo->selectOneById($request_id, DI::userSession()->getLocalUserId());
switch ($_POST['submit']) {
case $this->l10n->t('Discard'):
@@ -104,14 +103,14 @@ class Notification extends BaseModule
*/
protected function rawContent(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException($this->l10n->t('Permission denied.'));
}
if ($this->args->get(1) === 'mark' && $this->args->get(2) === 'all') {
try {
- $this->notificationRepo->setAllSeenForUser(Session::getLocalUser());
- $success = $this->notifyRepo->setAllSeenForUser(Session::getLocalUser());
+ $this->notificationRepo->setAllSeenForUser(DI::userSession()->getLocalUserId());
+ $success = $this->notifyRepo->setAllSeenForUser(DI::userSession()->getLocalUserId());
} catch (\Exception $e) {
$this->logger->warning('set all seen failed.', ['exception' => $e]);
$success = false;
@@ -132,7 +131,7 @@ class Notification extends BaseModule
*/
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice($this->l10n->t('You must be logged in to show this page.'));
return Login::form();
}
@@ -151,11 +150,11 @@ class Notification extends BaseModule
private function handleNotify(int $notifyId)
{
$Notify = $this->notifyRepo->selectOneById($notifyId);
- if ($Notify->uid !== Session::getLocalUser()) {
+ if ($Notify->uid !== DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
- if ($this->pconfig->get(Session::getLocalUser(), 'system', 'detailed_notif')) {
+ if ($this->pconfig->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
$Notify->setSeen();
$this->notifyRepo->save($Notify);
} else {
@@ -176,11 +175,11 @@ class Notification extends BaseModule
private function handleNotification(int $notificationId)
{
$Notification = $this->notificationRepo->selectOneById($notificationId);
- if ($Notification->uid !== Session::getLocalUser()) {
+ if ($Notification->uid !== DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
- if ($this->pconfig->get(Session::getLocalUser(), 'system', 'detailed_notif')) {
+ if ($this->pconfig->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
$Notification->setSeen();
$this->notificationRepo->save($Notification);
} else {
diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php
index 0a2d02390..a0fe8e9ae 100644
--- a/src/Module/Notifications/Ping.php
+++ b/src/Module/Notifications/Ping.php
@@ -28,7 +28,6 @@ use Friendica\Content\ForumManager;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -91,18 +90,18 @@ class Ping extends BaseModule
$today_birthday_count = 0;
- if (Session::getLocalUser()) {
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'detailed_notif')) {
- $notifications = $this->notificationRepo->selectDetailedForUser(Session::getLocalUser());
+ if (DI::userSession()->getLocalUserId()) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
+ $notifications = $this->notificationRepo->selectDetailedForUser(DI::userSession()->getLocalUserId());
} else {
- $notifications = $this->notificationRepo->selectDigestForUser(Session::getLocalUser());
+ $notifications = $this->notificationRepo->selectDigestForUser(DI::userSession()->getLocalUserId());
}
$condition = [
"`unseen` AND `uid` = ? AND NOT `origin` AND (`vid` != ? OR `vid` IS NULL)",
- Session::getLocalUser(), Verb::getID(Activity::FOLLOW)
+ DI::userSession()->getLocalUserId(), Verb::getID(Activity::FOLLOW)
];
- $items = Post::selectForUser(Session::getLocalUser(), ['wall', 'uid', 'uri-id'], $condition, ['limit' => 1000]);
+ $items = Post::selectForUser(DI::userSession()->getLocalUserId(), ['wall', 'uid', 'uri-id'], $condition, ['limit' => 1000]);
if (DBA::isResult($items)) {
$items_unseen = Post::toArray($items, false);
$arr = ['items' => $items_unseen];
@@ -140,12 +139,12 @@ class Ping extends BaseModule
}
}
- $intros = $this->introductionRepo->selectForUser(Session::getLocalUser());
+ $intros = $this->introductionRepo->selectForUser(DI::userSession()->getLocalUserId());
$intro_count = $intros->count();
$myurl = DI::baseUrl() . '/profile/' . DI::app()->getLoggedInUserNickname();
- $mail_count = DBA::count('mail', ["`uid` = ? AND NOT `seen` AND `from-url` != ?", Session::getLocalUser(), $myurl]);
+ $mail_count = DBA::count('mail', ["`uid` = ? AND NOT `seen` AND `from-url` != ?", DI::userSession()->getLocalUserId(), $myurl]);
if (intval(DI::config()->get('config', 'register_policy')) === Register::APPROVE && DI::app()->isSiteAdmin()) {
$regs = \Friendica\Model\Register::getPending();
@@ -155,12 +154,12 @@ class Ping extends BaseModule
}
}
- $cachekey = 'ping:events:' . Session::getLocalUser();
+ $cachekey = 'ping:events:' . DI::userSession()->getLocalUserId();
$ev = DI::cache()->get($cachekey);
if (is_null($ev)) {
$ev = DBA::selectToArray('event', ['type', 'start'],
["`uid` = ? AND `start` < ? AND `finish` > ? AND NOT `ignore`",
- Session::getLocalUser(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utcNow()]);
+ DI::userSession()->getLocalUserId(), DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utcNow()]);
DI::cache()->set($cachekey, $ev, Duration::HOUR);
}
@@ -188,7 +187,7 @@ class Ping extends BaseModule
}
}
- $owner = User::getOwnerDataById(Session::getLocalUser());
+ $owner = User::getOwnerDataById(DI::userSession()->getLocalUserId());
$navNotifications = array_map(function (Entity\Notification $notification) use ($owner) {
if (!DI::notify()->NotifyOnDesktop($notification)) {
@@ -215,7 +214,7 @@ class Ping extends BaseModule
}
if (DBA::isResult($regs)) {
- if (count($regs) <= 1 || DI::pConfig()->get(Session::getLocalUser(), 'system', 'detailed_notif')) {
+ if (count($regs) <= 1 || DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
foreach ($regs as $reg) {
$navNotifications[] = $this->formattedNavNotification->createFromParams(
[
diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php
index 1fa142362..a3cc04fe3 100644
--- a/src/Module/OAuth/Authorize.php
+++ b/src/Module/OAuth/Authorize.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\OAuth;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\BaseApi;
use Friendica\Security\OAuth;
@@ -71,7 +70,7 @@ class Authorize extends BaseApi
unset($redirect_request['pagename']);
$redirect = 'oauth/authorize?' . http_build_query($redirect_request);
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
if (empty($uid)) {
Logger::info('Redirect to login');
DI::app()->redirect('login?return_path=' . urlencode($redirect));
diff --git a/src/Module/PermissionTooltip.php b/src/Module/PermissionTooltip.php
index 453bb5d3a..c1ef4c2b4 100644
--- a/src/Module/PermissionTooltip.php
+++ b/src/Module/PermissionTooltip.php
@@ -22,7 +22,6 @@
namespace Friendica\Module;
use Friendica\Core\Hook;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -50,7 +49,7 @@ class PermissionTooltip extends \Friendica\BaseModule
throw new HTTPException\BadRequestException(DI::l10n()->t('Wrong type "%s", expected one of: %s', $type, implode(', ', $expectedTypes)));
}
- $condition = ['id' => $referenceId, 'uid' => [0, Session::getLocalUser()]];
+ $condition = ['id' => $referenceId, 'uid' => [0, DI::userSession()->getLocalUserId()]];
if ($type == 'item') {
$fields = ['uid', 'psid', 'private', 'uri-id'];
$model = Post::selectFirst($fields, $condition);
@@ -178,7 +177,7 @@ class PermissionTooltip extends \Friendica\BaseModule
private function fetchReceivers(int $uriId): string
{
$own_url = '';
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
if ($uid) {
$owner = User::getOwnerDataById($uid);
if (!empty($owner['url'])) {
diff --git a/src/Module/Photo.php b/src/Module/Photo.php
index 112f01d45..1847b4f70 100644
--- a/src/Module/Photo.php
+++ b/src/Module/Photo.php
@@ -24,7 +24,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -259,7 +258,7 @@ class Photo extends BaseModule
return MPhoto::getPhoto($matches[1], $matches[2]);
}
- return MPhoto::createPhotoForExternalResource($url, (int)Session::getLocalUser(), $media['mimetype'] ?? '');
+ return MPhoto::createPhotoForExternalResource($url, (int)DI::userSession()->getLocalUserId(), $media['mimetype'] ?? '');
case 'media':
$media = DBA::selectFirst('post-media', ['url', 'mimetype', 'uri-id'], ['id' => $id, 'type' => Post\Media::IMAGE]);
if (empty($media)) {
@@ -270,14 +269,14 @@ class Photo extends BaseModule
return MPhoto::getPhoto($matches[1], $matches[2]);
}
- return MPhoto::createPhotoForExternalResource($media['url'], (int)Session::getLocalUser(), $media['mimetype']);
+ return MPhoto::createPhotoForExternalResource($media['url'], (int)DI::userSession()->getLocalUserId(), $media['mimetype']);
case 'link':
$link = DBA::selectFirst('post-link', ['url', 'mimetype'], ['id' => $id]);
if (empty($link)) {
return false;
}
- return MPhoto::createPhotoForExternalResource($link['url'], (int)Session::getLocalUser(), $link['mimetype'] ?? '');
+ return MPhoto::createPhotoForExternalResource($link['url'], (int)DI::userSession()->getLocalUserId(), $link['mimetype'] ?? '');
case 'contact':
$fields = ['uid', 'uri-id', 'url', 'nurl', 'avatar', 'photo', 'xmpp', 'addr', 'network', 'failed', 'updated'];
$contact = Contact::getById($id, $fields);
diff --git a/src/Module/Profile/Common.php b/src/Module/Profile/Common.php
index 6e4b7c693..6837e0f82 100644
--- a/src/Module/Profile/Common.php
+++ b/src/Module/Profile/Common.php
@@ -25,7 +25,6 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Module;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -37,7 +36,7 @@ class Common extends BaseProfile
{
protected function content(array $request = []): string
{
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
@@ -56,7 +55,7 @@ class Common extends BaseProfile
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
- $displayCommonTab = Session::isAuthenticated() && $profile['uid'] != Session::getLocalUser();
+ $displayCommonTab = DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId();
if (!$displayCommonTab) {
$a->redirect('profile/' . $nickname . '/contacts');
diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php
index eab1c5cef..6397ff459 100644
--- a/src/Module/Profile/Contacts.php
+++ b/src/Module/Profile/Contacts.php
@@ -25,7 +25,6 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
@@ -36,7 +35,7 @@ class Contacts extends Module\BaseProfile
{
protected function content(array $request = []): string
{
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
@@ -50,7 +49,7 @@ class Contacts extends Module\BaseProfile
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
- $is_owner = $profile['uid'] == Session::getLocalUser();
+ $is_owner = $profile['uid'] == DI::userSession()->getLocalUserId();
if ($profile['hide-friends'] && !$is_owner) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -60,7 +59,7 @@ class Contacts extends Module\BaseProfile
$o = self::getTabsHTML($a, 'contacts', $is_owner, $profile['nickname'], $profile['hide-friends']);
- $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, Session::isAuthenticated() && $profile['uid'] != Session::getLocalUser());
+ $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId());
$condition = [
'uid' => $profile['uid'],
diff --git a/src/Module/Profile/Media.php b/src/Module/Profile/Media.php
index d98021089..bae2f9ad8 100644
--- a/src/Module/Profile/Media.php
+++ b/src/Module/Profile/Media.php
@@ -21,7 +21,6 @@
namespace Friendica\Module\Profile;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile as ProfileModel;
@@ -43,7 +42,7 @@ class Media extends BaseProfile
DI::page()['htmlhead'] .= ' ' . "\n";
}
- $is_owner = Session::getLocalUser() == $profile['uid'];
+ $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
$o = self::getTabsHTML($a, 'media', $is_owner, $profile['nickname'], $profile['hide-friends']);
diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php
index bec9366ae..a60266093 100644
--- a/src/Module/Profile/Profile.php
+++ b/src/Module/Profile/Profile.php
@@ -29,7 +29,6 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -82,13 +81,13 @@ class Profile extends BaseProfile
throw new HTTPException\NotFoundException(DI::l10n()->t('Profile not found.'));
}
- $remote_contact_id = Session::getRemoteContactID($profile['uid']);
+ $remote_contact_id = DI::userSession()->getRemoteContactID($profile['uid']);
- if (DI::config()->get('system', 'block_public') && !Session::getLocalUser() && !$remote_contact_id) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !$remote_contact_id) {
return Login::form();
}
- $is_owner = Session::getLocalUser() == $profile['uid'];
+ $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact_id) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
@@ -102,7 +101,7 @@ class Profile extends BaseProfile
Nav::setSelected('home');
- $is_owner = Session::getLocalUser() == $profile['uid'];
+ $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
$o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact_id) {
@@ -117,7 +116,7 @@ class Profile extends BaseProfile
$view_as_contact_id = intval($_GET['viewas'] ?? 0);
$view_as_contacts = Contact::selectToArray(['id', 'name'], [
- 'uid' => Session::getLocalUser(),
+ 'uid' => DI::userSession()->getLocalUserId(),
'rel' => [Contact::FOLLOWER, Contact::SHARING, Contact::FRIEND],
'network' => Protocol::DFRN,
'blocked' => false,
@@ -247,7 +246,7 @@ class Profile extends BaseProfile
'$submit' => DI::l10n()->t('Submit'),
'$basic' => DI::l10n()->t('Basic'),
'$advanced' => DI::l10n()->t('Advanced'),
- '$is_owner' => $profile['uid'] == Session::getLocalUser(),
+ '$is_owner' => $profile['uid'] == DI::userSession()->getLocalUserId(),
'$query_string' => DI::args()->getQueryString(),
'$basic_fields' => $basic_fields,
'$custom_fields' => $custom_fields,
@@ -308,8 +307,8 @@ class Profile extends BaseProfile
}
// site block
- $blocked = !Session::getLocalUser() && !$remote_contact_id && DI::config()->get('system', 'block_public');
- $userblock = !Session::getLocalUser() && !$remote_contact_id && $profile['hidewall'];
+ $blocked = !DI::userSession()->getLocalUserId() && !$remote_contact_id && DI::config()->get('system', 'block_public');
+ $userblock = !DI::userSession()->getLocalUserId() && !$remote_contact_id && $profile['hidewall'];
if (!$blocked && !$userblock) {
$keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], $profile['pub_keywords'] ?? '');
if (strlen($keywords)) {
diff --git a/src/Module/Profile/Schedule.php b/src/Module/Profile/Schedule.php
index 590786824..0e1f92018 100644
--- a/src/Module/Profile/Schedule.php
+++ b/src/Module/Profile/Schedule.php
@@ -24,7 +24,6 @@ namespace Friendica\Module\Profile;
use Friendica\BaseModule;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post;
@@ -36,7 +35,7 @@ class Schedule extends BaseProfile
{
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -44,7 +43,7 @@ class Schedule extends BaseProfile
throw new HTTPException\BadRequestException();
}
- if (!DBA::exists('delayed-post', ['id' => $_REQUEST['delete'], 'uid' => Session::getLocalUser()])) {
+ if (!DBA::exists('delayed-post', ['id' => $_REQUEST['delete'], 'uid' => DI::userSession()->getLocalUserId()])) {
throw new HTTPException\NotFoundException();
}
@@ -53,7 +52,7 @@ class Schedule extends BaseProfile
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -62,7 +61,7 @@ class Schedule extends BaseProfile
$o = self::getTabsHTML($a, 'schedule', true, $a->getLoggedInUserNickname(), false);
$schedule = [];
- $delayed = DBA::select('delayed-post', [], ['uid' => Session::getLocalUser()]);
+ $delayed = DBA::select('delayed-post', [], ['uid' => DI::userSession()->getLocalUserId()]);
while ($row = DBA::fetch($delayed)) {
$parameter = Post\Delayed::getParametersForid($row['id']);
if (empty($parameter)) {
diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php
index e10a95822..951a0e327 100644
--- a/src/Module/Profile/Status.php
+++ b/src/Module/Profile/Status.php
@@ -26,7 +26,6 @@ use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\ACL;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -92,19 +91,19 @@ class Status extends BaseProfile
$hashtags = $_GET['tag'] ?? '';
- if (DI::config()->get('system', 'block_public') && !Session::getLocalUser() && !Session::getRemoteContactID($profile['uid'])) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($profile['uid'])) {
return Login::form();
}
$o = '';
- if ($profile['uid'] == Session::getLocalUser()) {
+ if ($profile['uid'] == DI::userSession()->getLocalUserId()) {
Nav::setSelected('home');
}
- $remote_contact = Session::getRemoteContactID($profile['uid']);
- $is_owner = Session::getLocalUser() == $profile['uid'];
- $last_updated_key = "profile:" . $profile['uid'] . ":" . Session::getLocalUser() . ":" . $remote_contact;
+ $remote_contact = DI::userSession()->getRemoteContactID($profile['uid']);
+ $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
+ $last_updated_key = "profile:" . $profile['uid'] . ":" . DI::userSession()->getLocalUserId() . ":" . $remote_contact;
if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact) {
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
@@ -166,10 +165,10 @@ class Status extends BaseProfile
}
if (DI::mode()->isMobile()) {
- $itemspage_network = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemspage_network = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -197,9 +196,9 @@ class Status extends BaseProfile
}
if ($is_owner) {
- $unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => Session::getLocalUser()]);
+ $unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
if ($unseen) {
- Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => Session::getLocalUser()]);
+ Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
}
}
diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php
index 81d142a08..e8f8b7911 100644
--- a/src/Module/Proxy.php
+++ b/src/Module/Proxy.php
@@ -23,7 +23,6 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
@@ -75,7 +74,7 @@ class Proxy extends BaseModule
throw new \Friendica\Network\HTTPException\BadRequestException();
}
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
Logger::debug('Redirecting not logged in user to original address', ['url' => $request['url']]);
System::externalRedirect($request['url']);
}
@@ -84,7 +83,7 @@ class Proxy extends BaseModule
$request['url'] = str_replace(' ', '+', $request['url']);
// Fetch the content with the local user
- $fetchResult = HTTPSignature::fetchRaw($request['url'], Session::getLocalUser(), [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE], 'timeout' => 10]);
+ $fetchResult = HTTPSignature::fetchRaw($request['url'], DI::userSession()->getLocalUserId(), [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE], 'timeout' => 10]);
$img_str = $fetchResult->getBody();
if (!$fetchResult->isSuccess() || empty($img_str)) {
@@ -93,7 +92,7 @@ class Proxy extends BaseModule
// stop.
}
- Logger::debug('Got picture', ['Content-Type' => $fetchResult->getHeader('Content-Type'), 'uid' => Session::getLocalUser(), 'image' => $request['url']]);
+ Logger::debug('Got picture', ['Content-Type' => $fetchResult->getHeader('Content-Type'), 'uid' => DI::userSession()->getLocalUserId(), 'image' => $request['url']]);
$mime = Images::getMimeTypeByData($img_str);
diff --git a/src/Module/Register.php b/src/Module/Register.php
index 0e6ff18f2..9e79dabbe 100644
--- a/src/Module/Register.php
+++ b/src/Module/Register.php
@@ -29,7 +29,6 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -74,20 +73,20 @@ class Register extends BaseModule
// 'block_extended_register' blocks all registrations, period.
$block = DI::config()->get('system', 'block_extended_register');
- if (Session::getLocalUser() && $block) {
+ if (DI::userSession()->getLocalUserId() && $block) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return '';
}
- if (Session::getLocalUser()) {
- $user = DBA::selectFirst('user', ['parent-uid'], ['uid' => Session::getLocalUser()]);
+ if (DI::userSession()->getLocalUserId()) {
+ $user = DBA::selectFirst('user', ['parent-uid'], ['uid' => DI::userSession()->getLocalUserId()]);
if (!empty($user['parent-uid'])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Only parent users can create additional accounts.'));
return '';
}
}
- if (!Session::getLocalUser() && (intval(DI::config()->get('config', 'register_policy')) === self::CLOSED)) {
+ if (!DI::userSession()->getLocalUserId() && (intval(DI::config()->get('config', 'register_policy')) === self::CLOSED)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return '';
}
@@ -109,7 +108,7 @@ class Register extends BaseModule
$photo = $_REQUEST['photo'] ?? '';
$invite_id = $_REQUEST['invite_id'] ?? '';
- if (Session::getLocalUser() || DI::config()->get('system', 'no_openid')) {
+ if (DI::userSession()->getLocalUserId() || DI::config()->get('system', 'no_openid')) {
$fillwith = '';
$fillext = '';
$oidlabel = '';
@@ -180,7 +179,7 @@ class Register extends BaseModule
'$form_security_token' => BaseModule::getFormSecurityToken('register'),
'$explicit_content' => DI::config()->get('system', 'explicit_content', false),
'$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'),
- '$additional' => !empty(Session::getLocalUser()),
+ '$additional' => !empty(DI::userSession()->getLocalUserId()),
'$parent_password' => ['parent_password', DI::l10n()->t('Parent Password:'), '', DI::l10n()->t('Please enter the password of the parent account to legitimize your request.')]
]);
@@ -203,19 +202,19 @@ class Register extends BaseModule
$additional_account = false;
- if (!Session::getLocalUser() && !empty($arr['post']['parent_password'])) {
+ if (!DI::userSession()->getLocalUserId() && !empty($arr['post']['parent_password'])) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
- } elseif (Session::getLocalUser() && !empty($arr['post']['parent_password'])) {
+ } elseif (DI::userSession()->getLocalUserId() && !empty($arr['post']['parent_password'])) {
try {
- Model\User::getIdFromPasswordAuthentication(Session::getLocalUser(), $arr['post']['parent_password']);
+ Model\User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $arr['post']['parent_password']);
} catch (\Exception $ex) {
DI::sysmsg()->addNotice(DI::l10n()->t("Password doesn't match."));
$regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata));
}
$additional_account = true;
- } elseif (Session::getLocalUser()) {
+ } elseif (DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Please enter your password.'));
$regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata));
@@ -263,7 +262,7 @@ class Register extends BaseModule
}
if ($additional_account) {
- $user = DBA::selectFirst('user', ['email'], ['uid' => Session::getLocalUser()]);
+ $user = DBA::selectFirst('user', ['email'], ['uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($user)) {
DI::sysmsg()->addNotice(DI::l10n()->t('User not found.'));
DI::baseUrl()->redirect('register');
@@ -307,7 +306,7 @@ class Register extends BaseModule
}
if ($additional_account) {
- DBA::update('user', ['parent-uid' => Session::getLocalUser()], ['uid' => $user['uid']]);
+ DBA::update('user', ['parent-uid' => DI::userSession()->getLocalUserId()], ['uid' => $user['uid']]);
DI::sysmsg()->addInfo(DI::l10n()->t('The additional account was created.'));
DI::baseUrl()->redirect('delegation');
}
diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php
index e8db9df53..ddf45303b 100644
--- a/src/Module/Search/Acl.php
+++ b/src/Module/Search/Acl.php
@@ -27,7 +27,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -52,7 +51,7 @@ class Acl extends BaseModule
protected function rawContent(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
}
@@ -114,8 +113,8 @@ class Acl extends BaseModule
Logger::info('ACL {action} - {subaction} - start', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]);
$sql_extra = '';
- $condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", Session::getLocalUser()];
- $condition_group = ["`uid` = ? AND NOT `deleted`", Session::getLocalUser()];
+ $condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", DI::userSession()->getLocalUserId()];
+ $condition_group = ["`uid` = ? AND NOT `deleted`", DI::userSession()->getLocalUserId()];
if ($search != '') {
$sql_extra = "AND `name` LIKE '%%" . DBA::escape($search) . "%%'";
@@ -177,7 +176,7 @@ class Acl extends BaseModule
GROUP BY `group`.`name`, `group`.`id`
ORDER BY `group`.`name`
LIMIT ?, ?",
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$start,
$count
));
@@ -252,7 +251,7 @@ class Acl extends BaseModule
$condition = ["`parent` = ?", $conv_id];
$params = ['order' => ['author-name' => true]];
- $authors = Post::selectForUser(Session::getLocalUser(), ['author-link'], $condition, $params);
+ $authors = Post::selectForUser(DI::userSession()->getLocalUserId(), ['author-link'], $condition, $params);
$item_authors = [];
while ($author = Post::fetch($authors)) {
$item_authors[$author['author-link']] = $author['author-link'];
diff --git a/src/Module/Search/Directory.php b/src/Module/Search/Directory.php
index a572dcd80..7eb11118c 100644
--- a/src/Module/Search/Directory.php
+++ b/src/Module/Search/Directory.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Search;
use Friendica\Content\Widget;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\BaseSearch;
use Friendica\Module\Security\Login;
@@ -34,7 +33,7 @@ class Directory extends BaseSearch
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
diff --git a/src/Module/Search/Filed.php b/src/Module/Search/Filed.php
index 5f3c30f9b..50b69aeaa 100644
--- a/src/Module/Search/Filed.php
+++ b/src/Module/Search/Filed.php
@@ -26,7 +26,6 @@ use Friendica\Content\Pager;
use Friendica\Content\Text\HTML;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
@@ -39,13 +38,13 @@ class Filed extends BaseSearch
{
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form();
}
DI::page()['aside'] .= Widget::fileAs(DI::args()->getCommand(), $_GET['file'] ?? '');
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll') && ($_GET['mode'] ?? '') != 'minimal') {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll') && ($_GET['mode'] ?? '') != 'minimal') {
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$o = Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
} else {
@@ -60,10 +59,10 @@ class Filed extends BaseSearch
}
if (DI::mode()->isMobile()) {
- $itemspage_network = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemspage_network = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -71,7 +70,7 @@ class Filed extends BaseSearch
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemspage_network);
- $term_condition = ['type' => Category::FILE, 'uid' => Session::getLocalUser()];
+ $term_condition = ['type' => Category::FILE, 'uid' => DI::userSession()->getLocalUserId()];
if ($file) {
$term_condition['name'] = $file;
}
@@ -94,14 +93,14 @@ class Filed extends BaseSearch
if (count($posts) == 0) {
return '';
}
- $item_condition = ['uid' => [0, Session::getLocalUser()], 'uri-id' => $posts];
+ $item_condition = ['uid' => [0, DI::userSession()->getLocalUserId()], 'uri-id' => $posts];
$item_params = ['order' => ['uri-id' => true, 'uid' => true]];
- $items = Post::toArray(Post::selectForUser(Session::getLocalUser(), Item::DISPLAY_FIELDLIST, $item_condition, $item_params));
+ $items = Post::toArray(Post::selectForUser(DI::userSession()->getLocalUserId(), Item::DISPLAY_FIELDLIST, $item_condition, $item_params));
- $o .= DI::conversation()->create($items, 'filed', false, false, '', Session::getLocalUser());
+ $o .= DI::conversation()->create($items, 'filed', false, false, '', DI::userSession()->getLocalUserId());
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$o .= HTML::scrollLoader();
} else {
$o .= $pager->renderMinimal($count);
diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php
index 131cb5292..f4e1db614 100644
--- a/src/Module/Search/Index.php
+++ b/src/Module/Search/Index.php
@@ -31,7 +31,6 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -61,15 +60,15 @@ class Index extends BaseSearch
{
$search = (!empty($_GET['q']) ? trim(rawurldecode($_GET['q'])) : '');
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
}
- if (DI::config()->get('system', 'local_search') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'local_search') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.'));
}
- if (DI::config()->get('system', 'permit_crawling') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'permit_crawling') && !DI::userSession()->isAuthenticated()) {
// Default values:
// 10 requests are "free", after the 11th only a call per minute is allowed
@@ -94,7 +93,7 @@ class Index extends BaseSearch
}
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
DI::page()['aside'] .= Widget\SavedSearches::getHTML(Search::getSearchPath($search), $search);
}
@@ -161,10 +160,10 @@ class Index extends BaseSearch
// No items will be shown if the member has a blocked profile wall.
if (DI::mode()->isMobile()) {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
+ $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -174,19 +173,19 @@ class Index extends BaseSearch
if ($tag) {
Logger::info('Start tag search.', ['q' => $search]);
- $uriids = Tag::getURIIdListByTag($search, Session::getLocalUser(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
- $count = Tag::countByTag($search, Session::getLocalUser());
+ $uriids = Tag::getURIIdListByTag($search, DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
+ $count = Tag::countByTag($search, DI::userSession()->getLocalUserId());
} else {
Logger::info('Start fulltext search.', ['q' => $search]);
- $uriids = Post\Content::getURIIdListBySearch($search, Session::getLocalUser(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
- $count = Post\Content::countBySearch($search, Session::getLocalUser());
+ $uriids = Post\Content::getURIIdListBySearch($search, DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
+ $count = Post\Content::countBySearch($search, DI::userSession()->getLocalUserId());
}
if (!empty($uriids)) {
- $condition = ["(`uid` = ? OR (`uid` = ? AND NOT `global`))", 0, Session::getLocalUser()];
+ $condition = ["(`uid` = ? OR (`uid` = ? AND NOT `global`))", 0, DI::userSession()->getLocalUserId()];
$condition = DBA::mergeConditions($condition, ['uri-id' => $uriids]);
$params = ['order' => ['id' => true]];
- $items = Post::toArray(Post::selectForUser(Session::getLocalUser(), Item::DISPLAY_FIELDLIST, $condition, $params));
+ $items = Post::toArray(Post::selectForUser(DI::userSession()->getLocalUserId(), Item::DISPLAY_FIELDLIST, $condition, $params));
}
if (empty($items)) {
@@ -196,7 +195,7 @@ class Index extends BaseSearch
return $o;
}
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$o .= Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
}
@@ -213,9 +212,9 @@ class Index extends BaseSearch
Logger::info('Start Conversation.', ['q' => $search]);
- $o .= DI::conversation()->create($items, 'search', false, false, 'commented', Session::getLocalUser());
+ $o .= DI::conversation()->create($items, 'search', false, false, 'commented', DI::userSession()->getLocalUserId());
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll')) {
$o .= HTML::scrollLoader();
} else {
$o .= $pager->renderMinimal($count);
@@ -254,9 +253,9 @@ class Index extends BaseSearch
$search = $matches[1];
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
// User-specific contact URL/address search
- $contact_id = Contact::getIdForURL($search, Session::getLocalUser());
+ $contact_id = Contact::getIdForURL($search, DI::userSession()->getLocalUserId());
if (!$contact_id) {
// User-specific contact URL/address search and probe
$contact_id = Contact::getIdForURL($search);
@@ -293,9 +292,9 @@ class Index extends BaseSearch
$search = Network::convertToIdn($search);
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
// Post URL search
- $item_id = Item::fetchByLink($search, Session::getLocalUser());
+ $item_id = Item::fetchByLink($search, DI::userSession()->getLocalUserId());
if (!$item_id) {
// If the user-specific search failed, we search and probe a public post
$item_id = Item::fetchByLink($search);
diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php
index 784c8efbc..29918f032 100644
--- a/src/Module/Search/Saved.php
+++ b/src/Module/Search/Saved.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Module\Response;
@@ -51,10 +50,10 @@ class Saved extends BaseModule
$return_url = $_GET['return_url'] ?? Search::getSearchPath($search);
- if (Session::getLocalUser() && $search) {
+ if (DI::userSession()->getLocalUserId() && $search) {
switch ($action) {
case 'add':
- $fields = ['uid' => Session::getLocalUser(), 'term' => $search];
+ $fields = ['uid' => DI::userSession()->getLocalUserId(), 'term' => $search];
if (!$this->dba->exists('search', $fields)) {
if (!$this->dba->insert('search', $fields)) {
DI::sysmsg()->addNotice($this->t('Search term was not saved.'));
@@ -65,7 +64,7 @@ class Saved extends BaseModule
break;
case 'remove':
- if (!$this->dba->delete('search', ['uid' => Session::getLocalUser(), 'term' => $search])) {
+ if (!$this->dba->delete('search', ['uid' => DI::userSession()->getLocalUserId(), 'term' => $search])) {
DI::sysmsg()->addNotice($this->t('Search term was not removed.'));
}
break;
diff --git a/src/Module/Security/Login.php b/src/Module/Security/Login.php
index 6728fc638..19e1d8dca 100644
--- a/src/Module/Security/Login.php
+++ b/src/Module/Security/Login.php
@@ -27,7 +27,6 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\DI;
use Friendica\Module\Register;
@@ -63,7 +62,7 @@ class Login extends BaseModule
{
$return_path = $request['return_path'] ?? $this->session->pop('return_path', '') ;
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$this->baseUrl->redirect($return_path);
}
@@ -127,7 +126,7 @@ class Login extends BaseModule
];
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$tpl = Renderer::getMarkupTemplate('logout.tpl');
} else {
DI::page()['htmlhead'] .= Renderer::replaceMacros(
diff --git a/src/Module/Security/Logout.php b/src/Module/Security/Logout.php
index 62949029b..d68a414e1 100644
--- a/src/Module/Security/Logout.php
+++ b/src/Module/Security/Logout.php
@@ -26,7 +26,6 @@ use Friendica\BaseModule;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\System;
use Friendica\DI;
@@ -64,7 +63,7 @@ class Logout extends BaseModule
protected function rawContent(array $request = [])
{
$visitor_home = null;
- if (Session::getRemoteUser()) {
+ if (DI::userSession()->getRemoteUserId()) {
$visitor_home = Profile::getMyURL();
$this->cache->delete('zrlInit:' . $visitor_home);
}
diff --git a/src/Module/Security/TwoFactor/Recovery.php b/src/Module/Security/TwoFactor/Recovery.php
index 70fbaeccd..991a9b778 100644
--- a/src/Module/Security/TwoFactor/Recovery.php
+++ b/src/Module/Security/TwoFactor/Recovery.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\DI;
use Friendica\Model\User;
@@ -60,7 +59,7 @@ class Recovery extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -69,10 +68,10 @@ class Recovery extends BaseModule
$recovery_code = $_POST['recovery_code'] ?? '';
- if (RecoveryCode::existsForUser(Session::getLocalUser(), $recovery_code)) {
- RecoveryCode::markUsedForUser(Session::getLocalUser(), $recovery_code);
+ if (RecoveryCode::existsForUser(DI::userSession()->getLocalUserId(), $recovery_code)) {
+ RecoveryCode::markUsedForUser(DI::userSession()->getLocalUserId(), $recovery_code);
$this->session->set('2fa', true);
- DI::sysmsg()->addInfo($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(Session::getLocalUser())));
+ DI::sysmsg()->addInfo($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(DI::userSession()->getLocalUserId())));
$this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true);
@@ -85,7 +84,7 @@ class Recovery extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$this->baseUrl->redirect();
}
diff --git a/src/Module/Security/TwoFactor/SignOut.php b/src/Module/Security/TwoFactor/SignOut.php
index 990266d18..1c5263b59 100644
--- a/src/Module/Security/TwoFactor/SignOut.php
+++ b/src/Module/Security/TwoFactor/SignOut.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\DI;
use Friendica\Model\User\Cookie;
@@ -62,7 +61,7 @@ class SignOut extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser() || !($this->cookie->get('2fa_cookie_hash'))) {
+ if (!DI::userSession()->getLocalUserId() || !($this->cookie->get('2fa_cookie_hash'))) {
return;
}
@@ -81,7 +80,7 @@ class SignOut extends BaseModule
$this->baseUrl->redirect();
break;
case 'sign_out':
- $this->trustedBrowserRepository->removeForUser(Session::getLocalUser(), $this->cookie->get('2fa_cookie_hash'));
+ $this->trustedBrowserRepository->removeForUser(DI::userSession()->getLocalUserId(), $this->cookie->get('2fa_cookie_hash'));
$this->cookie->clear();
$this->session->clear();
@@ -96,7 +95,7 @@ class SignOut extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser() || !($this->cookie->get('2fa_cookie_hash'))) {
+ if (!DI::userSession()->getLocalUserId() || !($this->cookie->get('2fa_cookie_hash'))) {
$this->baseUrl->redirect();
}
diff --git a/src/Module/Security/TwoFactor/Trust.php b/src/Module/Security/TwoFactor/Trust.php
index 3b64056c5..83a19ce02 100644
--- a/src/Module/Security/TwoFactor/Trust.php
+++ b/src/Module/Security/TwoFactor/Trust.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\DI;
use Friendica\Model\User;
@@ -75,7 +74,7 @@ class Trust extends BaseModule
protected function post(array $request = [])
{
- if (!Session::getLocalUser() || !$this->session->get('2fa')) {
+ if (!DI::userSession()->getLocalUserId() || !$this->session->get('2fa')) {
$this->logger->info('Invalid call', ['request' => $request]);
return;
}
@@ -88,7 +87,7 @@ class Trust extends BaseModule
switch ($action) {
case 'trust':
case 'dont_trust':
- $trustedBrowser = $this->trustedBrowserFactory->createForUserWithUserAgent(Session::getLocalUser(), $this->server['HTTP_USER_AGENT'], $action === 'trust');
+ $trustedBrowser = $this->trustedBrowserFactory->createForUserWithUserAgent(DI::userSession()->getLocalUserId(), $this->server['HTTP_USER_AGENT'], $action === 'trust');
try {
$this->trustedBrowserRepository->save($trustedBrowser);
@@ -116,7 +115,7 @@ class Trust extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser() || !$this->session->get('2fa')) {
+ if (!DI::userSession()->getLocalUserId() || !$this->session->get('2fa')) {
$this->baseUrl->redirect();
}
diff --git a/src/Module/Settings/Account.php b/src/Module/Settings/Account.php
index 81690afd0..fc6c3972a 100644
--- a/src/Module/Settings/Account.php
+++ b/src/Module/Settings/Account.php
@@ -26,7 +26,6 @@ use Friendica\Core\ACL;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -69,9 +68,9 @@ class Account extends BaseSettings
}
// check if the old password was supplied correctly before changing it to the new value
- User::getIdFromPasswordAuthentication(Session::getLocalUser(), $request['opassword']);
+ User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $request['opassword']);
- $result = User::updatePassword(Session::getLocalUser(), $newpass);
+ $result = User::updatePassword(DI::userSession()->getLocalUserId(), $newpass);
if (!DBA::isResult($result)) {
throw new Exception(DI::l10n()->t('Password update failed. Please try again.'));
}
@@ -104,7 +103,7 @@ class Account extends BaseSettings
if ($email != $user['email']) {
// check for the correct password
try {
- User::getIdFromPasswordAuthentication(Session::getLocalUser(), $request['mpassword']);
+ User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $request['mpassword']);
} catch (Exception $ex) {
$err .= DI::l10n()->t('Wrong Password.');
$email = $user['email'];
@@ -146,7 +145,7 @@ class Account extends BaseSettings
$fields['openidserver'] = '';
}
- if (!User::update($fields, Session::getLocalUser())) {
+ if (!User::update($fields, DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
}
@@ -175,8 +174,8 @@ class Account extends BaseSettings
$str_group_deny = !empty($request['group_deny']) ? $aclFormatter->toString($request['group_deny']) : '';
$str_contact_deny = !empty($request['contact_deny']) ? $aclFormatter->toString($request['contact_deny']) : '';
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'unlisted', !empty($request['unlisted']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'accessible-photos', !empty($request['accessible-photos']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'unlisted', !empty($request['unlisted']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'accessible-photos', !empty($request['accessible-photos']));
$fields = [
'allow_cid' => $str_contact_allow,
@@ -198,7 +197,7 @@ class Account extends BaseSettings
'hide-friends' => $hide_friends
];
- if (!User::update($fields, Session::getLocalUser()) || !Profile::update($profile_fields, Session::getLocalUser())) {
+ if (!User::update($fields, DI::userSession()->getLocalUserId()) || !Profile::update($profile_fields, DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
}
@@ -213,12 +212,12 @@ class Account extends BaseSettings
$expire_starred = !empty($request['expire_starred']);
$expire_network_only = !empty($request['expire_network_only']);
- DI::pConfig()->set(Session::getLocalUser(), 'expire', 'items', $expire_items);
- DI::pConfig()->set(Session::getLocalUser(), 'expire', 'notes', $expire_notes);
- DI::pConfig()->set(Session::getLocalUser(), 'expire', 'starred', $expire_starred);
- DI::pConfig()->set(Session::getLocalUser(), 'expire', 'network_only', $expire_network_only);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'items', $expire_items);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'notes', $expire_notes);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'starred', $expire_starred);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'expire', 'network_only', $expire_network_only);
- if (!User::update(['expire' => $expire], Session::getLocalUser())) {
+ if (!User::update(['expire' => $expire], DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
}
@@ -273,7 +272,7 @@ class Account extends BaseSettings
if (!empty($request['notify_activity_participation'])) {
$notify_type = $notify_type | UserNotification::TYPE_ACTIVITY_PARTICIPATION;
}
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'notify_type', $notify_type);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_type', $notify_type);
if (!($notify_type & (UserNotification::TYPE_DIRECT_COMMENT + UserNotification::TYPE_DIRECT_THREAD_COMMENT))) {
$notify_like = false;
@@ -281,28 +280,28 @@ class Account extends BaseSettings
}
// Reset like notifications when they are going to be shown again
- if (!DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_like') && $notify_like) {
- DI::notification()->setAllSeenForUser(Session::getLocalUser(), ['vid' => Verb::getID(Activity::LIKE)]);
+ if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_like') && $notify_like) {
+ DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['vid' => Verb::getID(Activity::LIKE)]);
}
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'notify_like', $notify_like);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_like', $notify_like);
// Reset share notifications when they are going to be shown again
- if (!DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_announce') && $notify_announce) {
- DI::notification()->setAllSeenForUser(Session::getLocalUser(), ['vid' => Verb::getID(Activity::ANNOUNCE)]);
+ if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_announce') && $notify_announce) {
+ DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['vid' => Verb::getID(Activity::ANNOUNCE)]);
}
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'notify_announce', $notify_announce);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_announce', $notify_announce);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'email_textonly', !empty($request['email_textonly']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'detailed_notif', !empty($request['detailed_notif']));
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'notify_ignored', !empty($request['notify_ignored']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'email_textonly', !empty($request['email_textonly']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif', !empty($request['detailed_notif']));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'notify_ignored', !empty($request['notify_ignored']));
$fields = [
'notify-flags' => $notify,
];
- if (!User::update($fields, Session::getLocalUser())) {
+ if (!User::update($fields, DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
}
@@ -328,7 +327,7 @@ class Account extends BaseSettings
$profile_fields = [];
if ($account_type == User::ACCOUNT_TYPE_COMMUNITY) {
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'unlisted', true);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'unlisted', true);
$fields = [
'allow_cid' => '',
@@ -351,7 +350,7 @@ class Account extends BaseSettings
'account-type' => $account_type,
]);
- if (!User::update($fields, Session::getLocalUser()) || !empty($profile_fields) && !Profile::update($profile_fields, Session::getLocalUser())) {
+ if (!User::update($fields, DI::userSession()->getLocalUserId()) || !empty($profile_fields) && !Profile::update($profile_fields, DI::userSession()->getLocalUserId())) {
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
}
@@ -376,7 +375,7 @@ class Account extends BaseSettings
// "http" or "@" to be present in the string.
// All other fields from the row will be ignored
if ((strpos($csvRow[0], '@') !== false) || Network::isValidHttpUrl($csvRow[0])) {
- Worker::add(Worker::PRIORITY_MEDIUM, 'AddContact', Session::getLocalUser(), $csvRow[0]);
+ Worker::add(Worker::PRIORITY_MEDIUM, 'AddContact', DI::userSession()->getLocalUserId(), $csvRow[0]);
} else {
Logger::notice('Invalid account', ['url' => $csvRow[0]]);
}
@@ -395,7 +394,7 @@ class Account extends BaseSettings
}
if (!empty($request['relocate-submit'])) {
- Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, Session::getLocalUser());
+ Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, DI::userSession()->getLocalUserId());
DI::sysmsg()->addInfo(DI::l10n()->t("Relocate message has been send to your contacts"));
DI::baseUrl()->redirect($redirectUrl);
}
@@ -407,11 +406,11 @@ class Account extends BaseSettings
{
parent::content();
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
- $profile = DBA::selectFirst('profile', [], ['uid' => Session::getLocalUser()]);
+ $profile = DBA::selectFirst('profile', [], ['uid' => DI::userSession()->getLocalUserId()]);
if (!DBA::isResult($profile)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to find your profile. Please contact your admin.'));
return '';
@@ -434,10 +433,10 @@ class Account extends BaseSettings
$unkmail = $user['unkmail'];
$cntunkmail = $user['cntunkmail'];
- $expire_items = DI::pConfig()->get(Session::getLocalUser(), 'expire', 'items', true);
- $expire_notes = DI::pConfig()->get(Session::getLocalUser(), 'expire', 'notes', true);
- $expire_starred = DI::pConfig()->get(Session::getLocalUser(), 'expire', 'starred', true);
- $expire_network_only = DI::pConfig()->get(Session::getLocalUser(), 'expire', 'network_only', false);
+ $expire_items = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'items', true);
+ $expire_notes = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'notes', true);
+ $expire_starred = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'starred', true);
+ $expire_network_only = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'network_only', false);
if (!strlen($user['timezone'])) {
$timezone = $a->getTimeZone();
@@ -551,7 +550,7 @@ class Account extends BaseSettings
/* Installed langs */
$lang_choices = DI::l10n()->getAvailableLanguages();
- $notify_type = DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_type');
+ $notify_type = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_type');
$passwordRules = DI::l10n()->t('Allowed characters are a-z, A-Z, 0-9 and special characters except white spaces, accentuated letters and colon (:).')
. (PASSWORD_DEFAULT === PASSWORD_BCRYPT ? ' ' . DI::l10n()->t('Password length is limited to 72 characters.') : '');
@@ -563,7 +562,7 @@ class Account extends BaseSettings
'$submit' => DI::l10n()->t('Save Settings'),
'$baseurl' => DI::baseUrl()->get(true),
- '$uid' => Session::getLocalUser(),
+ '$uid' => DI::userSession()->getLocalUserId(),
'$form_security_token' => self::getFormSecurityToken('settings'),
'$open' => $this->parameters['open'] ?? 'password',
@@ -591,13 +590,13 @@ class Account extends BaseSettings
'$profile_in_net_dir' => ['profile_in_netdirectory', DI::l10n()->t('Allow your profile to be searchable globally?'), $profile['net-publish'], DI::l10n()->t("Activate this setting if you want others to easily find and follow you. Your profile will be searchable on remote systems. This setting also determines whether Friendica will inform search engines that your profile should be indexed or not.") . $net_pub_desc],
'$hide_friends' => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your profile?'), $profile['hide-friends'], DI::l10n()->t('A list of your contacts is displayed on your profile page. Activate this option to disable the display of your contact list.')],
'$hide_wall' => ['hidewall', DI::l10n()->t('Hide your profile details from anonymous viewers?'), $user['hidewall'], DI::l10n()->t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.')],
- '$unlisted' => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(Session::getLocalUser(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')],
- '$accessiblephotos' => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(Session::getLocalUser(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")],
+ '$unlisted' => ['unlisted', DI::l10n()->t('Make public posts unlisted'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'unlisted'), DI::l10n()->t('Your public posts will not appear on the community pages or in search results, nor be sent to relay servers. However they can still appear on public feeds on remote servers.')],
+ '$accessiblephotos' => ['accessible-photos', DI::l10n()->t('Make all posted pictures accessible'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'accessible-photos'), DI::l10n()->t("This option makes every posted picture accessible via the direct link. This is a workaround for the problem that most other networks can't handle permissions on pictures. Non public pictures still won't be visible for the public on your photo albums though.")],
'$blockwall' => ['blockwall', DI::l10n()->t('Allow friends to post to your profile page?'), (intval($user['blockwall']) ? '0' : '1'), DI::l10n()->t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts')],
'$blocktags' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')],
'$unkmail' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')],
'$cntunkmail' => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail, DI::l10n()->t("(to prevent spam abuse)")],
- '$group_select' => Group::displayGroupSelection(Session::getLocalUser(), $user['def_gid']),
+ '$group_select' => Group::displayGroupSelection(DI::userSession()->getLocalUserId(), $user['def_gid']),
'$permissions' => DI::l10n()->t('Default Post Permissions'),
'$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId()),
@@ -623,8 +622,8 @@ class Account extends BaseSettings
'$lbl_notify' => DI::l10n()->t('Create a desktop notification when:'),
'$notify_tagged' => ['notify_tagged', DI::l10n()->t('Someone tagged you'), is_null($notify_type) || $notify_type & UserNotification::TYPE_EXPLICIT_TAGGED, ''],
'$notify_direct_comment' => ['notify_direct_comment', DI::l10n()->t('Someone directly commented on your post'), is_null($notify_type) || $notify_type & (UserNotification::TYPE_IMPLICIT_TAGGED + UserNotification::TYPE_DIRECT_COMMENT + UserNotification::TYPE_DIRECT_THREAD_COMMENT), ''],
- '$notify_like' => ['notify_like', DI::l10n()->t('Someone liked your content'), DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_like'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
- '$notify_announce' => ['notify_announce', DI::l10n()->t('Someone shared your content'), DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_announce'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
+ '$notify_like' => ['notify_like', DI::l10n()->t('Someone liked your content'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_like'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
+ '$notify_announce' => ['notify_announce', DI::l10n()->t('Someone shared your content'), DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_announce'), DI::l10n()->t('Can only be enabled, when the direct comment notification is enabled.')],
'$notify_thread_comment' => ['notify_thread_comment', DI::l10n()->t('Someone commented in your thread'), is_null($notify_type) || $notify_type & UserNotification::TYPE_THREAD_COMMENT, ''],
'$notify_comment_participation' => ['notify_comment_participation', DI::l10n()->t('Someone commented in a thread where you commented'), is_null($notify_type) || $notify_type & UserNotification::TYPE_COMMENT_PARTICIPATION, ''],
'$notify_activity_participation' => ['notify_activity_participation', DI::l10n()->t('Someone commented in a thread where you interacted'), is_null($notify_type) || $notify_type & UserNotification::TYPE_ACTIVITY_PARTICIPATION, ''],
@@ -634,19 +633,19 @@ class Account extends BaseSettings
'$email_textonly' => [
'email_textonly',
DI::l10n()->t('Text-only notification emails'),
- DI::pConfig()->get(Session::getLocalUser(), 'system', 'email_textonly'),
+ DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'email_textonly'),
DI::l10n()->t('Send text only notification emails, without the html part')
],
'$detailed_notif' => [
'detailed_notif',
DI::l10n()->t('Show detailled notifications'),
- DI::pConfig()->get(Session::getLocalUser(), 'system', 'detailed_notif'),
+ DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif'),
DI::l10n()->t('Per default, notifications are condensed to a single notification per item. When enabled every notification is displayed.')
],
'$notify_ignored' => [
'notify_ignored',
DI::l10n()->t('Show notifications of ignored contacts'),
- DI::pConfig()->get(Session::getLocalUser(), 'system', 'notify_ignored', true),
+ DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'notify_ignored', true),
DI::l10n()->t("You don't see posts from ignored contacts. But you still see their comments. This setting controls if you want to still receive regular notifications that are caused by ignored contacts or not.")
],
diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php
index 19e62b6f0..a7046d40c 100644
--- a/src/Module/Settings/Delegation.php
+++ b/src/Module/Settings/Delegation.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Settings;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
@@ -59,14 +58,14 @@ class Delegation extends BaseSettings
DI::sysmsg()->addInfo(DI::l10n()->t('Delegation successfully revoked.'));
}
- DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => Session::getLocalUser()]);
+ DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => DI::userSession()->getLocalUserId()]);
}
protected function content(array $request = []): string
{
parent::content();
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -85,11 +84,11 @@ class Delegation extends BaseSettings
$user = User::getById($user_id, ['nickname']);
if (DBA::isResult($user)) {
$condition = [
- 'uid' => Session::getLocalUser(),
+ 'uid' => DI::userSession()->getLocalUserId(),
'nurl' => Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname'])
];
if (DBA::exists('contact', $condition)) {
- DBA::insert('manage', ['uid' => $user_id, 'mid' => Session::getLocalUser()]);
+ DBA::insert('manage', ['uid' => $user_id, 'mid' => DI::userSession()->getLocalUserId()]);
}
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('Delegate user not found.'));
@@ -104,12 +103,12 @@ class Delegation extends BaseSettings
DI::baseUrl()->redirect('settings/delegation');
}
- DBA::delete('manage', ['uid' => $user_id, 'mid' => Session::getLocalUser()]);
+ DBA::delete('manage', ['uid' => $user_id, 'mid' => DI::userSession()->getLocalUserId()]);
DI::baseUrl()->redirect('settings/delegation');
}
// find everybody that currently has delegated management to this account/page
- $delegates = DBA::selectToArray('user', [], ['`uid` IN (SELECT `uid` FROM `manage` WHERE `mid` = ?)', Session::getLocalUser()]);
+ $delegates = DBA::selectToArray('user', [], ['`uid` IN (SELECT `uid` FROM `manage` WHERE `mid` = ?)', DI::userSession()->getLocalUserId()]);
$uids = [];
foreach ($delegates as $user) {
@@ -120,7 +119,7 @@ class Delegation extends BaseSettings
$potentials = [];
$nicknames = [];
- $condition = ['baseurl' => DI::baseUrl(), 'self' => false, 'uid' => Session::getLocalUser(), 'blocked' => false];
+ $condition = ['baseurl' => DI::baseUrl(), 'self' => false, 'uid' => DI::userSession()->getLocalUserId(), 'blocked' => false];
$contacts = DBA::select('contact', ['nick'], $condition);
while ($contact = DBA::fetch($contacts)) {
$nicknames[] = $contact['nick'];
@@ -137,8 +136,8 @@ class Delegation extends BaseSettings
$parent_user = null;
$parent_password = null;
- $user = User::getById(Session::getLocalUser(), ['parent-uid', 'email']);
- if (DBA::isResult($user) && !DBA::exists('user', ['parent-uid' => Session::getLocalUser()])) {
+ $user = User::getById(DI::userSession()->getLocalUserId(), ['parent-uid', 'email']);
+ if (DBA::isResult($user) && !DBA::exists('user', ['parent-uid' => DI::userSession()->getLocalUserId()])) {
$parent_uid = $user['parent-uid'];
$parents = [0 => DI::l10n()->t('No parent user')];
@@ -146,7 +145,7 @@ class Delegation extends BaseSettings
$condition = ['email' => $user['email'], 'verified' => true, 'blocked' => false, 'parent-uid' => 0];
$parent_users = DBA::selectToArray('user', $fields, $condition);
foreach($parent_users as $parent) {
- if ($parent['uid'] != Session::getLocalUser()) {
+ if ($parent['uid'] != DI::userSession()->getLocalUserId()) {
$parents[$parent['uid']] = sprintf('%s (%s)', $parent['username'], $parent['nickname']);
}
}
diff --git a/src/Module/Settings/Display.php b/src/Module/Settings/Display.php
index f80aca2c5..11c3f5139 100644
--- a/src/Module/Settings/Display.php
+++ b/src/Module/Settings/Display.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Settings;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -44,7 +43,7 @@ class Display extends BaseSettings
self::checkFormSecurityTokenRedirectOnError('/settings/display', 'settings_display');
- $user = User::getById(Session::getLocalUser());
+ $user = User::getById(DI::userSession()->getLocalUserId());
$theme = !empty($_POST['theme']) ? trim($_POST['theme']) : $user['theme'];
$mobile_theme = !empty($_POST['mobile_theme']) ? trim($_POST['mobile_theme']) : '';
@@ -78,20 +77,20 @@ class Display extends BaseSettings
}
if ($mobile_theme !== '') {
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'mobile_theme', $mobile_theme);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'mobile_theme', $mobile_theme);
}
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'itemspage_network' , $itemspage_network);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'update_interval' , $browser_update);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'no_auto_update' , $no_auto_update);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'no_smilies' , !$enable_smile);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'infinite_scroll' , $infinite_scroll);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'no_smart_threading' , !$enable_smart_threading);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'hide_dislike' , !$enable_dislike);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'display_resharer' , $display_resharer);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'stay_local' , $stay_local);
- DI::pConfig()->set(Session::getLocalUser(), 'system', 'first_day_of_week' , $first_day_of_week);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network' , $itemspage_network);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'update_interval' , $browser_update);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update' , $no_auto_update);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_smilies' , !$enable_smile);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll' , $infinite_scroll);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_smart_threading' , !$enable_smart_threading);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike' , !$enable_dislike);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'display_resharer' , $display_resharer);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'stay_local' , $stay_local);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week' , $first_day_of_week);
if (in_array($theme, Theme::getAllowedList())) {
if ($theme == $user['theme']) {
@@ -101,7 +100,7 @@ class Display extends BaseSettings
theme_post(DI::app());
}
} else {
- DBA::update('user', ['theme' => $theme], ['uid' => Session::getLocalUser()]);
+ DBA::update('user', ['theme' => $theme], ['uid' => DI::userSession()->getLocalUserId()]);
}
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('The theme you chose isn\'t available.'));
@@ -116,7 +115,7 @@ class Display extends BaseSettings
{
parent::content();
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -130,7 +129,7 @@ class Display extends BaseSettings
$default_mobile_theme = 'none';
}
- $user = User::getById(Session::getLocalUser());
+ $user = User::getById(DI::userSession()->getLocalUserId());
$allowed_themes = Theme::getAllowedList();
@@ -159,26 +158,26 @@ class Display extends BaseSettings
$theme_selected = $user['theme'] ?: $default_theme;
$mobile_theme_selected = DI::session()->get('mobile-theme', $default_mobile_theme);
- $itemspage_network = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network'));
+ $itemspage_network = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network'));
$itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : DI::config()->get('system', 'itemspage_network'));
- $itemspage_mobile_network = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network'));
+ $itemspage_mobile_network = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network'));
$itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : DI::config()->get('system', 'itemspage_network_mobile'));
- $browser_update = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'update_interval'));
+ $browser_update = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'update_interval'));
if (intval($browser_update) != -1) {
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
}
- $no_auto_update = DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_auto_update', 0);
- $enable_smile = !DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_smilies', 0);
- $infinite_scroll = DI::pConfig()->get(Session::getLocalUser(), 'system', 'infinite_scroll', 0);
- $enable_smart_threading = !DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_smart_threading', 0);
- $enable_dislike = !DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike', 0);
- $display_resharer = DI::pConfig()->get(Session::getLocalUser(), 'system', 'display_resharer', 0);
- $stay_local = DI::pConfig()->get(Session::getLocalUser(), 'system', 'stay_local', 0);
+ $no_auto_update = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update', 0);
+ $enable_smile = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_smilies', 0);
+ $infinite_scroll = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll', 0);
+ $enable_smart_threading = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_smart_threading', 0);
+ $enable_dislike = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike', 0);
+ $display_resharer = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'display_resharer', 0);
+ $stay_local = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local', 0);
- $first_day_of_week = DI::pConfig()->get(Session::getLocalUser(), 'system', 'first_day_of_week', 0);
+ $first_day_of_week = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
$weekdays = [
0 => DI::l10n()->t("Sunday"),
1 => DI::l10n()->t("Monday"),
@@ -207,7 +206,7 @@ class Display extends BaseSettings
'$form_security_token' => self::getFormSecurityToken('settings_display'),
'$baseurl' => DI::baseUrl()->get(true),
- '$uid' => Session::getLocalUser(),
+ '$uid' => DI::userSession()->getLocalUserId(),
'$theme' => ['theme', DI::l10n()->t('Display Theme:'), $theme_selected, '', $themes, true],
'$mobile_theme' => ['mobile_theme', DI::l10n()->t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php
index aa14b8e75..14fe613c1 100644
--- a/src/Module/Settings/Profile/Index.php
+++ b/src/Module/Settings/Profile/Index.php
@@ -25,7 +25,6 @@ use Friendica\Core\ACL;
use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -44,11 +43,11 @@ class Index extends BaseSettings
{
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $profile = Profile::getByUID(Session::getLocalUser());
+ $profile = Profile::getByUID(DI::userSession()->getLocalUserId());
if (!DBA::isResult($profile)) {
return;
}
@@ -102,12 +101,12 @@ class Index extends BaseSettings
}
$profileFieldsNew = self::getProfileFieldsFromInput(
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
$_REQUEST['profile_field'],
$_REQUEST['profile_field_order']
);
- DI::profileField()->saveCollectionForUser(Session::getLocalUser(), $profileFieldsNew);
+ DI::profileField()->saveCollectionForUser(DI::userSession()->getLocalUserId(), $profileFieldsNew);
$result = Profile::update(
[
@@ -125,7 +124,7 @@ class Index extends BaseSettings
'pub_keywords' => $pub_keywords,
'prv_keywords' => $prv_keywords,
],
- Session::getLocalUser()
+ DI::userSession()->getLocalUserId()
);
if (!$result) {
@@ -138,7 +137,7 @@ class Index extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('You must be logged in to use this module'));
return Login::form();
}
@@ -147,7 +146,7 @@ class Index extends BaseSettings
$o = '';
- $profile = User::getOwnerDataById(Session::getLocalUser());
+ $profile = User::getOwnerDataById(DI::userSession()->getLocalUserId());
if (!DBA::isResult($profile)) {
throw new HTTPException\NotFoundException();
}
@@ -159,7 +158,7 @@ class Index extends BaseSettings
$custom_fields = [];
- $profileFields = DI::profileField()->selectByUserId(Session::getLocalUser());
+ $profileFields = DI::profileField()->selectByUserId(DI::userSession()->getLocalUserId());
foreach ($profileFields as $profileField) {
/** @var ProfileField $profileField */
$defaultPermissions = $profileField->permissionSet->withAllowedContacts(
diff --git a/src/Module/Settings/Profile/Photo/Crop.php b/src/Module/Settings/Profile/Photo/Crop.php
index 68b673f8c..34d65de30 100644
--- a/src/Module/Settings/Profile/Photo/Crop.php
+++ b/src/Module/Settings/Profile/Photo/Crop.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Settings\Profile\Photo;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -35,7 +34,7 @@ class Crop extends BaseSettings
{
protected function post(array $request = [])
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return;
}
@@ -58,7 +57,7 @@ class Crop extends BaseSettings
$path = 'profile/' . DI::app()->getLoggedInUserNickname();
- $base_image = Photo::selectFirst([], ['resource-id' => $resource_id, 'uid' => Session::getLocalUser(), 'scale' => $scale]);
+ $base_image = Photo::selectFirst([], ['resource-id' => $resource_id, 'uid' => DI::userSession()->getLocalUserId(), 'scale' => $scale]);
if (DBA::isResult($base_image)) {
$Image = Photo::getImageForPhoto($base_image);
if (empty($Image)) {
@@ -67,7 +66,7 @@ class Crop extends BaseSettings
if ($Image->isValid()) {
// If setting for the default profile, unset the profile photo flag from any other photos I own
- DBA::update('photo', ['profile' => 0], ['uid' => Session::getLocalUser()]);
+ DBA::update('photo', ['profile' => 0], ['uid' => DI::userSession()->getLocalUserId()]);
// Normalizing expected square crop parameters
$selectionW = $selectionH = min($selectionW, $selectionH);
@@ -92,11 +91,11 @@ class Crop extends BaseSettings
$Image->scaleDown(300);
}
- $condition = ['resource-id' => $resource_id, 'uid' => Session::getLocalUser(), 'contact-id' => 0];
+ $condition = ['resource-id' => $resource_id, 'uid' => DI::userSession()->getLocalUserId(), 'contact-id' => 0];
$r = Photo::store(
$Image,
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
0,
$resource_id,
$base_image['filename'],
@@ -114,7 +113,7 @@ class Crop extends BaseSettings
$r = Photo::store(
$Image,
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
0,
$resource_id,
$base_image['filename'],
@@ -132,7 +131,7 @@ class Crop extends BaseSettings
$r = Photo::store(
$Image,
- Session::getLocalUser(),
+ DI::userSession()->getLocalUserId(),
0,
$resource_id,
$base_image['filename'],
@@ -146,12 +145,12 @@ class Crop extends BaseSettings
Photo::update(['profile' => true], array_merge($condition, ['scale' => 6]));
}
- Contact::updateSelfFromUserID(Session::getLocalUser(), true);
+ Contact::updateSelfFromUserID(DI::userSession()->getLocalUserId(), true);
DI::sysmsg()->addInfo(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.'));
// Update global directory in background
- Profile::publishUpdate(Session::getLocalUser());
+ Profile::publishUpdate(DI::userSession()->getLocalUserId());
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image'));
}
@@ -162,7 +161,7 @@ class Crop extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -170,7 +169,7 @@ class Crop extends BaseSettings
$resource_id = $this->parameters['guid'];
- $photos = Photo::selectToArray([], ['resource-id' => $resource_id, 'uid' => Session::getLocalUser()], ['order' => ['scale' => false]]);
+ $photos = Photo::selectToArray([], ['resource-id' => $resource_id, 'uid' => DI::userSession()->getLocalUserId()], ['order' => ['scale' => false]]);
if (!DBA::isResult($photos)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Photo not found.'));
}
@@ -185,14 +184,14 @@ class Crop extends BaseSettings
// set an already uloaded photo as profile photo
// if photo is in 'Profile Photos', change it in db
if ($photos[0]['photo-type'] == Photo::USER_AVATAR && $havescale) {
- Photo::update(['profile' => false], ['uid' => Session::getLocalUser()]);
+ Photo::update(['profile' => false], ['uid' => DI::userSession()->getLocalUserId()]);
- Photo::update(['profile' => true], ['resource-id' => $resource_id, 'uid' => Session::getLocalUser()]);
+ Photo::update(['profile' => true], ['resource-id' => $resource_id, 'uid' => DI::userSession()->getLocalUserId()]);
- Contact::updateSelfFromUserID(Session::getLocalUser(), true);
+ Contact::updateSelfFromUserID(DI::userSession()->getLocalUserId(), true);
// Update global directory in background
- Profile::publishUpdate(Session::getLocalUser());
+ Profile::publishUpdate(DI::userSession()->getLocalUserId());
DI::sysmsg()->addInfo(DI::l10n()->t('Profile picture successfully updated.'));
diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php
index 1e1dbbe67..3553a9f40 100644
--- a/src/Module/Settings/Profile/Photo/Index.php
+++ b/src/Module/Settings/Profile/Photo/Index.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Settings\Profile\Photo;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Photo;
@@ -36,7 +35,7 @@ class Index extends BaseSettings
{
protected function post(array $request = [])
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return;
}
@@ -92,13 +91,13 @@ class Index extends BaseSettings
$filename = '';
- if (!Photo::store($Image, Session::getLocalUser(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 0, Photo::USER_AVATAR)) {
+ if (!Photo::store($Image, DI::userSession()->getLocalUserId(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 0, Photo::USER_AVATAR)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.'));
}
if ($width > 640 || $height > 640) {
$Image->scaleDown(640);
- if (!Photo::store($Image, Session::getLocalUser(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 1, Photo::USER_AVATAR)) {
+ if (!Photo::store($Image, DI::userSession()->getLocalUserId(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 1, Photo::USER_AVATAR)) {
DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '640'));
}
}
@@ -108,7 +107,7 @@ class Index extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -118,7 +117,7 @@ class Index extends BaseSettings
$newuser = $args->get($args->getArgc() - 1) === 'new';
- $contact = Contact::selectFirst(['avatar'], ['uid' => Session::getLocalUser(), 'self' => true]);
+ $contact = Contact::selectFirst(['avatar'], ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
$tpl = Renderer::getMarkupTemplate('settings/profile/photo/index.tpl');
$o = Renderer::replaceMacros($tpl, [
diff --git a/src/Module/Settings/TwoFactor/AppSpecific.php b/src/Module/Settings/TwoFactor/AppSpecific.php
index c37cc76c6..8a8d4801c 100644
--- a/src/Module/Settings/TwoFactor/AppSpecific.php
+++ b/src/Module/Settings/TwoFactor/AppSpecific.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
@@ -52,11 +51,11 @@ class AppSpecific extends BaseSettings
$this->pConfig = $pConfig;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $verified = $this->pConfig->get(Session::getLocalUser(), '2fa', 'verified');
+ $verified = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
if (!$verified) {
$this->baseUrl->redirect('settings/2fa');
@@ -70,7 +69,7 @@ class AppSpecific extends BaseSettings
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -83,17 +82,17 @@ class AppSpecific extends BaseSettings
if (empty($description)) {
DI::sysmsg()->addNotice($this->t('App-specific password generation failed: The description is empty.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
- } elseif (AppSpecificPassword::checkDuplicateForUser(Session::getLocalUser(), $description)) {
+ } elseif (AppSpecificPassword::checkDuplicateForUser(DI::userSession()->getLocalUserId(), $description)) {
DI::sysmsg()->addNotice($this->t('App-specific password generation failed: This description already exists.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
} else {
- $this->appSpecificPassword = AppSpecificPassword::generateForUser(Session::getLocalUser(), $_POST['description'] ?? '');
+ $this->appSpecificPassword = AppSpecificPassword::generateForUser(DI::userSession()->getLocalUserId(), $_POST['description'] ?? '');
DI::sysmsg()->addInfo($this->t('New app-specific password generated.'));
}
break;
case 'revoke_all' :
- AppSpecificPassword::deleteAllForUser(Session::getLocalUser());
+ AppSpecificPassword::deleteAllForUser(DI::userSession()->getLocalUserId());
DI::sysmsg()->addInfo($this->t('App-specific passwords successfully revoked.'));
$this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
break;
@@ -103,7 +102,7 @@ class AppSpecific extends BaseSettings
if (!empty($_POST['revoke_id'])) {
self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific');
- if (AppSpecificPassword::deleteForUser(Session::getLocalUser(), $_POST['revoke_id'])) {
+ if (AppSpecificPassword::deleteForUser(DI::userSession()->getLocalUserId(), $_POST['revoke_id'])) {
DI::sysmsg()->addInfo($this->t('App-specific password successfully revoked.'));
}
@@ -113,13 +112,13 @@ class AppSpecific extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form('settings/2fa/app_specific');
}
parent::content();
- $appSpecificPasswords = AppSpecificPassword::getListForUser(Session::getLocalUser());
+ $appSpecificPasswords = AppSpecificPassword::getListForUser(DI::userSession()->getLocalUserId());
return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/app_specific.tpl'), [
'$form_security_token' => self::getFormSecurityToken('settings_2fa_app_specific'),
diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php
index d17c7b849..97b118914 100644
--- a/src/Module/Settings/TwoFactor/Index.php
+++ b/src/Module/Settings/TwoFactor/Index.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Settings\TwoFactor;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Network\HTTPException\FoundException;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
@@ -36,24 +35,24 @@ class Index extends BaseSettings
{
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
self::checkFormSecurityTokenRedirectOnError('settings/2fa', 'settings_2fa');
try {
- User::getIdFromPasswordAuthentication(Session::getLocalUser(), $_POST['password'] ?? '');
+ User::getIdFromPasswordAuthentication(DI::userSession()->getLocalUserId(), $_POST['password'] ?? '');
- $has_secret = (bool)DI::pConfig()->get(Session::getLocalUser(), '2fa', 'secret');
- $verified = DI::pConfig()->get(Session::getLocalUser(), '2fa', 'verified');
+ $has_secret = (bool)DI::pConfig()->get(DI::userSession()->getLocalUserId(), '2fa', 'secret');
+ $verified = DI::pConfig()->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
switch ($_POST['action'] ?? '') {
case 'enable':
if (!$has_secret && !$verified) {
$Google2FA = new Google2FA();
- DI::pConfig()->set(Session::getLocalUser(), '2fa', 'secret', $Google2FA->generateSecretKey(32));
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), '2fa', 'secret', $Google2FA->generateSecretKey(32));
DI::baseUrl()
->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
@@ -61,9 +60,9 @@ class Index extends BaseSettings
break;
case 'disable':
if ($has_secret) {
- RecoveryCode::deleteForUser(Session::getLocalUser());
- DI::pConfig()->delete(Session::getLocalUser(), '2fa', 'secret');
- DI::pConfig()->delete(Session::getLocalUser(), '2fa', 'verified');
+ RecoveryCode::deleteForUser(DI::userSession()->getLocalUserId());
+ DI::pConfig()->delete(DI::userSession()->getLocalUserId(), '2fa', 'secret');
+ DI::pConfig()->delete(DI::userSession()->getLocalUserId(), '2fa', 'verified');
DI::session()->remove('2fa');
DI::sysmsg()->addInfo(DI::l10n()->t('Two-factor authentication successfully disabled.'));
@@ -104,14 +103,14 @@ class Index extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form('settings/2fa');
}
parent::content();
- $has_secret = (bool) DI::pConfig()->get(Session::getLocalUser(), '2fa', 'secret');
- $verified = DI::pConfig()->get(Session::getLocalUser(), '2fa', 'verified');
+ $has_secret = (bool) DI::pConfig()->get(DI::userSession()->getLocalUserId(), '2fa', 'secret');
+ $verified = DI::pConfig()->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/index.tpl'), [
'$form_security_token' => self::getFormSecurityToken('settings_2fa'),
@@ -129,12 +128,12 @@ class Index extends BaseSettings
'$recovery_codes_title' => DI::l10n()->t('Recovery codes'),
'$recovery_codes_remaining' => DI::l10n()->t('Remaining valid codes'),
- '$recovery_codes_count' => RecoveryCode::countValidForUser(Session::getLocalUser()),
+ '$recovery_codes_count' => RecoveryCode::countValidForUser(DI::userSession()->getLocalUserId()),
'$recovery_codes_message' => DI::l10n()->t('These one-use codes can replace an authenticator app code in case you have lost access to it.
'),
'$app_specific_passwords_title' => DI::l10n()->t('App-specific passwords'),
'$app_specific_passwords_remaining' => DI::l10n()->t('Generated app-specific passwords'),
- '$app_specific_passwords_count' => AppSpecificPassword::countForUser(Session::getLocalUser()),
+ '$app_specific_passwords_count' => AppSpecificPassword::countForUser(DI::userSession()->getLocalUserId()),
'$app_specific_passwords_message' => DI::l10n()->t('These randomly generated passwords allow you to authenticate on apps not supporting two-factor authentication.
'),
'$action_title' => DI::l10n()->t('Actions'),
diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php
index 54d24abbf..cde63f4fa 100644
--- a/src/Module/Settings/TwoFactor/Recovery.php
+++ b/src/Module/Settings/TwoFactor/Recovery.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Security\TwoFactor\Model\RecoveryCode;
@@ -50,11 +49,11 @@ class Recovery extends BaseSettings
$this->pConfig = $pConfig;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $secret = $this->pConfig->get(Session::getLocalUser(), '2fa', 'secret');
+ $secret = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'secret');
if (!$secret) {
$this->baseUrl->redirect('settings/2fa');
@@ -68,7 +67,7 @@ class Recovery extends BaseSettings
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -76,7 +75,7 @@ class Recovery extends BaseSettings
self::checkFormSecurityTokenRedirectOnError('settings/2fa/recovery', 'settings_2fa_recovery');
if ($_POST['action'] == 'regenerate') {
- RecoveryCode::regenerateForUser(Session::getLocalUser());
+ RecoveryCode::regenerateForUser(DI::userSession()->getLocalUserId());
DI::sysmsg()->addInfo($this->t('New recovery codes successfully generated.'));
$this->baseUrl->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
}
@@ -85,19 +84,19 @@ class Recovery extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form('settings/2fa/recovery');
}
parent::content();
- if (!RecoveryCode::countValidForUser(Session::getLocalUser())) {
- RecoveryCode::generateForUser(Session::getLocalUser());
+ if (!RecoveryCode::countValidForUser(DI::userSession()->getLocalUserId())) {
+ RecoveryCode::generateForUser(DI::userSession()->getLocalUserId());
}
- $recoveryCodes = RecoveryCode::getListForUser(Session::getLocalUser());
+ $recoveryCodes = RecoveryCode::getListForUser(DI::userSession()->getLocalUserId());
- $verified = $this->pConfig->get(Session::getLocalUser(), '2fa', 'verified');
+ $verified = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/recovery.tpl'), [
'$form_security_token' => self::getFormSecurityToken('settings_2fa_recovery'),
diff --git a/src/Module/Settings/TwoFactor/Trusted.php b/src/Module/Settings/TwoFactor/Trusted.php
index 5c873c8f9..6196eec7d 100644
--- a/src/Module/Settings/TwoFactor/Trusted.php
+++ b/src/Module/Settings/TwoFactor/Trusted.php
@@ -25,7 +25,6 @@ use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\BaseSettings;
use Friendica\Module\Response;
@@ -53,11 +52,11 @@ class Trusted extends BaseSettings
$this->pConfig = $pConfig;
$this->trustedBrowserRepo = $trustedBrowserRepo;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $verified = $this->pConfig->get(Session::getLocalUser(), '2fa', 'verified');
+ $verified = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
if (!$verified) {
$this->baseUrl->redirect('settings/2fa');
@@ -71,7 +70,7 @@ class Trusted extends BaseSettings
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -80,7 +79,7 @@ class Trusted extends BaseSettings
switch ($_POST['action']) {
case 'remove_all':
- $this->trustedBrowserRepo->removeAllForUser(Session::getLocalUser());
+ $this->trustedBrowserRepo->removeAllForUser(DI::userSession()->getLocalUserId());
DI::sysmsg()->addInfo($this->t('Trusted browsers successfully removed.'));
$this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
break;
@@ -90,7 +89,7 @@ class Trusted extends BaseSettings
if (!empty($_POST['remove_id'])) {
self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted');
- if ($this->trustedBrowserRepo->removeForUser(Session::getLocalUser(), $_POST['remove_id'])) {
+ if ($this->trustedBrowserRepo->removeForUser(DI::userSession()->getLocalUserId(), $_POST['remove_id'])) {
DI::sysmsg()->addInfo($this->t('Trusted browser successfully removed.'));
}
@@ -103,7 +102,7 @@ class Trusted extends BaseSettings
{
parent::content();
- $trustedBrowsers = $this->trustedBrowserRepo->selectAllByUid(Session::getLocalUser());
+ $trustedBrowsers = $this->trustedBrowserRepo->selectAllByUid(DI::userSession()->getLocalUserId());
$parser = Parser::create();
diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php
index 208fff49d..0c6ab59ba 100644
--- a/src/Module/Settings/TwoFactor/Verify.php
+++ b/src/Module/Settings/TwoFactor/Verify.php
@@ -29,7 +29,6 @@ use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Module\BaseSettings;
use Friendica\Module\Response;
@@ -54,12 +53,12 @@ class Verify extends BaseSettings
$this->pConfig = $pConfig;
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $secret = $this->pConfig->get(Session::getLocalUser(), '2fa', 'secret');
- $verified = $this->pConfig->get(Session::getLocalUser(), '2fa', 'verified');
+ $secret = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'secret');
+ $verified = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'verified');
if ($secret && $verified) {
$this->baseUrl->redirect('settings/2fa');
@@ -73,7 +72,7 @@ class Verify extends BaseSettings
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -82,10 +81,10 @@ class Verify extends BaseSettings
$google2fa = new Google2FA();
- $valid = $google2fa->verifyKey($this->pConfig->get(Session::getLocalUser(), '2fa', 'secret'), $_POST['verify_code'] ?? '');
+ $valid = $google2fa->verifyKey($this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'secret'), $_POST['verify_code'] ?? '');
if ($valid) {
- $this->pConfig->set(Session::getLocalUser(), '2fa', 'verified', true);
+ $this->pConfig->set(DI::userSession()->getLocalUserId(), '2fa', 'verified', true);
DI::session()->set('2fa', true);
DI::sysmsg()->addInfo($this->t('Two-factor authentication successfully activated.'));
@@ -99,7 +98,7 @@ class Verify extends BaseSettings
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return Login::form('settings/2fa/verify');
}
@@ -107,7 +106,7 @@ class Verify extends BaseSettings
$company = 'Friendica';
$holder = DI::session()->get('my_address');
- $secret = $this->pConfig->get(Session::getLocalUser(), '2fa', 'secret');
+ $secret = $this->pConfig->get(DI::userSession()->getLocalUserId(), '2fa', 'secret');
$otpauthUrl = (new Google2FA())->getQRCodeUrl($company, $holder, $secret);
diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php
index 5932640f4..095c69483 100644
--- a/src/Module/Settings/UserExport.php
+++ b/src/Module/Settings/UserExport.php
@@ -24,7 +24,6 @@ namespace Friendica\Module\Settings;
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -55,7 +54,7 @@ class UserExport extends BaseSettings
*/
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
}
@@ -101,17 +100,17 @@ class UserExport extends BaseSettings
case "backup":
header("Content-type: application/json");
header('Content-Disposition: attachment; filename="' . DI::app()->getLoggedInUserNickname() . '.' . $action . '"');
- self::exportAll(Session::getLocalUser());
+ self::exportAll(DI::userSession()->getLocalUserId());
break;
case "account":
header("Content-type: application/json");
header('Content-Disposition: attachment; filename="' . DI::app()->getLoggedInUserNickname() . '.' . $action . '"');
- self::exportAccount(Session::getLocalUser());
+ self::exportAccount(DI::userSession()->getLocalUserId());
break;
case "contact":
header("Content-type: application/csv");
header('Content-Disposition: attachment; filename="' . DI::app()->getLoggedInUserNickname() . '-contacts.csv' . '"');
- self::exportContactsAsCSV(Session::getLocalUser());
+ self::exportContactsAsCSV(DI::userSession()->getLocalUserId());
break;
}
System::exit();
diff --git a/src/Module/Update/Community.php b/src/Module/Update/Community.php
index d3648888f..22d42c28a 100644
--- a/src/Module/Update/Community.php
+++ b/src/Module/Update/Community.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Update;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Module\Conversation\Community as CommunityModule;
@@ -39,8 +38,8 @@ class Community extends CommunityModule
$this->parseRequest();
$o = '';
- if (!empty($_GET['force']) || !DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_auto_update')) {
- $o = DI::conversation()->create(self::getItems(), 'community', true, false, 'commented', Session::getLocalUser());
+ if (!empty($_GET['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
+ $o = DI::conversation()->create(self::getItems(), 'community', true, false, 'commented', DI::userSession()->getLocalUserId());
}
System::htmlUpdateExit($o);
diff --git a/src/Module/Update/Network.php b/src/Module/Update/Network.php
index c8eefab91..6224d7c43 100644
--- a/src/Module/Update/Network.php
+++ b/src/Module/Update/Network.php
@@ -21,7 +21,6 @@
namespace Friendica\Module\Update;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Item;
@@ -76,7 +75,7 @@ class Network extends NetworkModule
$ordering = '`commented`';
}
- $o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, Session::getLocalUser());
+ $o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, DI::userSession()->getLocalUserId());
}
System::htmlUpdateExit($o);
diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php
index a05d70482..be15820e4 100644
--- a/src/Module/Update/Profile.php
+++ b/src/Module/Update/Profile.php
@@ -22,7 +22,6 @@
namespace Friendica\Module\Update;
use Friendica\BaseModule;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -42,13 +41,13 @@ class Profile extends BaseModule
// Ensure we've got a profile owner if updating.
$a->setProfileOwner((int)($_GET['p'] ?? 0));
- if (DI::config()->get('system', 'block_public') && !Session::getLocalUser() && !Session::getRemoteContactID($a->getProfileOwner())) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($a->getProfileOwner())) {
throw new ForbiddenException();
}
- $remote_contact = Session::getRemoteContactID($a->getProfileOwner());
- $is_owner = Session::getLocalUser() == $a->getProfileOwner();
- $last_updated_key = "profile:" . $a->getProfileOwner() . ":" . Session::getLocalUser() . ":" . $remote_contact;
+ $remote_contact = DI::userSession()->getRemoteContactID($a->getProfileOwner());
+ $is_owner = DI::userSession()->getLocalUserId() == $a->getProfileOwner();
+ $last_updated_key = "profile:" . $a->getProfileOwner() . ":" . DI::userSession()->getLocalUserId() . ":" . $remote_contact;
if (!$is_owner && !$remote_contact) {
$user = User::getById($a->getProfileOwner(), ['hidewall']);
@@ -59,7 +58,7 @@ class Profile extends BaseModule
$o = '';
- if (empty($_GET['force']) && DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_auto_update')) {
+ if (empty($_GET['force']) && DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
System::htmlUpdateExit($o);
}
@@ -110,9 +109,9 @@ class Profile extends BaseModule
}
if ($is_owner) {
- $unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => Session::getLocalUser()]);
+ $unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
if ($unseen) {
- Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => Session::getLocalUser()]);
+ Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
}
}
From dd1482d7914c70b91c5a7a9e64271fff0c1f12c1 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Fri, 21 Oct 2022 00:49:38 +0200
Subject: [PATCH 10/40] Fix CI pipeline
---
.woodpecker/.continuous-deployment.yml | 11 ++++++-----
.woodpecker/.releaser.yml | 11 ++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml
index b1bc2406a..a98bfd347 100644
--- a/.woodpecker/.continuous-deployment.yml
+++ b/.woodpecker/.continuous-deployment.yml
@@ -4,11 +4,6 @@ depends_on:
- database_checks
- messages.po_check
-# This prevents executing this pipeline at other servers than ci.friendi.ca
-labels:
- location: friendica
- type: releaser
-
skip_clone: true
pipeline:
@@ -23,6 +18,7 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
restore_cache:
image: meltwater/drone-cache:dev
settings:
@@ -38,6 +34,7 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
composer_install:
image: friendicaci/php7.4:php7.4.18
commands:
@@ -50,6 +47,7 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
create_artifacts:
image: debian
commands:
@@ -74,6 +72,7 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
sign_artifacts:
image: plugins/gpgsign
settings:
@@ -90,6 +89,7 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
publish_artifacts:
image: alpine
commands:
@@ -100,3 +100,4 @@ pipeline:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
+ instance: releaser.ci.friendi.ca
diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml
index 043071ddd..b667ede90 100644
--- a/.woodpecker/.releaser.yml
+++ b/.woodpecker/.releaser.yml
@@ -2,11 +2,6 @@ depends_on:
- phpunit
- code_standards_check
-# This prevents executing this pipeline at other servers than ci.friendi.ca
-labels:
- location: friendica
- type: releaser
-
skip_clone: true
pipeline:
@@ -21,6 +16,7 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
restore_cache:
image: meltwater/drone-cache:dev
settings:
@@ -36,6 +32,7 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
composer_install:
image: friendicaci/php7.4:php7.4.18
commands:
@@ -46,6 +43,7 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
volumes:
- /etc/hosts:/etc/hosts
create_artifacts:
@@ -72,6 +70,7 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
sign_artifacts:
image: plugins/gpgsign
settings:
@@ -88,6 +87,7 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
publish_artifacts:
image: alpine
commands:
@@ -98,3 +98,4 @@ pipeline:
repo: friendica/friendica
branch: stable
event: tag
+ instance: releaser.ci.friendi.ca
From bf39b5a9484122cca0fb85565ef0e899b92cb01a Mon Sep 17 00:00:00 2001
From: Philipp
Date: Fri, 21 Oct 2022 10:08:39 +0200
Subject: [PATCH 11/40] Fix messages.po issue
---
mod/repair_ostatus.php | 2 +-
src/Module/Debug/ActivityPubConversion.php | 2 +-
src/Module/Debug/Babel.php | 2 +-
view/lang/C/messages.po | 2560 ++++++++++----------
4 files changed, 1283 insertions(+), 1283 deletions(-)
diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php
index cc7eecde2..b0ee0bf57 100644
--- a/mod/repair_ostatus.php
+++ b/mod/repair_ostatus.php
@@ -43,7 +43,7 @@ function repair_ostatus_content(App $a) {
$total = DBA::count('contact', $condition);
if (!$total) {
- return ($o . DI::l10n()->t('Error'));
+ return ($o . DI::l10n()->tt('Error', 'Errors', 1));
}
$contact = Contact::selectToArray(['url'], $condition, ['order' => ['url'], 'limit' => [$counter++, 1]]);
diff --git a/src/Module/Debug/ActivityPubConversion.php b/src/Module/Debug/ActivityPubConversion.php
index 0f41dbf17..9a74ce971 100644
--- a/src/Module/Debug/ActivityPubConversion.php
+++ b/src/Module/Debug/ActivityPubConversion.php
@@ -126,7 +126,7 @@ class ActivityPubConversion extends BaseModule
];
} catch (\Throwable $e) {
$results[] = [
- 'title' => DI::l10n()->t('Error'),
+ 'title' => DI::l10n()->tt('Error', 'Errors', 1),
'content' => $e->getMessage(),
];
}
diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php
index 649c12cec..52c0fee9e 100644
--- a/src/Module/Debug/Babel.php
+++ b/src/Module/Debug/Babel.php
@@ -290,7 +290,7 @@ class Babel extends BaseModule
];
} else {
$results[] = [
- 'title' => DI::l10n()->t('Error'),
+ 'title' => DI::l10n()->tt('Error', 'Errors', 1),
'content' => DI::l10n()->t('Twitter addon is absent from the addon/ folder.'),
];
}
diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po
index 6c9478188..134d580f0 100644
--- a/view/lang/C/messages.po
+++ b/view/lang/C/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2022.12-dev\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-10-19 20:30+0000\n"
+"POT-Creation-Date: 2022-10-21 08:18+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -18,343 +18,343 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
-#: mod/cal.php:46 mod/cal.php:50 mod/follow.php:40 mod/redir.php:36
-#: mod/redir.php:177 src/Module/Conversation/Community.php:194
-#: src/Module/Debug/ItemBody.php:39 src/Module/Diaspora/Receive.php:57
-#: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:42
-#: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57
-#: src/Module/Item/Star.php:43
+#: mod/cal.php:45 mod/cal.php:49 mod/follow.php:39 mod/redir.php:35
+#: mod/redir.php:176 src/Module/Conversation/Community.php:193
+#: src/Module/Debug/ItemBody.php:38 src/Module/Diaspora/Receive.php:57
+#: src/Module/Item/Follow.php:41 src/Module/Item/Ignore.php:41
+#: src/Module/Item/Pin.php:41 src/Module/Item/Pin.php:56
+#: src/Module/Item/Star.php:42
msgid "Access denied."
msgstr ""
-#: mod/cal.php:63 mod/cal.php:80 mod/photos.php:69 mod/photos.php:140
-#: mod/photos.php:794 src/Model/Profile.php:235 src/Module/Feed.php:73
-#: src/Module/HCard.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/Media.php:39
-#: src/Module/Profile/Status.php:59 src/Module/Register.php:268
+#: mod/cal.php:62 mod/cal.php:79 mod/photos.php:68 mod/photos.php:139
+#: mod/photos.php:793 src/Model/Profile.php:234 src/Module/Feed.php:72
+#: src/Module/HCard.php:51 src/Module/Profile/Common.php:40
+#: src/Module/Profile/Common.php:51 src/Module/Profile/Contacts.php:39
+#: src/Module/Profile/Contacts.php:49 src/Module/Profile/Media.php:38
+#: src/Module/Profile/Status.php:58 src/Module/Register.php:267
#: src/Module/RemoteFollow.php:59
msgid "User not found."
msgstr ""
-#: mod/cal.php:122 mod/display.php:262 src/Module/Profile/Profile.php:94
-#: src/Module/Profile/Profile.php:109 src/Module/Profile/Status.php:110
-#: src/Module/Update/Profile.php:56
+#: mod/cal.php:121 mod/display.php:261 src/Module/Profile/Profile.php:93
+#: src/Module/Profile/Profile.php:108 src/Module/Profile/Status.php:109
+#: src/Module/Update/Profile.php:55
msgid "Access to this profile has been restricted."
msgstr ""
-#: mod/cal.php:243 mod/events.php:376 src/Content/Nav.php:197
+#: mod/cal.php:242 mod/events.php:375 src/Content/Nav.php:197
#: src/Content/Nav.php:261 src/Module/BaseProfile.php:84
#: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:242
#: view/theme/frio/theme.php:246
msgid "Events"
msgstr ""
-#: mod/cal.php:244 mod/events.php:377
+#: mod/cal.php:243 mod/events.php:376
msgid "View"
msgstr ""
-#: mod/cal.php:245 mod/events.php:379
+#: mod/cal.php:244 mod/events.php:378
msgid "Previous"
msgstr ""
-#: mod/cal.php:246 mod/events.php:380 src/Module/Install.php:214
+#: mod/cal.php:245 mod/events.php:379 src/Module/Install.php:214
msgid "Next"
msgstr ""
-#: mod/cal.php:249 mod/events.php:385 src/Model/Event.php:461
+#: mod/cal.php:248 mod/events.php:384 src/Model/Event.php:460
msgid "today"
msgstr ""
-#: mod/cal.php:250 mod/events.php:386 src/Model/Event.php:462
+#: mod/cal.php:249 mod/events.php:385 src/Model/Event.php:461
#: src/Util/Temporal.php:342
msgid "month"
msgstr ""
-#: mod/cal.php:251 mod/events.php:387 src/Model/Event.php:463
+#: mod/cal.php:250 mod/events.php:386 src/Model/Event.php:462
#: src/Util/Temporal.php:343
msgid "week"
msgstr ""
-#: mod/cal.php:252 mod/events.php:388 src/Model/Event.php:464
+#: mod/cal.php:251 mod/events.php:387 src/Model/Event.php:463
#: src/Util/Temporal.php:344
msgid "day"
msgstr ""
-#: mod/cal.php:253 mod/events.php:389
+#: mod/cal.php:252 mod/events.php:388
msgid "list"
msgstr ""
-#: mod/cal.php:265 src/Console/User.php:182 src/Model/User.php:663
-#: src/Module/Admin/Users/Active.php:74 src/Module/Admin/Users/Blocked.php:75
+#: mod/cal.php:264 src/Console/User.php:182 src/Model/User.php:663
+#: src/Module/Admin/Users/Active.php:73 src/Module/Admin/Users/Blocked.php:75
#: src/Module/Admin/Users/Index.php:81 src/Module/Admin/Users/Pending.php:71
#: src/Module/Api/Twitter/ContactEndpoint.php:74
msgid "User not found"
msgstr ""
-#: mod/cal.php:274
+#: mod/cal.php:273
msgid "This calendar format is not supported"
msgstr ""
-#: mod/cal.php:276
+#: mod/cal.php:275
msgid "No exportable data found"
msgstr ""
-#: mod/cal.php:292
+#: mod/cal.php:291
msgid "calendar"
msgstr ""
-#: mod/display.php:143 mod/photos.php:798
-#: src/Module/Conversation/Community.php:188 src/Module/Directory.php:49
-#: src/Module/Search/Index.php:65
+#: mod/display.php:142 mod/photos.php:797
+#: src/Module/Conversation/Community.php:187 src/Module/Directory.php:48
+#: src/Module/Search/Index.php:64
msgid "Public access denied."
msgstr ""
-#: mod/display.php:213 mod/display.php:287
+#: mod/display.php:212 mod/display.php:286
msgid "The requested item doesn't exist or has been deleted."
msgstr ""
-#: mod/display.php:367
+#: mod/display.php:366
msgid "The feed for this item is unavailable."
msgstr ""
-#: mod/editpost.php:39 mod/events.php:219 mod/follow.php:57 mod/follow.php:131
-#: mod/item.php:182 mod/item.php:187 mod/item.php:865 mod/message.php:70
-#: mod/message.php:115 mod/notes.php:45 mod/ostatus_subscribe.php:34
-#: mod/photos.php:160 mod/photos.php:887 mod/repair_ostatus.php:32
-#: mod/settings.php:41 mod/settings.php:51 mod/settings.php:157
-#: mod/suggest.php:35 mod/uimport.php:33 mod/unfollow.php:36
-#: mod/unfollow.php:51 mod/unfollow.php:83 mod/wall_attach.php:67
-#: mod/wall_attach.php:69 mod/wall_upload.php:89 mod/wall_upload.php:91
+#: mod/editpost.php:38 mod/events.php:218 mod/follow.php:56 mod/follow.php:130
+#: mod/item.php:181 mod/item.php:186 mod/item.php:864 mod/message.php:69
+#: mod/message.php:114 mod/notes.php:44 mod/ostatus_subscribe.php:33
+#: mod/photos.php:159 mod/photos.php:886 mod/repair_ostatus.php:31
+#: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156
+#: mod/suggest.php:34 mod/uimport.php:33 mod/unfollow.php:35
+#: mod/unfollow.php:50 mod/unfollow.php:82 mod/wall_attach.php:66
+#: mod/wall_attach.php:68 mod/wall_upload.php:88 mod/wall_upload.php:90
#: mod/wallmessage.php:37 mod/wallmessage.php:56 mod/wallmessage.php:90
#: mod/wallmessage.php:110 src/Module/Attach.php:56 src/Module/BaseApi.php:94
-#: src/Module/BaseNotifications.php:98 src/Module/Contact/Advanced.php:61
-#: src/Module/Delegation.php:119 src/Module/FollowConfirm.php:39
-#: src/Module/FriendSuggest.php:58 src/Module/Group.php:41
-#: src/Module/Group.php:84 src/Module/Invite.php:43 src/Module/Invite.php:132
-#: src/Module/Notifications/Notification.php:77
-#: src/Module/Notifications/Notification.php:108
-#: src/Module/Profile/Common.php:56 src/Module/Profile/Contacts.php:56
-#: src/Module/Profile/Schedule.php:40 src/Module/Profile/Schedule.php:57
-#: src/Module/Register.php:78 src/Module/Register.php:91
-#: src/Module/Register.php:207 src/Module/Register.php:246
-#: src/Module/Search/Directory.php:38 src/Module/Settings/Account.php:51
-#: src/Module/Settings/Account.php:411 src/Module/Settings/Delegation.php:42
-#: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42
-#: src/Module/Settings/Display.php:120
-#: src/Module/Settings/Profile/Photo/Crop.php:166
-#: src/Module/Settings/Profile/Photo/Index.php:112
-#: src/Module/Settings/UserExport.php:59 src/Module/Settings/UserExport.php:93
-#: src/Module/Settings/UserExport.php:197
-#: src/Module/Settings/UserExport.php:217
-#: src/Module/Settings/UserExport.php:282
+#: src/Module/BaseNotifications.php:98 src/Module/Contact/Advanced.php:60
+#: src/Module/Delegation.php:118 src/Module/FollowConfirm.php:38
+#: src/Module/FriendSuggest.php:57 src/Module/Group.php:40
+#: src/Module/Group.php:83 src/Module/Invite.php:42 src/Module/Invite.php:131
+#: src/Module/Notifications/Notification.php:76
+#: src/Module/Notifications/Notification.php:107
+#: src/Module/Profile/Common.php:55 src/Module/Profile/Contacts.php:55
+#: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56
+#: src/Module/Register.php:77 src/Module/Register.php:90
+#: src/Module/Register.php:206 src/Module/Register.php:245
+#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50
+#: src/Module/Settings/Account.php:410 src/Module/Settings/Delegation.php:41
+#: src/Module/Settings/Delegation.php:69 src/Module/Settings/Display.php:41
+#: src/Module/Settings/Display.php:119
+#: src/Module/Settings/Profile/Photo/Crop.php:165
+#: src/Module/Settings/Profile/Photo/Index.php:111
+#: src/Module/Settings/UserExport.php:58 src/Module/Settings/UserExport.php:92
+#: src/Module/Settings/UserExport.php:196
+#: src/Module/Settings/UserExport.php:216
+#: src/Module/Settings/UserExport.php:281
msgid "Permission denied."
msgstr ""
-#: mod/editpost.php:46 mod/editpost.php:56
+#: mod/editpost.php:45 mod/editpost.php:55
msgid "Item not found"
msgstr ""
-#: mod/editpost.php:65
+#: mod/editpost.php:64
msgid "Edit post"
msgstr ""
-#: mod/editpost.php:92 mod/notes.php:57 src/Content/Text/HTML.php:882
-#: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:75
+#: mod/editpost.php:91 mod/notes.php:56 src/Content/Text/HTML.php:882
+#: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:74
msgid "Save"
msgstr ""
-#: mod/editpost.php:93 mod/photos.php:1334 src/Content/Conversation.php:342
+#: mod/editpost.php:92 mod/photos.php:1333 src/Content/Conversation.php:342
#: src/Object/Post.php:993
msgid "Loading..."
msgstr ""
-#: mod/editpost.php:94 mod/message.php:202 mod/message.php:358
+#: mod/editpost.php:93 mod/message.php:201 mod/message.php:357
#: mod/wallmessage.php:140 src/Content/Conversation.php:343
msgid "Upload photo"
msgstr ""
-#: mod/editpost.php:95 src/Content/Conversation.php:344
+#: mod/editpost.php:94 src/Content/Conversation.php:344
msgid "upload photo"
msgstr ""
-#: mod/editpost.php:96 src/Content/Conversation.php:345
+#: mod/editpost.php:95 src/Content/Conversation.php:345
msgid "Attach file"
msgstr ""
-#: mod/editpost.php:97 src/Content/Conversation.php:346
+#: mod/editpost.php:96 src/Content/Conversation.php:346
msgid "attach file"
msgstr ""
-#: mod/editpost.php:98 mod/message.php:203 mod/message.php:359
+#: mod/editpost.php:97 mod/message.php:202 mod/message.php:358
#: mod/wallmessage.php:141
msgid "Insert web link"
msgstr ""
-#: mod/editpost.php:99
+#: mod/editpost.php:98
msgid "web link"
msgstr ""
-#: mod/editpost.php:100
+#: mod/editpost.php:99
msgid "Insert video link"
msgstr ""
-#: mod/editpost.php:101
+#: mod/editpost.php:100
msgid "video link"
msgstr ""
-#: mod/editpost.php:102
+#: mod/editpost.php:101
msgid "Insert audio link"
msgstr ""
-#: mod/editpost.php:103
+#: mod/editpost.php:102
msgid "audio link"
msgstr ""
-#: mod/editpost.php:104 src/Content/Conversation.php:356
-#: src/Module/Item/Compose.php:201
+#: mod/editpost.php:103 src/Content/Conversation.php:356
+#: src/Module/Item/Compose.php:200
msgid "Set your location"
msgstr ""
-#: mod/editpost.php:105 src/Content/Conversation.php:357
+#: mod/editpost.php:104 src/Content/Conversation.php:357
msgid "set location"
msgstr ""
-#: mod/editpost.php:106 src/Content/Conversation.php:358
+#: mod/editpost.php:105 src/Content/Conversation.php:358
msgid "Clear browser location"
msgstr ""
-#: mod/editpost.php:107 src/Content/Conversation.php:359
+#: mod/editpost.php:106 src/Content/Conversation.php:359
msgid "clear location"
msgstr ""
-#: mod/editpost.php:108 mod/message.php:204 mod/message.php:361
-#: mod/photos.php:1485 mod/wallmessage.php:142 src/Content/Conversation.php:372
-#: src/Content/Conversation.php:718 src/Module/Item/Compose.php:205
+#: mod/editpost.php:107 mod/message.php:203 mod/message.php:360
+#: mod/photos.php:1484 mod/wallmessage.php:142 src/Content/Conversation.php:372
+#: src/Content/Conversation.php:718 src/Module/Item/Compose.php:204
#: src/Object/Post.php:538
msgid "Please wait"
msgstr ""
-#: mod/editpost.php:109 src/Content/Conversation.php:373
+#: mod/editpost.php:108 src/Content/Conversation.php:373
msgid "Permission settings"
msgstr ""
-#: mod/editpost.php:117 src/Core/ACL.php:326
+#: mod/editpost.php:116 src/Core/ACL.php:326
msgid "CC: email addresses"
msgstr ""
-#: mod/editpost.php:118 src/Content/Conversation.php:383
+#: mod/editpost.php:117 src/Content/Conversation.php:383
msgid "Public post"
msgstr ""
-#: mod/editpost.php:121 src/Content/Conversation.php:361
-#: src/Module/Item/Compose.php:206
+#: mod/editpost.php:120 src/Content/Conversation.php:361
+#: src/Module/Item/Compose.php:205
msgid "Set title"
msgstr ""
-#: mod/editpost.php:123 src/Content/Conversation.php:363
-#: src/Module/Item/Compose.php:207
+#: mod/editpost.php:122 src/Content/Conversation.php:363
+#: src/Module/Item/Compose.php:206
msgid "Categories (comma-separated list)"
msgstr ""
-#: mod/editpost.php:124 src/Core/ACL.php:327
+#: mod/editpost.php:123 src/Core/ACL.php:327
msgid "Example: bob@example.com, mary@example.com"
msgstr ""
-#: mod/editpost.php:129 mod/events.php:515 mod/photos.php:1333
-#: mod/photos.php:1389 mod/photos.php:1463 src/Content/Conversation.php:387
-#: src/Module/Item/Compose.php:200 src/Object/Post.php:1003
+#: mod/editpost.php:128 mod/events.php:514 mod/photos.php:1332
+#: mod/photos.php:1388 mod/photos.php:1462 src/Content/Conversation.php:387
+#: src/Module/Item/Compose.php:199 src/Object/Post.php:1003
msgid "Preview"
msgstr ""
-#: mod/editpost.php:131 mod/fbrowser.php:120 mod/fbrowser.php:147
-#: mod/follow.php:145 mod/photos.php:1000 mod/photos.php:1101 mod/tagrm.php:36
-#: mod/tagrm.php:128 mod/unfollow.php:98 src/Content/Conversation.php:390
-#: src/Module/Contact/Revoke.php:110 src/Module/RemoteFollow.php:128
-#: src/Module/Security/TwoFactor/SignOut.php:127
+#: mod/editpost.php:130 mod/fbrowser.php:119 mod/fbrowser.php:146
+#: mod/follow.php:144 mod/photos.php:999 mod/photos.php:1100 mod/tagrm.php:35
+#: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:390
+#: src/Module/Contact/Revoke.php:109 src/Module/RemoteFollow.php:128
+#: src/Module/Security/TwoFactor/SignOut.php:126
msgid "Cancel"
msgstr ""
-#: mod/editpost.php:135 src/Content/Conversation.php:347
-#: src/Module/Item/Compose.php:191 src/Object/Post.php:994
+#: mod/editpost.php:134 src/Content/Conversation.php:347
+#: src/Module/Item/Compose.php:190 src/Object/Post.php:994
msgid "Bold"
msgstr ""
-#: mod/editpost.php:136 src/Content/Conversation.php:348
-#: src/Module/Item/Compose.php:192 src/Object/Post.php:995
+#: mod/editpost.php:135 src/Content/Conversation.php:348
+#: src/Module/Item/Compose.php:191 src/Object/Post.php:995
msgid "Italic"
msgstr ""
-#: mod/editpost.php:137 src/Content/Conversation.php:349
-#: src/Module/Item/Compose.php:193 src/Object/Post.php:996
+#: mod/editpost.php:136 src/Content/Conversation.php:349
+#: src/Module/Item/Compose.php:192 src/Object/Post.php:996
msgid "Underline"
msgstr ""
-#: mod/editpost.php:138 src/Content/Conversation.php:350
-#: src/Module/Item/Compose.php:194 src/Object/Post.php:997
+#: mod/editpost.php:137 src/Content/Conversation.php:350
+#: src/Module/Item/Compose.php:193 src/Object/Post.php:997
msgid "Quote"
msgstr ""
-#: mod/editpost.php:139 src/Content/Conversation.php:351
-#: src/Module/Item/Compose.php:195 src/Object/Post.php:998
+#: mod/editpost.php:138 src/Content/Conversation.php:351
+#: src/Module/Item/Compose.php:194 src/Object/Post.php:998
msgid "Code"
msgstr ""
-#: mod/editpost.php:140 src/Content/Conversation.php:353
-#: src/Module/Item/Compose.php:197 src/Object/Post.php:1000
+#: mod/editpost.php:139 src/Content/Conversation.php:353
+#: src/Module/Item/Compose.php:196 src/Object/Post.php:1000
msgid "Link"
msgstr ""
-#: mod/editpost.php:141 src/Content/Conversation.php:354
-#: src/Module/Item/Compose.php:198 src/Object/Post.php:1001
+#: mod/editpost.php:140 src/Content/Conversation.php:354
+#: src/Module/Item/Compose.php:197 src/Object/Post.php:1001
msgid "Link or Media"
msgstr ""
-#: mod/editpost.php:144 src/Content/Conversation.php:397
-#: src/Content/Widget/VCard.php:114 src/Model/Profile.php:466
+#: mod/editpost.php:143 src/Content/Conversation.php:397
+#: src/Content/Widget/VCard.php:114 src/Model/Profile.php:465
#: src/Module/Admin/Logs/View.php:93
msgid "Message"
msgstr ""
-#: mod/editpost.php:145 src/Content/Conversation.php:398
-#: src/Module/Settings/TwoFactor/Trusted.php:140
+#: mod/editpost.php:144 src/Content/Conversation.php:398
+#: src/Module/Settings/TwoFactor/Trusted.php:139
msgid "Browser"
msgstr ""
-#: mod/editpost.php:146 mod/events.php:520 mod/photos.php:935
-#: mod/photos.php:1287 src/Content/Conversation.php:374
+#: mod/editpost.php:145 mod/events.php:519 mod/photos.php:934
+#: mod/photos.php:1286 src/Content/Conversation.php:374
msgid "Permissions"
msgstr ""
-#: mod/editpost.php:148 src/Content/Conversation.php:400
+#: mod/editpost.php:147 src/Content/Conversation.php:400
msgid "Open Compose page"
msgstr ""
-#: mod/events.php:125 mod/events.php:127
+#: mod/events.php:124 mod/events.php:126
msgid "Event can not end before it has started."
msgstr ""
-#: mod/events.php:133 mod/events.php:135
+#: mod/events.php:132 mod/events.php:134
msgid "Event title and start time are required."
msgstr ""
-#: mod/events.php:378
+#: mod/events.php:377
msgid "Create New Event"
msgstr ""
-#: mod/events.php:476 src/Module/Admin/Logs/View.php:97
+#: mod/events.php:475 src/Module/Admin/Logs/View.php:97
msgid "Event details"
msgstr ""
-#: mod/events.php:477
+#: mod/events.php:476
msgid "Starting date and Title are required."
msgstr ""
-#: mod/events.php:478 mod/events.php:483
+#: mod/events.php:477 mod/events.php:482
msgid "Event Starts:"
msgstr ""
-#: mod/events.php:478 mod/events.php:508
+#: mod/events.php:477 mod/events.php:507
#: src/Module/Admin/Blocklist/Server/Add.php:136
#: src/Module/Admin/Blocklist/Server/Add.php:138
#: src/Module/Admin/Blocklist/Server/Import.php:128
@@ -362,182 +362,182 @@ msgstr ""
#: src/Module/Admin/Blocklist/Server/Index.php:85
#: src/Module/Admin/Blocklist/Server/Index.php:113
#: src/Module/Admin/Blocklist/Server/Index.php:114
-#: src/Module/Admin/Item/Delete.php:69 src/Module/Debug/Probe.php:60
+#: src/Module/Admin/Item/Delete.php:69 src/Module/Debug/Probe.php:59
#: src/Module/Install.php:207 src/Module/Install.php:240
#: src/Module/Install.php:245 src/Module/Install.php:264
#: src/Module/Install.php:275 src/Module/Install.php:280
#: src/Module/Install.php:286 src/Module/Install.php:291
#: src/Module/Install.php:305 src/Module/Install.php:320
-#: src/Module/Install.php:347 src/Module/Register.php:149
+#: src/Module/Install.php:347 src/Module/Register.php:148
#: src/Module/Security/TwoFactor/Verify.php:102
-#: src/Module/Settings/TwoFactor/Index.php:141
-#: src/Module/Settings/TwoFactor/Verify.php:155
+#: src/Module/Settings/TwoFactor/Index.php:140
+#: src/Module/Settings/TwoFactor/Verify.php:154
msgid "Required"
msgstr ""
-#: mod/events.php:491 mod/events.php:514
+#: mod/events.php:490 mod/events.php:513
msgid "Finish date/time is not known or not relevant"
msgstr ""
-#: mod/events.php:493 mod/events.php:498
+#: mod/events.php:492 mod/events.php:497
msgid "Event Finishes:"
msgstr ""
-#: mod/events.php:504 src/Module/Profile/Profile.php:172
-#: src/Module/Settings/Profile/Index.php:239
+#: mod/events.php:503 src/Module/Profile/Profile.php:171
+#: src/Module/Settings/Profile/Index.php:238
msgid "Description:"
msgstr ""
-#: mod/events.php:506 src/Content/Widget/VCard.php:105 src/Model/Event.php:81
-#: src/Model/Event.php:108 src/Model/Event.php:470 src/Model/Event.php:920
-#: src/Model/Profile.php:374 src/Module/Contact/Profile.php:371
-#: src/Module/Directory.php:148 src/Module/Notifications/Introductions.php:187
-#: src/Module/Profile/Profile.php:194
+#: mod/events.php:505 src/Content/Widget/VCard.php:105 src/Model/Event.php:80
+#: src/Model/Event.php:107 src/Model/Event.php:469 src/Model/Event.php:919
+#: src/Model/Profile.php:373 src/Module/Contact/Profile.php:371
+#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:186
+#: src/Module/Profile/Profile.php:193
msgid "Location:"
msgstr ""
-#: mod/events.php:508 mod/events.php:510
+#: mod/events.php:507 mod/events.php:509
msgid "Title:"
msgstr ""
-#: mod/events.php:511 mod/events.php:512
+#: mod/events.php:510 mod/events.php:511
msgid "Share this event"
msgstr ""
-#: mod/events.php:517 mod/message.php:205 mod/message.php:360
-#: mod/photos.php:917 mod/photos.php:1021 mod/photos.php:1291
-#: mod/photos.php:1332 mod/photos.php:1388 mod/photos.php:1462
-#: src/Module/Admin/Item/Source.php:60 src/Module/Contact/Advanced.php:133
+#: mod/events.php:516 mod/message.php:204 mod/message.php:359
+#: mod/photos.php:916 mod/photos.php:1020 mod/photos.php:1290
+#: mod/photos.php:1331 mod/photos.php:1387 mod/photos.php:1461
+#: src/Module/Admin/Item/Source.php:60 src/Module/Contact/Advanced.php:132
#: src/Module/Contact/Profile.php:329
-#: src/Module/Debug/ActivityPubConversion.php:141
+#: src/Module/Debug/ActivityPubConversion.php:140
#: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64
-#: src/Module/Debug/Probe.php:55 src/Module/Debug/WebFinger.php:52
-#: src/Module/Delegation.php:148 src/Module/FriendSuggest.php:146
+#: src/Module/Debug/Probe.php:54 src/Module/Debug/WebFinger.php:51
+#: src/Module/Delegation.php:147 src/Module/FriendSuggest.php:145
#: src/Module/Install.php:252 src/Module/Install.php:294
-#: src/Module/Install.php:331 src/Module/Invite.php:179
-#: src/Module/Item/Compose.php:190 src/Module/Profile/Profile.php:247
-#: src/Module/Settings/Profile/Index.php:223 src/Object/Post.php:992
+#: src/Module/Install.php:331 src/Module/Invite.php:178
+#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:246
+#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:992
#: view/theme/duepuntozero/config.php:86 view/theme/frio/config.php:172
#: view/theme/quattro/config.php:88 view/theme/vier/config.php:136
msgid "Submit"
msgstr ""
-#: mod/events.php:518 src/Module/Profile/Profile.php:248
+#: mod/events.php:517 src/Module/Profile/Profile.php:247
msgid "Basic"
msgstr ""
-#: mod/events.php:519 src/Module/Admin/Site.php:437 src/Module/Contact.php:478
-#: src/Module/Profile/Profile.php:249
+#: mod/events.php:518 src/Module/Admin/Site.php:437 src/Module/Contact.php:477
+#: src/Module/Profile/Profile.php:248
msgid "Advanced"
msgstr ""
-#: mod/events.php:536
+#: mod/events.php:535
msgid "Failed to remove event"
msgstr ""
-#: mod/fbrowser.php:62 src/Content/Nav.php:195 src/Module/BaseProfile.php:64
+#: mod/fbrowser.php:61 src/Content/Nav.php:195 src/Module/BaseProfile.php:64
#: view/theme/frio/theme.php:240
msgid "Photos"
msgstr ""
-#: mod/fbrowser.php:122 mod/fbrowser.php:149
-#: src/Module/Settings/Profile/Photo/Index.php:129
+#: mod/fbrowser.php:121 mod/fbrowser.php:148
+#: src/Module/Settings/Profile/Photo/Index.php:128
msgid "Upload"
msgstr ""
-#: mod/fbrowser.php:144
+#: mod/fbrowser.php:143
msgid "Files"
msgstr ""
-#: mod/follow.php:75 mod/unfollow.php:97 src/Module/RemoteFollow.php:127
+#: mod/follow.php:74 mod/unfollow.php:96 src/Module/RemoteFollow.php:127
msgid "Submit Request"
msgstr ""
-#: mod/follow.php:85
+#: mod/follow.php:84
msgid "You already added this contact."
msgstr ""
-#: mod/follow.php:101
+#: mod/follow.php:100
msgid "The network type couldn't be detected. Contact can't be added."
msgstr ""
-#: mod/follow.php:109
+#: mod/follow.php:108
msgid "Diaspora support isn't enabled. Contact can't be added."
msgstr ""
-#: mod/follow.php:114
+#: mod/follow.php:113
msgid "OStatus support is disabled. Contact can't be added."
msgstr ""
-#: mod/follow.php:139 src/Content/Item.php:401 src/Content/Widget.php:81
-#: src/Model/Contact.php:1169 src/Model/Contact.php:1180
+#: mod/follow.php:138 src/Content/Item.php:401 src/Content/Widget.php:81
+#: src/Model/Contact.php:1194 src/Model/Contact.php:1205
#: view/theme/vier/theme.php:199
msgid "Connect/Follow"
msgstr ""
-#: mod/follow.php:140 src/Module/RemoteFollow.php:126
+#: mod/follow.php:139 src/Module/RemoteFollow.php:126
msgid "Please answer the following:"
msgstr ""
-#: mod/follow.php:141 mod/unfollow.php:95
+#: mod/follow.php:140 mod/unfollow.php:94
msgid "Your Identity Address:"
msgstr ""
-#: mod/follow.php:142 mod/unfollow.php:101
+#: mod/follow.php:141 mod/unfollow.php:100
#: src/Module/Admin/Blocklist/Contact.php:116
#: src/Module/Contact/Profile.php:367
-#: src/Module/Notifications/Introductions.php:129
-#: src/Module/Notifications/Introductions.php:198
+#: src/Module/Notifications/Introductions.php:128
+#: src/Module/Notifications/Introductions.php:197
msgid "Profile URL"
msgstr ""
-#: mod/follow.php:143 src/Module/Contact/Profile.php:379
-#: src/Module/Notifications/Introductions.php:191
-#: src/Module/Profile/Profile.php:207
+#: mod/follow.php:142 src/Module/Contact/Profile.php:379
+#: src/Module/Notifications/Introductions.php:190
+#: src/Module/Profile/Profile.php:206
msgid "Tags:"
msgstr ""
-#: mod/follow.php:154
+#: mod/follow.php:153
#, php-format
msgid "%s knows you"
msgstr ""
-#: mod/follow.php:155
+#: mod/follow.php:154
msgid "Add a personal note:"
msgstr ""
-#: mod/follow.php:164 mod/unfollow.php:110 src/Module/BaseProfile.php:59
-#: src/Module/Contact.php:448
+#: mod/follow.php:163 mod/unfollow.php:109 src/Module/BaseProfile.php:59
+#: src/Module/Contact.php:447
msgid "Status Messages and Posts"
msgstr ""
-#: mod/follow.php:192
+#: mod/follow.php:191
msgid "The contact could not be added."
msgstr ""
-#: mod/item.php:132 mod/item.php:136
+#: mod/item.php:131 mod/item.php:135
msgid "Unable to locate original post."
msgstr ""
-#: mod/item.php:338 mod/item.php:343
+#: mod/item.php:337 mod/item.php:342
msgid "Empty post discarded."
msgstr ""
-#: mod/item.php:675
+#: mod/item.php:674
msgid "Post updated."
msgstr ""
-#: mod/item.php:685 mod/item.php:690
+#: mod/item.php:684 mod/item.php:689
msgid "Item wasn't stored."
msgstr ""
-#: mod/item.php:701
+#: mod/item.php:700
msgid "Item couldn't be fetched."
msgstr ""
-#: mod/item.php:841 src/Module/Admin/Themes/Details.php:39
-#: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:43
-#: src/Module/Debug/ItemBody.php:58
+#: mod/item.php:840 src/Module/Admin/Themes/Details.php:39
+#: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42
+#: src/Module/Debug/ItemBody.php:57
msgid "Item not found."
msgstr ""
@@ -610,7 +610,7 @@ msgid ""
"your email for further instructions."
msgstr ""
-#: mod/lostpass.php:130 src/Module/Security/Login.php:162
+#: mod/lostpass.php:130 src/Module/Security/Login.php:161
msgid "Nickname or Email: "
msgstr ""
@@ -618,7 +618,7 @@ msgstr ""
msgid "Reset"
msgstr ""
-#: mod/lostpass.php:146 src/Module/Security/Login.php:174
+#: mod/lostpass.php:146 src/Module/Security/Login.php:173
msgid "Password Reset"
msgstr ""
@@ -679,616 +679,616 @@ msgstr ""
msgid "Your password has been changed at %s"
msgstr ""
-#: mod/match.php:63
+#: mod/match.php:62
msgid "No keywords to match. Please add keywords to your profile."
msgstr ""
-#: mod/match.php:94 src/Module/BaseSearch.php:120
+#: mod/match.php:93 src/Module/BaseSearch.php:119
msgid "No matches"
msgstr ""
-#: mod/match.php:99
+#: mod/match.php:98
msgid "Profile Match"
msgstr ""
-#: mod/message.php:47 mod/message.php:130 src/Content/Nav.php:289
+#: mod/message.php:46 mod/message.php:129 src/Content/Nav.php:289
msgid "New Message"
msgstr ""
-#: mod/message.php:84 mod/wallmessage.php:70
+#: mod/message.php:83 mod/wallmessage.php:70
msgid "No recipient selected."
msgstr ""
-#: mod/message.php:89
+#: mod/message.php:88
msgid "Unable to locate contact information."
msgstr ""
-#: mod/message.php:93 mod/wallmessage.php:76
+#: mod/message.php:92 mod/wallmessage.php:76
msgid "Message could not be sent."
msgstr ""
-#: mod/message.php:97 mod/wallmessage.php:79
+#: mod/message.php:96 mod/wallmessage.php:79
msgid "Message collection failure."
msgstr ""
-#: mod/message.php:124 src/Module/Notifications/Introductions.php:135
-#: src/Module/Notifications/Introductions.php:170
-#: src/Module/Notifications/Notification.php:86
+#: mod/message.php:123 src/Module/Notifications/Introductions.php:134
+#: src/Module/Notifications/Introductions.php:169
+#: src/Module/Notifications/Notification.php:85
msgid "Discard"
msgstr ""
-#: mod/message.php:137 src/Content/Nav.php:286 view/theme/frio/theme.php:247
+#: mod/message.php:136 src/Content/Nav.php:286 view/theme/frio/theme.php:247
msgid "Messages"
msgstr ""
-#: mod/message.php:150
+#: mod/message.php:149
msgid "Conversation not found."
msgstr ""
-#: mod/message.php:155
+#: mod/message.php:154
msgid "Message was not deleted."
msgstr ""
-#: mod/message.php:170
+#: mod/message.php:169
msgid "Conversation was not removed."
msgstr ""
-#: mod/message.php:184 mod/message.php:290 mod/wallmessage.php:124
+#: mod/message.php:183 mod/message.php:289 mod/wallmessage.php:124
msgid "Please enter a link URL:"
msgstr ""
-#: mod/message.php:193 mod/wallmessage.php:129
+#: mod/message.php:192 mod/wallmessage.php:129
msgid "Send Private Message"
msgstr ""
-#: mod/message.php:194 mod/message.php:350 mod/wallmessage.php:131
+#: mod/message.php:193 mod/message.php:349 mod/wallmessage.php:131
msgid "To:"
msgstr ""
-#: mod/message.php:195 mod/message.php:351 mod/wallmessage.php:132
+#: mod/message.php:194 mod/message.php:350 mod/wallmessage.php:132
msgid "Subject:"
msgstr ""
-#: mod/message.php:199 mod/message.php:354 mod/wallmessage.php:138
-#: src/Module/Invite.php:172
+#: mod/message.php:198 mod/message.php:353 mod/wallmessage.php:138
+#: src/Module/Invite.php:171
msgid "Your message:"
msgstr ""
-#: mod/message.php:226
+#: mod/message.php:225
msgid "No messages."
msgstr ""
-#: mod/message.php:282
+#: mod/message.php:281
msgid "Message not available."
msgstr ""
-#: mod/message.php:327
+#: mod/message.php:326
msgid "Delete message"
msgstr ""
-#: mod/message.php:329 mod/message.php:460
+#: mod/message.php:328 mod/message.php:459
msgid "D, d M Y - g:i A"
msgstr ""
-#: mod/message.php:344 mod/message.php:457
+#: mod/message.php:343 mod/message.php:456
msgid "Delete conversation"
msgstr ""
-#: mod/message.php:346
+#: mod/message.php:345
msgid ""
"No secure communications available. You may be able to "
"respond from the sender's profile page."
msgstr ""
-#: mod/message.php:349
+#: mod/message.php:348
msgid "Send Reply"
msgstr ""
-#: mod/message.php:431
+#: mod/message.php:430
#, php-format
msgid "Unknown sender - %s"
msgstr ""
-#: mod/message.php:433
+#: mod/message.php:432
#, php-format
msgid "You and %s"
msgstr ""
-#: mod/message.php:435
+#: mod/message.php:434
#, php-format
msgid "%s and You"
msgstr ""
-#: mod/message.php:463
+#: mod/message.php:462
#, php-format
msgid "%d message"
msgid_plural "%d messages"
msgstr[0] ""
msgstr[1] ""
-#: mod/notes.php:52 src/Module/BaseProfile.php:106
+#: mod/notes.php:51 src/Module/BaseProfile.php:106
msgid "Personal Notes"
msgstr ""
-#: mod/notes.php:56
+#: mod/notes.php:55
msgid "Personal notes are visible only by yourself."
msgstr ""
-#: mod/ostatus_subscribe.php:39
+#: mod/ostatus_subscribe.php:38
msgid "Subscribing to contacts"
msgstr ""
-#: mod/ostatus_subscribe.php:48
+#: mod/ostatus_subscribe.php:47
msgid "No contact provided."
msgstr ""
-#: mod/ostatus_subscribe.php:54
+#: mod/ostatus_subscribe.php:53
msgid "Couldn't fetch information for contact."
msgstr ""
-#: mod/ostatus_subscribe.php:65
+#: mod/ostatus_subscribe.php:64
msgid "Couldn't fetch friends for contact."
msgstr ""
-#: mod/ostatus_subscribe.php:71 mod/ostatus_subscribe.php:82
+#: mod/ostatus_subscribe.php:70 mod/ostatus_subscribe.php:81
msgid "Couldn't fetch following contacts."
msgstr ""
-#: mod/ostatus_subscribe.php:77
+#: mod/ostatus_subscribe.php:76
msgid "Couldn't fetch remote profile."
msgstr ""
-#: mod/ostatus_subscribe.php:87
+#: mod/ostatus_subscribe.php:86
msgid "Unsupported network"
msgstr ""
-#: mod/ostatus_subscribe.php:103 mod/repair_ostatus.php:52
+#: mod/ostatus_subscribe.php:102 mod/repair_ostatus.php:51
msgid "Done"
msgstr ""
-#: mod/ostatus_subscribe.php:117
+#: mod/ostatus_subscribe.php:116
msgid "success"
msgstr ""
-#: mod/ostatus_subscribe.php:119
+#: mod/ostatus_subscribe.php:118
msgid "failed"
msgstr ""
-#: mod/ostatus_subscribe.php:122
+#: mod/ostatus_subscribe.php:121
msgid "ignored"
msgstr ""
-#: mod/ostatus_subscribe.php:127 mod/repair_ostatus.php:58
+#: mod/ostatus_subscribe.php:126 mod/repair_ostatus.php:57
msgid "Keep this window open until done."
msgstr ""
-#: mod/photos.php:108 src/Module/BaseProfile.php:67
+#: mod/photos.php:107 src/Module/BaseProfile.php:67
msgid "Photo Albums"
msgstr ""
-#: mod/photos.php:109 mod/photos.php:1580
+#: mod/photos.php:108 mod/photos.php:1579
msgid "Recent Photos"
msgstr ""
-#: mod/photos.php:111 mod/photos.php:1069 mod/photos.php:1582
+#: mod/photos.php:110 mod/photos.php:1068 mod/photos.php:1581
msgid "Upload New Photos"
msgstr ""
-#: mod/photos.php:129 src/Module/BaseSettings.php:35
+#: mod/photos.php:128 src/Module/BaseSettings.php:35
msgid "everybody"
msgstr ""
-#: mod/photos.php:167
+#: mod/photos.php:166
msgid "Contact information unavailable"
msgstr ""
-#: mod/photos.php:196
+#: mod/photos.php:195
msgid "Album not found."
msgstr ""
-#: mod/photos.php:250
+#: mod/photos.php:249
msgid "Album successfully deleted"
msgstr ""
-#: mod/photos.php:252
+#: mod/photos.php:251
msgid "Album was empty."
msgstr ""
-#: mod/photos.php:284
+#: mod/photos.php:283
msgid "Failed to delete the photo."
msgstr ""
-#: mod/photos.php:553
+#: mod/photos.php:552
msgid "a photo"
msgstr ""
-#: mod/photos.php:553
+#: mod/photos.php:552
#, php-format
msgid "%1$s was tagged in %2$s by %3$s"
msgstr ""
-#: mod/photos.php:632 mod/photos.php:635 mod/photos.php:662
-#: mod/wall_upload.php:201 src/Module/Settings/Profile/Photo/Index.php:60
+#: mod/photos.php:631 mod/photos.php:634 mod/photos.php:661
+#: mod/wall_upload.php:200 src/Module/Settings/Profile/Photo/Index.php:59
#, php-format
msgid "Image exceeds size limit of %s"
msgstr ""
-#: mod/photos.php:638
+#: mod/photos.php:637
msgid "Image upload didn't complete, please try again"
msgstr ""
-#: mod/photos.php:641
+#: mod/photos.php:640
msgid "Image file is missing"
msgstr ""
-#: mod/photos.php:646
+#: mod/photos.php:645
msgid ""
"Server can't accept new file upload at this time, please contact your "
"administrator"
msgstr ""
-#: mod/photos.php:670
+#: mod/photos.php:669
msgid "Image file is empty."
msgstr ""
-#: mod/photos.php:685 mod/wall_upload.php:163
-#: src/Module/Settings/Profile/Photo/Index.php:69
+#: mod/photos.php:684 mod/wall_upload.php:162
+#: src/Module/Settings/Profile/Photo/Index.php:68
msgid "Unable to process image."
msgstr ""
-#: mod/photos.php:711 mod/wall_upload.php:226
-#: src/Module/Settings/Profile/Photo/Index.php:96
+#: mod/photos.php:710 mod/wall_upload.php:225
+#: src/Module/Settings/Profile/Photo/Index.php:95
msgid "Image upload failed."
msgstr ""
-#: mod/photos.php:803
+#: mod/photos.php:802
msgid "No photos selected"
msgstr ""
-#: mod/photos.php:872
+#: mod/photos.php:871
msgid "Access to this item is restricted."
msgstr ""
-#: mod/photos.php:927
+#: mod/photos.php:926
msgid "Upload Photos"
msgstr ""
-#: mod/photos.php:931 mod/photos.php:1017
+#: mod/photos.php:930 mod/photos.php:1016
msgid "New album name: "
msgstr ""
-#: mod/photos.php:932
+#: mod/photos.php:931
msgid "or select existing album:"
msgstr ""
-#: mod/photos.php:933
+#: mod/photos.php:932
msgid "Do not show a status post for this upload"
msgstr ""
-#: mod/photos.php:998
+#: mod/photos.php:997
msgid "Do you really want to delete this photo album and all its photos?"
msgstr ""
-#: mod/photos.php:999 mod/photos.php:1022
+#: mod/photos.php:998 mod/photos.php:1021
msgid "Delete Album"
msgstr ""
-#: mod/photos.php:1026
+#: mod/photos.php:1025
msgid "Edit Album"
msgstr ""
-#: mod/photos.php:1027
+#: mod/photos.php:1026
msgid "Drop Album"
msgstr ""
-#: mod/photos.php:1031
+#: mod/photos.php:1030
msgid "Show Newest First"
msgstr ""
-#: mod/photos.php:1033
+#: mod/photos.php:1032
msgid "Show Oldest First"
msgstr ""
-#: mod/photos.php:1054 mod/photos.php:1565
+#: mod/photos.php:1053 mod/photos.php:1564
msgid "View Photo"
msgstr ""
-#: mod/photos.php:1087
+#: mod/photos.php:1086
msgid "Permission denied. Access to this item may be restricted."
msgstr ""
-#: mod/photos.php:1089
+#: mod/photos.php:1088
msgid "Photo not available"
msgstr ""
-#: mod/photos.php:1099
+#: mod/photos.php:1098
msgid "Do you really want to delete this photo?"
msgstr ""
-#: mod/photos.php:1100 mod/photos.php:1292
+#: mod/photos.php:1099 mod/photos.php:1291
msgid "Delete Photo"
msgstr ""
-#: mod/photos.php:1192
+#: mod/photos.php:1191
msgid "View photo"
msgstr ""
-#: mod/photos.php:1194
+#: mod/photos.php:1193
msgid "Edit photo"
msgstr ""
-#: mod/photos.php:1195
+#: mod/photos.php:1194
msgid "Delete photo"
msgstr ""
-#: mod/photos.php:1196
+#: mod/photos.php:1195
msgid "Use as profile photo"
msgstr ""
-#: mod/photos.php:1203
+#: mod/photos.php:1202
msgid "Private Photo"
msgstr ""
-#: mod/photos.php:1209
+#: mod/photos.php:1208
msgid "View Full Size"
msgstr ""
-#: mod/photos.php:1260
+#: mod/photos.php:1259
msgid "Tags: "
msgstr ""
-#: mod/photos.php:1263
+#: mod/photos.php:1262
msgid "[Select tags to remove]"
msgstr ""
-#: mod/photos.php:1278
+#: mod/photos.php:1277
msgid "New album name"
msgstr ""
-#: mod/photos.php:1279
+#: mod/photos.php:1278
msgid "Caption"
msgstr ""
-#: mod/photos.php:1280
+#: mod/photos.php:1279
msgid "Add a Tag"
msgstr ""
-#: mod/photos.php:1280
+#: mod/photos.php:1279
msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping"
msgstr ""
-#: mod/photos.php:1281
+#: mod/photos.php:1280
msgid "Do not rotate"
msgstr ""
-#: mod/photos.php:1282
+#: mod/photos.php:1281
msgid "Rotate CW (right)"
msgstr ""
-#: mod/photos.php:1283
+#: mod/photos.php:1282
msgid "Rotate CCW (left)"
msgstr ""
-#: mod/photos.php:1329 mod/photos.php:1385 mod/photos.php:1459
-#: src/Module/Contact.php:548 src/Module/Item/Compose.php:189
+#: mod/photos.php:1328 mod/photos.php:1384 mod/photos.php:1458
+#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188
#: src/Object/Post.php:989
msgid "This is you"
msgstr ""
-#: mod/photos.php:1331 mod/photos.php:1387 mod/photos.php:1461
+#: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460
#: src/Object/Post.php:532 src/Object/Post.php:991
msgid "Comment"
msgstr ""
-#: mod/photos.php:1420 src/Content/Conversation.php:634 src/Object/Post.php:256
+#: mod/photos.php:1419 src/Content/Conversation.php:634 src/Object/Post.php:256
msgid "Select"
msgstr ""
-#: mod/photos.php:1421 mod/settings.php:351 src/Content/Conversation.php:635
-#: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Blocked.php:141
+#: mod/photos.php:1420 mod/settings.php:350 src/Content/Conversation.php:635
+#: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:141
#: src/Module/Admin/Users/Index.php:154
msgid "Delete"
msgstr ""
-#: mod/photos.php:1482 src/Object/Post.php:379
+#: mod/photos.php:1481 src/Object/Post.php:379
msgid "Like"
msgstr ""
-#: mod/photos.php:1483 src/Object/Post.php:379
+#: mod/photos.php:1482 src/Object/Post.php:379
msgid "I like this (toggle)"
msgstr ""
-#: mod/photos.php:1484 src/Object/Post.php:380
+#: mod/photos.php:1483 src/Object/Post.php:380
msgid "Dislike"
msgstr ""
-#: mod/photos.php:1486 src/Object/Post.php:380
+#: mod/photos.php:1485 src/Object/Post.php:380
msgid "I don't like this (toggle)"
msgstr ""
-#: mod/photos.php:1508
+#: mod/photos.php:1507
msgid "Map"
msgstr ""
-#: mod/photos.php:1571
+#: mod/photos.php:1570
msgid "View Album"
msgstr ""
-#: mod/redir.php:51 mod/redir.php:104
+#: mod/redir.php:50 mod/redir.php:103
msgid "Bad Request."
msgstr ""
-#: mod/redir.php:57 mod/redir.php:131 src/Module/Contact/Advanced.php:71
-#: src/Module/Contact/Advanced.php:110 src/Module/Contact/Contacts.php:54
+#: mod/redir.php:56 mod/redir.php:130 src/Module/Contact/Advanced.php:70
+#: src/Module/Contact/Advanced.php:109 src/Module/Contact/Contacts.php:53
#: src/Module/Contact/Conversations.php:79
#: src/Module/Contact/Conversations.php:84
#: src/Module/Contact/Conversations.php:89 src/Module/Contact/Media.php:43
#: src/Module/Contact/Posts.php:73 src/Module/Contact/Posts.php:78
#: src/Module/Contact/Posts.php:83 src/Module/Contact/Profile.php:143
#: src/Module/Contact/Profile.php:148 src/Module/Contact/Profile.php:153
-#: src/Module/FriendSuggest.php:72 src/Module/FriendSuggest.php:110
-#: src/Module/Group.php:98 src/Module/Group.php:107
+#: src/Module/FriendSuggest.php:71 src/Module/FriendSuggest.php:109
+#: src/Module/Group.php:97 src/Module/Group.php:106
msgid "Contact not found."
msgstr ""
-#: mod/removeme.php:66 src/Navigation/Notifications/Repository/Notify.php:467
+#: mod/removeme.php:65 src/Navigation/Notifications/Repository/Notify.php:467
msgid "[Friendica System Notify]"
msgstr ""
-#: mod/removeme.php:66
+#: mod/removeme.php:65
msgid "User deleted their account"
msgstr ""
-#: mod/removeme.php:67
+#: mod/removeme.php:66
msgid ""
"On your Friendica node an user deleted their account. Please ensure that "
"their data is removed from the backups."
msgstr ""
-#: mod/removeme.php:68
+#: mod/removeme.php:67
#, php-format
msgid "The user id is %d"
msgstr ""
-#: mod/removeme.php:102 mod/removeme.php:105
+#: mod/removeme.php:101 mod/removeme.php:104
msgid "Remove My Account"
msgstr ""
-#: mod/removeme.php:103
+#: mod/removeme.php:102
msgid ""
"This will completely remove your account. Once this has been done it is not "
"recoverable."
msgstr ""
-#: mod/removeme.php:104
+#: mod/removeme.php:103
msgid "Please enter your password for verification:"
msgstr ""
-#: mod/repair_ostatus.php:37
+#: mod/repair_ostatus.php:36
msgid "Resubscribing to OStatus contacts"
msgstr ""
-#: mod/repair_ostatus.php:47 src/Module/Debug/ActivityPubConversion.php:130
+#: mod/repair_ostatus.php:46 src/Module/Debug/ActivityPubConversion.php:129
#: src/Module/Debug/Babel.php:293 src/Module/Security/TwoFactor/Verify.php:99
msgid "Error"
msgid_plural "Errors"
msgstr[0] ""
msgstr[1] ""
-#: mod/settings.php:123
+#: mod/settings.php:122
msgid "Failed to connect with email account using the settings provided."
msgstr ""
-#: mod/settings.php:176
+#: mod/settings.php:175
msgid "Connected Apps"
msgstr ""
-#: mod/settings.php:177 src/Module/Admin/Blocklist/Contact.php:106
-#: src/Module/Admin/Users/Active.php:130 src/Module/Admin/Users/Blocked.php:131
+#: mod/settings.php:176 src/Module/Admin/Blocklist/Contact.php:106
+#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:131
#: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88
#: src/Module/Admin/Users/Index.php:143 src/Module/Admin/Users/Index.php:163
-#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:135
+#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:134
msgid "Name"
msgstr ""
-#: mod/settings.php:178 src/Content/Nav.php:215
+#: mod/settings.php:177 src/Content/Nav.php:215
msgid "Home Page"
msgstr ""
-#: mod/settings.php:179 src/Module/Admin/Queue.php:78
+#: mod/settings.php:178 src/Module/Admin/Queue.php:78
msgid "Created"
msgstr ""
-#: mod/settings.php:180
+#: mod/settings.php:179
msgid "Remove authorization"
msgstr ""
-#: mod/settings.php:206 mod/settings.php:238 mod/settings.php:269
-#: mod/settings.php:353 src/Module/Admin/Addons/Index.php:69
+#: mod/settings.php:205 mod/settings.php:237 mod/settings.php:268
+#: mod/settings.php:352 src/Module/Admin/Addons/Index.php:69
#: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:81
#: src/Module/Admin/Site.php:432 src/Module/Admin/Themes/Index.php:113
-#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:564
-#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:201
+#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:563
+#: src/Module/Settings/Delegation.php:169 src/Module/Settings/Display.php:200
msgid "Save Settings"
msgstr ""
-#: mod/settings.php:214
+#: mod/settings.php:213
msgid "Addon Settings"
msgstr ""
-#: mod/settings.php:215
+#: mod/settings.php:214
msgid "No Addon settings configured"
msgstr ""
-#: mod/settings.php:236
+#: mod/settings.php:235
msgid "Additional Features"
msgstr ""
-#: mod/settings.php:274
+#: mod/settings.php:273
msgid "Diaspora (Socialhome, Hubzilla)"
msgstr ""
-#: mod/settings.php:274 mod/settings.php:275
+#: mod/settings.php:273 mod/settings.php:274
msgid "enabled"
msgstr ""
-#: mod/settings.php:274 mod/settings.php:275
+#: mod/settings.php:273 mod/settings.php:274
msgid "disabled"
msgstr ""
-#: mod/settings.php:274 mod/settings.php:275
+#: mod/settings.php:273 mod/settings.php:274
#, php-format
msgid "Built-in support for %s connectivity is %s"
msgstr ""
-#: mod/settings.php:275
+#: mod/settings.php:274
msgid "OStatus (GNU Social)"
msgstr ""
-#: mod/settings.php:301
+#: mod/settings.php:300
msgid "Email access is disabled on this site."
msgstr ""
-#: mod/settings.php:306 mod/settings.php:351
+#: mod/settings.php:305 mod/settings.php:350
msgid "None"
msgstr ""
-#: mod/settings.php:312 src/Module/BaseSettings.php:78
+#: mod/settings.php:311 src/Module/BaseSettings.php:78
msgid "Social Networks"
msgstr ""
-#: mod/settings.php:317
+#: mod/settings.php:316
msgid "General Social Media Settings"
msgstr ""
-#: mod/settings.php:320
+#: mod/settings.php:319
msgid "Followed content scope"
msgstr ""
-#: mod/settings.php:322
+#: mod/settings.php:321
msgid ""
"By default, conversations in which your follows participated but didn't "
"start will be shown in your timeline. You can turn this behavior off, or "
"expand it to the conversations in which your follows liked a post."
msgstr ""
-#: mod/settings.php:324
+#: mod/settings.php:323
msgid "Only conversations my follows started"
msgstr ""
-#: mod/settings.php:325
+#: mod/settings.php:324
msgid "Conversations my follows started or commented on (default)"
msgstr ""
-#: mod/settings.php:326
+#: mod/settings.php:325
msgid "Any conversation my follows interacted with, including likes"
msgstr ""
-#: mod/settings.php:329
+#: mod/settings.php:328
msgid "Enable Content Warning"
msgstr ""
-#: mod/settings.php:329
+#: mod/settings.php:328
msgid ""
"Users on networks like Mastodon or Pleroma are able to set a content warning "
"field which collapse their post by default. This enables the automatic "
@@ -1296,144 +1296,144 @@ msgid ""
"affect any other content filtering you eventually set up."
msgstr ""
-#: mod/settings.php:330
+#: mod/settings.php:329
msgid "Enable intelligent shortening"
msgstr ""
-#: mod/settings.php:330
+#: mod/settings.php:329
msgid ""
"Normally the system tries to find the best link to add to shortened posts. "
"If disabled, every shortened post will always point to the original "
"friendica post."
msgstr ""
-#: mod/settings.php:331
+#: mod/settings.php:330
msgid "Enable simple text shortening"
msgstr ""
-#: mod/settings.php:331
+#: mod/settings.php:330
msgid ""
"Normally the system shortens posts at the next line feed. If this option is "
"enabled then the system will shorten the text at the maximum character limit."
msgstr ""
-#: mod/settings.php:332
+#: mod/settings.php:331
msgid "Attach the link title"
msgstr ""
-#: mod/settings.php:332
+#: mod/settings.php:331
msgid ""
"When activated, the title of the attached link will be added as a title on "
"posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that "
"share feed content."
msgstr ""
-#: mod/settings.php:333
+#: mod/settings.php:332
msgid "Your legacy ActivityPub/GNU Social account"
msgstr ""
-#: mod/settings.php:333
+#: mod/settings.php:332
msgid ""
"If you enter your old account name from an ActivityPub based system or your "
"GNU Social/Statusnet account name here (in the format user@domain.tld), your "
"contacts will be added automatically. The field will be emptied when done."
msgstr ""
-#: mod/settings.php:336
+#: mod/settings.php:335
msgid "Repair OStatus subscriptions"
msgstr ""
-#: mod/settings.php:340
+#: mod/settings.php:339
msgid "Email/Mailbox Setup"
msgstr ""
-#: mod/settings.php:341
+#: mod/settings.php:340
msgid ""
"If you wish to communicate with email contacts using this service "
"(optional), please specify how to connect to your mailbox."
msgstr ""
-#: mod/settings.php:342
+#: mod/settings.php:341
msgid "Last successful email check:"
msgstr ""
-#: mod/settings.php:344
+#: mod/settings.php:343
msgid "IMAP server name:"
msgstr ""
-#: mod/settings.php:345
+#: mod/settings.php:344
msgid "IMAP port:"
msgstr ""
-#: mod/settings.php:346
+#: mod/settings.php:345
msgid "Security:"
msgstr ""
-#: mod/settings.php:347
+#: mod/settings.php:346
msgid "Email login name:"
msgstr ""
-#: mod/settings.php:348
+#: mod/settings.php:347
msgid "Email password:"
msgstr ""
-#: mod/settings.php:349
+#: mod/settings.php:348
msgid "Reply-to address:"
msgstr ""
-#: mod/settings.php:350
+#: mod/settings.php:349
msgid "Send public posts to all email contacts:"
msgstr ""
-#: mod/settings.php:351
+#: mod/settings.php:350
msgid "Action after import:"
msgstr ""
-#: mod/settings.php:351 src/Content/Nav.php:283
+#: mod/settings.php:350 src/Content/Nav.php:283
msgid "Mark as seen"
msgstr ""
-#: mod/settings.php:351
+#: mod/settings.php:350
msgid "Move to folder"
msgstr ""
-#: mod/settings.php:352
+#: mod/settings.php:351
msgid "Move to folder:"
msgstr ""
-#: mod/suggest.php:45
+#: mod/suggest.php:44
msgid ""
"No suggestions available. If this is a new site, please try again in 24 "
"hours."
msgstr ""
-#: mod/suggest.php:56 src/Content/Widget.php:84 view/theme/vier/theme.php:202
+#: mod/suggest.php:55 src/Content/Widget.php:84 view/theme/vier/theme.php:202
msgid "Friend Suggestions"
msgstr ""
-#: mod/tagger.php:78 src/Content/Item.php:301 src/Model/Item.php:2861
+#: mod/tagger.php:77 src/Content/Item.php:301 src/Model/Item.php:2860
msgid "photo"
msgstr ""
-#: mod/tagger.php:78 src/Content/Item.php:295 src/Content/Item.php:305
+#: mod/tagger.php:77 src/Content/Item.php:295 src/Content/Item.php:305
msgid "status"
msgstr ""
-#: mod/tagger.php:111 src/Content/Item.php:315
+#: mod/tagger.php:110 src/Content/Item.php:315
#, php-format
msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr ""
-#: mod/tagrm.php:114
+#: mod/tagrm.php:113
msgid "Remove Item Tag"
msgstr ""
-#: mod/tagrm.php:116
+#: mod/tagrm.php:115
msgid "Select a tag to remove: "
msgstr ""
-#: mod/tagrm.php:127 src/Module/Settings/Delegation.php:179
-#: src/Module/Settings/TwoFactor/Trusted.php:144
+#: mod/tagrm.php:126 src/Module/Settings/Delegation.php:178
+#: src/Module/Settings/TwoFactor/Trusted.php:143
msgid "Remove"
msgstr ""
@@ -1441,13 +1441,13 @@ msgstr ""
msgid "User imports on closed servers can only be done by an administrator."
msgstr ""
-#: mod/uimport.php:55 src/Module/Register.php:100
+#: mod/uimport.php:55 src/Module/Register.php:99
msgid ""
"This site has exceeded the number of allowed daily account registrations. "
"Please try again tomorrow."
msgstr ""
-#: mod/uimport.php:62 src/Module/Register.php:174
+#: mod/uimport.php:62 src/Module/Register.php:173
msgid "Import"
msgstr ""
@@ -1482,50 +1482,50 @@ msgid ""
"select \"Export account\""
msgstr ""
-#: mod/unfollow.php:66 mod/unfollow.php:135
+#: mod/unfollow.php:65 mod/unfollow.php:134
msgid "You aren't following this contact."
msgstr ""
-#: mod/unfollow.php:72
+#: mod/unfollow.php:71
msgid "Unfollowing is currently not supported by your network."
msgstr ""
-#: mod/unfollow.php:93
+#: mod/unfollow.php:92
msgid "Disconnect/Unfollow"
msgstr ""
-#: mod/unfollow.php:144
+#: mod/unfollow.php:143
msgid "Contact was successfully unfollowed"
msgstr ""
-#: mod/unfollow.php:147
+#: mod/unfollow.php:146
msgid "Unable to unfollow this contact, please contact your administrator"
msgstr ""
-#: mod/wall_attach.php:40 mod/wall_attach.php:46 mod/wall_attach.php:75
-#: mod/wall_upload.php:54 mod/wall_upload.php:63 mod/wall_upload.php:97
-#: mod/wall_upload.php:148 mod/wall_upload.php:150
+#: mod/wall_attach.php:39 mod/wall_attach.php:45 mod/wall_attach.php:74
+#: mod/wall_upload.php:53 mod/wall_upload.php:62 mod/wall_upload.php:96
+#: mod/wall_upload.php:147 mod/wall_upload.php:149
msgid "Invalid request."
msgstr ""
-#: mod/wall_attach.php:93
+#: mod/wall_attach.php:92
msgid "Sorry, maybe your upload is bigger than the PHP configuration allows"
msgstr ""
-#: mod/wall_attach.php:93
+#: mod/wall_attach.php:92
msgid "Or - did you try to upload an empty file?"
msgstr ""
-#: mod/wall_attach.php:104
+#: mod/wall_attach.php:103
#, php-format
msgid "File exceeds size limit of %s"
msgstr ""
-#: mod/wall_attach.php:119
+#: mod/wall_attach.php:118
msgid "File upload failed."
msgstr ""
-#: mod/wall_upload.php:218 src/Model/Photo.php:1087
+#: mod/wall_upload.php:217 src/Model/Photo.php:1086
msgid "Wall Photos"
msgstr ""
@@ -1595,16 +1595,16 @@ msgid "All contacts"
msgstr ""
#: src/BaseModule.php:424 src/Content/Widget.php:236 src/Core/ACL.php:194
-#: src/Module/Contact.php:371 src/Module/PermissionTooltip.php:123
-#: src/Module/PermissionTooltip.php:145
+#: src/Module/Contact.php:370 src/Module/PermissionTooltip.php:122
+#: src/Module/PermissionTooltip.php:144
msgid "Followers"
msgstr ""
-#: src/BaseModule.php:429 src/Content/Widget.php:237 src/Module/Contact.php:372
+#: src/BaseModule.php:429 src/Content/Widget.php:237 src/Module/Contact.php:371
msgid "Following"
msgstr ""
-#: src/BaseModule.php:434 src/Content/Widget.php:238 src/Module/Contact.php:373
+#: src/BaseModule.php:434 src/Content/Widget.php:238 src/Module/Contact.php:372
msgid "Mutual friends"
msgstr ""
@@ -1763,12 +1763,12 @@ msgid "Enter new password: "
msgstr ""
#: src/Console/User.php:210 src/Module/Security/PasswordTooLong.php:66
-#: src/Module/Settings/Account.php:76
+#: src/Module/Settings/Account.php:75
msgid "Password update failed. Please try again."
msgstr ""
#: src/Console/User.php:213 src/Module/Security/PasswordTooLong.php:69
-#: src/Module/Settings/Account.php:79
+#: src/Module/Settings/Account.php:78
msgid "Password changed."
msgstr ""
@@ -1857,7 +1857,7 @@ msgstr ""
msgid "RSS/Atom"
msgstr ""
-#: src/Content/ContactSelector.php:129 src/Module/Admin/Users/Active.php:130
+#: src/Content/ContactSelector.php:129 src/Module/Admin/Users/Active.php:129
#: src/Module/Admin/Users/Blocked.php:131 src/Module/Admin/Users/Create.php:73
#: src/Module/Admin/Users/Deleted.php:88 src/Module/Admin/Users/Index.php:143
#: src/Module/Admin/Users/Index.php:163 src/Module/Admin/Users/Pending.php:104
@@ -2020,7 +2020,7 @@ msgstr ""
msgid "Visible to everybody "
msgstr ""
-#: src/Content/Conversation.php:312 src/Module/Item/Compose.php:199
+#: src/Content/Conversation.php:312 src/Module/Item/Compose.php:198
#: src/Object/Post.php:1002
msgid "Please enter a image/video/audio/webpage URL:"
msgstr ""
@@ -2029,7 +2029,7 @@ msgstr ""
msgid "Tag term:"
msgstr ""
-#: src/Content/Conversation.php:314 src/Module/Filer/SaveTag.php:74
+#: src/Content/Conversation.php:314 src/Module/Filer/SaveTag.php:73
msgid "Save to Folder:"
msgstr ""
@@ -2041,7 +2041,7 @@ msgstr ""
msgid "Delete item(s)?"
msgstr ""
-#: src/Content/Conversation.php:328 src/Module/Item/Compose.php:176
+#: src/Content/Conversation.php:328 src/Module/Item/Compose.php:175
msgid "Created at"
msgstr ""
@@ -2053,7 +2053,7 @@ msgstr ""
msgid "Share"
msgstr ""
-#: src/Content/Conversation.php:352 src/Module/Item/Compose.php:196
+#: src/Content/Conversation.php:352 src/Module/Item/Compose.php:195
#: src/Object/Post.php:999
msgid "Image"
msgstr ""
@@ -2062,7 +2062,7 @@ msgstr ""
msgid "Video"
msgstr ""
-#: src/Content/Conversation.php:368 src/Module/Item/Compose.php:223
+#: src/Content/Conversation.php:368 src/Module/Item/Compose.php:222
msgid "Scheduled at"
msgstr ""
@@ -2292,7 +2292,7 @@ msgstr ""
msgid "show more"
msgstr ""
-#: src/Content/Item.php:292 src/Model/Item.php:2859
+#: src/Content/Item.php:292 src/Model/Item.php:2858
msgid "event"
msgstr ""
@@ -2300,46 +2300,46 @@ msgstr ""
msgid "Follow Thread"
msgstr ""
-#: src/Content/Item.php:385 src/Model/Contact.php:1174
+#: src/Content/Item.php:385 src/Model/Contact.php:1199
msgid "View Status"
msgstr ""
-#: src/Content/Item.php:386 src/Content/Item.php:404 src/Model/Contact.php:1112
-#: src/Model/Contact.php:1166 src/Model/Contact.php:1175
-#: src/Module/Directory.php:158 src/Module/Settings/Profile/Index.php:226
+#: src/Content/Item.php:386 src/Content/Item.php:404 src/Model/Contact.php:1137
+#: src/Model/Contact.php:1191 src/Model/Contact.php:1200
+#: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:225
msgid "View Profile"
msgstr ""
-#: src/Content/Item.php:387 src/Model/Contact.php:1176
+#: src/Content/Item.php:387 src/Model/Contact.php:1201
msgid "View Photos"
msgstr ""
-#: src/Content/Item.php:388 src/Model/Contact.php:1167
-#: src/Model/Contact.php:1177
+#: src/Content/Item.php:388 src/Model/Contact.php:1192
+#: src/Model/Contact.php:1202
msgid "Network Posts"
msgstr ""
-#: src/Content/Item.php:389 src/Model/Contact.php:1168
-#: src/Model/Contact.php:1178
+#: src/Content/Item.php:389 src/Model/Contact.php:1193
+#: src/Model/Contact.php:1203
msgid "View Contact"
msgstr ""
-#: src/Content/Item.php:390 src/Model/Contact.php:1179
+#: src/Content/Item.php:390 src/Model/Contact.php:1204
msgid "Send PM"
msgstr ""
#: src/Content/Item.php:391 src/Module/Admin/Blocklist/Contact.php:100
-#: src/Module/Admin/Users/Active.php:141 src/Module/Admin/Users/Index.php:155
-#: src/Module/Contact.php:402 src/Module/Contact/Profile.php:350
+#: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:155
+#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:350
#: src/Module/Contact/Profile.php:451
msgid "Block"
msgstr ""
-#: src/Content/Item.php:392 src/Module/Contact.php:403
+#: src/Content/Item.php:392 src/Module/Contact.php:402
#: src/Module/Contact/Profile.php:351 src/Module/Contact/Profile.php:459
-#: src/Module/Notifications/Introductions.php:134
-#: src/Module/Notifications/Introductions.php:206
-#: src/Module/Notifications/Notification.php:90
+#: src/Module/Notifications/Introductions.php:133
+#: src/Module/Notifications/Introductions.php:205
+#: src/Module/Notifications/Notification.php:89
msgid "Ignore"
msgstr ""
@@ -2363,7 +2363,7 @@ msgstr ""
msgid "@name, !forum, #tags, content"
msgstr ""
-#: src/Content/Nav.php:186 src/Module/Security/Login.php:159
+#: src/Content/Nav.php:186 src/Module/Security/Login.php:158
msgid "Logout"
msgstr ""
@@ -2371,8 +2371,8 @@ msgstr ""
msgid "End this session"
msgstr ""
-#: src/Content/Nav.php:188 src/Module/Bookmarklet.php:45
-#: src/Module/Security/Login.php:160
+#: src/Content/Nav.php:188 src/Module/Bookmarklet.php:44
+#: src/Module/Security/Login.php:159
msgid "Login"
msgstr ""
@@ -2381,8 +2381,8 @@ msgid "Sign in"
msgstr ""
#: src/Content/Nav.php:193 src/Module/BaseProfile.php:56
-#: src/Module/Contact.php:437 src/Module/Contact/Profile.php:382
-#: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:238
+#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:382
+#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:238
msgid "Status"
msgstr ""
@@ -2392,8 +2392,8 @@ msgid "Your posts and conversations"
msgstr ""
#: src/Content/Nav.php:194 src/Module/BaseProfile.php:48
-#: src/Module/BaseSettings.php:55 src/Module/Contact.php:461
-#: src/Module/Contact/Profile.php:384 src/Module/Profile/Profile.php:241
+#: src/Module/BaseSettings.php:55 src/Module/Contact.php:460
+#: src/Module/Contact/Profile.php:384 src/Module/Profile/Profile.php:240
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:239
msgid "Profile"
msgstr ""
@@ -2407,7 +2407,7 @@ msgid "Your photos"
msgstr ""
#: src/Content/Nav.php:196 src/Module/BaseProfile.php:72
-#: src/Module/BaseProfile.php:75 src/Module/Contact.php:453
+#: src/Module/BaseProfile.php:75 src/Module/Contact.php:452
#: view/theme/frio/theme.php:241
msgid "Media"
msgstr ""
@@ -2432,8 +2432,8 @@ msgstr ""
msgid "Home"
msgstr ""
-#: src/Content/Nav.php:219 src/Module/Register.php:169
-#: src/Module/Security/Login.php:125
+#: src/Content/Nav.php:219 src/Module/Register.php:168
+#: src/Module/Security/Login.php:124
msgid "Register"
msgstr ""
@@ -2442,10 +2442,10 @@ msgid "Create an account"
msgstr ""
#: src/Content/Nav.php:225 src/Module/Help.php:67
-#: src/Module/Settings/TwoFactor/AppSpecific.php:129
-#: src/Module/Settings/TwoFactor/Index.php:119
-#: src/Module/Settings/TwoFactor/Recovery.php:107
-#: src/Module/Settings/TwoFactor/Verify.php:146 view/theme/vier/theme.php:244
+#: src/Module/Settings/TwoFactor/AppSpecific.php:128
+#: src/Module/Settings/TwoFactor/Index.php:118
+#: src/Module/Settings/TwoFactor/Recovery.php:106
+#: src/Module/Settings/TwoFactor/Verify.php:145 view/theme/vier/theme.php:244
msgid "Help"
msgstr ""
@@ -2462,7 +2462,7 @@ msgid "Addon applications, utilities, games"
msgstr ""
#: src/Content/Nav.php:233 src/Content/Text/HTML.php:888
-#: src/Module/Admin/Logs/View.php:87 src/Module/Search/Index.php:112
+#: src/Module/Admin/Logs/View.php:87 src/Module/Search/Index.php:111
msgid "Search"
msgstr ""
@@ -2481,8 +2481,8 @@ msgstr ""
#: src/Content/Nav.php:238 src/Content/Nav.php:297
#: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:125
-#: src/Module/BaseProfile.php:128 src/Module/Contact.php:374
-#: src/Module/Contact.php:468 view/theme/frio/theme.php:249
+#: src/Module/BaseProfile.php:128 src/Module/Contact.php:373
+#: src/Module/Contact.php:467 view/theme/frio/theme.php:249
msgid "Contacts"
msgstr ""
@@ -2507,7 +2507,7 @@ msgstr ""
msgid "People directory"
msgstr ""
-#: src/Content/Nav.php:266 src/Module/BaseAdmin.php:86
+#: src/Content/Nav.php:266 src/Module/BaseAdmin.php:85
msgid "Information"
msgstr ""
@@ -2516,7 +2516,7 @@ msgid "Information about this friendica instance"
msgstr ""
#: src/Content/Nav.php:269 src/Module/Admin/Tos.php:76
-#: src/Module/BaseAdmin.php:97 src/Module/Register.php:177
+#: src/Module/BaseAdmin.php:96 src/Module/Register.php:176
#: src/Module/Tos.php:87
msgid "Terms of Service"
msgstr ""
@@ -2542,7 +2542,7 @@ msgid "Friend Requests"
msgstr ""
#: src/Content/Nav.php:281 src/Module/BaseNotifications.php:149
-#: src/Module/Notifications/Introductions.php:75
+#: src/Module/Notifications/Introductions.php:74
msgid "Notifications"
msgstr ""
@@ -2588,7 +2588,7 @@ msgstr ""
msgid "Manage/edit friends and contacts"
msgstr ""
-#: src/Content/Nav.php:302 src/Module/BaseAdmin.php:127
+#: src/Content/Nav.php:302 src/Module/BaseAdmin.php:126
msgid "Admin"
msgstr ""
@@ -2639,8 +2639,8 @@ msgid ""
"%2$s %3$s"
msgstr ""
-#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3462
-#: src/Model/Item.php:3468 src/Model/Item.php:3469
+#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3461
+#: src/Model/Item.php:3467 src/Model/Item.php:3468
msgid "Link to source"
msgstr ""
@@ -2673,7 +2673,7 @@ msgid "The end"
msgstr ""
#: src/Content/Text/HTML.php:882 src/Content/Widget/VCard.php:110
-#: src/Model/Profile.php:460
+#: src/Model/Profile.php:459
msgid "Follow"
msgstr ""
@@ -2712,8 +2712,8 @@ msgstr ""
msgid "Examples: Robert Morgenstein, Fishing"
msgstr ""
-#: src/Content/Widget.php:83 src/Module/Contact.php:395
-#: src/Module/Directory.php:97 view/theme/vier/theme.php:201
+#: src/Content/Widget.php:83 src/Module/Contact.php:394
+#: src/Module/Directory.php:96 view/theme/vier/theme.php:201
msgid "Find"
msgstr ""
@@ -2729,7 +2729,7 @@ msgstr ""
msgid "Invite Friends"
msgstr ""
-#: src/Content/Widget.php:88 src/Module/Directory.php:89
+#: src/Content/Widget.php:88 src/Module/Directory.php:88
#: view/theme/vier/theme.php:206
msgid "Global Directory"
msgstr ""
@@ -2738,8 +2738,8 @@ msgstr ""
msgid "Local Directory"
msgstr ""
-#: src/Content/Widget.php:212 src/Model/Group.php:588
-#: src/Module/Contact.php:358 src/Module/Welcome.php:76
+#: src/Content/Widget.php:212 src/Model/Group.php:587
+#: src/Module/Contact.php:357 src/Module/Welcome.php:76
msgid "Groups"
msgstr ""
@@ -2751,8 +2751,8 @@ msgstr ""
msgid "Relationships"
msgstr ""
-#: src/Content/Widget.php:245 src/Module/Contact.php:310
-#: src/Module/Group.php:292
+#: src/Content/Widget.php:245 src/Module/Contact.php:309
+#: src/Module/Group.php:291
msgid "All Contacts"
msgstr ""
@@ -2795,15 +2795,15 @@ msgstr ""
msgid "Organisations"
msgstr ""
-#: src/Content/Widget.php:524 src/Model/Contact.php:1605
+#: src/Content/Widget.php:524 src/Model/Contact.php:1630
msgid "News"
msgstr ""
-#: src/Content/Widget.php:528 src/Module/Settings/Account.php:457
+#: src/Content/Widget.php:528 src/Module/Settings/Account.php:456
msgid "Account Types"
msgstr ""
-#: src/Content/Widget.php:529 src/Module/Admin/BaseUsers.php:52
+#: src/Content/Widget.php:529 src/Module/Admin/BaseUsers.php:51
msgid "All"
msgstr ""
@@ -2853,31 +2853,31 @@ msgstr[1] ""
msgid "More Trending Tags"
msgstr ""
-#: src/Content/Widget/VCard.php:103 src/Model/Profile.php:379
-#: src/Module/Contact/Profile.php:373 src/Module/Profile/Profile.php:176
+#: src/Content/Widget/VCard.php:103 src/Model/Profile.php:378
+#: src/Module/Contact/Profile.php:373 src/Module/Profile/Profile.php:175
msgid "XMPP:"
msgstr ""
-#: src/Content/Widget/VCard.php:104 src/Model/Profile.php:380
-#: src/Module/Contact/Profile.php:375 src/Module/Profile/Profile.php:180
+#: src/Content/Widget/VCard.php:104 src/Model/Profile.php:379
+#: src/Module/Contact/Profile.php:375 src/Module/Profile/Profile.php:179
msgid "Matrix:"
msgstr ""
-#: src/Content/Widget/VCard.php:108 src/Model/Profile.php:472
-#: src/Module/Notifications/Introductions.php:201
+#: src/Content/Widget/VCard.php:108 src/Model/Profile.php:471
+#: src/Module/Notifications/Introductions.php:200
msgid "Network:"
msgstr ""
-#: src/Content/Widget/VCard.php:112 src/Model/Profile.php:462
+#: src/Content/Widget/VCard.php:112 src/Model/Profile.php:461
msgid "Unfollow"
msgstr ""
-#: src/Core/ACL.php:165 src/Module/Profile/Profile.php:242
+#: src/Core/ACL.php:165 src/Module/Profile/Profile.php:241
msgid "Yourself"
msgstr ""
-#: src/Core/ACL.php:201 src/Module/PermissionTooltip.php:129
-#: src/Module/PermissionTooltip.php:151
+#: src/Core/ACL.php:201 src/Module/PermissionTooltip.php:128
+#: src/Module/PermissionTooltip.php:150
msgid "Mutuals"
msgstr ""
@@ -2885,8 +2885,8 @@ msgstr ""
msgid "Post to Email"
msgstr ""
-#: src/Core/ACL.php:320 src/Module/PermissionTooltip.php:86
-#: src/Module/PermissionTooltip.php:198
+#: src/Core/ACL.php:320 src/Module/PermissionTooltip.php:85
+#: src/Module/PermissionTooltip.php:197
msgid "Public"
msgstr ""
@@ -2896,7 +2896,7 @@ msgid ""
"community pages and by anyone with its link."
msgstr ""
-#: src/Core/ACL.php:322 src/Module/PermissionTooltip.php:94
+#: src/Core/ACL.php:322 src/Module/PermissionTooltip.php:93
msgid "Limited/Private"
msgstr ""
@@ -3237,142 +3237,142 @@ msgstr ""
msgid "Could not connect to database."
msgstr ""
+#: src/Core/L10n.php:403 src/Model/Event.php:428
+#: src/Module/Settings/Display.php:183
+msgid "Monday"
+msgstr ""
+
#: src/Core/L10n.php:403 src/Model/Event.php:429
#: src/Module/Settings/Display.php:184
-msgid "Monday"
+msgid "Tuesday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:430
#: src/Module/Settings/Display.php:185
-msgid "Tuesday"
+msgid "Wednesday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:431
#: src/Module/Settings/Display.php:186
-msgid "Wednesday"
+msgid "Thursday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:432
#: src/Module/Settings/Display.php:187
-msgid "Thursday"
+msgid "Friday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:433
#: src/Module/Settings/Display.php:188
-msgid "Friday"
-msgstr ""
-
-#: src/Core/L10n.php:403 src/Model/Event.php:434
-#: src/Module/Settings/Display.php:189
msgid "Saturday"
msgstr ""
-#: src/Core/L10n.php:403 src/Model/Event.php:428
-#: src/Module/Settings/Display.php:183
+#: src/Core/L10n.php:403 src/Model/Event.php:427
+#: src/Module/Settings/Display.php:182
msgid "Sunday"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:449
+#: src/Core/L10n.php:407 src/Model/Event.php:448
msgid "January"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:450
+#: src/Core/L10n.php:407 src/Model/Event.php:449
msgid "February"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:451
+#: src/Core/L10n.php:407 src/Model/Event.php:450
msgid "March"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:452
+#: src/Core/L10n.php:407 src/Model/Event.php:451
msgid "April"
msgstr ""
-#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:440
+#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:439
msgid "May"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:453
+#: src/Core/L10n.php:407 src/Model/Event.php:452
msgid "June"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:454
+#: src/Core/L10n.php:407 src/Model/Event.php:453
msgid "July"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:455
+#: src/Core/L10n.php:407 src/Model/Event.php:454
msgid "August"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:456
+#: src/Core/L10n.php:407 src/Model/Event.php:455
msgid "September"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:457
+#: src/Core/L10n.php:407 src/Model/Event.php:456
msgid "October"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:458
+#: src/Core/L10n.php:407 src/Model/Event.php:457
msgid "November"
msgstr ""
-#: src/Core/L10n.php:407 src/Model/Event.php:459
+#: src/Core/L10n.php:407 src/Model/Event.php:458
msgid "December"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:421
+#: src/Core/L10n.php:422 src/Model/Event.php:420
msgid "Mon"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:422
+#: src/Core/L10n.php:422 src/Model/Event.php:421
msgid "Tue"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:423
+#: src/Core/L10n.php:422 src/Model/Event.php:422
msgid "Wed"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:424
+#: src/Core/L10n.php:422 src/Model/Event.php:423
msgid "Thu"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:425
+#: src/Core/L10n.php:422 src/Model/Event.php:424
msgid "Fri"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:426
+#: src/Core/L10n.php:422 src/Model/Event.php:425
msgid "Sat"
msgstr ""
-#: src/Core/L10n.php:422 src/Model/Event.php:420
+#: src/Core/L10n.php:422 src/Model/Event.php:419
msgid "Sun"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:436
+#: src/Core/L10n.php:426 src/Model/Event.php:435
msgid "Jan"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:437
+#: src/Core/L10n.php:426 src/Model/Event.php:436
msgid "Feb"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:438
+#: src/Core/L10n.php:426 src/Model/Event.php:437
msgid "Mar"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:439
+#: src/Core/L10n.php:426 src/Model/Event.php:438
msgid "Apr"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:441
+#: src/Core/L10n.php:426 src/Model/Event.php:440
msgid "Jun"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:442
+#: src/Core/L10n.php:426 src/Model/Event.php:441
msgid "Jul"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:443
+#: src/Core/L10n.php:426 src/Model/Event.php:442
msgid "Aug"
msgstr ""
@@ -3380,15 +3380,15 @@ msgstr ""
msgid "Sep"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:445
+#: src/Core/L10n.php:426 src/Model/Event.php:444
msgid "Oct"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:446
+#: src/Core/L10n.php:426 src/Model/Event.php:445
msgid "Nov"
msgstr ""
-#: src/Core/L10n.php:426 src/Model/Event.php:447
+#: src/Core/L10n.php:426 src/Model/Event.php:446
msgid "Dec"
msgstr ""
@@ -3588,404 +3588,404 @@ msgstr ""
msgid "Legacy module file not found: %s"
msgstr ""
-#: src/Model/Contact.php:1170 src/Model/Contact.php:1181
+#: src/Model/Contact.php:1195 src/Model/Contact.php:1206
msgid "UnFollow"
msgstr ""
-#: src/Model/Contact.php:1187 src/Module/Admin/Users/Pending.php:107
-#: src/Module/Notifications/Introductions.php:132
-#: src/Module/Notifications/Introductions.php:204
+#: src/Model/Contact.php:1212 src/Module/Admin/Users/Pending.php:107
+#: src/Module/Notifications/Introductions.php:131
+#: src/Module/Notifications/Introductions.php:203
msgid "Approve"
msgstr ""
-#: src/Model/Contact.php:1601
+#: src/Model/Contact.php:1626
msgid "Organisation"
msgstr ""
-#: src/Model/Contact.php:1609
+#: src/Model/Contact.php:1634
msgid "Forum"
msgstr ""
-#: src/Model/Contact.php:2795
+#: src/Model/Contact.php:2820
msgid "Disallowed profile URL."
msgstr ""
-#: src/Model/Contact.php:2800 src/Module/Friendica.php:82
+#: src/Model/Contact.php:2825 src/Module/Friendica.php:82
msgid "Blocked domain"
msgstr ""
-#: src/Model/Contact.php:2805
+#: src/Model/Contact.php:2830
msgid "Connect URL missing."
msgstr ""
-#: src/Model/Contact.php:2814
+#: src/Model/Contact.php:2839
msgid ""
"The contact could not be added. Please check the relevant network "
"credentials in your Settings -> Social Networks page."
msgstr ""
-#: src/Model/Contact.php:2856
+#: src/Model/Contact.php:2881
msgid "The profile address specified does not provide adequate information."
msgstr ""
-#: src/Model/Contact.php:2858
+#: src/Model/Contact.php:2883
msgid "No compatible communication protocols or feeds were discovered."
msgstr ""
-#: src/Model/Contact.php:2861
+#: src/Model/Contact.php:2886
msgid "An author or name was not found."
msgstr ""
-#: src/Model/Contact.php:2864
+#: src/Model/Contact.php:2889
msgid "No browser URL could be matched to this address."
msgstr ""
-#: src/Model/Contact.php:2867
+#: src/Model/Contact.php:2892
msgid ""
"Unable to match @-style Identity Address with a known protocol or email "
"contact."
msgstr ""
-#: src/Model/Contact.php:2868
+#: src/Model/Contact.php:2893
msgid "Use mailto: in front of address to force email check."
msgstr ""
-#: src/Model/Contact.php:2874
+#: src/Model/Contact.php:2899
msgid ""
"The profile address specified belongs to a network which has been disabled "
"on this site."
msgstr ""
-#: src/Model/Contact.php:2879
+#: src/Model/Contact.php:2904
msgid ""
"Limited profile. This person will be unable to receive direct/personal "
"notifications from you."
msgstr ""
-#: src/Model/Contact.php:2938
+#: src/Model/Contact.php:2963
msgid "Unable to retrieve contact information."
msgstr ""
-#: src/Model/Event.php:53
+#: src/Model/Event.php:52
msgid "l F d, Y \\@ g:i A \\G\\M\\TP (e)"
msgstr ""
-#: src/Model/Event.php:74 src/Model/Event.php:91 src/Model/Event.php:468
-#: src/Model/Event.php:902
+#: src/Model/Event.php:73 src/Model/Event.php:90 src/Model/Event.php:467
+#: src/Model/Event.php:901
msgid "Starts:"
msgstr ""
-#: src/Model/Event.php:77 src/Model/Event.php:97 src/Model/Event.php:469
-#: src/Model/Event.php:906
+#: src/Model/Event.php:76 src/Model/Event.php:96 src/Model/Event.php:468
+#: src/Model/Event.php:905
msgid "Finishes:"
msgstr ""
-#: src/Model/Event.php:418
+#: src/Model/Event.php:417
msgid "all-day"
msgstr ""
-#: src/Model/Event.php:444
+#: src/Model/Event.php:443
msgid "Sept"
msgstr ""
-#: src/Model/Event.php:466
+#: src/Model/Event.php:465
msgid "No events to display"
msgstr ""
-#: src/Model/Event.php:582
+#: src/Model/Event.php:581
msgid "l, F j"
msgstr ""
-#: src/Model/Event.php:613
+#: src/Model/Event.php:612
msgid "Edit event"
msgstr ""
-#: src/Model/Event.php:614
+#: src/Model/Event.php:613
msgid "Duplicate event"
msgstr ""
-#: src/Model/Event.php:615
+#: src/Model/Event.php:614
msgid "Delete event"
msgstr ""
-#: src/Model/Event.php:858 src/Module/Debug/Localtime.php:38
+#: src/Model/Event.php:857 src/Module/Debug/Localtime.php:38
msgid "l F d, Y \\@ g:i A"
msgstr ""
-#: src/Model/Event.php:859
+#: src/Model/Event.php:858
msgid "D g:i A"
msgstr ""
-#: src/Model/Event.php:860
+#: src/Model/Event.php:859
msgid "g:i A"
msgstr ""
-#: src/Model/Event.php:921 src/Model/Event.php:923
+#: src/Model/Event.php:920 src/Model/Event.php:922
msgid "Show map"
msgstr ""
-#: src/Model/Event.php:922
+#: src/Model/Event.php:921
msgid "Hide map"
msgstr ""
-#: src/Model/Event.php:1015
+#: src/Model/Event.php:1014
#, php-format
msgid "%s's birthday"
msgstr ""
-#: src/Model/Event.php:1016
+#: src/Model/Event.php:1015
#, php-format
msgid "Happy Birthday %s"
msgstr ""
-#: src/Model/Group.php:106
+#: src/Model/Group.php:105
msgid ""
"A deleted group with this name was revived. Existing item permissions "
"may apply to this group and any future members. If this is "
"not what you intended, please create another group with a different name."
msgstr ""
-#: src/Model/Group.php:504
+#: src/Model/Group.php:503
msgid "Default privacy group for new contacts"
msgstr ""
-#: src/Model/Group.php:536
+#: src/Model/Group.php:535
msgid "Everybody"
msgstr ""
-#: src/Model/Group.php:555
+#: src/Model/Group.php:554
msgid "edit"
msgstr ""
-#: src/Model/Group.php:587
+#: src/Model/Group.php:586
msgid "add"
msgstr ""
-#: src/Model/Group.php:592
+#: src/Model/Group.php:591
msgid "Edit group"
msgstr ""
-#: src/Model/Group.php:593 src/Module/Group.php:193
+#: src/Model/Group.php:592 src/Module/Group.php:192
msgid "Contacts not in any group"
msgstr ""
-#: src/Model/Group.php:595
+#: src/Model/Group.php:594
msgid "Create a new group"
msgstr ""
-#: src/Model/Group.php:596 src/Module/Group.php:178 src/Module/Group.php:201
-#: src/Module/Group.php:276
+#: src/Model/Group.php:595 src/Module/Group.php:177 src/Module/Group.php:200
+#: src/Module/Group.php:275
msgid "Group Name: "
msgstr ""
-#: src/Model/Group.php:597
+#: src/Model/Group.php:596
msgid "Edit groups"
msgstr ""
-#: src/Model/Item.php:1971
+#: src/Model/Item.php:1970
#, php-format
msgid "Detected languages in this post:\\n%s"
msgstr ""
-#: src/Model/Item.php:2863
+#: src/Model/Item.php:2862
msgid "activity"
msgstr ""
-#: src/Model/Item.php:2865
+#: src/Model/Item.php:2864
msgid "comment"
msgstr ""
-#: src/Model/Item.php:2868
+#: src/Model/Item.php:2867
msgid "post"
msgstr ""
-#: src/Model/Item.php:3011
+#: src/Model/Item.php:3010
#, php-format
msgid "Content warning: %s"
msgstr ""
-#: src/Model/Item.php:3374
+#: src/Model/Item.php:3373
msgid "bytes"
msgstr ""
-#: src/Model/Item.php:3405
+#: src/Model/Item.php:3404
#, php-format
msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] ""
msgstr[1] ""
-#: src/Model/Item.php:3407
+#: src/Model/Item.php:3406
#, php-format
msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)"
msgstr[0] ""
msgstr[1] ""
-#: src/Model/Item.php:3412
+#: src/Model/Item.php:3411
#, php-format
msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s"
msgstr[0] ""
msgstr[1] ""
-#: src/Model/Item.php:3414
+#: src/Model/Item.php:3413
#, php-format
msgid "%d voter."
msgid_plural "%d voters."
msgstr[0] ""
msgstr[1] ""
-#: src/Model/Item.php:3416
+#: src/Model/Item.php:3415
#, php-format
msgid "Poll end: %s"
msgstr ""
-#: src/Model/Item.php:3450 src/Model/Item.php:3451
+#: src/Model/Item.php:3449 src/Model/Item.php:3450
msgid "View on separate page"
msgstr ""
-#: src/Model/Mail.php:138 src/Model/Mail.php:266
+#: src/Model/Mail.php:137 src/Model/Mail.php:265
msgid "[no subject]"
msgstr ""
-#: src/Model/Profile.php:362 src/Module/Profile/Profile.php:256
-#: src/Module/Profile/Profile.php:258
+#: src/Model/Profile.php:361 src/Module/Profile/Profile.php:255
+#: src/Module/Profile/Profile.php:257
msgid "Edit profile"
msgstr ""
-#: src/Model/Profile.php:364
+#: src/Model/Profile.php:363
msgid "Change profile photo"
msgstr ""
-#: src/Model/Profile.php:377 src/Module/Directory.php:153
-#: src/Module/Profile/Profile.php:184
+#: src/Model/Profile.php:376 src/Module/Directory.php:152
+#: src/Module/Profile/Profile.php:183
msgid "Homepage:"
msgstr ""
-#: src/Model/Profile.php:378 src/Module/Contact/Profile.php:377
-#: src/Module/Notifications/Introductions.php:189
+#: src/Model/Profile.php:377 src/Module/Contact/Profile.php:377
+#: src/Module/Notifications/Introductions.php:188
msgid "About:"
msgstr ""
-#: src/Model/Profile.php:464
+#: src/Model/Profile.php:463
msgid "Atom feed"
msgstr ""
-#: src/Model/Profile.php:507
+#: src/Model/Profile.php:506
msgid "F d"
msgstr ""
-#: src/Model/Profile.php:571 src/Model/Profile.php:660
+#: src/Model/Profile.php:570 src/Model/Profile.php:659
msgid "[today]"
msgstr ""
-#: src/Model/Profile.php:580
+#: src/Model/Profile.php:579
msgid "Birthday Reminders"
msgstr ""
-#: src/Model/Profile.php:581
+#: src/Model/Profile.php:580
msgid "Birthdays this week:"
msgstr ""
-#: src/Model/Profile.php:609
+#: src/Model/Profile.php:608
msgid "g A l F d"
msgstr ""
-#: src/Model/Profile.php:647
+#: src/Model/Profile.php:646
msgid "[No description]"
msgstr ""
-#: src/Model/Profile.php:673
+#: src/Model/Profile.php:672
msgid "Event Reminders"
msgstr ""
-#: src/Model/Profile.php:674
+#: src/Model/Profile.php:673
msgid "Upcoming events the next 7 days:"
msgstr ""
-#: src/Model/Profile.php:868
+#: src/Model/Profile.php:867
#, php-format
msgid "OpenWebAuth: %1$s welcomes %2$s"
msgstr ""
-#: src/Model/Profile.php:1008
+#: src/Model/Profile.php:1007
msgid "Hometown:"
msgstr ""
-#: src/Model/Profile.php:1009
+#: src/Model/Profile.php:1008
msgid "Marital Status:"
msgstr ""
-#: src/Model/Profile.php:1010
+#: src/Model/Profile.php:1009
msgid "With:"
msgstr ""
-#: src/Model/Profile.php:1011
+#: src/Model/Profile.php:1010
msgid "Since:"
msgstr ""
-#: src/Model/Profile.php:1012
+#: src/Model/Profile.php:1011
msgid "Sexual Preference:"
msgstr ""
-#: src/Model/Profile.php:1013
+#: src/Model/Profile.php:1012
msgid "Political Views:"
msgstr ""
-#: src/Model/Profile.php:1014
+#: src/Model/Profile.php:1013
msgid "Religious Views:"
msgstr ""
-#: src/Model/Profile.php:1015
+#: src/Model/Profile.php:1014
msgid "Likes:"
msgstr ""
-#: src/Model/Profile.php:1016
+#: src/Model/Profile.php:1015
msgid "Dislikes:"
msgstr ""
-#: src/Model/Profile.php:1017
+#: src/Model/Profile.php:1016
msgid "Title/Description:"
msgstr ""
-#: src/Model/Profile.php:1018 src/Module/Admin/Summary.php:235
+#: src/Model/Profile.php:1017 src/Module/Admin/Summary.php:235
msgid "Summary"
msgstr ""
-#: src/Model/Profile.php:1019
+#: src/Model/Profile.php:1018
msgid "Musical interests"
msgstr ""
-#: src/Model/Profile.php:1020
+#: src/Model/Profile.php:1019
msgid "Books, literature"
msgstr ""
-#: src/Model/Profile.php:1021
+#: src/Model/Profile.php:1020
msgid "Television"
msgstr ""
-#: src/Model/Profile.php:1022
+#: src/Model/Profile.php:1021
msgid "Film/dance/culture/entertainment"
msgstr ""
-#: src/Model/Profile.php:1023
+#: src/Model/Profile.php:1022
msgid "Hobbies/Interests"
msgstr ""
-#: src/Model/Profile.php:1024
+#: src/Model/Profile.php:1023
msgid "Love/romance"
msgstr ""
-#: src/Model/Profile.php:1025
+#: src/Model/Profile.php:1024
msgid "Work/employment"
msgstr ""
-#: src/Model/Profile.php:1026
+#: src/Model/Profile.php:1025
msgid "School/education"
msgstr ""
-#: src/Model/Profile.php:1027
+#: src/Model/Profile.php:1026
msgid "Contact information and Social Networks"
msgstr ""
@@ -4297,7 +4297,7 @@ msgstr ""
#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:429
#: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:234
#: 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:137
+#: src/Module/Admin/Tos.php:75 src/Module/Admin/Users/Active.php:136
#: src/Module/Admin/Users/Blocked.php:138 src/Module/Admin/Users/Create.php:61
#: src/Module/Admin/Users/Deleted.php:85 src/Module/Admin/Users/Index.php:150
#: src/Module/Admin/Users/Pending.php:101
@@ -4305,7 +4305,7 @@ msgid "Administration"
msgstr ""
#: src/Module/Admin/Addons/Details.php:112 src/Module/Admin/Addons/Index.php:68
-#: src/Module/BaseAdmin.php:94 src/Module/BaseSettings.php:85
+#: src/Module/BaseAdmin.php:93 src/Module/BaseSettings.php:85
msgid "Addons"
msgstr ""
@@ -4345,81 +4345,81 @@ msgid ""
"the open addon registry at %2$s"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:55
+#: src/Module/Admin/BaseUsers.php:54
msgid "List of all users"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:60
+#: src/Module/Admin/BaseUsers.php:59
msgid "Active"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:63
+#: src/Module/Admin/BaseUsers.php:62
msgid "List of active accounts"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:68 src/Module/Contact.php:318
-#: src/Module/Contact.php:378
+#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:317
+#: src/Module/Contact.php:377
msgid "Pending"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:71
+#: src/Module/Admin/BaseUsers.php:70
msgid "List of pending registrations"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:76 src/Module/Contact.php:326
-#: src/Module/Contact.php:379
+#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:325
+#: src/Module/Contact.php:378
msgid "Blocked"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:79
+#: src/Module/Admin/BaseUsers.php:78
msgid "List of blocked users"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:84
+#: src/Module/Admin/BaseUsers.php:83
msgid "Deleted"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:87
+#: src/Module/Admin/BaseUsers.php:86
msgid "List of pending user deletions"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:495
+#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:494
msgid "Normal Account Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:502
+#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:501
msgid "Soapbox Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:509
+#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:508
msgid "Public Forum"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:104 src/Module/Settings/Account.php:516
+#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:515
msgid "Automatic Friend Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:105
+#: src/Module/Admin/BaseUsers.php:104
msgid "Private Forum"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:467
+#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:466
msgid "Personal Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:474
+#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:473
msgid "Organisation Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:481
+#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:480
msgid "News Page"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:111 src/Module/Settings/Account.php:488
+#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:487
msgid "Community Forum"
msgstr ""
-#: src/Module/Admin/BaseUsers.php:112
+#: src/Module/Admin/BaseUsers.php:111
msgid "Relay"
msgstr ""
@@ -4449,7 +4449,7 @@ msgid "Block Remote Contact"
msgstr ""
#: src/Module/Admin/Blocklist/Contact.php:98
-#: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140
+#: src/Module/Admin/Users/Active.php:138 src/Module/Admin/Users/Blocked.php:140
#: src/Module/Admin/Users/Index.php:152 src/Module/Admin/Users/Pending.php:103
msgid "select all"
msgstr ""
@@ -4460,7 +4460,7 @@ msgstr ""
#: src/Module/Admin/Blocklist/Contact.php:101
#: src/Module/Admin/Users/Blocked.php:143 src/Module/Admin/Users/Index.php:157
-#: src/Module/Contact.php:402 src/Module/Contact/Profile.php:350
+#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:350
#: src/Module/Contact/Profile.php:451
msgid "Unblock"
msgstr ""
@@ -4885,7 +4885,7 @@ msgid ""
"only reflect the part of the network your node is aware of."
msgstr ""
-#: src/Module/Admin/Federation.php:203 src/Module/BaseAdmin.php:88
+#: src/Module/Admin/Federation.php:203 src/Module/BaseAdmin.php:87
msgid "Federation Statistics"
msgstr ""
@@ -4906,7 +4906,7 @@ msgstr[1] ""
msgid "Item marked for deletion."
msgstr ""
-#: src/Module/Admin/Item/Delete.php:65 src/Module/BaseAdmin.php:107
+#: src/Module/Admin/Item/Delete.php:65 src/Module/BaseAdmin.php:106
msgid "Delete Item"
msgstr ""
@@ -4935,7 +4935,7 @@ msgstr ""
msgid "The GUID of the item you want to delete."
msgstr ""
-#: src/Module/Admin/Item/Source.php:53 src/Module/BaseAdmin.php:117
+#: src/Module/Admin/Item/Source.php:53 src/Module/BaseAdmin.php:116
msgid "Item Source"
msgstr ""
@@ -4959,7 +4959,7 @@ msgstr ""
msgid "Tag"
msgstr ""
-#: src/Module/Admin/Item/Source.php:63 src/Module/Admin/Users/Active.php:130
+#: src/Module/Admin/Item/Source.php:63 src/Module/Admin/Users/Active.php:129
#: src/Module/Admin/Users/Blocked.php:131 src/Module/Admin/Users/Index.php:143
msgid "Type"
msgstr ""
@@ -4993,8 +4993,8 @@ msgstr ""
msgid "PHP log currently disabled."
msgstr ""
-#: src/Module/Admin/Logs/Settings.php:80 src/Module/BaseAdmin.php:109
-#: src/Module/BaseAdmin.php:110
+#: src/Module/Admin/Logs/Settings.php:80 src/Module/BaseAdmin.php:108
+#: src/Module/BaseAdmin.php:109
msgid "Logs"
msgstr ""
@@ -5047,7 +5047,7 @@ msgid ""
"is readable."
msgstr ""
-#: src/Module/Admin/Logs/View.php:85 src/Module/BaseAdmin.php:111
+#: src/Module/Admin/Logs/View.php:85 src/Module/BaseAdmin.php:110
msgid "View Logs"
msgstr ""
@@ -5089,7 +5089,7 @@ msgid "Data"
msgstr ""
#: src/Module/Admin/Logs/View.php:99
-#: src/Module/Debug/ActivityPubConversion.php:58
+#: src/Module/Debug/ActivityPubConversion.php:57
msgid "Source"
msgstr ""
@@ -5153,11 +5153,11 @@ msgstr ""
msgid "Priority"
msgstr ""
-#: src/Module/Admin/Site.php:334 src/Module/Settings/Display.php:138
+#: src/Module/Admin/Site.php:334 src/Module/Settings/Display.php:137
msgid "No special theme for mobile devices"
msgstr ""
-#: src/Module/Admin/Site.php:351 src/Module/Settings/Display.php:148
+#: src/Module/Admin/Site.php:351 src/Module/Settings/Display.php:147
#, php-format
msgid "%s - (Experimental)"
msgstr ""
@@ -5234,7 +5234,7 @@ msgstr ""
msgid "Interactors"
msgstr ""
-#: src/Module/Admin/Site.php:430 src/Module/BaseAdmin.php:91
+#: src/Module/Admin/Site.php:430 src/Module/BaseAdmin.php:90
msgid "Site"
msgstr ""
@@ -5246,7 +5246,7 @@ msgstr ""
msgid "Republish users to directory"
msgstr ""
-#: src/Module/Admin/Site.php:434 src/Module/Register.php:153
+#: src/Module/Admin/Site.php:434 src/Module/Register.php:152
msgid "Registration"
msgstr ""
@@ -6033,7 +6033,7 @@ msgid ""
msgstr ""
#: src/Module/Admin/Site.php:541 src/Module/Contact/Profile.php:275
-#: src/Module/Settings/TwoFactor/Index.php:126
+#: src/Module/Settings/TwoFactor/Index.php:125
msgid "Disabled"
msgstr ""
@@ -6097,7 +6097,7 @@ msgstr ""
msgid "Storage Configuration"
msgstr ""
-#: src/Module/Admin/Storage.php:141 src/Module/BaseAdmin.php:92
+#: src/Module/Admin/Storage.php:141 src/Module/BaseAdmin.php:91
msgid "Storage"
msgstr ""
@@ -6313,7 +6313,7 @@ msgid "Screenshot"
msgstr ""
#: src/Module/Admin/Themes/Details.php:91 src/Module/Admin/Themes/Index.php:112
-#: src/Module/BaseAdmin.php:95
+#: src/Module/BaseAdmin.php:94
msgid "Themes"
msgstr ""
@@ -6378,20 +6378,20 @@ msgid ""
"of sections should be [h2] and below."
msgstr ""
-#: src/Module/Admin/Users/Active.php:46 src/Module/Admin/Users/Index.php:46
+#: src/Module/Admin/Users/Active.php:45 src/Module/Admin/Users/Index.php:46
#, php-format
msgid "%s user blocked"
msgid_plural "%s users blocked"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Admin/Users/Active.php:54 src/Module/Admin/Users/Active.php:89
+#: src/Module/Admin/Users/Active.php:53 src/Module/Admin/Users/Active.php:88
#: src/Module/Admin/Users/Blocked.php:55 src/Module/Admin/Users/Blocked.php:90
#: src/Module/Admin/Users/Index.php:61 src/Module/Admin/Users/Index.php:96
msgid "You can't remove yourself"
msgstr ""
-#: src/Module/Admin/Users/Active.php:58 src/Module/Admin/Users/Blocked.php:59
+#: src/Module/Admin/Users/Active.php:57 src/Module/Admin/Users/Blocked.php:59
#: src/Module/Admin/Users/Index.php:65
#, php-format
msgid "%s user deleted"
@@ -6399,66 +6399,66 @@ msgid_plural "%s users deleted"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Admin/Users/Active.php:87 src/Module/Admin/Users/Blocked.php:88
+#: src/Module/Admin/Users/Active.php:86 src/Module/Admin/Users/Blocked.php:88
#: src/Module/Admin/Users/Index.php:94
#, php-format
msgid "User \"%s\" deleted"
msgstr ""
-#: src/Module/Admin/Users/Active.php:97 src/Module/Admin/Users/Index.php:104
+#: src/Module/Admin/Users/Active.php:96 src/Module/Admin/Users/Index.php:104
#, php-format
msgid "User \"%s\" blocked"
msgstr ""
-#: src/Module/Admin/Users/Active.php:130 src/Module/Admin/Users/Blocked.php:131
+#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:131
#: src/Module/Admin/Users/Deleted.php:88 src/Module/Admin/Users/Index.php:143
#: src/Module/Admin/Users/Index.php:163
msgid "Register date"
msgstr ""
-#: src/Module/Admin/Users/Active.php:130 src/Module/Admin/Users/Blocked.php:131
+#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:131
#: src/Module/Admin/Users/Deleted.php:88 src/Module/Admin/Users/Index.php:143
#: src/Module/Admin/Users/Index.php:163
msgid "Last login"
msgstr ""
-#: src/Module/Admin/Users/Active.php:130 src/Module/Admin/Users/Blocked.php:131
+#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:131
#: src/Module/Admin/Users/Deleted.php:88 src/Module/Admin/Users/Index.php:143
#: src/Module/Admin/Users/Index.php:163
msgid "Last public item"
msgstr ""
-#: src/Module/Admin/Users/Active.php:138
+#: src/Module/Admin/Users/Active.php:137
msgid "Active Accounts"
msgstr ""
-#: src/Module/Admin/Users/Active.php:142 src/Module/Admin/Users/Blocked.php:142
+#: src/Module/Admin/Users/Active.php:141 src/Module/Admin/Users/Blocked.php:142
#: src/Module/Admin/Users/Index.php:156
msgid "User blocked"
msgstr ""
-#: src/Module/Admin/Users/Active.php:143 src/Module/Admin/Users/Blocked.php:144
+#: src/Module/Admin/Users/Active.php:142 src/Module/Admin/Users/Blocked.php:144
#: src/Module/Admin/Users/Index.php:158
msgid "Site admin"
msgstr ""
-#: src/Module/Admin/Users/Active.php:144 src/Module/Admin/Users/Blocked.php:145
+#: src/Module/Admin/Users/Active.php:143 src/Module/Admin/Users/Blocked.php:145
#: src/Module/Admin/Users/Index.php:159
msgid "Account expired"
msgstr ""
-#: src/Module/Admin/Users/Active.php:145 src/Module/Admin/Users/Index.php:162
+#: src/Module/Admin/Users/Active.php:144 src/Module/Admin/Users/Index.php:162
msgid "Create a new user"
msgstr ""
-#: src/Module/Admin/Users/Active.php:151 src/Module/Admin/Users/Blocked.php:151
+#: src/Module/Admin/Users/Active.php:150 src/Module/Admin/Users/Blocked.php:151
#: src/Module/Admin/Users/Index.php:168
msgid ""
"Selected users will be deleted!\\n\\nEverything these users had posted on "
"this site will be permanently deleted!\\n\\nAre you sure?"
msgstr ""
-#: src/Module/Admin/Users/Active.php:152 src/Module/Admin/Users/Blocked.php:152
+#: src/Module/Admin/Users/Active.php:151 src/Module/Admin/Users/Blocked.php:152
#: src/Module/Admin/Users/Index.php:169
msgid ""
"The user {0} will be deleted!\\n\\nEverything this user has posted on this "
@@ -6514,7 +6514,7 @@ msgid "Permanent deletion"
msgstr ""
#: src/Module/Admin/Users/Index.php:151 src/Module/Admin/Users/Index.php:161
-#: src/Module/BaseAdmin.php:93
+#: src/Module/BaseAdmin.php:92
msgid "Users"
msgstr ""
@@ -6608,11 +6608,11 @@ msgstr ""
msgid "Contact not found"
msgstr ""
-#: src/Module/Apps.php:56
+#: src/Module/Apps.php:55
msgid "No installed applications."
msgstr ""
-#: src/Module/Apps.php:61
+#: src/Module/Apps.php:60
msgid "Applications"
msgstr ""
@@ -6620,89 +6620,89 @@ msgstr ""
msgid "Item was not found."
msgstr ""
-#: src/Module/BaseAdmin.php:55 src/Module/BaseAdmin.php:59
+#: src/Module/BaseAdmin.php:54 src/Module/BaseAdmin.php:58
msgid "Please login to continue."
msgstr ""
-#: src/Module/BaseAdmin.php:64
+#: src/Module/BaseAdmin.php:63
msgid "You don't have access to administration pages."
msgstr ""
-#: src/Module/BaseAdmin.php:68
+#: src/Module/BaseAdmin.php:67
msgid ""
"Submanaged account can't access the administration pages. Please log back in "
"as the main account."
msgstr ""
-#: src/Module/BaseAdmin.php:87
+#: src/Module/BaseAdmin.php:86
msgid "Overview"
msgstr ""
-#: src/Module/BaseAdmin.php:90
+#: src/Module/BaseAdmin.php:89
msgid "Configuration"
msgstr ""
-#: src/Module/BaseAdmin.php:96 src/Module/BaseSettings.php:63
+#: src/Module/BaseAdmin.php:95 src/Module/BaseSettings.php:63
msgid "Additional features"
msgstr ""
-#: src/Module/BaseAdmin.php:99
+#: src/Module/BaseAdmin.php:98
msgid "Database"
msgstr ""
-#: src/Module/BaseAdmin.php:100
+#: src/Module/BaseAdmin.php:99
msgid "DB updates"
msgstr ""
-#: src/Module/BaseAdmin.php:101
+#: src/Module/BaseAdmin.php:100
msgid "Inspect Deferred Workers"
msgstr ""
-#: src/Module/BaseAdmin.php:102
+#: src/Module/BaseAdmin.php:101
msgid "Inspect worker Queue"
msgstr ""
-#: src/Module/BaseAdmin.php:104
+#: src/Module/BaseAdmin.php:103
msgid "Tools"
msgstr ""
-#: src/Module/BaseAdmin.php:105
+#: src/Module/BaseAdmin.php:104
msgid "Contact Blocklist"
msgstr ""
-#: src/Module/BaseAdmin.php:106
+#: src/Module/BaseAdmin.php:105
msgid "Server Blocklist"
msgstr ""
-#: src/Module/BaseAdmin.php:113
+#: src/Module/BaseAdmin.php:112
msgid "Diagnostics"
msgstr ""
-#: src/Module/BaseAdmin.php:114
+#: src/Module/BaseAdmin.php:113
msgid "PHP Info"
msgstr ""
-#: src/Module/BaseAdmin.php:115
+#: src/Module/BaseAdmin.php:114
msgid "probe address"
msgstr ""
-#: src/Module/BaseAdmin.php:116
+#: src/Module/BaseAdmin.php:115
msgid "check webfinger"
msgstr ""
-#: src/Module/BaseAdmin.php:118
+#: src/Module/BaseAdmin.php:117
msgid "Babel"
msgstr ""
-#: src/Module/BaseAdmin.php:119 src/Module/Debug/ActivityPubConversion.php:138
+#: src/Module/BaseAdmin.php:118 src/Module/Debug/ActivityPubConversion.php:137
msgid "ActivityPub Conversion"
msgstr ""
-#: src/Module/BaseAdmin.php:128
+#: src/Module/BaseAdmin.php:127
msgid "Addon Features"
msgstr ""
-#: src/Module/BaseAdmin.php:129
+#: src/Module/BaseAdmin.php:128
msgid "User registrations waiting for confirmation"
msgstr ""
@@ -6733,7 +6733,7 @@ msgid_plural ""
msgstr[0] ""
msgstr[1] ""
-#: src/Module/BaseProfile.php:51 src/Module/Contact.php:464
+#: src/Module/BaseProfile.php:51 src/Module/Contact.php:463
msgid "Profile Details"
msgstr ""
@@ -6741,7 +6741,7 @@ msgstr ""
msgid "Only You Can See This"
msgstr ""
-#: src/Module/BaseProfile.php:114 src/Module/Profile/Schedule.php:83
+#: src/Module/BaseProfile.php:114 src/Module/Profile/Schedule.php:82
msgid "Scheduled Posts"
msgstr ""
@@ -6753,12 +6753,12 @@ msgstr ""
msgid "Tips for New Members"
msgstr ""
-#: src/Module/BaseSearch.php:70
+#: src/Module/BaseSearch.php:69
#, php-format
msgid "People Search - %s"
msgstr ""
-#: src/Module/BaseSearch.php:80
+#: src/Module/BaseSearch.php:79
#, php-format
msgid "Forum Search - %s"
msgstr ""
@@ -6768,7 +6768,7 @@ msgid "Account"
msgstr ""
#: src/Module/BaseSettings.php:48 src/Module/Security/TwoFactor/Verify.php:97
-#: src/Module/Settings/TwoFactor/Index.php:118
+#: src/Module/Settings/TwoFactor/Index.php:117
msgid "Two-factor authentication"
msgstr ""
@@ -6776,7 +6776,7 @@ msgstr ""
msgid "Display"
msgstr ""
-#: src/Module/BaseSettings.php:92 src/Module/Settings/Delegation.php:171
+#: src/Module/BaseSettings.php:92 src/Module/Settings/Delegation.php:170
msgid "Manage Accounts"
msgstr ""
@@ -6784,7 +6784,7 @@ msgstr ""
msgid "Connected apps"
msgstr ""
-#: src/Module/BaseSettings.php:106 src/Module/Settings/UserExport.php:77
+#: src/Module/BaseSettings.php:106 src/Module/Settings/UserExport.php:76
msgid "Export personal data"
msgstr ""
@@ -6792,207 +6792,207 @@ msgstr ""
msgid "Remove account"
msgstr ""
-#: src/Module/Bookmarklet.php:55
+#: src/Module/Bookmarklet.php:54
msgid "This page is missing a url parameter."
msgstr ""
-#: src/Module/Bookmarklet.php:67
+#: src/Module/Bookmarklet.php:66
msgid "The post was created"
msgstr ""
-#: src/Module/Contact.php:89
+#: src/Module/Contact.php:88
#, php-format
msgid "%d contact edited."
msgid_plural "%d contacts edited."
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Contact.php:313
+#: src/Module/Contact.php:312
msgid "Show all contacts"
msgstr ""
-#: src/Module/Contact.php:321
+#: src/Module/Contact.php:320
msgid "Only show pending contacts"
msgstr ""
-#: src/Module/Contact.php:329
+#: src/Module/Contact.php:328
msgid "Only show blocked contacts"
msgstr ""
-#: src/Module/Contact.php:334 src/Module/Contact.php:381
+#: src/Module/Contact.php:333 src/Module/Contact.php:380
#: src/Object/Post.php:339
msgid "Ignored"
msgstr ""
-#: src/Module/Contact.php:337
+#: src/Module/Contact.php:336
msgid "Only show ignored contacts"
msgstr ""
-#: src/Module/Contact.php:342 src/Module/Contact.php:382
+#: src/Module/Contact.php:341 src/Module/Contact.php:381
msgid "Archived"
msgstr ""
-#: src/Module/Contact.php:345
+#: src/Module/Contact.php:344
msgid "Only show archived contacts"
msgstr ""
-#: src/Module/Contact.php:350 src/Module/Contact.php:380
+#: src/Module/Contact.php:349 src/Module/Contact.php:379
msgid "Hidden"
msgstr ""
-#: src/Module/Contact.php:353
+#: src/Module/Contact.php:352
msgid "Only show hidden contacts"
msgstr ""
-#: src/Module/Contact.php:361
+#: src/Module/Contact.php:360
msgid "Organize your contact groups"
msgstr ""
-#: src/Module/Contact.php:393
+#: src/Module/Contact.php:392
msgid "Search your contacts"
msgstr ""
-#: src/Module/Contact.php:394 src/Module/Search/Index.php:207
+#: src/Module/Contact.php:393 src/Module/Search/Index.php:206
#, php-format
msgid "Results for: %s"
msgstr ""
-#: src/Module/Contact.php:401
+#: src/Module/Contact.php:400
msgid "Update"
msgstr ""
-#: src/Module/Contact.php:403 src/Module/Contact/Profile.php:351
+#: src/Module/Contact.php:402 src/Module/Contact/Profile.php:351
#: src/Module/Contact/Profile.php:459
msgid "Unignore"
msgstr ""
-#: src/Module/Contact.php:405
+#: src/Module/Contact.php:404
msgid "Batch Actions"
msgstr ""
-#: src/Module/Contact.php:440
+#: src/Module/Contact.php:439
msgid "Conversations started by this contact"
msgstr ""
-#: src/Module/Contact.php:445
+#: src/Module/Contact.php:444
msgid "Posts and Comments"
msgstr ""
-#: src/Module/Contact.php:456
+#: src/Module/Contact.php:455
msgid "Posts containing media objects"
msgstr ""
-#: src/Module/Contact.php:471
+#: src/Module/Contact.php:470
msgid "View all known contacts"
msgstr ""
-#: src/Module/Contact.php:481
+#: src/Module/Contact.php:480
msgid "Advanced Contact Settings"
msgstr ""
-#: src/Module/Contact.php:515
+#: src/Module/Contact.php:514
msgid "Mutual Friendship"
msgstr ""
-#: src/Module/Contact.php:519
+#: src/Module/Contact.php:518
msgid "is a fan of yours"
msgstr ""
-#: src/Module/Contact.php:523
+#: src/Module/Contact.php:522
msgid "you are a fan of"
msgstr ""
-#: src/Module/Contact.php:541
+#: src/Module/Contact.php:540
msgid "Pending outgoing contact request"
msgstr ""
-#: src/Module/Contact.php:543
+#: src/Module/Contact.php:542
msgid "Pending incoming contact request"
msgstr ""
-#: src/Module/Contact.php:556 src/Module/Contact/Profile.php:336
+#: src/Module/Contact.php:555 src/Module/Contact/Profile.php:336
#, php-format
msgid "Visit %s's profile [%s]"
msgstr ""
-#: src/Module/Contact/Advanced.php:100
+#: src/Module/Contact/Advanced.php:99
msgid "Contact update failed."
msgstr ""
-#: src/Module/Contact/Advanced.php:131
+#: src/Module/Contact/Advanced.php:130
msgid "Return to contact editor"
msgstr ""
-#: src/Module/Contact/Advanced.php:136
+#: src/Module/Contact/Advanced.php:135
msgid "Account Nickname"
msgstr ""
-#: src/Module/Contact/Advanced.php:137
+#: src/Module/Contact/Advanced.php:136
msgid "Account URL"
msgstr ""
-#: src/Module/Contact/Advanced.php:138
+#: src/Module/Contact/Advanced.php:137
msgid "Poll/Feed URL"
msgstr ""
-#: src/Module/Contact/Advanced.php:139
+#: src/Module/Contact/Advanced.php:138
msgid "New photo from this URL"
msgstr ""
-#: src/Module/Contact/Contacts.php:49 src/Module/Conversation/Network.php:187
-#: src/Module/Group.php:102
+#: src/Module/Contact/Contacts.php:48 src/Module/Conversation/Network.php:186
+#: src/Module/Group.php:101
msgid "Invalid contact."
msgstr ""
-#: src/Module/Contact/Contacts.php:72
+#: src/Module/Contact/Contacts.php:71
msgid "No known contacts."
msgstr ""
-#: src/Module/Contact/Contacts.php:86 src/Module/Profile/Common.php:98
+#: src/Module/Contact/Contacts.php:85 src/Module/Profile/Common.php:97
msgid "No common contacts."
msgstr ""
-#: src/Module/Contact/Contacts.php:98 src/Module/Profile/Contacts.php:96
+#: src/Module/Contact/Contacts.php:97 src/Module/Profile/Contacts.php:95
#, php-format
msgid "Follower (%s)"
msgid_plural "Followers (%s)"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Contact/Contacts.php:102 src/Module/Profile/Contacts.php:99
+#: src/Module/Contact/Contacts.php:101 src/Module/Profile/Contacts.php:98
#, php-format
msgid "Following (%s)"
msgid_plural "Following (%s)"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Contact/Contacts.php:106 src/Module/Profile/Contacts.php:102
+#: src/Module/Contact/Contacts.php:105 src/Module/Profile/Contacts.php:101
#, php-format
msgid "Mutual friend (%s)"
msgid_plural "Mutual friends (%s)"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Contact/Contacts.php:108 src/Module/Profile/Contacts.php:104
+#: src/Module/Contact/Contacts.php:107 src/Module/Profile/Contacts.php:103
#, php-format
msgid "These contacts both follow and are followed by %s ."
msgstr ""
-#: src/Module/Contact/Contacts.php:114 src/Module/Profile/Common.php:86
+#: src/Module/Contact/Contacts.php:113 src/Module/Profile/Common.php:85
#, php-format
msgid "Common contact (%s)"
msgid_plural "Common contacts (%s)"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Contact/Contacts.php:116 src/Module/Profile/Common.php:88
+#: src/Module/Contact/Contacts.php:115 src/Module/Profile/Common.php:87
#, php-format
msgid ""
"Both %s and yourself have publicly interacted with these "
"contacts (follow, comment or likes on public posts)."
msgstr ""
-#: src/Module/Contact/Contacts.php:122 src/Module/Profile/Contacts.php:110
+#: src/Module/Contact/Contacts.php:121 src/Module/Profile/Contacts.php:109
#, php-format
msgid "Contact (%s)"
msgid_plural "Contacts (%s)"
@@ -7165,7 +7165,7 @@ msgid "Awaiting connection acknowledge"
msgstr ""
#: src/Module/Contact/Profile.php:359
-#: src/Module/Notifications/Introductions.php:192
+#: src/Module/Notifications/Introductions.php:191
msgid "Hide this contact from others"
msgstr ""
@@ -7193,7 +7193,7 @@ msgid ""
msgstr ""
#: src/Module/Contact/Profile.php:380
-#: src/Module/Settings/TwoFactor/Index.php:140
+#: src/Module/Settings/TwoFactor/Index.php:139
msgid "Actions"
msgstr ""
@@ -7219,7 +7219,7 @@ msgstr ""
msgid "Toggle Ignored status"
msgstr ""
-#: src/Module/Contact/Profile.php:468 src/Module/Contact/Revoke.php:107
+#: src/Module/Contact/Profile.php:468 src/Module/Contact/Revoke.php:106
msgid "Revoke Follow"
msgstr ""
@@ -7227,129 +7227,129 @@ msgstr ""
msgid "Revoke the follow from this contact"
msgstr ""
-#: src/Module/Contact/Revoke.php:64
+#: src/Module/Contact/Revoke.php:63
msgid "Unknown contact."
msgstr ""
-#: src/Module/Contact/Revoke.php:74 src/Module/Group.php:111
+#: src/Module/Contact/Revoke.php:73 src/Module/Group.php:110
msgid "Contact is deleted."
msgstr ""
-#: src/Module/Contact/Revoke.php:78
+#: src/Module/Contact/Revoke.php:77
msgid "Contact is being deleted."
msgstr ""
-#: src/Module/Contact/Revoke.php:92
+#: src/Module/Contact/Revoke.php:91
msgid "Follow was successfully revoked."
msgstr ""
-#: src/Module/Contact/Revoke.php:108
+#: src/Module/Contact/Revoke.php:107
msgid ""
"Do you really want to revoke this contact's follow? This cannot be undone "
"and they will have to manually follow you back again."
msgstr ""
-#: src/Module/Contact/Revoke.php:109
-#: src/Module/Notifications/Introductions.php:144
-#: src/Module/OAuth/Acknowledge.php:53 src/Module/Register.php:131
-#: src/Module/Settings/TwoFactor/Trusted.php:126
+#: src/Module/Contact/Revoke.php:108
+#: src/Module/Notifications/Introductions.php:143
+#: src/Module/OAuth/Acknowledge.php:53 src/Module/Register.php:130
+#: src/Module/Settings/TwoFactor/Trusted.php:125
msgid "Yes"
msgstr ""
-#: src/Module/Conversation/Community.php:74
+#: src/Module/Conversation/Community.php:73
msgid ""
"This community stream shows all public posts received by this node. They may "
"not reflect the opinions of this node’s users."
msgstr ""
-#: src/Module/Conversation/Community.php:87
+#: src/Module/Conversation/Community.php:86
msgid "Local Community"
msgstr ""
-#: src/Module/Conversation/Community.php:90
+#: src/Module/Conversation/Community.php:89
msgid "Posts from local users on this server"
msgstr ""
-#: src/Module/Conversation/Community.php:98
+#: src/Module/Conversation/Community.php:97
msgid "Global Community"
msgstr ""
-#: src/Module/Conversation/Community.php:101
+#: src/Module/Conversation/Community.php:100
msgid "Posts from users of the whole federated network"
msgstr ""
-#: src/Module/Conversation/Community.php:134
+#: src/Module/Conversation/Community.php:133
msgid "Own Contacts"
msgstr ""
-#: src/Module/Conversation/Community.php:138
+#: src/Module/Conversation/Community.php:137
msgid "Include"
msgstr ""
-#: src/Module/Conversation/Community.php:139
+#: src/Module/Conversation/Community.php:138
msgid "Hide"
msgstr ""
-#: src/Module/Conversation/Community.php:156 src/Module/Search/Index.php:152
-#: src/Module/Search/Index.php:194
+#: src/Module/Conversation/Community.php:155 src/Module/Search/Index.php:151
+#: src/Module/Search/Index.php:193
msgid "No results."
msgstr ""
-#: src/Module/Conversation/Community.php:212
+#: src/Module/Conversation/Community.php:211
msgid "Community option not available."
msgstr ""
-#: src/Module/Conversation/Community.php:228
+#: src/Module/Conversation/Community.php:227
msgid "Not available."
msgstr ""
-#: src/Module/Conversation/Network.php:173
+#: src/Module/Conversation/Network.php:172
msgid "No such group"
msgstr ""
-#: src/Module/Conversation/Network.php:177
+#: src/Module/Conversation/Network.php:176
#, php-format
msgid "Group: %s"
msgstr ""
-#: src/Module/Conversation/Network.php:255
+#: src/Module/Conversation/Network.php:254
msgid "Latest Activity"
msgstr ""
-#: src/Module/Conversation/Network.php:258
+#: src/Module/Conversation/Network.php:257
msgid "Sort by latest activity"
msgstr ""
-#: src/Module/Conversation/Network.php:263
+#: src/Module/Conversation/Network.php:262
msgid "Latest Posts"
msgstr ""
-#: src/Module/Conversation/Network.php:266
+#: src/Module/Conversation/Network.php:265
msgid "Sort by post received date"
msgstr ""
-#: src/Module/Conversation/Network.php:271
+#: src/Module/Conversation/Network.php:270
msgid "Latest Creation"
msgstr ""
-#: src/Module/Conversation/Network.php:274
+#: src/Module/Conversation/Network.php:273
msgid "Sort by post creation date"
msgstr ""
-#: src/Module/Conversation/Network.php:279
-#: src/Module/Settings/Profile/Index.php:228
+#: src/Module/Conversation/Network.php:278
+#: src/Module/Settings/Profile/Index.php:227
msgid "Personal"
msgstr ""
-#: src/Module/Conversation/Network.php:282
+#: src/Module/Conversation/Network.php:281
msgid "Posts that mention or involve you"
msgstr ""
-#: src/Module/Conversation/Network.php:287 src/Object/Post.php:351
+#: src/Module/Conversation/Network.php:286 src/Object/Post.php:351
msgid "Starred"
msgstr ""
-#: src/Module/Conversation/Network.php:290
+#: src/Module/Conversation/Network.php:289
msgid "Favourite Posts"
msgstr ""
@@ -7364,23 +7364,23 @@ msgid ""
"code or the translation of Friendica. Thank you all!"
msgstr ""
-#: src/Module/Debug/ActivityPubConversion.php:54
+#: src/Module/Debug/ActivityPubConversion.php:53
msgid "Formatted"
msgstr ""
-#: src/Module/Debug/ActivityPubConversion.php:66
+#: src/Module/Debug/ActivityPubConversion.php:65
msgid "Activity"
msgstr ""
-#: src/Module/Debug/ActivityPubConversion.php:118
+#: src/Module/Debug/ActivityPubConversion.php:117
msgid "Object data"
msgstr ""
-#: src/Module/Debug/ActivityPubConversion.php:125
+#: src/Module/Debug/ActivityPubConversion.php:124
msgid "Result Item"
msgstr ""
-#: src/Module/Debug/ActivityPubConversion.php:139
+#: src/Module/Debug/ActivityPubConversion.php:138
msgid "Source activity"
msgstr ""
@@ -7560,12 +7560,12 @@ msgstr ""
msgid "Twitter Source / Tweet URL (requires API key)"
msgstr ""
-#: src/Module/Debug/Feed.php:53 src/Module/Filer/SaveTag.php:48
-#: src/Module/Settings/Profile/Index.php:142
+#: src/Module/Debug/Feed.php:52 src/Module/Filer/SaveTag.php:47
+#: src/Module/Settings/Profile/Index.php:141
msgid "You must be logged in to use this module"
msgstr ""
-#: src/Module/Debug/Feed.php:78
+#: src/Module/Debug/Feed.php:77
msgid "Source URL"
msgstr ""
@@ -7598,66 +7598,66 @@ msgstr ""
msgid "Please select your timezone:"
msgstr ""
-#: src/Module/Debug/Probe.php:39 src/Module/Debug/WebFinger.php:38
+#: src/Module/Debug/Probe.php:38 src/Module/Debug/WebFinger.php:37
msgid "Only logged in users are permitted to perform a probing."
msgstr ""
-#: src/Module/Debug/Probe.php:53
+#: src/Module/Debug/Probe.php:52
msgid "Probe Diagnostic"
msgstr ""
-#: src/Module/Debug/Probe.php:54
+#: src/Module/Debug/Probe.php:53
msgid "Output"
msgstr ""
-#: src/Module/Debug/Probe.php:57
+#: src/Module/Debug/Probe.php:56
msgid "Lookup address"
msgstr ""
-#: src/Module/Debug/WebFinger.php:51
+#: src/Module/Debug/WebFinger.php:50
msgid "Webfinger Diagnostic"
msgstr ""
-#: src/Module/Debug/WebFinger.php:53
+#: src/Module/Debug/WebFinger.php:52
msgid "Lookup address:"
msgstr ""
-#: src/Module/Delegation.php:111
+#: src/Module/Delegation.php:110
#, php-format
msgid "You are now logged in as %s"
msgstr ""
-#: src/Module/Delegation.php:143
+#: src/Module/Delegation.php:142
msgid "Switch between your accounts"
msgstr ""
-#: src/Module/Delegation.php:144
+#: src/Module/Delegation.php:143
msgid "Manage your accounts"
msgstr ""
-#: src/Module/Delegation.php:145
+#: src/Module/Delegation.php:144
msgid ""
"Toggle between different identities or community/group pages which share "
"your account details or which you have been granted \"manage\" permissions"
msgstr ""
-#: src/Module/Delegation.php:146
+#: src/Module/Delegation.php:145
msgid "Select an identity to manage: "
msgstr ""
-#: src/Module/Directory.php:75
+#: src/Module/Directory.php:74
msgid "No entries (some entries may be hidden)."
msgstr ""
-#: src/Module/Directory.php:91
+#: src/Module/Directory.php:90
msgid "Find on this site"
msgstr ""
-#: src/Module/Directory.php:93
+#: src/Module/Directory.php:92
msgid "Results for:"
msgstr ""
-#: src/Module/Directory.php:95
+#: src/Module/Directory.php:94
msgid "Site Directory"
msgstr ""
@@ -7669,23 +7669,23 @@ msgstr ""
msgid "Item was not removed"
msgstr ""
-#: src/Module/Filer/SaveTag.php:74
+#: src/Module/Filer/SaveTag.php:73
msgid "- select -"
msgstr ""
-#: src/Module/FriendSuggest.php:83
+#: src/Module/FriendSuggest.php:82
msgid "Suggested contact not found."
msgstr ""
-#: src/Module/FriendSuggest.php:101
+#: src/Module/FriendSuggest.php:100
msgid "Friend suggestion sent."
msgstr ""
-#: src/Module/FriendSuggest.php:138
+#: src/Module/FriendSuggest.php:137
msgid "Suggest Friends"
msgstr ""
-#: src/Module/FriendSuggest.php:141
+#: src/Module/FriendSuggest.php:140
#, php-format
msgid "Suggest a friend for %s"
msgstr ""
@@ -7737,87 +7737,87 @@ msgid ""
"Suggestions, praise, etc. - please email \"info\" at \"friendi - dot - ca"
msgstr ""
-#: src/Module/Group.php:57
+#: src/Module/Group.php:56
msgid "Could not create group."
msgstr ""
-#: src/Module/Group.php:68 src/Module/Group.php:214 src/Module/Group.php:238
+#: src/Module/Group.php:67 src/Module/Group.php:213 src/Module/Group.php:237
msgid "Group not found."
msgstr ""
-#: src/Module/Group.php:74
+#: src/Module/Group.php:73
msgid "Group name was not changed."
msgstr ""
-#: src/Module/Group.php:92
+#: src/Module/Group.php:91
msgid "Unknown group."
msgstr ""
-#: src/Module/Group.php:117
+#: src/Module/Group.php:116
msgid "Unable to add the contact to the group."
msgstr ""
-#: src/Module/Group.php:120
+#: src/Module/Group.php:119
msgid "Contact successfully added to group."
msgstr ""
-#: src/Module/Group.php:124
+#: src/Module/Group.php:123
msgid "Unable to remove the contact from the group."
msgstr ""
-#: src/Module/Group.php:127
+#: src/Module/Group.php:126
msgid "Contact successfully removed from group."
msgstr ""
-#: src/Module/Group.php:131
+#: src/Module/Group.php:130
msgid "Bad request."
msgstr ""
-#: src/Module/Group.php:170
+#: src/Module/Group.php:169
msgid "Save Group"
msgstr ""
-#: src/Module/Group.php:171
+#: src/Module/Group.php:170
msgid "Filter"
msgstr ""
-#: src/Module/Group.php:177
+#: src/Module/Group.php:176
msgid "Create a group of contacts/friends."
msgstr ""
-#: src/Module/Group.php:219
+#: src/Module/Group.php:218
msgid "Unable to remove group."
msgstr ""
-#: src/Module/Group.php:270
+#: src/Module/Group.php:269
msgid "Delete Group"
msgstr ""
-#: src/Module/Group.php:280
+#: src/Module/Group.php:279
msgid "Edit Group Name"
msgstr ""
-#: src/Module/Group.php:290
+#: src/Module/Group.php:289
msgid "Members"
msgstr ""
-#: src/Module/Group.php:293
+#: src/Module/Group.php:292
msgid "Group is empty"
msgstr ""
-#: src/Module/Group.php:306
+#: src/Module/Group.php:305
msgid "Remove contact from group"
msgstr ""
-#: src/Module/Group.php:327
+#: src/Module/Group.php:326
msgid "Click on a contact to add or remove."
msgstr ""
-#: src/Module/Group.php:341
+#: src/Module/Group.php:340
msgid "Add contact to group"
msgstr ""
-#: src/Module/HCard.php:46
+#: src/Module/HCard.php:45
msgid "No profile"
msgstr ""
@@ -7829,7 +7829,7 @@ msgstr ""
msgid "Help:"
msgstr ""
-#: src/Module/Home.php:55
+#: src/Module/Home.php:54
#, php-format
msgid "Welcome to %s"
msgstr ""
@@ -7990,40 +7990,40 @@ msgid ""
"administrator email. This will allow you to enter the site admin panel."
msgstr ""
-#: src/Module/Invite.php:58
+#: src/Module/Invite.php:57
msgid "Total invitation limit exceeded."
msgstr ""
-#: src/Module/Invite.php:83
+#: src/Module/Invite.php:82
#, php-format
msgid "%s : Not a valid email address."
msgstr ""
-#: src/Module/Invite.php:109
+#: src/Module/Invite.php:108
msgid "Please join us on Friendica"
msgstr ""
-#: src/Module/Invite.php:118
+#: src/Module/Invite.php:117
msgid "Invitation limit exceeded. Please contact your site administrator."
msgstr ""
-#: src/Module/Invite.php:122
+#: src/Module/Invite.php:121
#, php-format
msgid "%s : Message delivery failed."
msgstr ""
-#: src/Module/Invite.php:126
+#: src/Module/Invite.php:125
#, php-format
msgid "%d message sent."
msgid_plural "%d messages sent."
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Invite.php:144
+#: src/Module/Invite.php:143
msgid "You have no more invitations available"
msgstr ""
-#: src/Module/Invite.php:151
+#: src/Module/Invite.php:150
#, php-format
msgid ""
"Visit %s for a list of public sites that you can join. Friendica members on "
@@ -8031,14 +8031,14 @@ msgid ""
"other social networks."
msgstr ""
-#: src/Module/Invite.php:153
+#: src/Module/Invite.php:152
#, php-format
msgid ""
"To accept this invitation, please visit and register at %s or any other "
"public Friendica website."
msgstr ""
-#: src/Module/Invite.php:154
+#: src/Module/Invite.php:153
#, php-format
msgid ""
"Friendica sites all inter-connect to create a huge privacy-enhanced social "
@@ -8047,94 +8047,94 @@ msgid ""
"sites you can join."
msgstr ""
-#: src/Module/Invite.php:158
+#: src/Module/Invite.php:157
msgid ""
"Our apologies. This system is not currently configured to connect with other "
"public sites or invite members."
msgstr ""
-#: src/Module/Invite.php:161
+#: src/Module/Invite.php:160
msgid ""
"Friendica sites all inter-connect to create a huge privacy-enhanced social "
"web that is owned and controlled by its members. They can also connect with "
"many traditional social networks."
msgstr ""
-#: src/Module/Invite.php:160
+#: src/Module/Invite.php:159
#, php-format
msgid "To accept this invitation, please visit and register at %s."
msgstr ""
-#: src/Module/Invite.php:168
+#: src/Module/Invite.php:167
msgid "Send invitations"
msgstr ""
-#: src/Module/Invite.php:169
+#: src/Module/Invite.php:168
msgid "Enter email addresses, one per line:"
msgstr ""
-#: src/Module/Invite.php:173
+#: src/Module/Invite.php:172
msgid ""
"You are cordially invited to join me and other close friends on Friendica - "
"and help us to create a better social web."
msgstr ""
-#: src/Module/Invite.php:175
+#: src/Module/Invite.php:174
msgid "You will need to supply this invitation code: $invite_code"
msgstr ""
-#: src/Module/Invite.php:175
+#: src/Module/Invite.php:174
msgid ""
"Once you have registered, please connect with me via my profile page at:"
msgstr ""
-#: src/Module/Invite.php:177
+#: src/Module/Invite.php:176
msgid ""
"For more information about the Friendica project and why we feel it is "
"important, please visit http://friendi.ca"
msgstr ""
-#: src/Module/Item/Compose.php:86
+#: src/Module/Item/Compose.php:85
msgid "Please enter a post body."
msgstr ""
-#: src/Module/Item/Compose.php:99
+#: src/Module/Item/Compose.php:98
msgid "This feature is only available with the frio theme."
msgstr ""
-#: src/Module/Item/Compose.php:123
+#: src/Module/Item/Compose.php:122
msgid "Compose new personal note"
msgstr ""
-#: src/Module/Item/Compose.php:132
+#: src/Module/Item/Compose.php:131
msgid "Compose new post"
msgstr ""
-#: src/Module/Item/Compose.php:188
+#: src/Module/Item/Compose.php:187
msgid "Visibility"
msgstr ""
-#: src/Module/Item/Compose.php:202
+#: src/Module/Item/Compose.php:201
msgid "Clear the location"
msgstr ""
-#: src/Module/Item/Compose.php:203
+#: src/Module/Item/Compose.php:202
msgid "Location services are unavailable on your device"
msgstr ""
-#: src/Module/Item/Compose.php:204
+#: src/Module/Item/Compose.php:203
msgid ""
"Location services are disabled. Please check the website's permissions on "
"your device"
msgstr ""
-#: src/Module/Item/Compose.php:210
+#: src/Module/Item/Compose.php:209
msgid ""
"You can make this page always open when you use the New Post button in the "
"Theme Customization settings ."
msgstr ""
-#: src/Module/Item/Follow.php:52
+#: src/Module/Item/Follow.php:51
msgid "Unable to follow this item."
msgstr ""
@@ -8153,70 +8153,70 @@ msgstr ""
msgid "A Decentralized Social Network"
msgstr ""
-#: src/Module/Notifications/Introductions.php:99
+#: src/Module/Notifications/Introductions.php:98
msgid "Show Ignored Requests"
msgstr ""
-#: src/Module/Notifications/Introductions.php:99
+#: src/Module/Notifications/Introductions.php:98
msgid "Hide Ignored Requests"
msgstr ""
-#: src/Module/Notifications/Introductions.php:115
-#: src/Module/Notifications/Introductions.php:178
+#: src/Module/Notifications/Introductions.php:114
+#: src/Module/Notifications/Introductions.php:177
msgid "Notification type:"
msgstr ""
-#: src/Module/Notifications/Introductions.php:118
+#: src/Module/Notifications/Introductions.php:117
msgid "Suggested by:"
msgstr ""
-#: src/Module/Notifications/Introductions.php:143
+#: src/Module/Notifications/Introductions.php:142
msgid "Claims to be known to you: "
msgstr ""
-#: src/Module/Notifications/Introductions.php:144
-#: src/Module/OAuth/Acknowledge.php:54 src/Module/Register.php:132
-#: src/Module/Settings/TwoFactor/Trusted.php:126
+#: src/Module/Notifications/Introductions.php:143
+#: src/Module/OAuth/Acknowledge.php:54 src/Module/Register.php:131
+#: src/Module/Settings/TwoFactor/Trusted.php:125
msgid "No"
msgstr ""
-#: src/Module/Notifications/Introductions.php:152
+#: src/Module/Notifications/Introductions.php:151
msgid "Shall your connection be bidirectional or not?"
msgstr ""
-#: src/Module/Notifications/Introductions.php:153
+#: src/Module/Notifications/Introductions.php:152
#, php-format
msgid ""
"Accepting %s as a friend allows %s to subscribe to your posts, and you will "
"also receive updates from them in your news feed."
msgstr ""
-#: src/Module/Notifications/Introductions.php:154
+#: src/Module/Notifications/Introductions.php:153
#, php-format
msgid ""
"Accepting %s as a subscriber allows them to subscribe to your posts, but you "
"will not receive updates from them in your news feed."
msgstr ""
-#: src/Module/Notifications/Introductions.php:156
+#: src/Module/Notifications/Introductions.php:155
msgid "Friend"
msgstr ""
-#: src/Module/Notifications/Introductions.php:157
+#: src/Module/Notifications/Introductions.php:156
msgid "Subscriber"
msgstr ""
-#: src/Module/Notifications/Introductions.php:216
+#: src/Module/Notifications/Introductions.php:215
msgid "No introductions."
msgstr ""
-#: src/Module/Notifications/Introductions.php:217
+#: src/Module/Notifications/Introductions.php:216
#: src/Module/Notifications/Notifications.php:134
#, php-format
msgid "No more %s notifications."
msgstr ""
-#: src/Module/Notifications/Notification.php:136
+#: src/Module/Notifications/Notification.php:135
msgid "You must be logged in to show this page."
msgstr ""
@@ -8240,11 +8240,11 @@ msgstr ""
msgid "Show unread"
msgstr ""
-#: src/Module/Notifications/Ping.php:225
+#: src/Module/Notifications/Ping.php:224
msgid "{0} requested registration"
msgstr ""
-#: src/Module/Notifications/Ping.php:236
+#: src/Module/Notifications/Ping.php:235
#, php-format
msgid "{0} and %d others requested registration"
msgstr ""
@@ -8259,15 +8259,15 @@ msgid ""
"and/or create new posts for you?"
msgstr ""
-#: src/Module/OAuth/Authorize.php:55
+#: src/Module/OAuth/Authorize.php:54
msgid "Unsupported or missing response type"
msgstr ""
-#: src/Module/OAuth/Authorize.php:60 src/Module/OAuth/Token.php:72
+#: src/Module/OAuth/Authorize.php:59 src/Module/OAuth/Token.php:72
msgid "Incomplete request data"
msgstr ""
-#: src/Module/OAuth/Authorize.php:107
+#: src/Module/OAuth/Authorize.php:106
#, php-format
msgid ""
"Please copy the following authentication code into your application and "
@@ -8278,117 +8278,117 @@ msgstr ""
msgid "Unsupported or missing grant type"
msgstr ""
-#: src/Module/PermissionTooltip.php:50
+#: src/Module/PermissionTooltip.php:49
#, php-format
msgid "Wrong type \"%s\", expected one of: %s"
msgstr ""
-#: src/Module/PermissionTooltip.php:67
+#: src/Module/PermissionTooltip.php:66
msgid "Model not found"
msgstr ""
-#: src/Module/PermissionTooltip.php:90
+#: src/Module/PermissionTooltip.php:89
msgid "Unlisted"
msgstr ""
-#: src/Module/PermissionTooltip.php:108
+#: src/Module/PermissionTooltip.php:107
msgid "Remote privacy information not available."
msgstr ""
-#: src/Module/PermissionTooltip.php:117
+#: src/Module/PermissionTooltip.php:116
msgid "Visible to:"
msgstr ""
-#: src/Module/PermissionTooltip.php:201
+#: src/Module/PermissionTooltip.php:200
#, php-format
msgid "Collection (%s)"
msgstr ""
-#: src/Module/PermissionTooltip.php:205
+#: src/Module/PermissionTooltip.php:204
#, php-format
msgid "Followers (%s)"
msgstr ""
-#: src/Module/PermissionTooltip.php:224
+#: src/Module/PermissionTooltip.php:223
#, php-format
msgid "%d more"
msgstr ""
-#: src/Module/PermissionTooltip.php:228
+#: src/Module/PermissionTooltip.php:227
#, php-format
msgid "To: %s "
msgstr ""
-#: src/Module/PermissionTooltip.php:231
+#: src/Module/PermissionTooltip.php:230
#, php-format
msgid "CC: %s "
msgstr ""
-#: src/Module/PermissionTooltip.php:234
+#: src/Module/PermissionTooltip.php:233
#, php-format
msgid "BCC: %s "
msgstr ""
-#: src/Module/Photo.php:129
+#: src/Module/Photo.php:128
msgid "The Photo is not available."
msgstr ""
-#: src/Module/Photo.php:142
+#: src/Module/Photo.php:141
#, php-format
msgid "The Photo with id %s is not available."
msgstr ""
-#: src/Module/Photo.php:175
+#: src/Module/Photo.php:174
#, php-format
msgid "Invalid external resource with url %s."
msgstr ""
-#: src/Module/Photo.php:177
+#: src/Module/Photo.php:176
#, php-format
msgid "Invalid photo with id %s."
msgstr ""
-#: src/Module/Profile/Contacts.php:120
+#: src/Module/Profile/Contacts.php:119
msgid "No contacts."
msgstr ""
-#: src/Module/Profile/Profile.php:82
+#: src/Module/Profile/Profile.php:81
msgid "Profile not found."
msgstr ""
-#: src/Module/Profile/Profile.php:135
+#: src/Module/Profile/Profile.php:134
#, php-format
msgid ""
"You're currently viewing your profile as %s Cancel "
msgstr ""
-#: src/Module/Profile/Profile.php:144 src/Module/Settings/Account.php:580
+#: src/Module/Profile/Profile.php:143 src/Module/Settings/Account.php:579
msgid "Full Name:"
msgstr ""
-#: src/Module/Profile/Profile.php:149
+#: src/Module/Profile/Profile.php:148
msgid "Member since:"
msgstr ""
-#: src/Module/Profile/Profile.php:155
+#: src/Module/Profile/Profile.php:154
msgid "j F, Y"
msgstr ""
-#: src/Module/Profile/Profile.php:156
+#: src/Module/Profile/Profile.php:155
msgid "j F"
msgstr ""
-#: src/Module/Profile/Profile.php:164 src/Util/Temporal.php:167
+#: src/Module/Profile/Profile.php:163 src/Util/Temporal.php:167
msgid "Birthday:"
msgstr ""
-#: src/Module/Profile/Profile.php:167 src/Module/Settings/Profile/Index.php:246
+#: src/Module/Profile/Profile.php:166 src/Module/Settings/Profile/Index.php:245
#: src/Util/Temporal.php:169
msgid "Age: "
msgstr ""
-#: src/Module/Profile/Profile.php:167 src/Module/Settings/Profile/Index.php:246
+#: src/Module/Profile/Profile.php:166 src/Module/Settings/Profile/Index.php:245
#: src/Util/Temporal.php:169
#, php-format
msgid "%d year old"
@@ -8396,190 +8396,190 @@ msgid_plural "%d years old"
msgstr[0] ""
msgstr[1] ""
-#: src/Module/Profile/Profile.php:234
+#: src/Module/Profile/Profile.php:233
msgid "Forums:"
msgstr ""
-#: src/Module/Profile/Profile.php:246
+#: src/Module/Profile/Profile.php:245
msgid "View profile as:"
msgstr ""
-#: src/Module/Profile/Profile.php:263
+#: src/Module/Profile/Profile.php:262
msgid "View as"
msgstr ""
-#: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329
-#: src/Module/Profile/Status.php:66 src/Module/Profile/Status.php:69
+#: src/Module/Profile/Profile.php:325 src/Module/Profile/Profile.php:328
+#: src/Module/Profile/Status.php:65 src/Module/Profile/Status.php:68
#: src/Protocol/Feed.php:1028 src/Protocol/OStatus.php:1047
#, php-format
msgid "%s's timeline"
msgstr ""
-#: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:67
+#: src/Module/Profile/Profile.php:326 src/Module/Profile/Status.php:66
#: src/Protocol/Feed.php:1032 src/Protocol/OStatus.php:1052
#, php-format
msgid "%s's posts"
msgstr ""
-#: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:68
+#: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:67
#: src/Protocol/Feed.php:1035 src/Protocol/OStatus.php:1056
#, php-format
msgid "%s's comments"
msgstr ""
-#: src/Module/Profile/Schedule.php:85
+#: src/Module/Profile/Schedule.php:84
msgid "Scheduled"
msgstr ""
-#: src/Module/Profile/Schedule.php:86
+#: src/Module/Profile/Schedule.php:85
msgid "Content"
msgstr ""
-#: src/Module/Profile/Schedule.php:87
+#: src/Module/Profile/Schedule.php:86
msgid "Remove post"
msgstr ""
-#: src/Module/Register.php:85
+#: src/Module/Register.php:84
msgid "Only parent users can create additional accounts."
msgstr ""
-#: src/Module/Register.php:117
+#: src/Module/Register.php:116
msgid ""
"You may (optionally) fill in this form via OpenID by supplying your OpenID "
"and clicking \"Register\"."
msgstr ""
-#: src/Module/Register.php:118
+#: src/Module/Register.php:117
msgid ""
"If you are not familiar with OpenID, please leave that field blank and fill "
"in the rest of the items."
msgstr ""
-#: src/Module/Register.php:119
+#: src/Module/Register.php:118
msgid "Your OpenID (optional): "
msgstr ""
-#: src/Module/Register.php:128
+#: src/Module/Register.php:127
msgid "Include your profile in member directory?"
msgstr ""
-#: src/Module/Register.php:149
+#: src/Module/Register.php:148
msgid "Note for the admin"
msgstr ""
-#: src/Module/Register.php:149
+#: src/Module/Register.php:148
msgid "Leave a message for the admin, why you want to join this node"
msgstr ""
-#: src/Module/Register.php:150
+#: src/Module/Register.php:149
msgid "Membership on this site is by invitation only."
msgstr ""
-#: src/Module/Register.php:151
+#: src/Module/Register.php:150
msgid "Your invitation code: "
msgstr ""
-#: src/Module/Register.php:159
+#: src/Module/Register.php:158
msgid "Your Full Name (e.g. Joe Smith, real or real-looking): "
msgstr ""
-#: src/Module/Register.php:160
+#: src/Module/Register.php:159
msgid ""
"Your Email Address: (Initial information will be send there, so this has to "
"be an existing address.)"
msgstr ""
-#: src/Module/Register.php:161
+#: src/Module/Register.php:160
msgid "Please repeat your e-mail address:"
msgstr ""
-#: src/Module/Register.php:163 src/Module/Security/PasswordTooLong.php:98
-#: src/Module/Settings/Account.php:571
+#: src/Module/Register.php:162 src/Module/Security/PasswordTooLong.php:98
+#: src/Module/Settings/Account.php:570
msgid "New Password:"
msgstr ""
-#: src/Module/Register.php:163
+#: src/Module/Register.php:162
msgid "Leave empty for an auto generated password."
msgstr ""
-#: src/Module/Register.php:164 src/Module/Security/PasswordTooLong.php:99
-#: src/Module/Settings/Account.php:572
+#: src/Module/Register.php:163 src/Module/Security/PasswordTooLong.php:99
+#: src/Module/Settings/Account.php:571
msgid "Confirm:"
msgstr ""
-#: src/Module/Register.php:165
+#: src/Module/Register.php:164
#, php-format
msgid ""
"Choose a profile nickname. This must begin with a text character. Your "
"profile address on this site will then be \"nickname@%s \"."
msgstr ""
-#: src/Module/Register.php:166
+#: src/Module/Register.php:165
msgid "Choose a nickname: "
msgstr ""
-#: src/Module/Register.php:175
+#: src/Module/Register.php:174
msgid "Import your profile to this friendica instance"
msgstr ""
-#: src/Module/Register.php:182
+#: src/Module/Register.php:181
msgid "Note: This node explicitly contains adult content"
msgstr ""
-#: src/Module/Register.php:184 src/Module/Settings/Delegation.php:155
+#: src/Module/Register.php:183 src/Module/Settings/Delegation.php:154
msgid "Parent Password:"
msgstr ""
-#: src/Module/Register.php:184 src/Module/Settings/Delegation.php:155
+#: src/Module/Register.php:183 src/Module/Settings/Delegation.php:154
msgid ""
"Please enter the password of the parent account to legitimize your request."
msgstr ""
-#: src/Module/Register.php:213
+#: src/Module/Register.php:212
msgid "Password doesn't match."
msgstr ""
-#: src/Module/Register.php:219
+#: src/Module/Register.php:218
msgid "Please enter your password."
msgstr ""
-#: src/Module/Register.php:261
+#: src/Module/Register.php:260
msgid "You have entered too much information."
msgstr ""
-#: src/Module/Register.php:284
+#: src/Module/Register.php:283
msgid "Please enter the identical mail address in the second field."
msgstr ""
-#: src/Module/Register.php:311
+#: src/Module/Register.php:310
msgid "The additional account was created."
msgstr ""
-#: src/Module/Register.php:336
+#: src/Module/Register.php:335
msgid ""
"Registration successful. Please check your email for further instructions."
msgstr ""
-#: src/Module/Register.php:340
+#: src/Module/Register.php:339
#, php-format
msgid ""
"Failed to send email message. Here your accout details: login: %s "
"password: %s You can change your password after login."
msgstr ""
-#: src/Module/Register.php:346
+#: src/Module/Register.php:345
msgid "Registration successful."
msgstr ""
-#: src/Module/Register.php:351 src/Module/Register.php:358
+#: src/Module/Register.php:350 src/Module/Register.php:357
msgid "Your registration can not be processed."
msgstr ""
-#: src/Module/Register.php:357
+#: src/Module/Register.php:356
msgid "You have to leave a request note for the admin."
msgstr ""
-#: src/Module/Register.php:403
+#: src/Module/Register.php:402
msgid "Your registration is pending approval by the site owner."
msgstr ""
@@ -8624,86 +8624,86 @@ msgstr ""
msgid "Your Webfinger address or profile URL:"
msgstr ""
-#: src/Module/Search/Acl.php:56
+#: src/Module/Search/Acl.php:55
msgid "You must be logged in to use this module."
msgstr ""
-#: src/Module/Search/Index.php:69
+#: src/Module/Search/Index.php:68
msgid "Only logged in users are permitted to perform a search."
msgstr ""
-#: src/Module/Search/Index.php:89
+#: src/Module/Search/Index.php:88
msgid "Only one search per minute is permitted for not logged in users."
msgstr ""
-#: src/Module/Search/Index.php:205
+#: src/Module/Search/Index.php:204
#, php-format
msgid "Items tagged with: %s"
msgstr ""
-#: src/Module/Search/Saved.php:60
+#: src/Module/Search/Saved.php:59
msgid "Search term was not saved."
msgstr ""
-#: src/Module/Search/Saved.php:63
+#: src/Module/Search/Saved.php:62
msgid "Search term already saved."
msgstr ""
-#: src/Module/Search/Saved.php:69
+#: src/Module/Search/Saved.php:68
msgid "Search term was not removed."
msgstr ""
-#: src/Module/Security/Login.php:124
+#: src/Module/Security/Login.php:123
msgid "Create a New Account"
msgstr ""
-#: src/Module/Security/Login.php:144
+#: src/Module/Security/Login.php:143
msgid "Your OpenID: "
msgstr ""
-#: src/Module/Security/Login.php:147
+#: src/Module/Security/Login.php:146
msgid ""
"Please enter your username and password to add the OpenID to your existing "
"account."
msgstr ""
-#: src/Module/Security/Login.php:149
+#: src/Module/Security/Login.php:148
msgid "Or login using OpenID: "
msgstr ""
-#: src/Module/Security/Login.php:163
+#: src/Module/Security/Login.php:162
msgid "Password: "
msgstr ""
-#: src/Module/Security/Login.php:164
+#: src/Module/Security/Login.php:163
msgid "Remember me"
msgstr ""
-#: src/Module/Security/Login.php:173
+#: src/Module/Security/Login.php:172
msgid "Forgot your password?"
msgstr ""
-#: src/Module/Security/Login.php:176
+#: src/Module/Security/Login.php:175
msgid "Website Terms of Service"
msgstr ""
-#: src/Module/Security/Login.php:177
+#: src/Module/Security/Login.php:176
msgid "terms of service"
msgstr ""
-#: src/Module/Security/Login.php:179
+#: src/Module/Security/Login.php:178
msgid "Website Privacy Policy"
msgstr ""
-#: src/Module/Security/Login.php:180
+#: src/Module/Security/Login.php:179
msgid "privacy policy"
msgstr ""
-#: src/Module/Security/Logout.php:85
-#: src/Module/Security/TwoFactor/SignOut.php:80
-#: src/Module/Security/TwoFactor/SignOut.php:88
-#: src/Module/Security/TwoFactor/SignOut.php:110
-#: src/Module/Security/TwoFactor/SignOut.php:117
+#: src/Module/Security/Logout.php:84
+#: src/Module/Security/TwoFactor/SignOut.php:79
+#: src/Module/Security/TwoFactor/SignOut.php:87
+#: src/Module/Security/TwoFactor/SignOut.php:109
+#: src/Module/Security/TwoFactor/SignOut.php:116
msgid "Logged out."
msgstr ""
@@ -8724,7 +8724,7 @@ msgid ""
msgstr ""
#: src/Module/Security/PasswordTooLong.php:54
-#: src/Module/Settings/Account.php:68
+#: src/Module/Settings/Account.php:67
msgid "Passwords do not match."
msgstr ""
@@ -8733,7 +8733,7 @@ msgid "Password does not need changing."
msgstr ""
#: src/Module/Security/PasswordTooLong.php:74
-#: src/Module/Settings/Account.php:82
+#: src/Module/Settings/Account.php:81
msgid "Password unchanged."
msgstr ""
@@ -8753,103 +8753,103 @@ msgid "Update Password"
msgstr ""
#: src/Module/Security/PasswordTooLong.php:97
-#: src/Module/Settings/Account.php:573
+#: src/Module/Settings/Account.php:572
msgid "Current Password:"
msgstr ""
#: src/Module/Security/PasswordTooLong.php:97
-#: src/Module/Settings/Account.php:573
+#: src/Module/Settings/Account.php:572
msgid "Your current password to confirm the changes"
msgstr ""
#: src/Module/Security/PasswordTooLong.php:98
-#: src/Module/Settings/Account.php:556
+#: src/Module/Settings/Account.php:555
msgid ""
"Allowed characters are a-z, A-Z, 0-9 and special characters except white "
"spaces, accentuated letters and colon (:)."
msgstr ""
#: src/Module/Security/PasswordTooLong.php:98
-#: src/Module/Settings/Account.php:557
+#: src/Module/Settings/Account.php:556
msgid "Password length is limited to 72 characters."
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:75
+#: src/Module/Security/TwoFactor/Recovery.php:74
#, php-format
msgid "Remaining recovery codes: %d"
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:81
+#: src/Module/Security/TwoFactor/Recovery.php:80
#: src/Module/Security/TwoFactor/Verify.php:78
-#: src/Module/Settings/TwoFactor/Verify.php:95
+#: src/Module/Settings/TwoFactor/Verify.php:94
msgid "Invalid code, please retry."
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:100
+#: src/Module/Security/TwoFactor/Recovery.php:99
msgid "Two-factor recovery"
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:101
+#: src/Module/Security/TwoFactor/Recovery.php:100
msgid ""
"You can enter one of your one-time recovery codes in case you lost access "
"to your mobile device.
"
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:102
+#: src/Module/Security/TwoFactor/Recovery.php:101
#, php-format
msgid ""
"Don’t have your phone? Enter a two-factor recovery code "
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:103
+#: src/Module/Security/TwoFactor/Recovery.php:102
msgid "Please enter a recovery code"
msgstr ""
-#: src/Module/Security/TwoFactor/Recovery.php:104
+#: src/Module/Security/TwoFactor/Recovery.php:103
msgid "Submit recovery code and complete login"
msgstr ""
-#: src/Module/Security/TwoFactor/SignOut.php:124
+#: src/Module/Security/TwoFactor/SignOut.php:123
msgid "Sign out of this browser?"
msgstr ""
-#: src/Module/Security/TwoFactor/SignOut.php:125
+#: src/Module/Security/TwoFactor/SignOut.php:124
msgid ""
"If you trust this browser, you will not be asked for verification code "
"the next time you sign in.
"
msgstr ""
-#: src/Module/Security/TwoFactor/SignOut.php:126
+#: src/Module/Security/TwoFactor/SignOut.php:125
msgid "Sign out"
msgstr ""
-#: src/Module/Security/TwoFactor/SignOut.php:128
+#: src/Module/Security/TwoFactor/SignOut.php:127
msgid "Trust and sign out"
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:97
+#: src/Module/Security/TwoFactor/Trust.php:96
msgid "Couldn't save browser to Cookie."
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:142
+#: src/Module/Security/TwoFactor/Trust.php:141
msgid "Trust this browser?"
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:143
+#: src/Module/Security/TwoFactor/Trust.php:142
msgid ""
"If you choose to trust this browser, you will not be asked for a "
"verification code the next time you sign in.
"
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:144
+#: src/Module/Security/TwoFactor/Trust.php:143
msgid "Not now"
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:145
+#: src/Module/Security/TwoFactor/Trust.php:144
msgid "Don't trust"
msgstr ""
-#: src/Module/Security/TwoFactor/Trust.php:146
+#: src/Module/Security/TwoFactor/Trust.php:145
msgid "Trust"
msgstr ""
@@ -8867,7 +8867,7 @@ msgid ""
msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:102
-#: src/Module/Settings/TwoFactor/Verify.php:155
+#: src/Module/Settings/TwoFactor/Verify.php:154
msgid "Please enter a code from your authentication app"
msgstr ""
@@ -8875,119 +8875,119 @@ msgstr ""
msgid "Verify code and complete login"
msgstr ""
-#: src/Module/Settings/Account.php:97
+#: src/Module/Settings/Account.php:96
msgid "Please use a shorter name."
msgstr ""
-#: src/Module/Settings/Account.php:100
+#: src/Module/Settings/Account.php:99
msgid "Name too short."
msgstr ""
-#: src/Module/Settings/Account.php:109
+#: src/Module/Settings/Account.php:108
msgid "Wrong Password."
msgstr ""
-#: src/Module/Settings/Account.php:114
+#: src/Module/Settings/Account.php:113
msgid "Invalid email."
msgstr ""
-#: src/Module/Settings/Account.php:120
+#: src/Module/Settings/Account.php:119
msgid "Cannot change to that email."
msgstr ""
-#: src/Module/Settings/Account.php:150 src/Module/Settings/Account.php:202
-#: src/Module/Settings/Account.php:222 src/Module/Settings/Account.php:306
-#: src/Module/Settings/Account.php:355
+#: src/Module/Settings/Account.php:149 src/Module/Settings/Account.php:201
+#: src/Module/Settings/Account.php:221 src/Module/Settings/Account.php:305
+#: src/Module/Settings/Account.php:354
msgid "Settings were not updated."
msgstr ""
-#: src/Module/Settings/Account.php:367
+#: src/Module/Settings/Account.php:366
msgid "Contact CSV file upload error"
msgstr ""
-#: src/Module/Settings/Account.php:386
+#: src/Module/Settings/Account.php:385
msgid "Importing Contacts done"
msgstr ""
-#: src/Module/Settings/Account.php:399
+#: src/Module/Settings/Account.php:398
msgid "Relocate message has been send to your contacts"
msgstr ""
-#: src/Module/Settings/Account.php:416
+#: src/Module/Settings/Account.php:415
msgid "Unable to find your profile. Please contact your admin."
msgstr ""
-#: src/Module/Settings/Account.php:458
+#: src/Module/Settings/Account.php:457
msgid "Personal Page Subtypes"
msgstr ""
-#: src/Module/Settings/Account.php:459
+#: src/Module/Settings/Account.php:458
msgid "Community Forum Subtypes"
msgstr ""
-#: src/Module/Settings/Account.php:469
+#: src/Module/Settings/Account.php:468
msgid "Account for a personal profile."
msgstr ""
-#: src/Module/Settings/Account.php:476
+#: src/Module/Settings/Account.php:475
msgid ""
"Account for an organisation that automatically approves contact requests as "
"\"Followers\"."
msgstr ""
-#: src/Module/Settings/Account.php:483
+#: src/Module/Settings/Account.php:482
msgid ""
"Account for a news reflector that automatically approves contact requests as "
"\"Followers\"."
msgstr ""
-#: src/Module/Settings/Account.php:490
+#: src/Module/Settings/Account.php:489
msgid "Account for community discussions."
msgstr ""
-#: src/Module/Settings/Account.php:497
+#: src/Module/Settings/Account.php:496
msgid ""
"Account for a regular personal profile that requires manual approval of "
"\"Friends\" and \"Followers\"."
msgstr ""
-#: src/Module/Settings/Account.php:504
+#: src/Module/Settings/Account.php:503
msgid ""
"Account for a public profile that automatically approves contact requests as "
"\"Followers\"."
msgstr ""
-#: src/Module/Settings/Account.php:511
+#: src/Module/Settings/Account.php:510
msgid "Automatically approves all contact requests."
msgstr ""
-#: src/Module/Settings/Account.php:518
+#: src/Module/Settings/Account.php:517
msgid ""
"Account for a popular profile that automatically approves contact requests "
"as \"Friends\"."
msgstr ""
-#: src/Module/Settings/Account.php:523
+#: src/Module/Settings/Account.php:522
msgid "Private Forum [Experimental]"
msgstr ""
-#: src/Module/Settings/Account.php:525
+#: src/Module/Settings/Account.php:524
msgid "Requires manual approval of contact requests."
msgstr ""
-#: src/Module/Settings/Account.php:534
+#: src/Module/Settings/Account.php:533
msgid "OpenID:"
msgstr ""
-#: src/Module/Settings/Account.php:534
+#: src/Module/Settings/Account.php:533
msgid "(Optional) Allow this OpenID to login to this account."
msgstr ""
-#: src/Module/Settings/Account.php:542
+#: src/Module/Settings/Account.php:541
msgid "Publish your profile in your local site directory?"
msgstr ""
-#: src/Module/Settings/Account.php:542
+#: src/Module/Settings/Account.php:541
#, php-format
msgid ""
"Your profile will be published in this node's local "
@@ -8995,89 +8995,89 @@ msgid ""
"system settings."
msgstr ""
-#: src/Module/Settings/Account.php:548
+#: src/Module/Settings/Account.php:547
#, php-format
msgid ""
"Your profile will also be published in the global friendica directories (e."
"g. %s )."
msgstr ""
-#: src/Module/Settings/Account.php:561
+#: src/Module/Settings/Account.php:560
msgid "Account Settings"
msgstr ""
-#: src/Module/Settings/Account.php:562
+#: src/Module/Settings/Account.php:561
#, php-format
msgid "Your Identity Address is '%s' or '%s'."
msgstr ""
-#: src/Module/Settings/Account.php:570
+#: src/Module/Settings/Account.php:569
msgid "Password Settings"
msgstr ""
-#: src/Module/Settings/Account.php:572
+#: src/Module/Settings/Account.php:571
msgid "Leave password fields blank unless changing"
msgstr ""
-#: src/Module/Settings/Account.php:574
+#: src/Module/Settings/Account.php:573
msgid "Password:"
msgstr ""
-#: src/Module/Settings/Account.php:574
+#: src/Module/Settings/Account.php:573
msgid "Your current password to confirm the changes of the email address"
msgstr ""
-#: src/Module/Settings/Account.php:577
+#: src/Module/Settings/Account.php:576
msgid "Delete OpenID URL"
msgstr ""
-#: src/Module/Settings/Account.php:579
+#: src/Module/Settings/Account.php:578
msgid "Basic Settings"
msgstr ""
-#: src/Module/Settings/Account.php:581
+#: src/Module/Settings/Account.php:580
msgid "Email Address:"
msgstr ""
-#: src/Module/Settings/Account.php:582
+#: src/Module/Settings/Account.php:581
msgid "Your Timezone:"
msgstr ""
-#: src/Module/Settings/Account.php:583
+#: src/Module/Settings/Account.php:582
msgid "Your Language:"
msgstr ""
-#: src/Module/Settings/Account.php:583
+#: src/Module/Settings/Account.php:582
msgid ""
"Set the language we use to show you friendica interface and to send you "
"emails"
msgstr ""
-#: src/Module/Settings/Account.php:584
+#: src/Module/Settings/Account.php:583
msgid "Default Post Location:"
msgstr ""
-#: src/Module/Settings/Account.php:585
+#: src/Module/Settings/Account.php:584
msgid "Use Browser Location:"
msgstr ""
-#: src/Module/Settings/Account.php:587
+#: src/Module/Settings/Account.php:586
msgid "Security and Privacy Settings"
msgstr ""
-#: src/Module/Settings/Account.php:589
+#: src/Module/Settings/Account.php:588
msgid "Maximum Friend Requests/Day:"
msgstr ""
-#: src/Module/Settings/Account.php:589 src/Module/Settings/Account.php:599
+#: src/Module/Settings/Account.php:588 src/Module/Settings/Account.php:598
msgid "(to prevent spam abuse)"
msgstr ""
-#: src/Module/Settings/Account.php:591
+#: src/Module/Settings/Account.php:590
msgid "Allow your profile to be searchable globally?"
msgstr ""
-#: src/Module/Settings/Account.php:591
+#: src/Module/Settings/Account.php:590
msgid ""
"Activate this setting if you want others to easily find and follow you. Your "
"profile will be searchable on remote systems. This setting also determines "
@@ -9085,43 +9085,43 @@ msgid ""
"indexed or not."
msgstr ""
-#: src/Module/Settings/Account.php:592
+#: src/Module/Settings/Account.php:591
msgid "Hide your contact/friend list from viewers of your profile?"
msgstr ""
-#: src/Module/Settings/Account.php:592
+#: src/Module/Settings/Account.php:591
msgid ""
"A list of your contacts is displayed on your profile page. Activate this "
"option to disable the display of your contact list."
msgstr ""
-#: src/Module/Settings/Account.php:593
+#: src/Module/Settings/Account.php:592
msgid "Hide your profile details from anonymous viewers?"
msgstr ""
-#: src/Module/Settings/Account.php:593
+#: src/Module/Settings/Account.php:592
msgid ""
"Anonymous visitors will only see your profile picture, your display name and "
"the nickname you are using on your profile page. Your public posts and "
"replies will still be accessible by other means."
msgstr ""
-#: src/Module/Settings/Account.php:594
+#: src/Module/Settings/Account.php:593
msgid "Make public posts unlisted"
msgstr ""
-#: src/Module/Settings/Account.php:594
+#: src/Module/Settings/Account.php:593
msgid ""
"Your public posts will not appear on the community pages or in search "
"results, nor be sent to relay servers. However they can still appear on "
"public feeds on remote servers."
msgstr ""
-#: src/Module/Settings/Account.php:595
+#: src/Module/Settings/Account.php:594
msgid "Make all posted pictures accessible"
msgstr ""
-#: src/Module/Settings/Account.php:595
+#: src/Module/Settings/Account.php:594
msgid ""
"This option makes every posted picture accessible via the direct link. This "
"is a workaround for the problem that most other networks can't handle "
@@ -9129,566 +9129,566 @@ msgid ""
"public on your photo albums though."
msgstr ""
-#: src/Module/Settings/Account.php:596
+#: src/Module/Settings/Account.php:595
msgid "Allow friends to post to your profile page?"
msgstr ""
-#: src/Module/Settings/Account.php:596
+#: src/Module/Settings/Account.php:595
msgid ""
"Your contacts may write posts on your profile wall. These posts will be "
"distributed to your contacts"
msgstr ""
-#: src/Module/Settings/Account.php:597
+#: src/Module/Settings/Account.php:596
msgid "Allow friends to tag your posts?"
msgstr ""
-#: src/Module/Settings/Account.php:597
+#: src/Module/Settings/Account.php:596
msgid "Your contacts can add additional tags to your posts."
msgstr ""
-#: src/Module/Settings/Account.php:598
+#: src/Module/Settings/Account.php:597
msgid "Permit unknown people to send you private mail?"
msgstr ""
-#: src/Module/Settings/Account.php:598
+#: src/Module/Settings/Account.php:597
msgid ""
"Friendica network users may send you private messages even if they are not "
"in your contact list."
msgstr ""
-#: src/Module/Settings/Account.php:599
+#: src/Module/Settings/Account.php:598
msgid "Maximum private messages per day from unknown people:"
msgstr ""
-#: src/Module/Settings/Account.php:601
+#: src/Module/Settings/Account.php:600
msgid "Default Post Permissions"
msgstr ""
-#: src/Module/Settings/Account.php:605
+#: src/Module/Settings/Account.php:604
msgid "Expiration settings"
msgstr ""
-#: src/Module/Settings/Account.php:606
+#: src/Module/Settings/Account.php:605
msgid "Automatically expire posts after this many days:"
msgstr ""
-#: src/Module/Settings/Account.php:606
+#: src/Module/Settings/Account.php:605
msgid "If empty, posts will not expire. Expired posts will be deleted"
msgstr ""
-#: src/Module/Settings/Account.php:607
+#: src/Module/Settings/Account.php:606
msgid "Expire posts"
msgstr ""
-#: src/Module/Settings/Account.php:607
+#: src/Module/Settings/Account.php:606
msgid "When activated, posts and comments will be expired."
msgstr ""
-#: src/Module/Settings/Account.php:608
+#: src/Module/Settings/Account.php:607
msgid "Expire personal notes"
msgstr ""
-#: src/Module/Settings/Account.php:608
+#: src/Module/Settings/Account.php:607
msgid ""
"When activated, the personal notes on your profile page will be expired."
msgstr ""
-#: src/Module/Settings/Account.php:609
+#: src/Module/Settings/Account.php:608
msgid "Expire starred posts"
msgstr ""
-#: src/Module/Settings/Account.php:609
+#: src/Module/Settings/Account.php:608
msgid ""
"Starring posts keeps them from being expired. That behaviour is overwritten "
"by this setting."
msgstr ""
-#: src/Module/Settings/Account.php:610
+#: src/Module/Settings/Account.php:609
msgid "Only expire posts by others"
msgstr ""
-#: src/Module/Settings/Account.php:610
+#: src/Module/Settings/Account.php:609
msgid ""
"When activated, your own posts never expire. Then the settings above are "
"only valid for posts you received."
msgstr ""
-#: src/Module/Settings/Account.php:613
+#: src/Module/Settings/Account.php:612
msgid "Notification Settings"
msgstr ""
-#: src/Module/Settings/Account.php:614
+#: src/Module/Settings/Account.php:613
msgid "Send a notification email when:"
msgstr ""
-#: src/Module/Settings/Account.php:615
+#: src/Module/Settings/Account.php:614
msgid "You receive an introduction"
msgstr ""
-#: src/Module/Settings/Account.php:616
+#: src/Module/Settings/Account.php:615
msgid "Your introductions are confirmed"
msgstr ""
-#: src/Module/Settings/Account.php:617
+#: src/Module/Settings/Account.php:616
msgid "Someone writes on your profile wall"
msgstr ""
-#: src/Module/Settings/Account.php:618
+#: src/Module/Settings/Account.php:617
msgid "Someone writes a followup comment"
msgstr ""
-#: src/Module/Settings/Account.php:619
+#: src/Module/Settings/Account.php:618
msgid "You receive a private message"
msgstr ""
-#: src/Module/Settings/Account.php:620
+#: src/Module/Settings/Account.php:619
msgid "You receive a friend suggestion"
msgstr ""
-#: src/Module/Settings/Account.php:621
+#: src/Module/Settings/Account.php:620
msgid "You are tagged in a post"
msgstr ""
-#: src/Module/Settings/Account.php:623
+#: src/Module/Settings/Account.php:622
msgid "Create a desktop notification when:"
msgstr ""
-#: src/Module/Settings/Account.php:624
+#: src/Module/Settings/Account.php:623
msgid "Someone tagged you"
msgstr ""
-#: src/Module/Settings/Account.php:625
+#: src/Module/Settings/Account.php:624
msgid "Someone directly commented on your post"
msgstr ""
-#: src/Module/Settings/Account.php:626
+#: src/Module/Settings/Account.php:625
msgid "Someone liked your content"
msgstr ""
-#: src/Module/Settings/Account.php:626 src/Module/Settings/Account.php:627
+#: src/Module/Settings/Account.php:625 src/Module/Settings/Account.php:626
msgid "Can only be enabled, when the direct comment notification is enabled."
msgstr ""
-#: src/Module/Settings/Account.php:627
+#: src/Module/Settings/Account.php:626
msgid "Someone shared your content"
msgstr ""
-#: src/Module/Settings/Account.php:628
+#: src/Module/Settings/Account.php:627
msgid "Someone commented in your thread"
msgstr ""
-#: src/Module/Settings/Account.php:629
+#: src/Module/Settings/Account.php:628
msgid "Someone commented in a thread where you commented"
msgstr ""
-#: src/Module/Settings/Account.php:630
+#: src/Module/Settings/Account.php:629
msgid "Someone commented in a thread where you interacted"
msgstr ""
-#: src/Module/Settings/Account.php:632
+#: src/Module/Settings/Account.php:631
msgid "Activate desktop notifications"
msgstr ""
-#: src/Module/Settings/Account.php:632
+#: src/Module/Settings/Account.php:631
msgid "Show desktop popup on new notifications"
msgstr ""
-#: src/Module/Settings/Account.php:636
+#: src/Module/Settings/Account.php:635
msgid "Text-only notification emails"
msgstr ""
-#: src/Module/Settings/Account.php:638
+#: src/Module/Settings/Account.php:637
msgid "Send text only notification emails, without the html part"
msgstr ""
-#: src/Module/Settings/Account.php:642
+#: src/Module/Settings/Account.php:641
msgid "Show detailled notifications"
msgstr ""
-#: src/Module/Settings/Account.php:644
+#: src/Module/Settings/Account.php:643
msgid ""
"Per default, notifications are condensed to a single notification per item. "
"When enabled every notification is displayed."
msgstr ""
-#: src/Module/Settings/Account.php:648
+#: src/Module/Settings/Account.php:647
msgid "Show notifications of ignored contacts"
msgstr ""
-#: src/Module/Settings/Account.php:650
+#: src/Module/Settings/Account.php:649
msgid ""
"You don't see posts from ignored contacts. But you still see their comments. "
"This setting controls if you want to still receive regular notifications "
"that are caused by ignored contacts or not."
msgstr ""
-#: src/Module/Settings/Account.php:653
+#: src/Module/Settings/Account.php:652
msgid "Advanced Account/Page Type Settings"
msgstr ""
-#: src/Module/Settings/Account.php:654
+#: src/Module/Settings/Account.php:653
msgid "Change the behaviour of this account for special situations"
msgstr ""
-#: src/Module/Settings/Account.php:657
+#: src/Module/Settings/Account.php:656
msgid "Import Contacts"
msgstr ""
-#: src/Module/Settings/Account.php:658
+#: src/Module/Settings/Account.php:657
msgid ""
"Upload a CSV file that contains the handle of your followed accounts in the "
"first column you exported from the old account."
msgstr ""
-#: src/Module/Settings/Account.php:659
+#: src/Module/Settings/Account.php:658
msgid "Upload File"
msgstr ""
-#: src/Module/Settings/Account.php:662
+#: src/Module/Settings/Account.php:661
msgid "Relocate"
msgstr ""
-#: src/Module/Settings/Account.php:663
+#: src/Module/Settings/Account.php:662
msgid ""
"If you have moved this profile from another server, and some of your "
"contacts don't receive your updates, try pushing this button."
msgstr ""
-#: src/Module/Settings/Account.php:664
+#: src/Module/Settings/Account.php:663
msgid "Resend relocate message to contacts"
msgstr ""
-#: src/Module/Settings/Delegation.php:53
+#: src/Module/Settings/Delegation.php:52
msgid "Delegation successfully granted."
msgstr ""
-#: src/Module/Settings/Delegation.php:55
+#: src/Module/Settings/Delegation.php:54
msgid "Parent user not found, unavailable or password doesn't match."
msgstr ""
-#: src/Module/Settings/Delegation.php:59
+#: src/Module/Settings/Delegation.php:58
msgid "Delegation successfully revoked."
msgstr ""
-#: src/Module/Settings/Delegation.php:81 src/Module/Settings/Delegation.php:103
+#: src/Module/Settings/Delegation.php:80 src/Module/Settings/Delegation.php:102
msgid ""
"Delegated administrators can view but not change delegation permissions."
msgstr ""
-#: src/Module/Settings/Delegation.php:95
+#: src/Module/Settings/Delegation.php:94
msgid "Delegate user not found."
msgstr ""
-#: src/Module/Settings/Delegation.php:143
+#: src/Module/Settings/Delegation.php:142
msgid "No parent user"
msgstr ""
-#: src/Module/Settings/Delegation.php:154
-#: src/Module/Settings/Delegation.php:165
+#: src/Module/Settings/Delegation.php:153
+#: src/Module/Settings/Delegation.php:164
msgid "Parent User"
msgstr ""
-#: src/Module/Settings/Delegation.php:162
+#: src/Module/Settings/Delegation.php:161
msgid "Additional Accounts"
msgstr ""
-#: src/Module/Settings/Delegation.php:163
+#: src/Module/Settings/Delegation.php:162
msgid ""
"Register additional accounts that are automatically connected to your "
"existing account so you can manage them from this account."
msgstr ""
-#: src/Module/Settings/Delegation.php:164
+#: src/Module/Settings/Delegation.php:163
msgid "Register an additional account"
msgstr ""
-#: src/Module/Settings/Delegation.php:168
+#: src/Module/Settings/Delegation.php:167
msgid ""
"Parent users have total control about this account, including the account "
"settings. Please double check whom you give this access."
msgstr ""
-#: src/Module/Settings/Delegation.php:172
+#: src/Module/Settings/Delegation.php:171
msgid "Delegates"
msgstr ""
-#: src/Module/Settings/Delegation.php:174
+#: src/Module/Settings/Delegation.php:173
msgid ""
"Delegates are able to manage all aspects of this account/page except for "
"basic account settings. Please do not delegate your personal account to "
"anybody that you do not trust completely."
msgstr ""
-#: src/Module/Settings/Delegation.php:175
+#: src/Module/Settings/Delegation.php:174
msgid "Existing Page Delegates"
msgstr ""
-#: src/Module/Settings/Delegation.php:177
+#: src/Module/Settings/Delegation.php:176
msgid "Potential Delegates"
msgstr ""
-#: src/Module/Settings/Delegation.php:180
+#: src/Module/Settings/Delegation.php:179
msgid "Add"
msgstr ""
-#: src/Module/Settings/Delegation.php:181
+#: src/Module/Settings/Delegation.php:180
msgid "No entries."
msgstr ""
-#: src/Module/Settings/Display.php:107
+#: src/Module/Settings/Display.php:106
msgid "The theme you chose isn't available."
msgstr ""
-#: src/Module/Settings/Display.php:146
+#: src/Module/Settings/Display.php:145
#, php-format
msgid "%s - (Unsupported)"
msgstr ""
-#: src/Module/Settings/Display.php:200
+#: src/Module/Settings/Display.php:199
msgid "Display Settings"
msgstr ""
-#: src/Module/Settings/Display.php:202
+#: src/Module/Settings/Display.php:201
msgid "General Theme Settings"
msgstr ""
-#: src/Module/Settings/Display.php:203
+#: src/Module/Settings/Display.php:202
msgid "Custom Theme Settings"
msgstr ""
-#: src/Module/Settings/Display.php:204
+#: src/Module/Settings/Display.php:203
msgid "Content Settings"
msgstr ""
-#: src/Module/Settings/Display.php:205 view/theme/duepuntozero/config.php:87
+#: src/Module/Settings/Display.php:204 view/theme/duepuntozero/config.php:87
#: view/theme/frio/config.php:173 view/theme/quattro/config.php:89
#: view/theme/vier/config.php:137
msgid "Theme settings"
msgstr ""
-#: src/Module/Settings/Display.php:206
+#: src/Module/Settings/Display.php:205
msgid "Calendar"
msgstr ""
-#: src/Module/Settings/Display.php:212
+#: src/Module/Settings/Display.php:211
msgid "Display Theme:"
msgstr ""
-#: src/Module/Settings/Display.php:213
+#: src/Module/Settings/Display.php:212
msgid "Mobile Theme:"
msgstr ""
-#: src/Module/Settings/Display.php:216
+#: src/Module/Settings/Display.php:215
msgid "Number of items to display per page:"
msgstr ""
-#: src/Module/Settings/Display.php:216 src/Module/Settings/Display.php:217
+#: src/Module/Settings/Display.php:215 src/Module/Settings/Display.php:216
msgid "Maximum of 100 items"
msgstr ""
-#: src/Module/Settings/Display.php:217
+#: src/Module/Settings/Display.php:216
msgid "Number of items to display per page when viewed from mobile device:"
msgstr ""
-#: src/Module/Settings/Display.php:218
+#: src/Module/Settings/Display.php:217
msgid "Update browser every xx seconds"
msgstr ""
-#: src/Module/Settings/Display.php:218
+#: src/Module/Settings/Display.php:217
msgid "Minimum of 10 seconds. Enter -1 to disable it."
msgstr ""
-#: src/Module/Settings/Display.php:219
+#: src/Module/Settings/Display.php:218
msgid "Automatic updates only at the top of the post stream pages"
msgstr ""
-#: src/Module/Settings/Display.php:219
+#: src/Module/Settings/Display.php:218
msgid ""
"Auto update may add new posts at the top of the post stream pages, which can "
"affect the scroll position and perturb normal reading if it happens anywhere "
"else the top of the page."
msgstr ""
-#: src/Module/Settings/Display.php:220
+#: src/Module/Settings/Display.php:219
msgid "Display emoticons"
msgstr ""
-#: src/Module/Settings/Display.php:220
+#: src/Module/Settings/Display.php:219
msgid "When enabled, emoticons are replaced with matching symbols."
msgstr ""
-#: src/Module/Settings/Display.php:221
+#: src/Module/Settings/Display.php:220
msgid "Infinite scroll"
msgstr ""
-#: src/Module/Settings/Display.php:221
+#: src/Module/Settings/Display.php:220
msgid "Automatic fetch new items when reaching the page end."
msgstr ""
-#: src/Module/Settings/Display.php:222
+#: src/Module/Settings/Display.php:221
msgid "Enable Smart Threading"
msgstr ""
-#: src/Module/Settings/Display.php:222
+#: src/Module/Settings/Display.php:221
msgid "Enable the automatic suppression of extraneous thread indentation."
msgstr ""
-#: src/Module/Settings/Display.php:223
+#: src/Module/Settings/Display.php:222
msgid "Display the Dislike feature"
msgstr ""
-#: src/Module/Settings/Display.php:223
+#: src/Module/Settings/Display.php:222
msgid "Display the Dislike button and dislike reactions on posts and comments."
msgstr ""
-#: src/Module/Settings/Display.php:224
+#: src/Module/Settings/Display.php:223
msgid "Display the resharer"
msgstr ""
-#: src/Module/Settings/Display.php:224
+#: src/Module/Settings/Display.php:223
msgid "Display the first resharer as icon and text on a reshared item."
msgstr ""
-#: src/Module/Settings/Display.php:225
+#: src/Module/Settings/Display.php:224
msgid "Stay local"
msgstr ""
-#: src/Module/Settings/Display.php:225
+#: src/Module/Settings/Display.php:224
msgid "Don't go to a remote system when following a contact link."
msgstr ""
-#: src/Module/Settings/Display.php:227
+#: src/Module/Settings/Display.php:226
msgid "Beginning of week:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:84
+#: src/Module/Settings/Profile/Index.php:83
msgid "Profile Name is required."
msgstr ""
-#: src/Module/Settings/Profile/Index.php:132
+#: src/Module/Settings/Profile/Index.php:131
msgid "Profile couldn't be updated."
msgstr ""
+#: src/Module/Settings/Profile/Index.php:172
+#: src/Module/Settings/Profile/Index.php:192
+msgid "Label:"
+msgstr ""
+
#: src/Module/Settings/Profile/Index.php:173
#: src/Module/Settings/Profile/Index.php:193
-msgid "Label:"
+msgid "Value:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:174
-#: src/Module/Settings/Profile/Index.php:194
-msgid "Value:"
+#: src/Module/Settings/Profile/Index.php:183
+#: src/Module/Settings/Profile/Index.php:203
+msgid "Field Permissions"
msgstr ""
#: src/Module/Settings/Profile/Index.php:184
#: src/Module/Settings/Profile/Index.php:204
-msgid "Field Permissions"
-msgstr ""
-
-#: src/Module/Settings/Profile/Index.php:185
-#: src/Module/Settings/Profile/Index.php:205
msgid "(click to open/close)"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:191
+#: src/Module/Settings/Profile/Index.php:190
msgid "Add a new profile field"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:221
+#: src/Module/Settings/Profile/Index.php:220
msgid "Profile Actions"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:222
+#: src/Module/Settings/Profile/Index.php:221
msgid "Edit Profile Details"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:224
+#: src/Module/Settings/Profile/Index.php:223
msgid "Change Profile Photo"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:229
+#: src/Module/Settings/Profile/Index.php:228
msgid "Profile picture"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:230
+#: src/Module/Settings/Profile/Index.php:229
msgid "Location"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:231 src/Util/Temporal.php:96
+#: src/Module/Settings/Profile/Index.php:230 src/Util/Temporal.php:96
#: src/Util/Temporal.php:98
msgid "Miscellaneous"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:232
+#: src/Module/Settings/Profile/Index.php:231
msgid "Custom Profile Fields"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:234 src/Module/Welcome.php:58
+#: src/Module/Settings/Profile/Index.php:233 src/Module/Welcome.php:58
msgid "Upload Profile Photo"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:238
+#: src/Module/Settings/Profile/Index.php:237
msgid "Display name:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:241
+#: src/Module/Settings/Profile/Index.php:240
msgid "Street Address:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:242
+#: src/Module/Settings/Profile/Index.php:241
msgid "Locality/City:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:243
+#: src/Module/Settings/Profile/Index.php:242
msgid "Region/State:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:244
+#: src/Module/Settings/Profile/Index.php:243
msgid "Postal/Zip Code:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:245
+#: src/Module/Settings/Profile/Index.php:244
msgid "Country:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:247
+#: src/Module/Settings/Profile/Index.php:246
msgid "XMPP (Jabber) address:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:247
+#: src/Module/Settings/Profile/Index.php:246
msgid "The XMPP address will be published so that people can follow you there."
msgstr ""
-#: src/Module/Settings/Profile/Index.php:248
+#: src/Module/Settings/Profile/Index.php:247
msgid "Matrix (Element) address:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:248
+#: src/Module/Settings/Profile/Index.php:247
msgid ""
"The Matrix address will be published so that people can follow you there."
msgstr ""
-#: src/Module/Settings/Profile/Index.php:249
+#: src/Module/Settings/Profile/Index.php:248
msgid "Homepage URL:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:250
+#: src/Module/Settings/Profile/Index.php:249
msgid "Public Keywords:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:250
+#: src/Module/Settings/Profile/Index.php:249
msgid "(Used for suggesting potential friends, can be seen by others)"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:251
+#: src/Module/Settings/Profile/Index.php:250
msgid "Private Keywords:"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:251
+#: src/Module/Settings/Profile/Index.php:250
msgid "(Used for searching profiles, never shown to others)"
msgstr ""
-#: src/Module/Settings/Profile/Index.php:252
+#: src/Module/Settings/Profile/Index.php:251
#, php-format
msgid ""
"Custom fields appear on your profile page .
\n"
@@ -9699,257 +9699,257 @@ msgid ""
"contacts or the Friendica contacts in the selected groups.
"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:108
-#: src/Module/Settings/Profile/Photo/Crop.php:126
-#: src/Module/Settings/Profile/Photo/Crop.php:144
-#: src/Module/Settings/Profile/Photo/Index.php:102
+#: src/Module/Settings/Profile/Photo/Crop.php:107
+#: src/Module/Settings/Profile/Photo/Crop.php:125
+#: src/Module/Settings/Profile/Photo/Crop.php:143
+#: src/Module/Settings/Profile/Photo/Index.php:101
#, php-format
msgid "Image size reduction [%s] failed."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:151
+#: src/Module/Settings/Profile/Photo/Crop.php:150
msgid ""
"Shift-reload the page or clear browser cache if the new photo does not "
"display immediately."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:156
+#: src/Module/Settings/Profile/Photo/Crop.php:155
msgid "Unable to process image"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:175
+#: src/Module/Settings/Profile/Photo/Crop.php:174
msgid "Photo not found."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:197
+#: src/Module/Settings/Profile/Photo/Crop.php:196
msgid "Profile picture successfully updated."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:223
-#: src/Module/Settings/Profile/Photo/Crop.php:227
+#: src/Module/Settings/Profile/Photo/Crop.php:222
+#: src/Module/Settings/Profile/Photo/Crop.php:226
msgid "Crop Image"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:224
+#: src/Module/Settings/Profile/Photo/Crop.php:223
msgid "Please adjust the image cropping for optimum viewing."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Crop.php:226
+#: src/Module/Settings/Profile/Photo/Crop.php:225
msgid "Use Image As Is"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:46
+#: src/Module/Settings/Profile/Photo/Index.php:45
msgid "Missing uploaded image."
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:125
+#: src/Module/Settings/Profile/Photo/Index.php:124
msgid "Profile Picture Settings"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:126
+#: src/Module/Settings/Profile/Photo/Index.php:125
msgid "Current Profile Picture"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:127
+#: src/Module/Settings/Profile/Photo/Index.php:126
msgid "Upload Profile Picture"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:128
+#: src/Module/Settings/Profile/Photo/Index.php:127
msgid "Upload Picture:"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:133
+#: src/Module/Settings/Profile/Photo/Index.php:132
msgid "or"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:135
+#: src/Module/Settings/Profile/Photo/Index.php:134
msgid "skip this step"
msgstr ""
-#: src/Module/Settings/Profile/Photo/Index.php:137
+#: src/Module/Settings/Profile/Photo/Index.php:136
msgid "select a photo from your photo albums"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:66
-#: src/Module/Settings/TwoFactor/Recovery.php:64
-#: src/Module/Settings/TwoFactor/Trusted.php:67
-#: src/Module/Settings/TwoFactor/Verify.php:69
+#: src/Module/Settings/TwoFactor/AppSpecific.php:65
+#: src/Module/Settings/TwoFactor/Recovery.php:63
+#: src/Module/Settings/TwoFactor/Trusted.php:66
+#: src/Module/Settings/TwoFactor/Verify.php:68
msgid "Please enter your password to access this page."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:84
+#: src/Module/Settings/TwoFactor/AppSpecific.php:83
msgid "App-specific password generation failed: The description is empty."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:87
+#: src/Module/Settings/TwoFactor/AppSpecific.php:86
msgid ""
"App-specific password generation failed: This description already exists."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:91
+#: src/Module/Settings/TwoFactor/AppSpecific.php:90
msgid "New app-specific password generated."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:97
+#: src/Module/Settings/TwoFactor/AppSpecific.php:96
msgid "App-specific passwords successfully revoked."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:107
+#: src/Module/Settings/TwoFactor/AppSpecific.php:106
msgid "App-specific password successfully revoked."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:128
+#: src/Module/Settings/TwoFactor/AppSpecific.php:127
msgid "Two-factor app-specific passwords"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:130
+#: src/Module/Settings/TwoFactor/AppSpecific.php:129
msgid ""
"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.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:131
+#: src/Module/Settings/TwoFactor/AppSpecific.php:130
msgid ""
"Make sure to copy your new app-specific password now. You won’t be able to "
"see it again!"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:134
+#: src/Module/Settings/TwoFactor/AppSpecific.php:133
msgid "Description"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:135
+#: src/Module/Settings/TwoFactor/AppSpecific.php:134
msgid "Last Used"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:136
+#: src/Module/Settings/TwoFactor/AppSpecific.php:135
msgid "Revoke"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:137
+#: src/Module/Settings/TwoFactor/AppSpecific.php:136
msgid "Revoke All"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:140
+#: src/Module/Settings/TwoFactor/AppSpecific.php:139
msgid ""
"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."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:141
+#: src/Module/Settings/TwoFactor/AppSpecific.php:140
msgid "Generate new app-specific password"
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:142
+#: src/Module/Settings/TwoFactor/AppSpecific.php:141
msgid "Friendiqa on my Fairphone 2..."
msgstr ""
-#: src/Module/Settings/TwoFactor/AppSpecific.php:143
+#: src/Module/Settings/TwoFactor/AppSpecific.php:142
msgid "Generate"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:69
+#: src/Module/Settings/TwoFactor/Index.php:68
msgid "Two-factor authentication successfully disabled."
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:121
+#: src/Module/Settings/TwoFactor/Index.php:120
msgid ""
"Use an application on a mobile device to get two-factor authentication "
"codes when prompted on login.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:125
+#: src/Module/Settings/TwoFactor/Index.php:124
msgid "Authenticator app"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:126
+#: src/Module/Settings/TwoFactor/Index.php:125
msgid "Configured"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:126
+#: src/Module/Settings/TwoFactor/Index.php:125
msgid "Not Configured"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:127
+#: src/Module/Settings/TwoFactor/Index.php:126
msgid "You haven't finished configuring your authenticator app.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:128
+#: src/Module/Settings/TwoFactor/Index.php:127
msgid "Your authenticator app is correctly configured.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:130
+#: src/Module/Settings/TwoFactor/Index.php:129
msgid "Recovery codes"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:131
+#: src/Module/Settings/TwoFactor/Index.php:130
msgid "Remaining valid codes"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:133
+#: src/Module/Settings/TwoFactor/Index.php:132
msgid ""
"These one-use codes can replace an authenticator app code in case you "
"have lost access to it.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:135
+#: src/Module/Settings/TwoFactor/Index.php:134
msgid "App-specific passwords"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:136
+#: src/Module/Settings/TwoFactor/Index.php:135
msgid "Generated app-specific passwords"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:138
+#: src/Module/Settings/TwoFactor/Index.php:137
msgid ""
"These randomly generated passwords allow you to authenticate on apps not "
"supporting two-factor authentication.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:141
+#: src/Module/Settings/TwoFactor/Index.php:140
msgid "Current password:"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:141
+#: src/Module/Settings/TwoFactor/Index.php:140
msgid ""
"You need to provide your current password to change two-factor "
"authentication settings."
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:142
+#: src/Module/Settings/TwoFactor/Index.php:141
msgid "Enable two-factor authentication"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:143
+#: src/Module/Settings/TwoFactor/Index.php:142
msgid "Disable two-factor authentication"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:144
+#: src/Module/Settings/TwoFactor/Index.php:143
msgid "Show recovery codes"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:145
+#: src/Module/Settings/TwoFactor/Index.php:144
msgid "Manage app-specific passwords"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:146
+#: src/Module/Settings/TwoFactor/Index.php:145
msgid "Manage trusted browsers"
msgstr ""
-#: src/Module/Settings/TwoFactor/Index.php:147
+#: src/Module/Settings/TwoFactor/Index.php:146
msgid "Finish app configuration"
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:80
+#: src/Module/Settings/TwoFactor/Recovery.php:79
msgid "New recovery codes successfully generated."
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:106
+#: src/Module/Settings/TwoFactor/Recovery.php:105
msgid "Two-factor recovery codes"
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:108
+#: src/Module/Settings/TwoFactor/Recovery.php:107
msgid ""
"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."
@@ -9957,68 +9957,68 @@ msgid ""
"don’t have the recovery codes you will lose access to your account.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:110
+#: src/Module/Settings/TwoFactor/Recovery.php:109
msgid ""
"When you generate new recovery codes, you must copy the new codes. Your old "
"codes won’t work anymore."
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:111
+#: src/Module/Settings/TwoFactor/Recovery.php:110
msgid "Generate new recovery codes"
msgstr ""
-#: src/Module/Settings/TwoFactor/Recovery.php:113
+#: src/Module/Settings/TwoFactor/Recovery.php:112
msgid "Next: Verification"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:84
+#: src/Module/Settings/TwoFactor/Trusted.php:83
msgid "Trusted browsers successfully removed."
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:94
+#: src/Module/Settings/TwoFactor/Trusted.php:93
msgid "Trusted browser successfully removed."
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:136
+#: src/Module/Settings/TwoFactor/Trusted.php:135
msgid "Two-factor Trusted Browsers"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:137
+#: src/Module/Settings/TwoFactor/Trusted.php:136
msgid ""
"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."
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:138
+#: src/Module/Settings/TwoFactor/Trusted.php:137
msgid "Device"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:139
+#: src/Module/Settings/TwoFactor/Trusted.php:138
msgid "OS"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:141
+#: src/Module/Settings/TwoFactor/Trusted.php:140
msgid "Trusted"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:142
+#: src/Module/Settings/TwoFactor/Trusted.php:141
msgid "Created At"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:143
+#: src/Module/Settings/TwoFactor/Trusted.php:142
msgid "Last Use"
msgstr ""
-#: src/Module/Settings/TwoFactor/Trusted.php:145
+#: src/Module/Settings/TwoFactor/Trusted.php:144
msgid "Remove All"
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:91
+#: src/Module/Settings/TwoFactor/Verify.php:90
msgid "Two-factor authentication successfully activated."
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:125
+#: src/Module/Settings/TwoFactor/Verify.php:124
#, php-format
msgid ""
"Or you can submit the authentication settings manually:
\n"
@@ -10038,53 +10038,53 @@ msgid ""
""
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:145
+#: src/Module/Settings/TwoFactor/Verify.php:144
msgid "Two-factor code verification"
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:147
+#: src/Module/Settings/TwoFactor/Verify.php:146
msgid ""
"Please scan this QR Code with your authenticator app and submit the "
"provided code.
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:149
+#: src/Module/Settings/TwoFactor/Verify.php:148
#, php-format
msgid ""
"Or you can open the following URL in your mobile device:
%s
"
msgstr ""
-#: src/Module/Settings/TwoFactor/Verify.php:156
+#: src/Module/Settings/TwoFactor/Verify.php:155
msgid "Verify code and enable two-factor authentication"
msgstr ""
-#: src/Module/Settings/UserExport.php:69
+#: src/Module/Settings/UserExport.php:68
msgid "Export account"
msgstr ""
-#: src/Module/Settings/UserExport.php:69
+#: src/Module/Settings/UserExport.php:68
msgid ""
"Export your account info and contacts. Use this to make a backup of your "
"account and/or to move it to another server."
msgstr ""
-#: src/Module/Settings/UserExport.php:70
+#: src/Module/Settings/UserExport.php:69
msgid "Export all"
msgstr ""
-#: src/Module/Settings/UserExport.php:70
+#: src/Module/Settings/UserExport.php:69
msgid ""
"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 "
"of your account (photos are not exported)"
msgstr ""
-#: src/Module/Settings/UserExport.php:71
+#: src/Module/Settings/UserExport.php:70
msgid "Export Contacts to CSV"
msgstr ""
-#: src/Module/Settings/UserExport.php:71
+#: src/Module/Settings/UserExport.php:70
msgid ""
"Export the list of the accounts you are following as CSV file. Compatible to "
"e.g. Mastodon."
From 22198ea495f1f597d20dd2084c38df0df45778f7 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 23:35:01 +0200
Subject: [PATCH 12/40] UserSession class [6] - Refactor src/Module/ files
without DI
---
src/Module/BaseNotifications.php | 6 +++---
src/Module/Contact/Conversations.php | 15 ++++++++++-----
src/Module/Contact/Posts.php | 15 ++++++++++-----
src/Module/Filer/RemoveTag.php | 11 +++++++----
src/Module/Magic.php | 17 ++++++++++-------
src/Module/ParseUrl.php | 18 ++++++++++++++++--
src/Module/Security/PasswordTooLong.php | 13 ++++++++-----
src/Module/Security/TwoFactor/Verify.php | 17 ++++++++++-------
8 files changed, 74 insertions(+), 38 deletions(-)
diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php
index 9e7456c7b..a011961b6 100644
--- a/src/Module/BaseNotifications.php
+++ b/src/Module/BaseNotifications.php
@@ -28,7 +28,7 @@ use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
use Friendica\Network\HTTPException\ForbiddenException;
@@ -90,11 +90,11 @@ abstract class BaseNotifications extends BaseModule
*/
abstract public function getNotifications();
- public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- if (!Session::getLocalUser()) {
+ if (!$userSession->getLocalUserId()) {
throw new ForbiddenException($this->t('Permission denied.'));
}
diff --git a/src/Module/Contact/Conversations.php b/src/Module/Contact/Conversations.php
index a2f969c9c..838e499cc 100644
--- a/src/Module/Contact/Conversations.php
+++ b/src/Module/Contact/Conversations.php
@@ -29,7 +29,7 @@ use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Theme;
use Friendica\Model;
use Friendica\Module\Contact;
@@ -56,25 +56,30 @@ class Conversations extends BaseModule
* @var LocalRelationship
*/
private $localRelationship;
+ /**
+ * @var IHandleUserSessions
+ */
+ private $userSession;
- public function __construct(L10n $l10n, LocalRelationship $localRelationship, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Page $page, Conversation $conversation, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, LocalRelationship $localRelationship, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Page $page, Conversation $conversation, IHandleUserSessions $userSession, $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->page = $page;
$this->conversation = $conversation;
$this->localRelationship = $localRelationship;
+ $this->userSession = $userSession;
}
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!$this->userSession->getLocalUserId()) {
return Login::form($_SERVER['REQUEST_URI']);
}
// Backward compatibility: Ensure to use the public contact when the user contact is provided
// Remove by version 2022.03
- $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), Session::getLocalUser());
+ $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), $this->userSession->getLocalUserId());
if (empty($data)) {
throw new NotFoundException($this->t('Contact not found.'));
}
@@ -89,7 +94,7 @@ class Conversations extends BaseModule
throw new NotFoundException($this->t('Contact not found.'));
}
- $localRelationship = $this->localRelationship->getForUserContact(Session::getLocalUser(), $contact['id']);
+ $localRelationship = $this->localRelationship->getForUserContact($this->userSession->getLocalUserId(), $contact['id']);
if ($localRelationship->rel === Model\Contact::SELF) {
$this->baseUrl->redirect('profile/' . $contact['nick']);
}
diff --git a/src/Module/Contact/Posts.php b/src/Module/Contact/Posts.php
index 78cd42b1a..c5a6da0d1 100644
--- a/src/Module/Contact/Posts.php
+++ b/src/Module/Contact/Posts.php
@@ -28,7 +28,7 @@ use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\DBA;
use Friendica\Model;
use Friendica\Module\Contact;
@@ -51,24 +51,29 @@ class Posts extends BaseModule
* @var App\Page
*/
private $page;
+ /**
+ * @var IHandleUserSessions
+ */
+ private $userSession;
- public function __construct(L10n $l10n, LocalRelationship $localRelationship, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Page $page, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, LocalRelationship $localRelationship, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Page $page, IHandleUserSessions $userSession, $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->localRelationship = $localRelationship;
$this->page = $page;
+ $this->userSession = $userSession;
}
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!$this->userSession->getLocalUserId()) {
return Login::form($_SERVER['REQUEST_URI']);
}
// Backward compatibility: Ensure to use the public contact when the user contact is provided
// Remove by version 2022.03
- $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), Session::getLocalUser());
+ $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), $this->userSession->getLocalUserId());
if (empty($data)) {
throw new NotFoundException($this->t('Contact not found.'));
}
@@ -83,7 +88,7 @@ class Posts extends BaseModule
throw new NotFoundException($this->t('Contact not found.'));
}
- $localRelationship = $this->localRelationship->getForUserContact(Session::getLocalUser(), $contact['id']);
+ $localRelationship = $this->localRelationship->getForUserContact($this->userSession->getLocalUserId(), $contact['id']);
if ($localRelationship->rel === Model\Contact::SELF) {
$this->baseUrl->redirect('profile/' . $contact['nick']);
}
diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php
index b940e6983..fccc90f9d 100644
--- a/src/Module/Filer/RemoveTag.php
+++ b/src/Module/Filer/RemoveTag.php
@@ -24,7 +24,7 @@ namespace Friendica\Module\Filer;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Post;
@@ -41,12 +41,15 @@ class RemoveTag extends BaseModule
{
/** @var SystemMessages */
private $systemMessages;
+ /** @var IHandleUserSessions */
+ private $userSession;
- public function __construct(SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+ public function __construct(SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->systemMessages = $systemMessages;
+ $this->userSession = $userSession;
}
protected function post(array $request = [])
@@ -56,7 +59,7 @@ class RemoveTag extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!$this->userSession->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
@@ -108,7 +111,7 @@ class RemoveTag extends BaseModule
return 404;
}
- if (!Post\Category::deleteFileByURIId($item['uri-id'], Session::getLocalUser(), $type, $term)) {
+ if (!Post\Category::deleteFileByURIId($item['uri-id'], $this->userSession->getLocalUserId(), $type, $term)) {
$this->systemMessages->addNotice($this->l10n->t('Item was not removed'));
return 500;
}
diff --git a/src/Module/Magic.php b/src/Module/Magic.php
index 42eae695e..c300e5971 100644
--- a/src/Module/Magic.php
+++ b/src/Module/Magic.php
@@ -24,7 +24,7 @@ namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Model\Contact;
@@ -50,14 +50,17 @@ class Magic extends BaseModule
protected $dba;
/** @var ICanSendHttpRequests */
protected $httpClient;
+ /** @var IHandleUserSessions */
+ protected $userSession;
- public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, array $server, array $parameters = [])
+ public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, IHandleUserSessions $userSession, $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->app = $app;
- $this->dba = $dba;
- $this->httpClient = $httpClient;
+ $this->app = $app;
+ $this->dba = $dba;
+ $this->httpClient = $httpClient;
+ $this->userSession = $userSession;
}
protected function rawContent(array $request = [])
@@ -91,8 +94,8 @@ class Magic extends BaseModule
}
// OpenWebAuth
- if (Session::getLocalUser() && $owa) {
- $user = User::getById(Session::getLocalUser());
+ if ($this->userSession->getLocalUserId() && $owa) {
+ $user = User::getById($this->userSession->getLocalUserId());
// Extract the basepath
// NOTE: we need another solution because this does only work
diff --git a/src/Module/ParseUrl.php b/src/Module/ParseUrl.php
index 91d09240b..fc096bbd5 100644
--- a/src/Module/ParseUrl.php
+++ b/src/Module/ParseUrl.php
@@ -21,19 +21,33 @@
namespace Friendica\Module;
+use Friendica\App;
use Friendica\BaseModule;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
-use Friendica\Core\Session;
+use Friendica\Core\L10n;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Util;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
class ParseUrl extends BaseModule
{
+ /** @var IHandleUserSessions */
+ protected $userSession;
+
+ public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Session\Capability\IHandleUserSessions $userSession, $server, array $parameters = [])
+ {
+ parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+ $this->userSession = $userSession;
+ }
+
protected function rawContent(array $request = [])
{
- if (!Session::isAuthenticated()) {
+ if (!$this->userSession->isAuthenticated()) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
diff --git a/src/Module/Security/PasswordTooLong.php b/src/Module/Security/PasswordTooLong.php
index 32008f048..433144419 100644
--- a/src/Module/Security/PasswordTooLong.php
+++ b/src/Module/Security/PasswordTooLong.php
@@ -24,7 +24,7 @@ namespace Friendica\Module\Security;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\DBA;
use Friendica\Model\User;
use Friendica\Module\Response;
@@ -36,12 +36,15 @@ class PasswordTooLong extends \Friendica\BaseModule
{
/** @var SystemMessages */
private $sysmsg;
+ /** @var IHandleUserSessions */
+ private $userSession;
- public function __construct(SystemMessages $sysmsg, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+ public function __construct(SystemMessages $sysmsg, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->sysmsg = $sysmsg;
+ $this->sysmsg = $sysmsg;
+ $this->userSession = $userSession;
}
protected function post(array $request = [])
@@ -55,13 +58,13 @@ class PasswordTooLong extends \Friendica\BaseModule
}
// check if the old password was supplied correctly before changing it to the new value
- User::getIdFromPasswordAuthentication(Session::getLocalUser(), $request['password_current']);
+ User::getIdFromPasswordAuthentication($this->userSession->getLocalUserId(), $request['password_current']);
if (strlen($request['password_current']) <= 72) {
throw new \Exception($this->l10n->t('Password does not need changing.'));
}
- $result = User::updatePassword(Session::getLocalUser(), $newpass);
+ $result = User::updatePassword($this->userSession->getLocalUserId(), $newpass);
if (!DBA::isResult($result)) {
throw new \Exception($this->l10n->t('Password update failed. Please try again.'));
}
diff --git a/src/Module/Security/TwoFactor/Verify.php b/src/Module/Security/TwoFactor/Verify.php
index 93a9fd4de..efd7e2c73 100644
--- a/src/Module/Security/TwoFactor/Verify.php
+++ b/src/Module/Security/TwoFactor/Verify.php
@@ -26,8 +26,8 @@ use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Module\Response;
use Friendica\Util\Profiler;
use PragmaRX\Google2FA\Google2FA;
@@ -47,18 +47,21 @@ class Verify extends BaseModule
protected $session;
/** @var IManagePersonalConfigValues */
protected $pConfig;
+ /** @var IHandleUserSessions */
+ protected $userSession;
- public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManagePersonalConfigValues $pConfig, IHandleSessions $session, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManagePersonalConfigValues $pConfig, IHandleSessions $session, IHandleUserSessions $userSession, $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->session = $session;
- $this->pConfig = $pConfig;
+ $this->session = $session;
+ $this->pConfig = $pConfig;
+ $this->userSession = $userSession;
}
protected function post(array $request = [])
{
- if (!Session::getLocalUser()) {
+ if (!$this->userSession->getLocalUserId()) {
return;
}
@@ -67,7 +70,7 @@ class Verify extends BaseModule
$code = $request['verify_code'] ?? '';
- $valid = (new Google2FA())->verifyKey($this->pConfig->get(Session::getLocalUser(), '2fa', 'secret'), $code);
+ $valid = (new Google2FA())->verifyKey($this->pConfig->get($this->userSession->getLocalUserId(), '2fa', 'secret'), $code);
// The same code can't be used twice even if it's valid
if ($valid && $this->session->get('2fa') !== $code) {
@@ -82,7 +85,7 @@ class Verify extends BaseModule
protected function content(array $request = []): string
{
- if (!Session::getLocalUser()) {
+ if (!$this->userSession->getLocalUserId()) {
$this->baseUrl->redirect();
}
From ee71086133392f6c48cfb36bca3a7185665742c2 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 23:45:14 +0200
Subject: [PATCH 13/40] UserSession class [7] - Refactor view/ files
---
view/theme/duepuntozero/config.php | 11 +++++-----
view/theme/duepuntozero/theme.php | 3 +--
view/theme/frio/config.php | 33 +++++++++++++++---------------
view/theme/frio/php/scheme.php | 3 +--
view/theme/frio/theme.php | 11 +++++-----
view/theme/quattro/config.php | 21 +++++++++----------
view/theme/vier/config.php | 21 +++++++++----------
view/theme/vier/theme.php | 15 +++++++-------
8 files changed, 55 insertions(+), 63 deletions(-)
diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php
index 1a2d231f4..a64f6f5fe 100644
--- a/view/theme/duepuntozero/config.php
+++ b/view/theme/duepuntozero/config.php
@@ -21,16 +21,15 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
function theme_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
$user = true;
return clean_form($a, $colorset, $user);
@@ -38,12 +37,12 @@ function theme_content(App $a)
function theme_post(App $a)
{
- if (! Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['duepuntozero-settings-submit'])) {
- DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
@@ -76,7 +75,7 @@ function clean_form(App $a, &$colorset, $user)
];
if ($user) {
- $color = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $color = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
} else {
$color = DI::config()->get('duepuntozero', 'colorset');
}
diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php
index 70190eb02..729c5bb08 100644
--- a/view/theme/duepuntozero/theme.php
+++ b/view/theme/duepuntozero/theme.php
@@ -21,7 +21,6 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
/*
@@ -35,7 +34,7 @@ function duepuntozero_init(App $a) {
$colorset = null;
if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
- $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
if (!$colorset)
$colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings
}
diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php
index 4c7a13542..04d418861 100644
--- a/view/theme/frio/config.php
+++ b/view/theme/frio/config.php
@@ -21,14 +21,13 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
require_once 'view/theme/frio/php/Image.php';
function theme_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -48,12 +47,12 @@ function theme_post(App $a)
'always_open_compose',
] as $field) {
if (isset($_POST['frio_' . $field])) {
- DI::pConfig()->set(Session::getLocalUser(), 'frio', $field, $_POST['frio_' . $field]);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'frio', $field, $_POST['frio_' . $field]);
}
}
- DI::pConfig()->set(Session::getLocalUser(), 'frio', 'css_modified', time());
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'frio', 'css_modified', time());
}
}
@@ -89,13 +88,13 @@ function theme_admin_post(App $a)
function theme_content(): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$arr = [
- 'scheme' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme',
- DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema',
+ 'scheme' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme',
+ DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema',
DI::config()->get('frio', 'scheme',
DI::config()->get('frio', 'schema')
)
@@ -103,15 +102,15 @@ function theme_content(): string
),
'share_string' => '',
- 'scheme_accent' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')),
- 'nav_bg' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')),
- 'nav_icon_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')),
- 'link_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')),
- 'background_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')),
- 'contentbg_transp' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')),
- 'background_image' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')),
- 'bg_image_option' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')),
- 'always_open_compose' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
+ 'scheme_accent' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')),
+ 'nav_bg' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')),
+ 'nav_icon_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')),
+ 'link_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')),
+ 'background_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')),
+ 'contentbg_transp' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')),
+ 'background_image' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')),
+ 'bg_image_option' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')),
+ 'always_open_compose' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
];
return frio_form($arr);
@@ -119,7 +118,7 @@ function theme_content(): string
function theme_admin(): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
diff --git a/view/theme/frio/php/scheme.php b/view/theme/frio/php/scheme.php
index 26c358877..f99b1bff0 100644
--- a/view/theme/frio/php/scheme.php
+++ b/view/theme/frio/php/scheme.php
@@ -34,7 +34,6 @@
* 'overwrites' => Variables which overwriting custom settings
*/
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Util\Strings;
@@ -43,7 +42,7 @@ function get_scheme_info($scheme)
$theme = DI::app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/';
if (empty($scheme)) {
- $scheme = DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme', DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema', '---'));
+ $scheme = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', '---'));
}
$scheme = Strings::sanitizeFilePathItem($scheme);
diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php
index ce1e376e6..c29b1f13d 100644
--- a/view/theme/frio/theme.php
+++ b/view/theme/frio/theme.php
@@ -29,7 +29,6 @@ use Friendica\Content\Widget;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
@@ -215,8 +214,8 @@ function frio_remote_nav(App $a, array &$nav_info)
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
if ($a->isLoggedIn()) {
$remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
- } elseif (!Session::getLocalUser() && Session::getRemoteUser()) {
- $remoteUser = Contact::getById(Session::getRemoteUser(), $fields);
+ } elseif (!DI::userSession()->getLocalUserId() && DI::userSession()->getRemoteUserId()) {
+ $remoteUser = Contact::getById(DI::userSession()->getRemoteUserId(), $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Guest');
} elseif (Profile::getMyURL()) {
$remoteUser = Contact::getByURL($homelink, null, $fields);
@@ -233,7 +232,7 @@ function frio_remote_nav(App $a, array &$nav_info)
$server_url = $remoteUser['baseurl'];
}
- if (!Session::getLocalUser() && !empty($server_url) && !is_null($remoteUser)) {
+ if (!DI::userSession()->getLocalUserId() && !empty($server_url) && !is_null($remoteUser)) {
// user menu
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
@@ -257,8 +256,8 @@ function frio_display_item(App $a, &$arr)
// Add follow to the item menu
$followThread = [];
if (
- Session::getLocalUser()
- && in_array($arr['item']['uid'], [0, Session::getLocalUser()])
+ DI::userSession()->getLocalUserId()
+ && in_array($arr['item']['uid'], [0, DI::userSession()->getLocalUserId()])
&& $arr['item']['gravity'] == Item::GRAVITY_PARENT
&& !$arr['item']['self']
&& !$arr['item']['mention']
diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php
index 48ef298f9..245f6a221 100644
--- a/view/theme/quattro/config.php
+++ b/view/theme/quattro/config.php
@@ -21,32 +21,31 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
function theme_content(App $a) {
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $align = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'align' );
- $color = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'color' );
- $tfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","tfs");
- $pfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","pfs");
+ $align = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'align' );
+ $color = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'color' );
+ $tfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","tfs");
+ $pfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","pfs");
return quattro_form($a,$align, $color, $tfs, $pfs);
}
function theme_post(App $a) {
- if (! Session::getLocalUser()) {
+ if (! DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['quattro-settings-submit'])){
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'align', $_POST['quattro_align']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'color', $_POST['quattro_color']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'tfs', $_POST['quattro_tfs']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'pfs', $_POST['quattro_pfs']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'align', $_POST['quattro_align']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'color', $_POST['quattro_color']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'tfs', $_POST['quattro_tfs']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'pfs', $_POST['quattro_pfs']);
}
}
diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php
index 28aebf970..f20a5afea 100644
--- a/view/theme/vier/config.php
+++ b/view/theme/vier/config.php
@@ -21,14 +21,13 @@
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
require_once __DIR__ . '/theme.php';
function theme_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
@@ -36,7 +35,7 @@ function theme_content(App $a)
return;
}
- $style = DI::pConfig()->get(Session::getLocalUser(), 'vier', 'style');
+ $style = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'vier', 'style');
if ($style == "") {
$style = DI::config()->get('vier', 'style');
@@ -59,18 +58,18 @@ function theme_content(App $a)
function theme_post(App $a)
{
- if (! Session::getLocalUser()) {
+ if (! DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['vier-settings-submit'])) {
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'style', $_POST['vier_style']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_pages', $_POST['vier_show_pages']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_services', $_POST['vier_show_services']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_friends', $_POST['vier_show_friends']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'style', $_POST['vier_style']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_pages', $_POST['vier_show_pages']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_services', $_POST['vier_show_services']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_friends', $_POST['vier_show_friends']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
}
}
diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php
index ec82cf428..2d313cb29 100644
--- a/view/theme/vier/theme.php
+++ b/view/theme/vier/theme.php
@@ -31,7 +31,6 @@ use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -53,7 +52,7 @@ function vier_init(App $a)
DI::mode()->has(App\Mode::MAINTENANCEDISABLED)
&& (
$args->get(0) === 'profile' && $args->get(1) === ($a->getLoggedInUserNickname() ?? '')
- || $args->get(0) === 'network' && Session::getLocalUser()
+ || $args->get(0) === 'network' && DI::userSession()->getLocalUserId()
)
) {
vier_community_info();
@@ -115,8 +114,8 @@ EOT;
function get_vier_config($key, $default = false, $admin = false)
{
- if (Session::getLocalUser() && !$admin) {
- $result = DI::pConfig()->get(Session::getLocalUser(), "vier", $key);
+ if (DI::userSession()->getLocalUserId() && !$admin) {
+ $result = DI::pConfig()->get(DI::userSession()->getLocalUserId(), "vier", $key);
if (!is_null($result)) {
return $result;
}
@@ -145,7 +144,7 @@ function vier_community_info()
// comunity_profiles
if ($show_profiles) {
- $contacts = Contact\Relation::getSuggestions(Session::getLocalUser(), 0, 9);
+ $contacts = Contact\Relation::getSuggestions(DI::userSession()->getLocalUserId(), 0, 9);
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
if (DBA::isResult($contacts)) {
@@ -192,7 +191,7 @@ function vier_community_info()
}
//right_aside FIND FRIENDS
- if ($show_friends && Session::getLocalUser()) {
+ if ($show_friends && DI::userSession()->getLocalUserId()) {
$nv = [];
$nv['findpeople'] = DI::l10n()->t('Find People');
$nv['desc'] = DI::l10n()->t('Enter name or interest');
@@ -211,8 +210,8 @@ function vier_community_info()
}
//Community_Pages at right_aside
- if ($show_pages && Session::getLocalUser()) {
- $aside['$page'] = ForumManager::widget('network/forum', Session::getLocalUser());;
+ if ($show_pages && DI::userSession()->getLocalUserId()) {
+ $aside['$page'] = ForumManager::widget('network/forum', DI::userSession()->getLocalUserId());;
}
// END Community Page
From fad1763e28e30f513dee52bbcabea2ec2cfd239b Mon Sep 17 00:00:00 2001
From: Philipp
Date: Fri, 21 Oct 2022 08:38:40 +0200
Subject: [PATCH 14/40] Update view/theme/quattro/config.php
Co-authored-by: Hypolite Petovan
---
view/theme/quattro/config.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php
index 245f6a221..608d8de2d 100644
--- a/view/theme/quattro/config.php
+++ b/view/theme/quattro/config.php
@@ -37,7 +37,7 @@ function theme_content(App $a) {
}
function theme_post(App $a) {
- if (! DI::userSession()->getLocalUserId()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
From 84201f09154d1c7f751fd6e9afc901cca446e1ab Mon Sep 17 00:00:00 2001
From: Philipp
Date: Fri, 21 Oct 2022 08:38:45 +0200
Subject: [PATCH 15/40] Update view/theme/vier/config.php
Co-authored-by: Hypolite Petovan
---
view/theme/vier/config.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php
index f20a5afea..b5fe4ff10 100644
--- a/view/theme/vier/config.php
+++ b/view/theme/vier/config.php
@@ -58,7 +58,7 @@ function theme_content(App $a)
function theme_post(App $a)
{
- if (! DI::userSession()->getLocalUserId()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
From 8ad83e5d5c1e5d1f6b97fa216c3fc5343b603862 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Fri, 21 Oct 2022 19:16:25 +0200
Subject: [PATCH 16/40] Add missing DI
---
src/Model/Contact/Group.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Model/Contact/Group.php b/src/Model/Contact/Group.php
index f18e344d0..52ae70807 100644
--- a/src/Model/Contact/Group.php
+++ b/src/Model/Contact/Group.php
@@ -22,6 +22,7 @@
namespace Friendica\Model\Contact;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
/**
From b3f9cef94a7be372428767125f85b7fec085b460 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 21:22:47 +0200
Subject: [PATCH 17/40] UserSession class [3] - Refactor src/ files excluding
Module/Model
---
src/App.php | 15 +++---
src/App/Page.php | 6 +--
src/App/Router.php | 4 +-
src/Content/Conversation.php | 40 +++++++--------
src/Content/ForumManager.php | 3 +-
src/Content/Item.php | 16 +++---
src/Content/Nav.php | 21 ++++----
src/Content/Smilies.php | 3 +-
src/Content/Widget.php | 21 ++++----
src/Content/Widget/SavedSearches.php | 3 +-
src/Content/Widget/VCard.php | 5 +-
src/Core/ACL.php | 2 +-
src/Core/Search.php | 6 +--
.../Factory/FormattedNavNotification.php | 4 +-
.../Notifications/Factory/FormattedNotify.php | 16 +++---
.../Notifications/Factory/Introduction.php | 6 +--
src/Network/Probe.php | 3 +-
src/Object/Post.php | 49 +++++++++----------
src/Object/Thread.php | 7 ++-
src/Security/Authentication.php | 3 +-
src/Security/BasicAuth.php | 3 +-
src/Security/Security.php | 14 +++---
src/Util/Temporal.php | 3 +-
23 files changed, 120 insertions(+), 133 deletions(-)
diff --git a/src/App.php b/src/App.php
index 081767cfd..395ddab4d 100644
--- a/src/App.php
+++ b/src/App.php
@@ -33,7 +33,6 @@ use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\L10n;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
@@ -158,7 +157,7 @@ class App
public function isLoggedIn(): bool
{
- return Session::getLocalUser() && $this->user_id && ($this->user_id == Session::getLocalUser());
+ return DI::userSession()->getLocalUserId() && $this->user_id && ($this->user_id == DI::userSession()->getLocalUserId());
}
/**
@@ -172,7 +171,7 @@ class App
$adminlist = explode(',', str_replace(' ', '', $admin_email));
- return Session::getLocalUser() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
+ return DI::userSession()->getLocalUserId() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
}
/**
@@ -496,11 +495,11 @@ class App
$page_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
- if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) {
+ if (!empty($this->profile_owner) && ($this->profile_owner != DI::userSession()->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
- if ($this->database->isResult($user) && !Session::getLocalUser()) {
+ if ($this->database->isResult($user) && !DI::userSession()->getLocalUserId()) {
$page_theme = $user['theme'];
}
}
@@ -529,10 +528,10 @@ class App
$page_mobile_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
- if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) {
+ if (!empty($this->profile_owner) && ($this->profile_owner != DI::userSession()->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
}
}
@@ -629,7 +628,7 @@ class App
}
// ZRL
- if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !Session::getLocalUser()) {
+ if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !DI::userSession()->getLocalUserId()) {
// Only continue when the given profile link seems valid
// Valid profile links contain a path with "/profile/" and no query parameters
if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') &&
diff --git a/src/App/Page.php b/src/App/Page.php
index d1aa17ad0..c9beb0d48 100644
--- a/src/App/Page.php
+++ b/src/App/Page.php
@@ -32,9 +32,9 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Theme;
+use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Network;
@@ -232,7 +232,7 @@ class Page implements ArrayAccess
*/
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
{
- $interval = ((Session::getLocalUser()) ? $pConfig->get(Session::getLocalUser(), 'system', 'update_interval') : 40000);
+ $interval = ((DI::userSession()->getLocalUserId()) ? $pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'update_interval') : 40000);
// If the update is 'deactivated' set it to the highest integer number (~24 days)
if ($interval < 0) {
@@ -277,7 +277,7 @@ class Page implements ArrayAccess
* being first
*/
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
- '$local_user' => Session::getLocalUser(),
+ '$local_user' => DI::userSession()->getLocalUserId(),
'$generator' => 'Friendica' . ' ' . App::VERSION,
'$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
diff --git a/src/App/Router.php b/src/App/Router.php
index 356279e49..1f56a89d9 100644
--- a/src/App/Router.php
+++ b/src/App/Router.php
@@ -34,7 +34,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Lock\Capability\ICanLock;
-use Friendica\Core\Session;
+use Friendica\DI;
use Friendica\LegacyModule;
use Friendica\Module\HTTPException\MethodNotAllowed;
use Friendica\Module\HTTPException\PageNotFound;
@@ -309,7 +309,7 @@ class Router
if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
//Check if module is an app and if public access to apps is allowed or not
$privateapps = $this->config->get('config', 'private_addons', false);
- if (!Session::getLocalUser() && Hook::isAddonApp($moduleName) && $privateapps) {
+ if (!DI::userSession()->getLocalUserId() && Hook::isAddonApp($moduleName) && $privateapps) {
throw new MethodNotAllowedException($this->l10n->t("You must be logged in to use addons. "));
} else {
include_once "addon/{$moduleName}/{$moduleName}.php";
diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php
index 9ff1b63ef..4b313d76f 100644
--- a/src/Content/Conversation.php
+++ b/src/Content/Conversation.php
@@ -32,10 +32,10 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item as ItemModel;
use Friendica\Model\Post;
@@ -172,7 +172,7 @@ class Conversation
continue;
}
- if (Session::getPublicContact() == $activity['author-id']) {
+ if (DI::userSession()->getPublicContactId() == $activity['author-id']) {
$conv_responses[$mode][$activity['thr-parent-id']]['self'] = 1;
}
@@ -297,7 +297,7 @@ class Conversation
$x['bang'] = $x['bang'] ?? '';
$x['visitor'] = $x['visitor'] ?? 'block';
$x['is_owner'] = $x['is_owner'] ?? true;
- $x['profile_uid'] = $x['profile_uid'] ?? Session::getLocalUser();
+ $x['profile_uid'] = $x['profile_uid'] ?? DI::userSession()->getLocalUserId();
$geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
@@ -360,7 +360,7 @@ class Conversation
'$title' => $x['title'] ?? '',
'$placeholdertitle' => $this->l10n->t('Set title'),
'$category' => $x['category'] ?? '',
- '$placeholdercategory' => Feature::isEnabled(Session::getLocalUser(), 'categories') ? $this->l10n->t("Categories \x28comma-separated list\x29") : '',
+ '$placeholdercategory' => Feature::isEnabled(DI::userSession()->getLocalUserId(), 'categories') ? $this->l10n->t("Categories \x28comma-separated list\x29") : '',
'$scheduled_at' => Temporal::getDateTimeField(
new \DateTime(),
new \DateTime('now + 6 months'),
@@ -398,7 +398,7 @@ class Conversation
'$browser' => $this->l10n->t('Browser'),
'$compose_link_title' => $this->l10n->t('Open Compose page'),
- '$always_open_compose' => $this->pConfig->get(Session::getLocalUser(), 'frio', 'always_open_compose', false),
+ '$always_open_compose' => $this->pConfig->get(DI::userSession()->getLocalUserId(), 'frio', 'always_open_compose', false),
]);
@@ -437,7 +437,7 @@ class Conversation
$this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
$this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
- $ssl_state = (bool)Session::getLocalUser();
+ $ssl_state = (bool)DI::userSession()->getLocalUserId();
$live_update_div = '';
@@ -489,11 +489,11 @@ class Conversation
}
}
} elseif ($mode === 'notes') {
- $items = $this->addChildren($items, false, $order, Session::getLocalUser(), $mode);
+ $items = $this->addChildren($items, false, $order, DI::userSession()->getLocalUserId(), $mode);
if (!$update) {
$live_update_div = '
' . "\r\n"
- . "\r\n";
}
} elseif ($mode === 'display') {
@@ -527,7 +527,7 @@ class Conversation
$live_update_div = '
' . "\r\n";
}
- $page_dropping = Session::getLocalUser() && Session::getLocalUser() == $uid;
+ $page_dropping = DI::userSession()->getLocalUserId() && DI::userSession()->getLocalUserId() == $uid;
if (!$update) {
$_SESSION['return_path'] = $this->args->getQueryString();
@@ -547,7 +547,7 @@ class Conversation
'announce' => [],
];
- if ($this->pConfig->get(Session::getLocalUser(), 'system', 'hide_dislike')) {
+ if ($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
unset($conv_responses['dislike']);
}
@@ -565,7 +565,7 @@ class Conversation
$writable = $items[0]['writable'] || ($items[0]['uid'] == 0) && in_array($items[0]['network'], Protocol::FEDERATED);
}
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
$writable = false;
}
@@ -598,7 +598,7 @@ class Conversation
$threadsid++;
// prevent private email from leaking.
- if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) {
+ if ($item['network'] === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item['uid']) {
continue;
}
@@ -642,17 +642,17 @@ class Conversation
'announce' => null,
];
- if ($this->pConfig->get(Session::getLocalUser(), 'system', 'hide_dislike')) {
+ if ($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
unset($likebuttons['dislike']);
}
$body_html = ItemModel::prepareBody($item, true, $preview);
- [$categories, $folders] = $this->item->determineCategoriesTerms($item, Session::getLocalUser());
+ [$categories, $folders] = $this->item->determineCategoriesTerms($item, DI::userSession()->getLocalUserId());
if (!empty($item['title'])) {
$title = $item['title'];
- } elseif (!empty($item['content-warning']) && $this->pConfig->get(Session::getLocalUser(), 'system', 'disable_cw', false)) {
+ } elseif (!empty($item['content-warning']) && $this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'disable_cw', false)) {
$title = ucfirst($item['content-warning']);
} else {
$title = '';
@@ -746,7 +746,7 @@ class Conversation
$this->builtinActivityPuller($item, $conv_responses);
// Only add what is visible
- if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) {
+ if ($item['network'] === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item['uid']) {
continue;
}
@@ -791,11 +791,11 @@ class Conversation
private function getBlocklist(): array
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return [];
}
- $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get(Session::getLocalUser(), 'system', 'blocked'));
+ $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'blocked'));
if (empty($str_blocked)) {
return [];
}
@@ -865,7 +865,7 @@ class Conversation
$row['direction'] = ['direction' => 4, 'title' => $this->l10n->t('You subscribed to one or more tags in this post.')];
break;
case ItemModel::PR_ANNOUNCEMENT:
- if (!empty($row['causer-id']) && $this->pConfig->get(Session::getLocalUser(), 'system', 'display_resharer')) {
+ if (!empty($row['causer-id']) && $this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'display_resharer')) {
$row['owner-id'] = $row['causer-id'];
$row['owner-link'] = $row['causer-link'];
$row['owner-avatar'] = $row['causer-avatar'];
@@ -1217,7 +1217,7 @@ class Conversation
$parents[$i]['children'] = $this->sortItemChildren($parents[$i]['children']);
}
- if (!$this->pConfig->get(Session::getLocalUser(), 'system', 'no_smart_threading', 0)) {
+ if (!$this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'no_smart_threading', 0)) {
foreach ($parents as $i => $parent) {
$parents[$i] = $this->smartFlattenConversation($parent);
}
diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php
index f5e776147..603151473 100644
--- a/src/Content/ForumManager.php
+++ b/src/Content/ForumManager.php
@@ -24,7 +24,6 @@ namespace Friendica\Content;
use Friendica\Content\Text\HTML;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -224,7 +223,7 @@ class ForumManager
AND NOT `contact`.`pending` AND NOT `contact`.`archive`
AND `contact`.`uid` = ?
GROUP BY `contact`.`id`",
- Session::getLocalUser(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY, Session::getLocalUser()
+ DI::userSession()->getLocalUserId(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY, DI::userSession()->getLocalUserId()
);
return DBA::toArray($stmtContacts);
diff --git a/src/Content/Item.php b/src/Content/Item.php
index 521c01546..469c7764c 100644
--- a/src/Content/Item.php
+++ b/src/Content/Item.php
@@ -27,9 +27,9 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Item as ItemModel;
@@ -110,7 +110,7 @@ class Item
$categories[] = [
'name' => $savedFolderName,
'url' => $url,
- 'removeurl' => Session::getLocalUser() == $uid ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : '',
+ 'removeurl' => DI::userSession()->getLocalUserId() == $uid ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : '',
'first' => $first,
'last' => false
];
@@ -121,12 +121,12 @@ class Item
$categories[count($categories) - 1]['last'] = true;
}
- if (Session::getLocalUser() == $uid) {
+ if (DI::userSession()->getLocalUserId() == $uid) {
foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid, Post\Category::FILE) as $savedFolderName) {
$folders[] = [
'name' => $savedFolderName,
'url' => "#",
- 'removeurl' => Session::getLocalUser() == $uid ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : '',
+ 'removeurl' => DI::userSession()->getLocalUserId() == $uid ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : '',
'first' => $first,
'last' => false
];
@@ -332,7 +332,7 @@ class Item
$sub_link = $contact_url = $pm_url = $status_link = '';
$photos_link = $posts_link = $block_link = $ignore_link = '';
- if (Session::getLocalUser() && Session::getLocalUser() == $item['uid'] && $item['gravity'] == ItemModel::GRAVITY_PARENT && !$item['self'] && !$item['mention']) {
+ if (DI::userSession()->getLocalUserId() && DI::userSession()->getLocalUserId() == $item['uid'] && $item['gravity'] == ItemModel::GRAVITY_PARENT && !$item['self'] && !$item['mention']) {
$sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;';
}
@@ -349,7 +349,7 @@ class Item
$pcid = $item['author-id'];
$network = '';
$rel = 0;
- $condition = ['uid' => Session::getLocalUser(), 'uri-id' => $item['author-uri-id']];
+ $condition = ['uid' => DI::userSession()->getLocalUserId(), 'uri-id' => $item['author-uri-id']];
$contact = DBA::selectFirst('contact', ['id', 'network', 'rel'], $condition);
if (DBA::isResult($contact)) {
$cid = $contact['id'];
@@ -379,7 +379,7 @@ class Item
}
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$menu = [
$this->l10n->t('Follow Thread') => $sub_link,
$this->l10n->t('View Status') => $status_link,
@@ -440,7 +440,7 @@ class Item
return (!($this->activity->match($item['verb'], Activity::FOLLOW) &&
$item['object-type'] === Activity\ObjectType::NOTE &&
empty($item['self']) &&
- $item['uid'] == Session::getLocalUser())
+ $item['uid'] == DI::userSession()->getLocalUserId())
);
}
diff --git a/src/Content/Nav.php b/src/Content/Nav.php
index c66758a6d..06e6895d9 100644
--- a/src/Content/Nav.php
+++ b/src/Content/Nav.php
@@ -24,7 +24,6 @@ namespace Friendica\Content;
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -127,7 +126,7 @@ class Nav
//Don't populate apps_menu if apps are private
$privateapps = DI::config()->get('config', 'private_addons', false);
- if (Session::getLocalUser() || !$privateapps) {
+ if (DI::userSession()->getLocalUserId() || !$privateapps) {
$arr = ['app_menu' => self::$app_menu];
Hook::callAll('app_menu', $arr);
@@ -149,7 +148,7 @@ class Nav
*/
private static function getInfo(App $a): array
{
- $ssl_state = (bool) Session::getLocalUser();
+ $ssl_state = (bool) DI::userSession()->getLocalUserId();
/*
* Our network is distributed, and as you visit friends some of the
@@ -182,7 +181,7 @@ class Nav
$userinfo = null;
// nav links: array of array('href', 'text', 'extra css classes', 'title')
- if (Session::isAuthenticated()) {
+ if (DI::userSession()->isAuthenticated()) {
$nav['logout'] = ['logout', DI::l10n()->t('Logout'), '', DI::l10n()->t('End this session')];
} else {
$nav['login'] = ['login', DI::l10n()->t('Login'), (DI::args()->getModuleName() == 'login' ? 'selected' : ''), DI::l10n()->t('Sign in')];
@@ -211,11 +210,11 @@ class Nav
$homelink = DI::session()->get('visitor_home', '');
}
- if ((DI::args()->getModuleName() != 'home') && (! (Session::getLocalUser()))) {
+ if ((DI::args()->getModuleName() != 'home') && (! (DI::userSession()->getLocalUserId()))) {
$nav['home'] = [$homelink, DI::l10n()->t('Home'), '', DI::l10n()->t('Home Page')];
}
- if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !Session::isAuthenticated()) {
+ if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !DI::userSession()->isAuthenticated()) {
$nav['register'] = ['register', DI::l10n()->t('Register'), '', DI::l10n()->t('Create an account')];
}
@@ -229,7 +228,7 @@ class Nav
$nav['apps'] = ['apps', DI::l10n()->t('Apps'), '', DI::l10n()->t('Addon applications, utilities, games')];
}
- if (Session::getLocalUser() || !DI::config()->get('system', 'local_search')) {
+ if (DI::userSession()->getLocalUserId() || !DI::config()->get('system', 'local_search')) {
$nav['search'] = ['search', DI::l10n()->t('Search'), '', DI::l10n()->t('Search site content')];
$nav['searchoption'] = [
@@ -252,12 +251,12 @@ class Nav
}
}
- if ((Session::getLocalUser() || DI::config()->get('system', 'community_page_style') != Community::DISABLED_VISITOR) &&
+ if ((DI::userSession()->getLocalUserId() || DI::config()->get('system', 'community_page_style') != Community::DISABLED_VISITOR) &&
!(DI::config()->get('system', 'community_page_style') == Community::DISABLED)) {
$nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')];
}
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$nav['events'] = ['events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
}
@@ -270,7 +269,7 @@ class Nav
}
// The following nav links are only show to logged in users
- if (Session::getLocalUser() && !empty($a->getLoggedInUserNickname())) {
+ if (DI::userSession()->getLocalUserId() && !empty($a->getLoggedInUserNickname())) {
$nav['network'] = ['network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
$nav['home'] = ['profile/' . $a->getLoggedInUserNickname(), DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')];
@@ -288,7 +287,7 @@ class Nav
$nav['messages']['outbox'] = ['message/sent', DI::l10n()->t('Outbox'), '', DI::l10n()->t('Outbox')];
$nav['messages']['new'] = ['message/new', DI::l10n()->t('New Message'), '', DI::l10n()->t('New Message')];
- if (User::hasIdentities(DI::session()->get('submanage') ?: Session::getLocalUser())) {
+ if (User::hasIdentities(DI::session()->get('submanage') ?: DI::userSession()->getLocalUserId())) {
$nav['delegation'] = ['delegation', DI::l10n()->t('Accounts'), '', DI::l10n()->t('Manage other pages')];
}
diff --git a/src/Content/Smilies.php b/src/Content/Smilies.php
index 68093e843..02abee6cf 100644
--- a/src/Content/Smilies.php
+++ b/src/Content/Smilies.php
@@ -22,7 +22,6 @@
namespace Friendica\Content;
use Friendica\Core\Hook;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Util\Strings;
@@ -214,7 +213,7 @@ class Smilies
public static function replaceFromArray(string $text, array $smilies, bool $no_images = false): string
{
if (intval(DI::config()->get('system', 'no_smilies'))
- || (Session::getLocalUser() && intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_smilies')))
+ || (DI::userSession()->getLocalUserId() && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_smilies')))
) {
return $text;
}
diff --git a/src/Content/Widget.php b/src/Content/Widget.php
index 06841ed92..400ed2dab 100644
--- a/src/Content/Widget.php
+++ b/src/Content/Widget.php
@@ -26,7 +26,6 @@ use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -67,7 +66,7 @@ class Widget
$global_dir = Search::getGlobalDirectory();
if (DI::config()->get('system', 'invitation_only')) {
- $x = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'invites_remaining'));
+ $x = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'invites_remaining'));
if ($x || DI::app()->isSiteAdmin()) {
DI::page()['aside'] .= ''
. DI::l10n()->tt('%d invitation available', '%d invitations available', $x)
@@ -196,7 +195,7 @@ class Widget
*/
public static function groups(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -205,7 +204,7 @@ class Widget
'ref' => $group['id'],
'name' => $group['name']
];
- }, Group::getByUserId(Session::getLocalUser()));
+ }, Group::getByUserId(DI::userSession()->getLocalUserId()));
return self::filter(
'group',
@@ -228,7 +227,7 @@ class Widget
*/
public static function contactRels(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
@@ -259,13 +258,13 @@ class Widget
*/
public static function networks(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$networks = self::unavailableNetworks();
$query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")";
- $condition = array_merge([$query], array_merge([Session::getLocalUser()], $networks));
+ $condition = array_merge([$query], array_merge([DI::userSession()->getLocalUserId()], $networks));
$r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]);
@@ -300,12 +299,12 @@ class Widget
*/
public static function fileAs(string $baseurl, string $selected = ''): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$terms = [];
- foreach (Post\Category::getArray(Session::getLocalUser(), Post\Category::FILE) as $savedFolderName) {
+ foreach (Post\Category::getArray(DI::userSession()->getLocalUserId(), Post\Category::FILE) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
@@ -362,11 +361,11 @@ class Widget
*/
public static function commonFriendsVisitor(int $uid, string $nickname): string
{
- if (Session::getLocalUser() == $uid) {
+ if (DI::userSession()->getLocalUserId() == $uid) {
return '';
}
- $visitorPCid = Session::getLocalUser() ? Contact::getPublicIdByUserId(Session::getLocalUser()) : Session::getRemoteUser();
+ $visitorPCid = DI::userSession()->getLocalUserId() ? Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId()) : DI::userSession()->getRemoteUserId();
if (!$visitorPCid) {
return '';
}
diff --git a/src/Content/Widget/SavedSearches.php b/src/Content/Widget/SavedSearches.php
index a7cff52f2..484afc258 100644
--- a/src/Content/Widget/SavedSearches.php
+++ b/src/Content/Widget/SavedSearches.php
@@ -23,7 +23,6 @@ namespace Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -38,7 +37,7 @@ class SavedSearches
public static function getHTML($return_url, $search = '')
{
$saved = [];
- $saved_searches = DBA::select('search', ['id', 'term'], ['uid' => Session::getLocalUser()]);
+ $saved_searches = DBA::select('search', ['id', 'term'], ['uid' => DI::userSession()->getLocalUserId()]);
while ($saved_search = DBA::fetch($saved_searches)) {
$saved[] = [
'id' => $saved_search['id'],
diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php
index 6ff5f21a4..3a29522cf 100644
--- a/src/Content/Widget/VCard.php
+++ b/src/Content/Widget/VCard.php
@@ -26,7 +26,6 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Contact;
@@ -65,13 +64,13 @@ class VCard
$photo = Contact::getPhoto($contact);
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
if ($contact['uid']) {
$id = $contact['id'];
$rel = $contact['rel'];
$pending = $contact['pending'];
} else {
- $pcontact = Contact::selectFirst([], ['uid' => Session::getLocalUser(), 'uri-id' => $contact['uri-id']]);
+ $pcontact = Contact::selectFirst([], ['uid' => DI::userSession()->getLocalUserId(), 'uri-id' => $contact['uri-id']]);
$id = $pcontact['id'] ?? 0;
$rel = $pcontact['rel'] ?? Contact::NOTHING;
diff --git a/src/Core/ACL.php b/src/Core/ACL.php
index dc9b2a0f5..a2db32afc 100644
--- a/src/Core/ACL.php
+++ b/src/Core/ACL.php
@@ -62,7 +62,7 @@ class ACL
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
- $contacts = self::getValidMessageRecipientsForUser(Session::getLocalUser());
+ $contacts = self::getValidMessageRecipientsForUser(DI::userSession()->getLocalUserId());
$tpl = Renderer::getMarkupTemplate('acl/message_recipient.tpl');
$o = Renderer::replaceMacros($tpl, [
diff --git a/src/Core/Search.php b/src/Core/Search.php
index 6cca544b8..c41df70d9 100644
--- a/src/Core/Search.php
+++ b/src/Core/Search.php
@@ -70,7 +70,7 @@ class Search
return $emptyResultList;
}
- $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', Session::getLocalUser());
+ $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', DI::userSession()->getLocalUserId());
$result = new ContactResult(
$user_data['name'] ?? '',
@@ -136,7 +136,7 @@ class Search
foreach ($profiles as $profile) {
$profile_url = $profile['profile_url'] ?? '';
- $contactDetails = Contact::getByURLForUser($profile_url, Session::getLocalUser());
+ $contactDetails = Contact::getByURLForUser($profile_url, DI::userSession()->getLocalUserId());
$result = new ContactResult(
$profile['name'] ?? '',
@@ -211,7 +211,7 @@ class Search
{
Logger::info('Searching', ['search' => $search, 'mode' => $mode, 'page' => $page]);
- if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
return [];
}
diff --git a/src/Navigation/Notifications/Factory/FormattedNavNotification.php b/src/Navigation/Notifications/Factory/FormattedNavNotification.php
index 8457b9256..fc66a1cc1 100644
--- a/src/Navigation/Notifications/Factory/FormattedNavNotification.php
+++ b/src/Navigation/Notifications/Factory/FormattedNavNotification.php
@@ -23,7 +23,7 @@ namespace Friendica\Navigation\Notifications\Factory;
use Friendica\BaseFactory;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Navigation\Notifications\Entity;
use Friendica\Navigation\Notifications\Exception\NoMessageException;
@@ -72,7 +72,7 @@ class FormattedNavNotification extends BaseFactory
*/
public function createFromParams(array $contact, string $message, \DateTime $date, Uri $href, bool $seen = false): ValueObject\FormattedNavNotification
{
- $contact['photo'] = Contact::getAvatarUrlForUrl($contact['url'], Session::getLocalUser(), Proxy::SIZE_MICRO);
+ $contact['photo'] = Contact::getAvatarUrlForUrl($contact['url'], DI::userSession()->getLocalUserId(), Proxy::SIZE_MICRO);
$dateMySQL = $date->format(DateTimeFormat::MYSQL);
diff --git a/src/Navigation/Notifications/Factory/FormattedNotify.php b/src/Navigation/Notifications/Factory/FormattedNotify.php
index 4868ce1b9..7077bfb34 100644
--- a/src/Navigation/Notifications/Factory/FormattedNotify.php
+++ b/src/Navigation/Notifications/Factory/FormattedNotify.php
@@ -27,8 +27,8 @@ use Friendica\BaseFactory;
use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Database\Database;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
@@ -211,7 +211,7 @@ class FormattedNotify extends BaseFactory
$formattedNotifications = new FormattedNotifies();
try {
- $Notifies = $this->notify->selectForUser(Session::getLocalUser(), $conditions, $params);
+ $Notifies = $this->notify->selectForUser(DI::userSession()->getLocalUserId(), $conditions, $params);
foreach ($Notifies as $Notify) {
$formattedNotifications[] = new ValueObject\FormattedNotify(
@@ -244,7 +244,7 @@ class FormattedNotify extends BaseFactory
*/
public function getNetworkList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies
{
- $condition = ['wall' => false, 'uid' => Session::getLocalUser()];
+ $condition = ['wall' => false, 'uid' => DI::userSession()->getLocalUserId()];
if (!$seen) {
$condition['unseen'] = true;
@@ -257,7 +257,7 @@ class FormattedNotify extends BaseFactory
$formattedNotifications = new FormattedNotifies();
try {
- $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params);
+ $userPosts = Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params);
while ($userPost = $this->dba->fetch($userPosts)) {
$formattedNotifications[] = $this->createFromFormattedItem($this->formatItem($userPost));
}
@@ -280,7 +280,7 @@ class FormattedNotify extends BaseFactory
*/
public function getPersonalList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies
{
- $condition = ['wall' => false, 'uid' => Session::getLocalUser(), 'author-id' => Session::getPublicContact()];
+ $condition = ['wall' => false, 'uid' => DI::userSession()->getLocalUserId(), 'author-id' => DI::userSession()->getPublicContactId()];
if (!$seen) {
$condition['unseen'] = true;
@@ -293,7 +293,7 @@ class FormattedNotify extends BaseFactory
$formattedNotifications = new FormattedNotifies();
try {
- $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params);
+ $userPosts = Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params);
while ($userPost = $this->dba->fetch($userPosts)) {
$formattedNotifications[] = $this->createFromFormattedItem($this->formatItem($userPost));
}
@@ -316,7 +316,7 @@ class FormattedNotify extends BaseFactory
*/
public function getHomeList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies
{
- $condition = ['wall' => true, 'uid' => Session::getLocalUser()];
+ $condition = ['wall' => true, 'uid' => DI::userSession()->getLocalUserId()];
if (!$seen) {
$condition['unseen'] = true;
@@ -329,7 +329,7 @@ class FormattedNotify extends BaseFactory
$formattedNotifications = new FormattedNotifies();
try {
- $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params);
+ $userPosts = Post::selectForUser(DI::userSession()->getLocalUserId(), $fields, $condition, $params);
while ($userPost = $this->dba->fetch($userPosts)) {
$formattedItem = $this->formatItem($userPost);
diff --git a/src/Navigation/Notifications/Factory/Introduction.php b/src/Navigation/Notifications/Factory/Introduction.php
index 1b718ad1a..d60bf4d6b 100644
--- a/src/Navigation/Notifications/Factory/Introduction.php
+++ b/src/Navigation/Notifications/Factory/Introduction.php
@@ -29,9 +29,9 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Database\Database;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Module\BaseNotifications;
use Friendica\Navigation\Notifications\ValueObject;
@@ -143,7 +143,7 @@ class Introduction extends BaseFactory
'url' => $intro['furl'],
'zrl' => Contact::magicLink($intro['furl']),
'hidden' => $intro['hidden'] == 1,
- 'post_newfriend' => (intval($this->pConfig->get(Session::getLocalUser(), 'system', 'post_newfriend')) ? '1' : 0),
+ 'post_newfriend' => (intval($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'post_newfriend')) ? '1' : 0),
'note' => $intro['note'],
'request' => $intro['frequest'] . '?addr=' . $return_addr]);
@@ -168,7 +168,7 @@ class Introduction extends BaseFactory
'about' => BBCode::convert($intro['about'], false),
'keywords' => $intro['keywords'],
'hidden' => $intro['hidden'] == 1,
- 'post_newfriend' => (intval($this->pConfig->get(Session::getLocalUser(), 'system', 'post_newfriend')) ? '1' : 0),
+ 'post_newfriend' => (intval($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'post_newfriend')) ? '1' : 0),
'url' => $intro['url'],
'zrl' => Contact::magicLink($intro['url']),
'addr' => $intro['addr'],
diff --git a/src/Network/Probe.php b/src/Network/Probe.php
index 4261ad84e..8683b2652 100644
--- a/src/Network/Probe.php
+++ b/src/Network/Probe.php
@@ -27,7 +27,6 @@ use Exception;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -317,7 +316,7 @@ class Probe
}
if ($uid == -1) {
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
}
if (empty($network) || ($network == Protocol::ACTIVITYPUB)) {
diff --git a/src/Object/Post.php b/src/Object/Post.php
index a86539f1d..7c73be779 100644
--- a/src/Object/Post.php
+++ b/src/Object/Post.php
@@ -28,7 +28,6 @@ use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
@@ -87,7 +86,7 @@ class Post
$this->setTemplate('wall');
$this->toplevel = $this->getId() == $this->getDataValue('parent');
- if (!empty(Session::getUserIDForVisitorContactID($this->getDataValue('contact-id')))) {
+ if (!empty(DI::userSession()->getUserIDForVisitorContactID($this->getDataValue('contact-id')))) {
$this->visiting = true;
}
@@ -104,14 +103,14 @@ class Post
if (!empty($data['children'])) {
foreach ($data['children'] as $item) {
// Only add will be displayed
- if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) {
+ if ($item['network'] === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item['uid']) {
continue;
} elseif (!DI::contentItem()->isVisibleActivity($item)) {
continue;
}
// You can always comment on Diaspora and OStatus items
- if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (Session::getLocalUser() == $item['uid'])) {
+ if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (DI::userSession()->getLocalUserId() == $item['uid'])) {
$item['writable'] = true;
}
@@ -206,7 +205,7 @@ class Post
$lock = ($item['private'] == Item::PRIVATE) ? $privacy : false;
$connector = !in_array($item['network'], Protocol::NATIVE_SUPPORT) ? DI::l10n()->t('Connector Message') : false;
- $shareable = in_array($conv->getProfileOwner(), [0, Session::getLocalUser()]) && $item['private'] != Item::PRIVATE;
+ $shareable = in_array($conv->getProfileOwner(), [0, DI::userSession()->getLocalUserId()]) && $item['private'] != Item::PRIVATE;
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
// On Diaspora only toplevel posts can be reshared
@@ -216,7 +215,7 @@ class Post
$edpost = false;
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
if (Strings::compareLink(DI::session()->get('my_url'), $item['author-link'])) {
if ($item['event-id'] != 0) {
$edpost = ['events/event/' . $item['event-id'], DI::l10n()->t('Edit')];
@@ -224,7 +223,7 @@ class Post
$edpost = ['editpost/' . $item['id'], DI::l10n()->t('Edit')];
}
}
- $dropping = in_array($item['uid'], [0, Session::getLocalUser()]);
+ $dropping = in_array($item['uid'], [0, DI::userSession()->getLocalUserId()]);
}
// Editing on items of not subscribed users isn't currently possible
@@ -234,7 +233,7 @@ class Post
$edpost = false;
}
- if (($this->getDataValue('uid') == Session::getLocalUser()) || $this->isVisiting()) {
+ if (($this->getDataValue('uid') == DI::userSession()->getLocalUserId()) || $this->isVisiting()) {
$dropping = true;
}
@@ -249,7 +248,7 @@ class Post
$drop = false;
$block = false;
- if (Session::getLocalUser()) {
+ if (DI::userSession()->getLocalUserId()) {
$drop = [
'dropping' => $dropping,
'pagedrop' => $item['pagedrop'],
@@ -258,7 +257,7 @@ class Post
];
}
- if (!$item['self'] && Session::getLocalUser()) {
+ if (!$item['self'] && DI::userSession()->getLocalUserId()) {
$block = [
'blocking' => true,
'block' => DI::l10n()->t('Block %s', $item['author-name']),
@@ -266,14 +265,14 @@ class Post
];
}
- $filer = Session::getLocalUser() ? DI::l10n()->t('Save to folder') : false;
+ $filer = DI::userSession()->getLocalUserId() ? DI::l10n()->t('Save to folder') : false;
$profile_name = $item['author-name'];
if (!empty($item['author-link']) && empty($item['author-name'])) {
$profile_name = $item['author-link'];
}
- if (Session::isAuthenticated()) {
+ if (DI::userSession()->isAuthenticated()) {
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
$profile_link = Contact::magicLinkByContact($author);
@@ -327,8 +326,8 @@ class Post
$tagger = '';
if ($this->isToplevel()) {
- if (Session::getLocalUser()) {
- $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], Session::getLocalUser());
+ if (DI::userSession()->getLocalUserId()) {
+ $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], DI::userSession()->getLocalUserId());
if ($item['mention'] || $ignored) {
$ignore = [
'do' => DI::l10n()->t('Ignore thread'),
@@ -351,7 +350,7 @@ class Post
'starred' => DI::l10n()->t('Starred'),
];
- if ($conv->getProfileOwner() == Session::getLocalUser() && ($item['uid'] != 0)) {
+ if ($conv->getProfileOwner() == DI::userSession()->getLocalUserId() && ($item['uid'] != 0)) {
if ($origin && in_array($item['private'], [Item::PUBLIC, Item::UNLISTED])) {
$ispinned = ($item['featured'] ? 'pinned' : 'unpinned');
@@ -397,17 +396,17 @@ class Post
$body_html = Item::prepareBody($item, true);
- list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, Session::getLocalUser());
+ list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, DI::userSession()->getLocalUserId());
if (!empty($item['title'])) {
$title = $item['title'];
- } elseif (!empty($item['content-warning']) && DI::pConfig()->get(Session::getLocalUser(), 'system', 'disable_cw', false)) {
+ } elseif (!empty($item['content-warning']) && DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'disable_cw', false)) {
$title = ucfirst($item['content-warning']);
} else {
$title = '';
}
- if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike')) {
+ if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
$buttons['dislike'] = false;
}
@@ -434,7 +433,7 @@ class Post
}
// Fetching of Diaspora posts doesn't always work. There are issues with reshares and possibly comments
- if (!Session::getLocalUser() && ($item['network'] != Protocol::DIASPORA) && !empty(DI::session()->get('remote_comment'))) {
+ if (!DI::userSession()->getLocalUserId() && ($item['network'] != Protocol::DIASPORA) && !empty(DI::session()->get('remote_comment'))) {
$remote_comment = [DI::l10n()->t('Comment this item on your system'), DI::l10n()->t('Remote comment'),
str_replace('{uri}', urlencode($item['uri']), DI::session()->get('remote_comment'))];
@@ -642,7 +641,7 @@ class Post
/*
* Only add what will be displayed
*/
- if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) {
+ if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
return false;
} elseif ($activity->match($item->getDataValue('verb'), Activity::LIKE) ||
$activity->match($item->getDataValue('verb'), Activity::DISLIKE)) {
@@ -850,7 +849,7 @@ class Post
// This will allow us to comment on wall-to-wall items owned by our friends
// and community forums even if somebody else wrote the post.
// bug #517 - this fixes for conversation owner
- if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == Session::getLocalUser()) {
+ if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == DI::userSession()->getLocalUserId()) {
return true;
}
@@ -898,20 +897,20 @@ class Post
{
$a = DI::app();
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$owner = User::getOwnerDataById($a->getLoggedInUserId());
$item = $this->getData();
- if (!empty($item['content-warning']) && Feature::isEnabled(Session::getLocalUser(), 'add_abstract')) {
+ if (!empty($item['content-warning']) && Feature::isEnabled(DI::userSession()->getLocalUserId(), 'add_abstract')) {
$text = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $item['content-warning'] . "[/abstract]\n";
} else {
$text = '';
}
- if (!Feature::isEnabled(Session::getLocalUser(), 'explicit_mentions')) {
+ if (!Feature::isEnabled(DI::userSession()->getLocalUserId(), 'explicit_mentions')) {
return $text;
}
@@ -958,7 +957,7 @@ class Post
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words');
+ $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
diff --git a/src/Object/Thread.php b/src/Object/Thread.php
index a62874900..8ce9f6b89 100644
--- a/src/Object/Thread.php
+++ b/src/Object/Thread.php
@@ -23,7 +23,6 @@ namespace Friendica\Object;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Protocol\Activity;
use Friendica\Security\Security;
@@ -76,7 +75,7 @@ class Thread
switch ($mode) {
case 'network':
case 'notes':
- $this->profile_owner = Session::getLocalUser();
+ $this->profile_owner = DI::userSession()->getLocalUserId();
$this->writable = true;
break;
case 'profile':
@@ -169,7 +168,7 @@ class Thread
/*
* Only add will be displayed
*/
- if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) {
+ if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
Logger::info('[WARN] Conversation::addThread : Thread is a mail ('. $item->getId() .').');
return false;
}
@@ -202,7 +201,7 @@ class Thread
$result = [];
foreach ($this->parents as $item) {
- if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) {
+ if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
continue;
}
diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php
index 3cd7b76bc..7b9f0ff3e 100644
--- a/src/Security/Authentication.php
+++ b/src/Security/Authentication.php
@@ -26,7 +26,6 @@ use Friendica\App;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Hook;
-use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\System;
use Friendica\Database\Database;
@@ -333,7 +332,7 @@ class Authentication
'addr' => $this->remoteAddress,
]);
- Session::setVisitorsContacts();
+ DI::userSession()->setVisitorsContacts();
$member_since = strtotime($user_record['register_date']);
$this->session->set('new_member', time() < ($member_since + (60 * 60 * 24 * 14)));
diff --git a/src/Security/BasicAuth.php b/src/Security/BasicAuth.php
index 257e52d46..7c3f3cc9c 100644
--- a/src/Security/BasicAuth.php
+++ b/src/Security/BasicAuth.php
@@ -24,7 +24,6 @@ namespace Friendica\Security;
use Exception;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
@@ -191,7 +190,7 @@ class BasicAuth
Hook::callAll('logged_in', $record);
- self::$current_user_id = Session::getLocalUser();
+ self::$current_user_id = DI::userSession()->getLocalUserId();
return self::$current_user_id;
}
diff --git a/src/Security/Security.php b/src/Security/Security.php
index f0b33501f..80d24c9ba 100644
--- a/src/Security/Security.php
+++ b/src/Security/Security.php
@@ -22,10 +22,10 @@
namespace Friendica\Security;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\User;
-use Friendica\Core\Session;
/**
* Secures that User is allow to do requests
@@ -36,20 +36,20 @@ class Security
{
static $verified = 0;
- if (!Session::isAuthenticated()) {
+ if (!DI::userSession()->isAuthenticated()) {
return false;
}
- $uid = Session::getLocalUser();
+ $uid = DI::userSession()->getLocalUserId();
if ($uid == $owner) {
return true;
}
- if (Session::getLocalUser() && ($owner == 0)) {
+ if (DI::userSession()->getLocalUserId() && ($owner == 0)) {
return true;
}
- if (!empty($cid = Session::getRemoteContactID($owner))) {
+ if (!empty($cid = DI::userSession()->getRemoteContactID($owner))) {
// use remembered decision and avoid a DB lookup for each and every display item
// DO NOT use this function if there are going to be multiple owners
// We have a contact-id for an authenticated remote user, this block determines if the contact
@@ -93,8 +93,8 @@ class Security
*/
public static function getPermissionsSQLByUserId(int $owner_id, bool $accessible = false)
{
- $local_user = Session::getLocalUser();
- $remote_contact = Session::getRemoteContactID($owner_id);
+ $local_user = DI::userSession()->getLocalUserId();
+ $remote_contact = DI::userSession()->getRemoteContactID($owner_id);
$acc_sql = '';
if ($accessible) {
diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php
index 72271c06f..394655062 100644
--- a/src/Util/Temporal.php
+++ b/src/Util/Temporal.php
@@ -24,7 +24,6 @@ namespace Friendica\Util;
use DateTime;
use DateTimeZone;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -239,7 +238,7 @@ class Temporal
bool $required = false): string
{
// First day of the week (0 = Sunday)
- $firstDay = DI::pConfig()->get(Session::getLocalUser(), 'system', 'first_day_of_week', 0);
+ $firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
$lang = substr(DI::l10n()->getCurrentLang(), 0, 2);
From f83784cc63a0b3228ef361a8e59b284b99714142 Mon Sep 17 00:00:00 2001
From: Philipp
Date: Thu, 20 Oct 2022 21:27:32 +0200
Subject: [PATCH 18/40] Move DI dependency for App\Page class
---
index.php | 1 +
src/App.php | 6 ++++--
src/App/Page.php | 23 ++++++++++++-----------
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/index.php b/index.php
index ba990532b..bde93bd71 100644
--- a/index.php
+++ b/index.php
@@ -45,6 +45,7 @@ $a->runFrontend(
$dice->create(\Friendica\Core\PConfig\Capability\IManagePersonalConfigValues::class),
$dice->create(\Friendica\Security\Authentication::class),
$dice->create(\Friendica\App\Page::class),
+ $dice->create(\Friendica\Core\Session\Capability\IHandleUserSessions::class),
new \Friendica\Util\HTTPInputData($_SERVER),
$start_time
);
diff --git a/src/App.php b/src/App.php
index 395ddab4d..5c9a6fadd 100644
--- a/src/App.php
+++ b/src/App.php
@@ -27,6 +27,7 @@ use Friendica\App\BaseURL;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Module\Maintenance;
use Friendica\Security\Authentication;
use Friendica\Core\Config\ValueObject\Cache;
@@ -592,12 +593,13 @@ class App
* @param Authentication $auth The Authentication backend of the node
* @param App\Page $page The Friendica page printing container
* @param HTTPInputData $httpInput A library for processing PHP input streams
+ * @param IHandleUserSessions $userSessions The UserSession class
* @param float $start_time The start time of the overall script execution
*
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, HTTPInputData $httpInput, float $start_time)
+ public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, HTTPInputData $httpInput, IHandleUserSessions $userSessions, float $start_time)
{
$this->profiler->set($start_time, 'start');
$this->profiler->set(microtime(true), 'classinit');
@@ -736,7 +738,7 @@ class App
$response = $module->run($input);
$this->profiler->set(microtime(true) - $timestamp, 'content');
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
- $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
+ $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $userSessions->getLocalUserId());
} else {
$page->exit($response);
}
diff --git a/src/App/Page.php b/src/App/Page.php
index c9beb0d48..a6f46bdd8 100644
--- a/src/App/Page.php
+++ b/src/App/Page.php
@@ -34,7 +34,6 @@ use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Theme;
-use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Network;
@@ -222,17 +221,18 @@ class Page implements ArrayAccess
* - Infinite scroll data
* - head.tpl template
*
- * @param App $app The Friendica App instance
- * @param Arguments $args The Friendica App Arguments
- * @param L10n $l10n The l10n language instance
- * @param IManageConfigValues $config The Friendica configuration
- * @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
+ * @param App $app The Friendica App instance
+ * @param Arguments $args The Friendica App Arguments
+ * @param L10n $l10n The l10n language instance
+ * @param IManageConfigValues $config The Friendica configuration
+ * @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
+ * @param int $localUID The local user id
*
* @throws HTTPException\InternalServerErrorException
*/
- private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
+ private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, int $localUID)
{
- $interval = ((DI::userSession()->getLocalUserId()) ? $pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'update_interval') : 40000);
+ $interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
// If the update is 'deactivated' set it to the highest integer number (~24 days)
if ($interval < 0) {
@@ -277,7 +277,7 @@ class Page implements ArrayAccess
* being first
*/
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
- '$local_user' => DI::userSession()->getLocalUserId(),
+ '$local_user' => $localUID,
'$generator' => 'Friendica' . ' ' . App::VERSION,
'$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
@@ -444,10 +444,11 @@ class Page implements ArrayAccess
* @param L10n $l10n The l10n language class
* @param IManageConfigValues $config The Configuration of this node
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
+ * @param int $localUID The UID of the local user
*
* @throws HTTPException\InternalServerErrorException|HTTPException\ServiceUnavailableException
*/
- public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
+ public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig, int $localUID)
{
$moduleName = $args->getModuleName();
@@ -481,7 +482,7 @@ class Page implements ArrayAccess
* all the module functions have executed so that all
* theme choices made by the modules can take effect.
*/
- $this->initHead($app, $args, $l10n, $config, $pconfig);
+ $this->initHead($app, $args, $l10n, $config, $pconfig, $localUID);
/* Build the page ending -- this is stuff that goes right before
* the closing