]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Authentication.php
AutoInstall Test fix
[friendica.git] / src / Core / Authentication.php
index 3a4471d2a46d6b17fa48db2a8990d7dee9966cfd..4d227c27109fbf2201999e1ca3db4b5774ffcc99 100644 (file)
@@ -5,17 +5,18 @@
 
 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
 {
        /**
@@ -81,8 +82,8 @@ 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);
@@ -153,10 +154,10 @@ class Authentication extends BaseObject
                }
 
                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]);
@@ -184,7 +185,7 @@ class Authentication extends BaseObject
                         * 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']);
                        }
@@ -193,8 +194,8 @@ class Authentication extends BaseObject
                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']);
                        }
                }
        }