Forcing application ACP-Login unless no applications available
authorAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 15:07:18 +0000 (17:07 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 15:07:18 +0000 (17:07 +0200)
wcfsetup/install/files/lib/acp/form/LoginForm.class.php

index c6cf6321eced119943becf51b1ea0c119d6ff0f5..3be61ed022315b6841f31ebcfc38123bea5e44f8 100755 (executable)
@@ -5,6 +5,7 @@ use wcf\form\AbstractForm;
 use wcf\system\application\ApplicationHandler;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
+use wcf\system\request\RouteHandler;
 use wcf\system\user\authentication\EmailUserAuthentication;
 use wcf\system\user\authentication\UserAuthenticationFactory;
 use wcf\system\WCF;
@@ -53,6 +54,11 @@ class LoginForm extends AbstractForm {
                if (WCF::getUser()->userID) {
                        throw new PermissionDeniedException();
                }
+               else if (PACKAGE_ID == 1 && PACKAGE_ID != ApplicationHandler::getInstance()->getPrimaryApplication()->packageID) {
+                       $application = ApplicationHandler::getInstance()->getPrimaryApplication();
+                       HeaderUtil::redirect(RouteHandler::getProtocol() . $application->domainName . $application->domainPath . 'acp/index.php/Login/');
+                       exit;
+               }
                
                parent::__run();
        }