diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:14:24 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:14:24 +0100 |
commit | 55a71a16cbfacd3836ca70e37e45f85bd44ceab1 (patch) | |
tree | 22721869994c6acdc9720aa4ef3bcac4cb1eab65 /inc/auth.php | |
parent | c09f0eb1d9009ce0a7d2a12c41b125957604eff5 (diff) | |
download | rpg-55a71a16cbfacd3836ca70e37e45f85bd44ceab1.tar.gz rpg-55a71a16cbfacd3836ca70e37e45f85bd44ceab1.tar.bz2 |
removed pre PHP 5.2 code wrt setcookie and session setting
- moved cookiedir determination in the if-statement
Diffstat (limited to 'inc/auth.php')
-rw-r--r-- | inc/auth.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/inc/auth.php b/inc/auth.php index 8fde129aa..6c4636b2f 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -528,11 +528,7 @@ function auth_logoff($keepbc = false) { $USERINFO = null; //FIXME $cookieDir = empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir']; - if(version_compare(PHP_VERSION, '5.2.0', '>')) { - setcookie(DOKU_COOKIE, '', time() - 600000, $cookieDir, '', ($conf['securecookie'] && is_ssl()), true); - } else { - setcookie(DOKU_COOKIE, '', time() - 600000, $cookieDir, '', ($conf['securecookie'] && is_ssl())); - } + setcookie(DOKU_COOKIE, '', time() - 600000, $cookieDir, '', ($conf['securecookie'] && is_ssl()), true); if($auth) $auth->logOff(); } @@ -1319,11 +1315,8 @@ function auth_setCookie($user, $pass, $sticky) { $cookie = base64_encode($user).'|'.((int) $sticky).'|'.base64_encode($pass); $cookieDir = empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir']; $time = $sticky ? (time() + 60 * 60 * 24 * 365) : 0; //one year - if(version_compare(PHP_VERSION, '5.2.0', '>')) { - setcookie(DOKU_COOKIE, $cookie, $time, $cookieDir, '', ($conf['securecookie'] && is_ssl()), true); - } else { - setcookie(DOKU_COOKIE, $cookie, $time, $cookieDir, '', ($conf['securecookie'] && is_ssl())); - } + setcookie(DOKU_COOKIE, $cookie, $time, $cookieDir, '', ($conf['securecookie'] && is_ssl()), true); + // set session $_SESSION[DOKU_COOKIE]['auth']['user'] = $user; $_SESSION[DOKU_COOKIE]['auth']['pass'] = sha1($pass); |