mirror of
https://github.com/friendica/friendica
synced 2025-04-19 05:50:10 +00:00
Replace defaults() calls on $_SESSION by Core\Session calls
- Replace direct calls to $_SESSION by Core\Session calls in Module\Login
This commit is contained in:
parent
cbca26d185
commit
01e71254d9
10 changed files with 37 additions and 43 deletions
|
@ -32,26 +32,21 @@ class Login extends BaseModule
|
|||
{
|
||||
$a = self::getApp();
|
||||
|
||||
if (!empty($_SESSION['theme'])) {
|
||||
unset($_SESSION['theme']);
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['mobile-theme'])) {
|
||||
unset($_SESSION['mobile-theme']);
|
||||
}
|
||||
Session::remove('theme');
|
||||
Session::remove('mobile-theme');
|
||||
|
||||
if (local_user()) {
|
||||
$a->internalRedirect();
|
||||
}
|
||||
|
||||
return self::form(defaults($_SESSION, 'return_path', null), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
|
||||
return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
|
||||
}
|
||||
|
||||
public static function post()
|
||||
{
|
||||
$return_path = defaults($_SESSION, 'return_path', '');
|
||||
$return_path = Session::get('return_path');
|
||||
session_unset();
|
||||
$_SESSION['return_path'] = $return_path;
|
||||
Session::set('return_path', $return_path);
|
||||
|
||||
// OpenId Login
|
||||
if (
|
||||
|
@ -159,17 +154,13 @@ class Login extends BaseModule
|
|||
}
|
||||
|
||||
// if we haven't failed up this point, log them in.
|
||||
$_SESSION['remember'] = $remember;
|
||||
$_SESSION['last_login_date'] = DateTimeFormat::utcNow();
|
||||
Session::set('remember', $remember);
|
||||
Session::set('last_login_date', DateTimeFormat::utcNow());
|
||||
|
||||
Session::setAuthenticatedForUser($a, $record, true, true);
|
||||
|
||||
if (!empty($_SESSION['return_path'])) {
|
||||
$return_path = $_SESSION['return_path'];
|
||||
unset($_SESSION['return_path']);
|
||||
} else {
|
||||
$return_path = '';
|
||||
}
|
||||
$return_path = Session::get('return_path', '');
|
||||
Session::remove('return_path');
|
||||
|
||||
$a->internalRedirect($return_path);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Contact as ContactModel;
|
||||
|
@ -226,8 +227,10 @@ class Profile extends BaseModule
|
|||
$sql_extra = Item::getPermissionsSQLByUserId($a->profile['profile_uid'], $remote_contact, $groups, $remote_cid);
|
||||
$sql_extra2 = '';
|
||||
|
||||
$last_updated_array = Session::get('last_updated', []);
|
||||
|
||||
if ($update) {
|
||||
$last_updated = (defaults($_SESSION['last_updated'], $last_updated_key, 0));
|
||||
$last_updated = $last_updated_array[$last_updated_key] ?? 0;
|
||||
|
||||
// If the page user is the owner of the page we should query for unseen
|
||||
// items. Otherwise use a timestamp of the last succesful update request.
|
||||
|
@ -334,7 +337,8 @@ 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)
|
||||
$_SESSION['last_updated'][$last_updated_key] = time();
|
||||
$last_updated_array[$last_updated_key] = time();
|
||||
Session::set('last_updated', $last_updated_array);
|
||||
|
||||
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
|
||||
$o .= ProfileModel::getBirthdays();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue