From 3a52179393406723a88c1309416bbb3a86b953e8 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 30 Sep 2020 16:53:18 +0200 Subject: [PATCH] Move 'Authentication' to Security namespace --- index.php | 2 +- src/App.php | 2 +- src/DI.php | 20 ++++++++++++-------- src/{App => Security}/Authentication.php | 6 +++--- 4 files changed, 17 insertions(+), 13 deletions(-) rename src/{App => Security}/Authentication.php (99%) diff --git a/index.php b/index.php index 4857b1f129..dd884a976e 100644 --- a/index.php +++ b/index.php @@ -38,6 +38,6 @@ $a->runFrontend( $dice->create(\Friendica\App\Module::class), $dice->create(\Friendica\App\Router::class), $dice->create(\Friendica\Core\PConfig\IPConfig::class), - $dice->create(\Friendica\App\Authentication::class), + $dice->create(\Friendica\Security\Authentication::class), $dice->create(\Friendica\App\Page::class) ); diff --git a/src/App.php b/src/App.php index 65ae3fe2f4..91a5a07446 100644 --- a/src/App.php +++ b/src/App.php @@ -24,7 +24,7 @@ namespace Friendica; use Exception; use Friendica\App\Arguments; use Friendica\App\BaseURL; -use Friendica\App\Authentication; +use Friendica\Security\Authentication; use Friendica\Core\Config\Cache; use Friendica\Core\Config\IConfig; use Friendica\Core\PConfig\IPConfig; diff --git a/src/DI.php b/src/DI.php index 4db53f271b..73f9b7811d 100644 --- a/src/DI.php +++ b/src/DI.php @@ -63,14 +63,6 @@ abstract class DI // "App" namespace instances // - /** - * @return App\Authentication - */ - public static function auth() - { - return self::$dice->create(App\Authentication::class); - } - /** * @return App\Arguments */ @@ -406,6 +398,18 @@ abstract class DI return self::$dice->create(Protocol\Activity::class); } + // + // "Security" namespace instances + // + + /** + * @return \Friendica\Security\Authentication + */ + public static function auth() + { + return self::$dice->create(Security\Authentication::class); + } + // // "Util" namespace instances // diff --git a/src/App/Authentication.php b/src/Security/Authentication.php similarity index 99% rename from src/App/Authentication.php rename to src/Security/Authentication.php index e3d2737470..5c6624a33f 100644 --- a/src/App/Authentication.php +++ b/src/Security/Authentication.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\App; +namespace Friendica\Security; use Exception; use Friendica\App; @@ -41,7 +41,7 @@ use Friendica\Core\L10n; use Psr\Log\LoggerInterface; /** - * Handle Authentification, Session and Cookies + * Handle Authentication, Session and Cookies */ class Authentication { @@ -374,7 +374,7 @@ class Authentication * that expires after one week (the default is when the browser is closed). * The cookie will be renewed automatically. * The week ensures that sessions will expire after some inactivity. - */; + */ if ($this->session->get('remember')) { $this->logger->info('Injecting cookie for remembered user ' . $user_record['nickname']); $this->cookie->set($user_record['uid'], $user_record['password'], $user_record['prvkey']);