aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/security/LoginManager.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-04-27 23:17:38 +0200
committerVirtualTam <virtualtam@flibidi.net>2018-06-02 16:46:06 +0200
commit51f0128cdba52099c40693379e72f094b42a6f80 (patch)
tree57f71dc7d38611aaf91e77703acfd7ffbd0ac7c1 /application/security/LoginManager.php
parentfab87c2696b9d6a26310f1bfc024b018ca5184fe (diff)
downloadShaarli-51f0128cdba52099c40693379e72f094b42a6f80.tar.gz
Shaarli-51f0128cdba52099c40693379e72f094b42a6f80.tar.zst
Shaarli-51f0128cdba52099c40693379e72f094b42a6f80.zip
Refactor session and cookie timeout control
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application/security/LoginManager.php')
-rw-r--r--application/security/LoginManager.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php
index e7b9b21e..27247f3f 100644
--- a/application/security/LoginManager.php
+++ b/application/security/LoginManager.php
@@ -49,13 +49,12 @@ class LoginManager
49 * Check user session state and validity (expiration) 49 * Check user session state and validity (expiration)
50 * 50 *
51 * @param array $cookie The $_COOKIE array 51 * @param array $cookie The $_COOKIE array
52 * @param string $webPath Path on the server in which the cookie will be available on
53 * @param string $clientIpId Client IP address identifier 52 * @param string $clientIpId Client IP address identifier
54 * @param string $token Session token 53 * @param string $token Session token
55 * 54 *
56 * @return bool true if the user session is valid, false otherwise 55 * @return bool true if the user session is valid, false otherwise
57 */ 56 */
58 public function checkLoginState($cookie, $webPath, $clientIpId, $token) 57 public function checkLoginState($cookie, $clientIpId, $token)
59 { 58 {
60 if (! $this->configManager->exists('credentials.login')) { 59 if (! $this->configManager->exists('credentials.login')) {
61 // Shaarli is not configured yet 60 // Shaarli is not configured yet
@@ -73,7 +72,7 @@ class LoginManager
73 if ($this->sessionManager->hasSessionExpired() 72 if ($this->sessionManager->hasSessionExpired()
74 || $this->sessionManager->hasClientIpChanged($clientIpId) 73 || $this->sessionManager->hasClientIpChanged($clientIpId)
75 ) { 74 ) {
76 $this->sessionManager->logout($webPath); 75 $this->sessionManager->logout();
77 $this->isLoggedIn = false; 76 $this->isLoggedIn = false;
78 return; 77 return;
79 } 78 }