summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Göhler <somebody.here@gmx.de>2012-10-11 14:11:30 +0200
committerMichael Göhler <somebody.here@gmx.de>2012-10-14 22:36:25 +0200
commit382f8d060cad9da01ff7c24fc937b3f0d1b46990 (patch)
treed5fe687ffb07799c8cef804866c298972232a2c1
parent38b9bffaeaaa6154c903f87100f20e07afe8261d (diff)
downloadnextcloud-server-382f8d060cad9da01ff7c24fc937b3f0d1b46990.tar.gz
nextcloud-server-382f8d060cad9da01ff7c24fc937b3f0d1b46990.zip
fixed wrong variable usage
-rw-r--r--lib/base.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php
index 6105f525845..4007d241dee 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -513,7 +513,7 @@ class OC{
protected static function cleanupLoginTokens($user) {
$cutoff = time() - OC_Config::getValue('remember_login_cookie_lifetime', 60*60*24*15);
- $tokens = OC_Preferences::getKeys($_COOKIE['oc_username'], 'login_token');
+ $tokens = OC_Preferences::getKeys($user, 'login_token');
foreach($tokens as $token) {
$time = OC_Preferences::getValue($user, 'login_token', $token);
if ($time < $cutoff) {
@@ -543,10 +543,10 @@ class OC{
// test cookies token against stored tokens
if (in_array($_COOKIE['oc_token'], $tokens, true)) {
// replace successfully used token with a new one
- OC_Preferences::deleteKey($_POST['user'], 'login_token', $_COOKIE['oc_token']);
- $token = md5($_POST["user"].OC_Util::generate_random_bytes(10).$_COOKIE['oc_token']);
- OC_Preferences::setValue($_POST['user'], 'login_token', $token, time());
- OC_User::setMagicInCookie($_POST['user'], $token);
+ OC_Preferences::deleteKey($_COOKIE['oc_username'], 'login_token', $_COOKIE['oc_token']);
+ $token = md5($_COOKIE['oc_username'].OC_Util::generate_random_bytes(10).$_COOKIE['oc_token']);
+ OC_Preferences::setValue($_COOKIE['oc_username'], 'login_token', $token, time());
+ OC_User::setMagicInCookie($_COOKIE['oc_username'], $token);
// login
OC_User::setUserId($_COOKIE['oc_username']);
OC_Util::redirectToDefaultPage();