summaryrefslogtreecommitdiff
path: root/app/Auth
diff options
context:
space:
mode:
Diffstat (limited to 'app/Auth')
-rw-r--r--app/Auth/Base.php1
-rw-r--r--app/Auth/GitHub.php2
-rw-r--r--app/Auth/Google.php2
-rw-r--r--app/Auth/Ldap.php4
-rw-r--r--app/Auth/RememberMe.php3
-rw-r--r--app/Auth/ReverseProxy.php2
6 files changed, 9 insertions, 5 deletions
diff --git a/app/Auth/Base.php b/app/Auth/Base.php
index e023e4fe..e2209e1f 100644
--- a/app/Auth/Base.php
+++ b/app/Auth/Base.php
@@ -10,6 +10,7 @@ use Pimple\Container;
* @package auth
* @author Frederic Guillot
*
+ * @property \Core\Session $session
* @property \Model\Acl $acl
* @property \Model\LastLogin $lastLogin
* @property \Model\User $user
diff --git a/app/Auth/GitHub.php b/app/Auth/GitHub.php
index 0e335fb4..816cc9c1 100644
--- a/app/Auth/GitHub.php
+++ b/app/Auth/GitHub.php
@@ -34,7 +34,7 @@ class GitHub extends Base
{
$user = $this->user->getByGitHubId($github_id);
- if ($user) {
+ if (! empty($user)) {
$this->userSession->refresh($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
diff --git a/app/Auth/Google.php b/app/Auth/Google.php
index e7abae08..9a977037 100644
--- a/app/Auth/Google.php
+++ b/app/Auth/Google.php
@@ -35,7 +35,7 @@ class Google extends Base
{
$user = $this->user->getByGoogleId($google_id);
- if ($user) {
+ if (! empty($user)) {
$this->userSession->refresh($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
diff --git a/app/Auth/Ldap.php b/app/Auth/Ldap.php
index ed29199f..3ee6ec9b 100644
--- a/app/Auth/Ldap.php
+++ b/app/Auth/Ldap.php
@@ -36,7 +36,7 @@ class Ldap extends Base
$user = $this->user->getByUsername($username);
- if ($user) {
+ if (! empty($user)) {
// There is already a local user with that name
if ($user['is_ldap_user'] == 0) {
@@ -241,7 +241,7 @@ class Ldap extends Base
}
// User id not retrieved: LDAP_ACCOUNT_ID not properly configured
- if (! $username && ! isset($info[0][LDAP_ACCOUNT_ID][0])) {
+ if (empty($username) && ! isset($info[0][LDAP_ACCOUNT_ID][0])) {
return false;
}
diff --git a/app/Auth/RememberMe.php b/app/Auth/RememberMe.php
index 4736442e..e8b20f37 100644
--- a/app/Auth/RememberMe.php
+++ b/app/Auth/RememberMe.php
@@ -103,6 +103,9 @@ class RememberMe extends Base
// Create the session
$this->userSession->refresh($this->user->getById($record['user_id']));
+ // Do not ask 2FA for remember me session
+ $this->session['2fa_validated'] = true;
+
$this->container['dispatcher']->dispatch(
'auth.success',
new AuthEvent(self::AUTH_NAME, $this->userSession->getId())
diff --git a/app/Auth/ReverseProxy.php b/app/Auth/ReverseProxy.php
index 6cd01b28..c8fd5eec 100644
--- a/app/Auth/ReverseProxy.php
+++ b/app/Auth/ReverseProxy.php
@@ -32,7 +32,7 @@ class ReverseProxy extends Base
$login = $_SERVER[REVERSE_PROXY_USER_HEADER];
$user = $this->user->getByUsername($login);
- if (! $user) {
+ if (empty($user)) {
$this->createUser($login);
$user = $this->user->getByUsername($login);
}