Some ACP session fixes
authorAlexander Ebert <ebert@woltlab.com>
Wed, 6 Apr 2016 15:43:39 +0000 (17:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 6 Apr 2016 15:43:39 +0000 (17:43 +0200)
There is still something clearly going wrong when completing the setup.

wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php
wcfsetup/install/files/options.inc.php

index eb2bed913dbdfee6586e2593ed3f81a38605b462..06127966c765ccc326bc3571e36803b46e005fe9 100644 (file)
@@ -1223,6 +1223,8 @@ class WCFSetup extends WCF {
                }
                
                // login as admin
+               define('COOKIE_PREFIX', 'wcf2_');
+               
                $factory = new ACPSessionFactory();
                $factory->load();
                
index c33ce248ce7b5589df9e31b19730ed22fe82f75c..dd1b22ba5e991bea465d93957faf774ab27c35f1 100644 (file)
@@ -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];
                }
                
index c841ca222c92c4d17d5ccab93b24e5d339584a0c..d4d68b4ebc0ae7feb6674d83d577f905d0588748 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  */
 define('LAST_UPDATE_TIME', TIME_NOW);
 
-define('COOKIE_PREFIX', 'wcf_');
+define('COOKIE_PREFIX', 'wcf2_');
 define('COOKIE_PATH', '');
 define('COOKIE_DOMAIN', '');