Remove obsolete code in SessionHandler.class.php
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 2 Dec 2014 01:20:29 +0000 (02:20 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 2 Dec 2014 01:20:29 +0000 (02:20 +0100)
wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index 7754748fb6eccca99c476189cbbff227270d3391..7f84b227e0336e245b8664a24412e7eda5cb6ff6 100644 (file)
@@ -590,21 +590,6 @@ class SessionHandler extends SingletonFactory {
                        return $this->changeUserVirtual($user);
                }
                
-               $sessionTable = call_user_func(array($this->sessionClassName, 'getDatabaseTableName'));
-               
-               if ($user->userID && !$hideSession) {
-                       // user is not a guest, delete all other sessions of this user
-                       $sql = "DELETE FROM     ".$sessionTable."
-                               WHERE           sessionID <> ?
-                                               AND userID = ?";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       //$statement->execute(array($this->sessionID, $user->userID));
-                       
-                       // reset session variables
-                       $this->variables = array();
-                       $this->variablesChanged = true;
-               }
-               
                // update user reference
                $this->user = $user;
                
@@ -621,6 +606,8 @@ class SessionHandler extends SingletonFactory {
                                // MySQL error 23000 = unique key
                                // do not check against the message itself, some weird systems localize them
                                if ($e->getCode() == 23000) {
+                                       $sessionTable = call_user_func(array($this->sessionClassName, 'getDatabaseTableName'));
+                                       
                                        // user is not a guest, delete all other sessions of this user
                                        $sql = "DELETE FROM     ".$sessionTable."
                                                WHERE           sessionID <> ?