namespace Friendica\Core;
-use Friendica\Core\Addon;
use Friendica\BaseObject;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
-use Friendica\Util\DateTimeFormat;
-use Friendica\Database\DBA;
use Friendica\Core\L10n;
+use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\Database\DBA;
+use Friendica\Util\DateTimeFormat;
/**
* Handle Authentification, Session and Cookies
-*/
+*/
class Authentication extends BaseObject
{
/**
$a->user = $user_record;
if ($interactive) {
- if ($a->user['login_date'] <= NULL_DATE) {
- $_SESSION['return_url'] = 'profile_photo/new';
+ if ($a->user['login_date'] <= DBA::NULL_DATETIME) {
+ $_SESSION['return_path'] = 'profile_photo/new';
$a->module = 'profile_photo';
info(L10n::t("Welcome ") . $a->user['username'] . EOL);
info(L10n::t('Please upload a profile photo.') . EOL);
}
if ($login_initial) {
- logger('auth_identities: ' . print_r($a->identities, true), LOGGER_DEBUG);
+ Logger::log('auth_identities: ' . print_r($a->identities, true), Logger::DEBUG);
}
if ($login_refresh) {
- logger('auth_identities refresh: ' . print_r($a->identities, true), LOGGER_DEBUG);
+ Logger::log('auth_identities refresh: ' . print_r($a->identities, true), Logger::DEBUG);
}
$contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => true]);
* The week ensures that sessions will expire after some inactivity.
*/
if (!empty($_SESSION['remember'])) {
- logger('Injecting cookie for remembered user ' . $a->user['nickname']);
+ Logger::log('Injecting cookie for remembered user ' . $a->user['nickname']);
self::setCookie(604800, $user_record);
unset($_SESSION['remember']);
}
if ($login_initial) {
Addon::callHooks('logged_in', $a->user);
- if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
- goaway($a->getbaseUrl() . '/' . $_SESSION['return_url']);
+ if (($a->module !== 'home') && isset($_SESSION['return_path'])) {
+ $a->internalRedirect($_SESSION['return_path']);
}
}
}