Remove the previous controllers
authorAlexander Ebert <ebert@woltlab.com>
Tue, 19 Mar 2024 15:29:45 +0000 (16:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 19 Mar 2024 15:29:45 +0000 (16:29 +0100)
Those are considered to be internal controllers and `DeleteSessionAction` behaves differently. Since the only consumers are internal components, it is safer to remove them than to risk them becoming out of sync

wcfsetup/install/files/lib/action/DeleteSessionAction.class.php [deleted file]
wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php [deleted file]

diff --git a/wcfsetup/install/files/lib/action/DeleteSessionAction.class.php b/wcfsetup/install/files/lib/action/DeleteSessionAction.class.php
deleted file mode 100644 (file)
index 4ad4ae1..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-namespace wcf\action;
-
-use Laminas\Diactoros\Response\JsonResponse;
-use wcf\system\exception\AJAXException;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\session\SessionHandler;
-use wcf\system\WCF;
-use wcf\util\StringUtil;
-
-/**
- * Deletes a specific user session.
- *
- * @author  Joshua Ruesweg
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @deprecated 6.1
- */
-final class DeleteSessionAction extends AbstractSecureAction
-{
-    use TAJAXException;
-
-    /**
-     * @inheritDoc
-     */
-    public $loginRequired = true;
-
-    /**
-     * @var string
-     */
-    private $sessionID;
-
-    /**
-     * @inheritDoc
-     */
-    public function __run()
-    {
-        try {
-            return parent::__run();
-        } catch (\Throwable $e) {
-            if ($e instanceof AJAXException) {
-                throw $e;
-            } else {
-                $this->throwException($e);
-            }
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function readParameters()
-    {
-        parent::readParameters();
-
-        if (isset($_POST['sessionID'])) {
-            $this->sessionID = StringUtil::trim($_POST['sessionID']);
-        }
-
-        if (empty($this->sessionID)) {
-            throw new IllegalLinkException();
-        }
-
-        $found = false;
-        foreach (SessionHandler::getInstance()->getUserSessions(WCF::getUser()) as $session) {
-            if ($session->getSessionID() === $this->sessionID) {
-                $found = true;
-                break;
-            }
-        }
-
-        if (!$found) {
-            throw new IllegalLinkException();
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function execute()
-    {
-        parent::execute();
-
-        SessionHandler::getInstance()->deleteUserSession($this->sessionID);
-
-        $this->executed();
-
-        return new JsonResponse([
-            'sessionID' => $this->sessionID,
-        ]);
-    }
-}
diff --git a/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php b/wcfsetup/install/files/lib/action/EditorGetMentionSuggestionsAction.class.php
deleted file mode 100644 (file)
index 11f97c3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-namespace wcf\action;
-
-use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\ServerRequestInterface;
-use Psr\Http\Server\RequestHandlerInterface;
-use wcf\system\endpoint\controller\core\messages\GetMentionSuggestions;
-
-/**
- * Suggests users that may be mentioned.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2023 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @since   6.0
- * @deprecated 6.1
- */
-final class EditorGetMentionSuggestionsAction implements RequestHandlerInterface
-{
-    public function handle(ServerRequestInterface $request): ResponseInterface
-    {
-        $controller = new GetMentionSuggestions();
-
-        return $controller($request, []);
-    }
-}