mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 09:49:16 +02:00
refactoring
This commit is contained in:
parent
7b6e2ccdd4
commit
c1796fdefc
16 changed files with 25 additions and 16 deletions
|
@ -64,7 +64,7 @@ function startSecureSession($redirectToLogin = true, $initSecureData = false) {
|
|||
if (isset($_SESSION)) {
|
||||
unset($_SESSION);
|
||||
}
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
$sessionDir = dirname(__FILE__) . "/../sess";
|
||||
session_save_path($sessionDir);
|
||||
// enable garbage collection (fix for Debian based systems)
|
||||
|
@ -121,6 +121,15 @@ function startSecureSession($redirectToLogin = true, $initSecureData = false) {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the session uses files storage.
|
||||
*
|
||||
* @return bool file based session
|
||||
*/
|
||||
function isFileBasedSession(): bool {
|
||||
return ((session_module_name() !== false) && (strtolower(session_module_name()) === 'files'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the client's IP address is on the list of allowed IPs.
|
||||
* The script is stopped if the host is not valid.
|
||||
|
|
|
@ -50,7 +50,7 @@ use ZipArchive;
|
|||
include_once('../../lib/persistence.inc');
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -48,7 +48,7 @@ include_once('../../lib/config.inc');
|
|||
include_once('../../lib/status.inc');
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path(dirname(__FILE__) . '/../../sess');
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -65,7 +65,7 @@ include_once __DIR__ . '/../../lib/2factor.inc';
|
|||
include_once __DIR__ . '/../../lib/configPages.inc';
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -50,7 +50,7 @@ include_once('../../lib/modules.inc');
|
|||
include_once '../../lib/configPages.inc';
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -42,7 +42,7 @@ include_once(__DIR__ . "/../../lib/config.inc");
|
|||
include_once(__DIR__ . "/../../lib/modules.inc");
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -49,7 +49,7 @@ include_once '../../lib/types.inc';
|
|||
include_once '../../lib/configPages.inc';
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -36,7 +36,7 @@ use htmlResponsiveRow;
|
|||
include_once('../../lib/config.inc');
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -38,7 +38,7 @@ if (isLAMProVersion()) {
|
|||
}
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path(dirname(__FILE__) . '/../../sess');
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -66,7 +66,7 @@ include_once('../../lib/status.inc');
|
|||
include_once('../../lib/selfService.inc');
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -44,7 +44,7 @@ include_once('../../lib/types.inc');
|
|||
include_once '../../lib/configPages.inc';
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -52,7 +52,7 @@ include_once('../../lib/config.inc');
|
|||
include_once('../../lib/status.inc');
|
||||
|
||||
// start session
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -46,7 +46,7 @@ if (!empty($_GET['selfService']) && ($_GET['selfService'] === '1')) {
|
|||
session_name('SELFSERVICE');
|
||||
}
|
||||
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path("../sess");
|
||||
}
|
||||
lam_start_session();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
include_once(__DIR__ . "/../../lib/config.inc"); // Include config.inc which provides Config class
|
||||
|
||||
// set session save path
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path(dirname(__FILE__) . '/../../sess');
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ if (isLAMProVersion()) {
|
|||
}
|
||||
|
||||
// set session save path
|
||||
if (strtolower(session_module_name()) == 'files') {
|
||||
if (isFileBasedSession()) {
|
||||
session_save_path(dirname(__FILE__) . '/../sess');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
parameters:
|
||||
level: 6
|
||||
level: 7
|
||||
scanDirectories:
|
||||
- lam/lib
|
||||
- lam/templates
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue