From 3a8bcb3fbf396da7d7966016410ad6ad9275d1e9 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:12:23 +0200 Subject: [PATCH] Move Core\Session::set() to DI::session()->set() --- src/App.php | 4 ++-- src/Core/Session.php | 5 ----- src/Module/Conversation/Network.php | 2 +- src/Module/Delegation.php | 2 +- src/Module/Profile/Status.php | 2 +- src/Module/Settings/TwoFactor/Verify.php | 2 +- src/Module/Update/Profile.php | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/App.php b/src/App.php index 003ff56589..95b0716e28 100644 --- a/src/App.php +++ b/src/App.php @@ -634,8 +634,8 @@ class App if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) { if ($this->session->get('visitor_home') != $_GET['zrl']) { - Core\Session::set('my_url', $_GET['zrl']); - Core\Session::set('authenticated', 0); + $this->session->set('my_url', $_GET['zrl']); + $this->session->set('authenticated', 0); $remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']); if (!empty($remote_contact['subscribe'])) { diff --git a/src/Core/Session.php b/src/Core/Session.php index 9deadbedb2..1af219dd57 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function set($name, $value) - { - DI::session()->set($name, $value); - } - public static function setMultiple(array $values) { DI::session()->setMultiple($values); diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index d5f4f6d2fc..ed32744d38 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -345,7 +345,7 @@ class Network extends BaseModule self::$star = false; } - Session::set('network-tab', self::$selectedTab); + DI::session()->set('network-tab', self::$selectedTab); DI::pConfig()->set(local_user(), 'network.view', 'selected_tab', self::$selectedTab); self::$accountTypeString = $get['accounttype'] ?? $this->parameters['accounttype'] ?? ''; diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index f8aeb4c762..e3ae977e2d 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -102,7 +102,7 @@ class Delegation extends BaseModule DI::auth()->setForUser(DI::app(), $user, true, true); if ($limited_id) { - Session::set('submanage', $original_id); + DI::session()->set('submanage', $original_id); } $ret = []; diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 2bf9b429be..fa3f36e885 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -189,7 +189,7 @@ class Status extends BaseProfile // Set a time stamp for this page. We will make use of it when we // search for new items (update routine) $last_updated_array[$last_updated_key] = time(); - Session::set('last_updated', $last_updated_array); + DI::session()->set('last_updated', $last_updated_array); if ($is_owner && !DI::config()->get('theme', 'hide_eventlist')) { $o .= ProfileModel::getBirthdays(); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 820f7e255a..86e9af5aee 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -86,7 +86,7 @@ class Verify extends BaseSettings if ($valid) { $this->pConfig->set(local_user(), '2fa', 'verified', true); - Session::set('2fa', true); + DI::session()->set('2fa', true); DI::sysmsg()->addInfo($this->t('Two-factor authentication successfully activated.')); diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index 4d6793605e..4a1360fb9a 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -102,7 +102,7 @@ class Profile extends BaseModule // Set a time stamp for this page. We will make use of it when we // search for new items (update routine) $last_updated_array[$last_updated_key] = time(); - Session::set('last_updated', $last_updated_array); + DI::session()->set('last_updated', $last_updated_array); if ($is_owner && !$a->getProfileOwner() && !DI::config()->get('theme', 'hide_eventlist')) { $o .= ProfileModel::getBirthdays();