Delete sessions after password change
authorjoshuaruesweg <ruesweg@woltlab.com>
Mon, 26 Oct 2020 10:05:35 +0000 (11:05 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Mon, 2 Nov 2020 11:22:41 +0000 (12:22 +0100)
Closes #3635
Closes #3641

wcfsetup/install/files/lib/data/user/UserAction.class.php

index e2de2fe17e1c142b26069002ddf8b877af203474..772e2b3e9af22d9fdece1467937fc195533e2b96 100644 (file)
@@ -20,6 +20,7 @@ use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
 use wcf\system\request\RequestHandler;
+use wcf\system\session\SessionHandler;
 use wcf\system\user\group\assignment\UserGroupAssignmentHandler;
 use wcf\system\WCF;
 use wcf\util\UserRegistrationUtil;
@@ -325,6 +326,13 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                                        }
                                }
                        }
+                       
+                       if (array_key_exists('password', $this->parameters['data'])) {
+                               foreach ($this->getObjects() as $object) {
+                                       SessionHandler::getInstance()->deleteUserSessionsExcept($object->getDecoratedObject(), SessionHandler::getInstance()->sessionID);
+                                       SessionHandler::getInstance()->deleteAcpSessionsExcept($object->getDecoratedObject(), SessionHandler::getInstance()->sessionID);
+                               }
+                       }
                }
                else {
                        if (empty($this->objects)) {