MDL-13623 proper version detection

This commit is contained in:
skodak
2008-02-26 18:33:22 +00:00
parent 997dc05600
commit 13db6cc1e4
2 changed files with 4 additions and 7 deletions
+2 -3
View File
@@ -2057,8 +2057,7 @@ function require_logout() {
error_log('MoodleSessionTest cookie could not be set in moodlelib.php:'.__LINE__);
error_log('Headers were already sent in file: '.$file.' on line '.$line);
} else {
if (function_exists('array_fill_keys')) {
//PHP 5.2.0
if (check_php_version('5.2.0')) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
@@ -7756,7 +7755,7 @@ function report_session_error() {
moodle_setlocale();
//clear session cookies
if (function_exists('array_fill_keys')) {
if (check_php_version('5.2.0')) {
//PHP 5.2.0
setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
+2 -4
View File
@@ -517,8 +517,7 @@ global $HTTPSPAGEREQUIRED;
if (empty($nomoodlecookie)) {
session_name('MoodleSession'.$CFG->sessioncookie);
if (function_exists('array_fill_keys')) {
//PHP 5.2.0
if (check_php_version('5.2.0')) {
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
@@ -530,8 +529,7 @@ global $HTTPSPAGEREQUIRED;
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
$_SESSION['SESSION']->has_timed_out = true;
}
if (function_exists('array_fill_keys')) {
//PHP 5.2.0
if (check_php_version('5.2.0')) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);