aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/security
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-07-22 18:12:10 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commitfabff3835da26e6c95cea56b2a01a03749dec7c8 (patch)
tree4818fb25f92ff9ed15d3d25b78d2dfc9c064fc3a /application/security
parenta8c11451e8d885a243c1ad52012093ba8d121e2c (diff)
downloadShaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.tar.gz
Shaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.tar.zst
Shaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.zip
Move PHP and config init to dedicated file
in order to keep index.php as minimal as possible
Diffstat (limited to 'application/security')
-rw-r--r--application/security/SessionManager.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php
index 46219a3d..76b0afe8 100644
--- a/application/security/SessionManager.php
+++ b/application/security/SessionManager.php
@@ -49,6 +49,20 @@ class SessionManager
49 } 49 }
50 50
51 /** 51 /**
52 * Initialize XSRF token and links per page session variables.
53 */
54 public function initialize(): void
55 {
56 if (!isset($this->session['tokens'])) {
57 $this->session['tokens'] = [];
58 }
59
60 if (!isset($this->session['LINKS_PER_PAGE'])) {
61 $this->session['LINKS_PER_PAGE'] = $this->conf->get('general.links_per_page', 20);
62 }
63 }
64
65 /**
52 * Define whether the user should stay signed in across browser sessions 66 * Define whether the user should stay signed in across browser sessions
53 * 67 *
54 * @param bool $staySignedIn Keep the user signed in 68 * @param bool $staySignedIn Keep the user signed in