From: nodiscc Date: Sat, 9 Feb 2019 18:52:40 +0000 (+0000) Subject: Merge pull request #1264 from shaarli/doc-fix-mkdocs-warnings X-Git-Tag: v0.11.0~35 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=3dc80d69abc481394862f2a3aeeee9c59f7dba37;hp=8d1509e8a64cb7d3d026b48f545cd151512d5887;p=github%2Fshaarli%2FShaarli.git Merge pull request #1264 from shaarli/doc-fix-mkdocs-warnings doc: fix invalid links --- diff --git a/.travis.yml b/.travis.yml index cb81846f..c6400eef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ dist: trusty matrix: include: + - language: php + php: 7.3 - language: php php: 7.2 - language: php diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php index 0f315483..1ff3d0be 100644 --- a/application/security/LoginManager.php +++ b/application/security/LoginManager.php @@ -58,6 +58,9 @@ class LoginManager */ public function generateStaySignedInToken($clientIpAddress) { + if ($this->configManager->get('security.session_protection_disabled') === true) { + $clientIpAddress = ''; + } $this->staySignedInToken = sha1( $this->configManager->get('credentials.hash') . $clientIpAddress diff --git a/tests/security/LoginManagerTest.php b/tests/security/LoginManagerTest.php index de8055ed..7b0262b3 100644 --- a/tests/security/LoginManagerTest.php +++ b/tests/security/LoginManagerTest.php @@ -260,6 +260,20 @@ class LoginManagerTest extends TestCase ); } + /** + * Generate a token depending on the user credentials with session protected disabled + */ + public function testGenerateStaySignedInTokenSessionProtectionDisabled() + { + $this->configManager->set('security.session_protection_disabled', true); + $this->loginManager->generateStaySignedInToken($this->clientIpAddress); + + $this->assertEquals( + sha1($this->passwordHash . $this->salt), + $this->loginManager->getStaySignedInToken() + ); + } + /** * Check user login - Shaarli has not yet been configured */