Add explicit parameter to IHandleUserSession->setvisitorContacts

- Convert some remaining $_SESSION references to object calls
- Address part of https://github.com/friendica/friendica/issues/12486#issuecomment-1428489772
This commit is contained in:
Hypolite Petovan 2023-03-26 19:00:48 -04:00
parent 2fdf39e8b8
commit b268fa60e7
4 changed files with 18 additions and 12 deletions

View file

@ -323,19 +323,21 @@ class Authentication
*/
public function setForUser(App $a, array $user_record, bool $login_initial = false, bool $interactive = false, bool $login_refresh = false)
{
$my_url = $this->baseUrl . '/profile/' . $user_record['nickname'];
$this->session->setMultiple([
'uid' => $user_record['uid'],
'theme' => $user_record['theme'],
'mobile-theme' => $this->pConfig->get($user_record['uid'], 'system', 'mobile_theme'),
'authenticated' => 1,
'page_flags' => $user_record['page-flags'],
'my_url' => $this->baseUrl . '/profile/' . $user_record['nickname'],
'my_url' => $my_url,
'my_address' => $user_record['nickname'] . '@' . substr($this->baseUrl, strpos($this->baseUrl, '://') + 3),
'addr' => $this->remoteAddress,
'nickname' => $user_record['nickname'],
]);
$this->session->setVisitorsContacts();
$this->session->setVisitorsContacts($my_url);
$member_since = strtotime($user_record['register_date']);
$this->session->set('new_member', time() < ($member_since + (60 * 60 * 24 * 14)));