X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fsession.inc;h=869ce9a805820d5ee5ccb4145b72e07ebf850f00;hb=81dd5f392e49a94960c250053e375ed135ac9bad;hp=27e6f8e6746e407ebc98471d7891b007aff20d7e;hpb=c8079e929cf5fe79b6d7fb4619f6245c99fa0399;p=fa-stable.git diff --git a/includes/session.inc b/includes/session.inc index 27e6f8e6..869ce9a8 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -21,7 +21,11 @@ class SessionManager $https = isset($secure) ? $secure : (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'); // Set session cookie options - session_set_cookie_params($limit, $path, $domain, $https, true); + if (version_compare(PHP_VERSION, '5.2', '<')) // avoid failure on older php versions + session_set_cookie_params($limit, $path, $domain, $https); + else + session_set_cookie_params($limit, $path, $domain, $https, true); + session_start(); // Make sure the session hasn't expired, and destroy it if it has @@ -184,7 +188,7 @@ function write_login_filelog($login, $result) $msg .= "*/\n"; $msg .= "\$login_faillog = " .var_export($login_faillog, true). ";\n"; - $filename = $path_to_root."/faillog.php"; + $filename = $path_to_root."/tmp/faillog.php"; if ((!file_exists($filename) && is_writable($path_to_root)) || is_writable($filename)) { @@ -365,7 +369,7 @@ include_once($path_to_root . "/config.php"); get_text_init(); if ($login_delay > 0) - @include_once($path_to_root . "/faillog.php"); + @include_once($path_to_root . "/tmp/faillog.php"); // Page Initialisation if (!isset($_SESSION['language']) || !method_exists($_SESSION['language'], 'set_language')) @@ -408,7 +412,7 @@ html_cleanup($_SERVER); // logout.php is the only page we should have always // accessable regardless of access level and current login status. -if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){ +if (!defined('FA_LOGOUT_PHP_FILE')){ login_timeout(); @@ -477,4 +481,4 @@ $SysPrefs = &$_SESSION['SysPrefs']; // We quote all values later with db_escape() before db update. $_POST = strip_quotes($_POST); -?> \ No newline at end of file +?>