From: Alexander Ebert Date: Wed, 6 Apr 2016 15:43:39 +0000 (+0200) Subject: Some ACP session fixes X-Git-Tag: 3.0.0_Beta_1~1964 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2114900f934c659c3553b75c32d106785e8587f3;p=GitHub%2FWoltLab%2FWCF.git Some ACP session fixes There is still something clearly going wrong when completing the setup. --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index eb2bed913d..06127966c7 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -1223,6 +1223,8 @@ class WCFSetup extends WCF { } // login as admin + define('COOKIE_PREFIX', 'wcf2_'); + $factory = new ACPSessionFactory(); $factory->load(); diff --git a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php index c33ce248ce..dd1b22ba5e 100644 --- a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php +++ b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php @@ -5,6 +5,7 @@ use wcf\data\application\ApplicationAction; use wcf\data\application\ApplicationList; use wcf\system\cache\builder\ApplicationCacheBuilder; use wcf\system\Regex; +use wcf\system\request\RouteHandler; use wcf\system\SingletonFactory; /** @@ -89,7 +90,17 @@ class ApplicationHandler extends SingletonFactory { */ public function getActiveApplication() { // work-around during WCFSetup - if (isset($this->cache['application'][PACKAGE_ID])) { + if (!PACKAGE_ID) { + $host = str_replace(RouteHandler::getProtocol(), '', RouteHandler::getHost()); + + return new Application(null, [ + 'domainName' => $host, + 'domainPath' => RouteHandler::getPath(), + 'cookieDomain' => $host, + 'cookiePath' => RouteHandler::getPath(['acp']) + ]); + } + else if (isset($this->cache['application'][PACKAGE_ID])) { return $this->cache['application'][PACKAGE_ID]; } diff --git a/wcfsetup/install/files/options.inc.php b/wcfsetup/install/files/options.inc.php index c841ca222c..d4d68b4ebc 100644 --- a/wcfsetup/install/files/options.inc.php +++ b/wcfsetup/install/files/options.inc.php @@ -3,12 +3,12 @@ * Default options.inc.php for package installation of package com.woltlab.wcf. * * @author Marcel Werk - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License */ define('LAST_UPDATE_TIME', TIME_NOW); -define('COOKIE_PREFIX', 'wcf_'); +define('COOKIE_PREFIX', 'wcf2_'); define('COOKIE_PATH', ''); define('COOKIE_DOMAIN', '');