Merge SessionHandler::getSessions() and ::getUserSessions()
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 22 Apr 2021 13:47:12 +0000 (15:47 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 22 Apr 2021 13:49:29 +0000 (15:49 +0200)
The split is obsolete give the removal of ACP sessions.

see 3dcc6f0cbe6a2b20c10290c1ec46ba6ab8bdafe3

wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index e0883c8a14de4bd7475da05def9d22a23212e974..0452c34871847288c8bff116bc7384004b228491 100644 (file)
@@ -1394,18 +1394,6 @@ final class SessionHandler extends SingletonFactory
         return $this->firstVisit;
     }
 
-    /**
-     * Returns all user sessions for a specific user.
-     *
-     * @return      Session[]
-     * @throws      \InvalidArgumentException if the given user is a guest.
-     * @since       5.4
-     */
-    public function getUserSessions(User $user): array
-    {
-        return $this->getSessions($user, false);
-    }
-
     /**
      * Returns all sessions for a specific user.
      *
@@ -1413,7 +1401,7 @@ final class SessionHandler extends SingletonFactory
      * @throws      \InvalidArgumentException if the given user is a guest.
      * @since       5.4
      */
-    private function getSessions(User $user): array
+    public function getUserSessions(User $user): array
     {
         if (!$user->userID) {
             throw new \InvalidArgumentException("The given user is a guest.");
@@ -1434,7 +1422,7 @@ final class SessionHandler extends SingletonFactory
     }
 
     /**
-     * Deletes the user sessions for a specific user, except the session with the given session id.
+     * Deletes the sessions for a specific user, except the session with the given session id.
      *
      * If the given session id is `null` or unknown, all sessions of the user will be deleted.
      *
@@ -1467,7 +1455,7 @@ final class SessionHandler extends SingletonFactory
     }
 
     /**
-     * Deletes a user session with the given session ID.
+     * Deletes a session with the given session ID.
      *
      * @since       5.4
      */