From 8af3a0780a160dd8a2f079f46f18b40a67d5c700 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 28 Dec 2016 15:03:06 -0800 Subject: [PATCH] Pref for session time added. Modification of PRFLAN_60 and PRFLAN_61 --- e107_admin/prefs.php | 26 +++++++++++++++++----- e107_core/xml/default_install.xml | 1 + e107_handlers/session_handler.php | 4 ++-- e107_languages/English/admin/lan_prefs.php | 7 ++++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 180588451..17ea06d6f 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -1263,7 +1263,11 @@ $text .= " - + "; + + if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') // Only allow if an SSL login has been made. + { + $text .=" @@ -1272,10 +1276,9 @@ $text .= "
".PRFLAN_61."
- - -"; - + "; + } + // Secure Image/ Captcha $secureImage = array('signcode'=>PRFLAN_76, 'logcode'=>PRFLAN_81, "fpwcode"=>PRFLAN_138,'admincode'=>PRFLAN_222); foreach($secureImage as $key=>$label) @@ -1363,7 +1366,18 @@ $text .= " ".$frm->text('cookie_name', $pref['cookie_name'], 20)."
".PRFLAN_263.".
- + + + + + + ".$frm->number('session_lifetime', $pref['session_lifetime'],6)." +
".PRFLAN_273."
+ + + + + diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index 18fd42cdf..355aa62a8 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -243,6 +243,7 @@ 1 0 + 86400 %d %b %Y : %H:%M 0 diff --git a/e107_handlers/session_handler.php b/e107_handlers/session_handler.php index 9d73a51e1..b8d78a2b3 100644 --- a/e107_handlers/session_handler.php +++ b/e107_handlers/session_handler.php @@ -205,9 +205,9 @@ class e_session { $config['SavePath'] = e107::getPref('session_save_path', false); // FIXME - new pref $config['SaveMethod'] = e107::getPref('session_save_method', 'files'); // FIXME - new pref - $options['lifetime'] = (integer) e107::getPref('session_lifetime', 86400); // FIXME - new pref + $options['lifetime'] = (integer) e107::getPref('session_lifetime', 86400); // $options['path'] = e107::getPref('session_cookie_path', ''); // FIXME - new pref - $options['secure'] = e107::getPref('ssl_enabled', false); // FIXME - new pref + $options['secure'] = e107::getPref('ssl_enabled', false); // } if(defined('SESSION_SAVE_PATH')) // safer than a pref. diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index 97a06866a..f59d89012 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -58,8 +58,8 @@ define("PRFLAN_55", "Cookie/Session name"); define("PRFLAN_56", "Timezone"); define("PRFLAN_58", "Restrict website to members only"); define("PRFLAN_59", "ticking will restrict all areas apart from the front page and signup page to members only"); -define("PRFLAN_60", "Enable SSL"); -define("PRFLAN_61", "Only enable SSL if you are sure you know what you are doing!"); +define("PRFLAN_60", "Use SSL only"); +define("PRFLAN_61", "Redirect all traffic through SSL (https)"); define("PRFLAN_76", "Display CAPTCHA on signup page."); define("PRFLAN_77", "Admin Display Options "); define("PRFLAN_78", "Leave blank to disable"); @@ -289,3 +289,6 @@ define("PRFLAN_268", "Frontend Inline-Editing"); define("PRFLAN_269", "Admins with this userclass (and the appropriate admin permissions) will be able to edit html directly via the frontend area."); define("PRFLAN_270", "Contact Form Filtering"); define("PRFLAN_271", "Ignore form submissions containing these words or phrases. One per line."); + +define("PRFLAN_272", "Session Lifetime"); +define("PRFLAN_273", "Lifetime in seconds. 0 = until the browser is closed. "); \ No newline at end of file