Fixed route handling for ACP auth
authorAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2011 19:34:50 +0000 (21:34 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2011 19:34:50 +0000 (21:34 +0200)
wcfsetup/install/files/lib/system/WCFACP.class.php

index 155944c8722c9cd37899c53eb30cfc3b2e46fdac..938b2d627b122dde8a86ede8e22fd3bd3636d2f7 100644 (file)
@@ -45,10 +45,10 @@ class WCFACP extends WCF {
         * Does the user authentication.
         */
        protected function initAuth() {
-               /**
-                * @todo        FIX THIS!
-                */
-               if ((!isset($_REQUEST['page']) || ($_REQUEST['page'] != 'Logout' && $_REQUEST['page'] != 'ACPCaptcha')) && (isset($_REQUEST['page']) || !isset($_REQUEST['form']) || $_REQUEST['form'] != 'Login')) {
+               // this is a work-around since neither RequestHandler
+               // nor RouteHandler are populated right now
+               $pathInfo = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : '';
+               if (empty($pathInfo) || !preg_match('~^/(ACPCaptcha|Login)/~', $pathInfo)) {
                        if (WCF::getUser()->userID == 0) {
                                util\HeaderUtil::redirect('index.php/Login/'.SID_ARG_1ST);
                                exit;