From 5942a52ee1b26fdf495dc9c0946d616afc649607 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 17 Apr 2014 23:59:21 +0200 Subject: [PATCH] inc/session.php is no longer needed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/filter-functions.php | 1 + inc/filters.php | 8 ++++- inc/mysql-connect.php | 5 +++- inc/session-functions.php | 23 +++++++++++++++ inc/session.php | 62 +-------------------------------------- 5 files changed, 36 insertions(+), 63 deletions(-) diff --git a/inc/filter-functions.php b/inc/filter-functions.php index c8e74588e5..939cd84d5b 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -101,6 +101,7 @@ ORDER BY registerFilter(__FUNCTION__, __LINE__, 'init', 'LOAD_CONFIGURATION'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_RANDOMIZER'); registerFilter(__FUNCTION__, __LINE__, 'init', 'LOAD_RUNTIME_INCLUDES'); + registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_LANGUAGE'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_EXTENSIONS'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_SESSION'); registerFilter(__FUNCTION__, __LINE__, 'init', 'SET_CURRENT_DATE'); diff --git a/inc/filters.php b/inc/filters.php index 5b3c05c5f2..0cd2a06191 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -880,12 +880,18 @@ function FILTER_RUN_YEARLY_RESET () { // Filter for loading more runtime includes (not for installation) function FILTER_LOAD_RUNTIME_INCLUDES () { // Load more includes - foreach (array('databases', 'session') as $inc) { + foreach (array('databases') as $inc) { // Load the include loadIncludeOnce('inc/' . $inc . '.php'); } // END - foreach } +// Filter for initializing language by loading the language file +function FILTER_INIT_LANGUAGE () { + // Load language file(s) + loadLanguageFile(); +} + // Filter for checking admin ACL function FILTER_CHECK_ADMIN_ACL () { // Extension not installed so it's always allowed to access everywhere! diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 4a6361853e..3514b82a4b 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -132,8 +132,11 @@ if ((!isInstaller()) && (isInstalled())) { // Init message system initMessages(); + // Init session + initSession(); + // Include more - foreach (array('databases', 'session', 'install-functions', 'load_config', 'load_cache') as $inc) { + foreach (array('databases', 'install-functions', 'load_config', 'load_cache') as $inc) { // Load include file loadIncludeOnce('inc/' . $inc . '.php'); } // END - foreach diff --git a/inc/session-functions.php b/inc/session-functions.php index 954d233c3d..8f2ec9e9ec 100644 --- a/inc/session-functions.php +++ b/inc/session-functions.php @@ -184,5 +184,28 @@ function isSessionDataSet ($sessionData) { return $isset; } +// Initializes session +function initSession () { + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!'); + + // Is ext-sql_patches there and newer? + if (isExtensionInstalledAndNewer('sql_patches', '0.5.3')) { + // Set session save path if set + if ((isConfigEntrySet('session_save_path')) && (getConfig('session_save_path') != '')) { + // Please make sure this valid! + session_save_path(getConfig('session_save_path')); + } // END - if + } // END - if + + // Is a session id there? + if (!isValidSession()) { + // Start the session + $GLOBALS['valid_session'] = session_start(); + $GLOBALS['isValidSession'] = TRUE; + } // END - if + + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'EXIT!'); +} + // [EOF] ?> diff --git a/inc/session.php b/inc/session.php index 355d77307a..f551ef47b7 100644 --- a/inc/session.php +++ b/inc/session.php @@ -1,63 +1,3 @@ -- 2.30.2