Fixed some legacy paths and ACP issues
authorAlexander Ebert <ebert@woltlab.com>
Sat, 14 Feb 2015 11:51:12 +0000 (12:51 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 14 Feb 2015 11:51:12 +0000 (12:51 +0100)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php
wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php

index 1c43b33bcb2df34339d2dbb43fba8cf0e84e0f31..f3e8b2ba65184920b8e6c2899f9978e2a3f8c718 100644 (file)
@@ -406,11 +406,21 @@ WCF.ACP.Package.Installation = Class.extend({
         * Initializes the WCF.Action.Proxy object.
         */
        _initProxy: function() {
+               var $actionName = '';
+               var $parts = this._actionName.split(/([A-Z][a-z0-9]+)/);
+               for (var $i = 0, $length = $parts.length; $i < $length; $i++) {
+                       var $part = $parts[$i];
+                       if ($part.length) {
+                               if ($actionName.length) $actionName += '-';
+                               $actionName += $part.toLowerCase();
+                       }
+               }
+               
                this._proxy = new WCF.Action.Proxy({
                        failure: $.proxy(this._failure, this),
                        showLoadingOverlay: false,
                        success: $.proxy(this._success, this),
-                       url: 'index.php/' + this._actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+                       url: 'index.php?' + $actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                });
        },
        
@@ -1788,7 +1798,7 @@ WCF.ACP.Worker = Class.extend({
                        },
                        showLoadingOverlay: false,
                        success: $.proxy(this._success, this),
-                       url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+                       url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                });
                this._title = title;
        },
@@ -2437,7 +2447,7 @@ WCF.ACP.Import.Manager = Class.extend({
                this._proxy = new WCF.Action.Proxy({
                        showLoadingOverlay: false,
                        success: $.proxy(this._success, this),
-                       url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+                       url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                });
                this._redirectURL = redirectURL;
                
@@ -2464,7 +2474,7 @@ WCF.ACP.Import.Manager = Class.extend({
                                        success: $.proxy(function() {
                                                window.location = this._redirectURL;
                                        }, this),
-                                       url: 'index.php/CacheClear/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+                                       url: 'index.php?cache-clear/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                                });
                        }, this)).appendTo($form);
                        
index 2b943c3bc16b738cd9e09738265a4ced5468ce87..3cd431d381a49a1fe93f2b5326efbd2fbe8e4b85 100755 (executable)
@@ -13,7 +13,7 @@ use wcf\util\StringUtil;
  * Handles an AJAX-based package installation.
  * 
  * @author     Alexander Ebert
- * @copyright  2001-2014 WoltLab GmbH
+ * @copyright  2001-2015 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage acp.action
@@ -119,7 +119,7 @@ class InstallPackageAction extends AbstractDialogAction {
                                $application = $statement->fetchObject('wcf\data\application\Application');
                                
                                // build redirect location
-                               $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED;
+                               $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED;
                                
                                WCF::resetZendOpcache();
                                
index e0b4958e05393a09cee10b3954e0a664272be950..b0010a1b3d20835cb9f488bef9fbf2935935ebc1 100644 (file)
@@ -136,7 +136,7 @@ class UninstallPackageAction extends InstallPackageAction {
                        $application = $statement->fetchObject('wcf\data\application\Application');
                        
                        // build redirect location
-                       $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED;
+                       $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED;
                        
                        // show success
                        $this->data = array(
index eb099df7e79df8df840cf155d71f0be8a6300dda..6681cfe50643215357dcd3fbedee09e994714961 100644 (file)
@@ -197,7 +197,7 @@ class RequestHandler extends SingletonFactory {
                        $controller = $routeData['controller'];
                        
                        // validate class name
-                       if (!preg_match('~^[a-z0-9' . (URL_LEGACY_MODE ? '' : '\-') . ']+$~i', $controller)) {
+                       if (!preg_match('~^[a-z0-9-]+$~i', $controller)) {
                                throw new SystemException("Illegal class name '".$controller."'");
                        }
                        
@@ -216,6 +216,7 @@ class RequestHandler extends SingletonFactory {
                        $this->activeRequest = new Request($classData['className'], $classData['controller'], $classData['pageType']);
                }
                catch (SystemException $e) {
+                       die("eek: " . $e->getMessage());
                        throw new IllegalLinkException();
                }
        }
@@ -322,7 +323,7 @@ class RequestHandler extends SingletonFactory {
        protected function lookupController($controller, $pageType, $application) {
                if (isset($this->controllers[$application]) && isset($this->controllers[$application][$pageType])) {
                        $ciController = mb_strtolower($controller);
-                       if (!URL_LEGACY_MODE) $ciController = str_replace('-', '', $ciController);
+                       if (!URL_LEGACY_MODE || $this->isACPRequest) $ciController = str_replace('-', '', $ciController);
                        
                        if (isset($this->controllers[$application][$pageType][$ciController])) {
                                return $this->controllers[$application][$pageType][$ciController];
index 5ad3a35bb6f3791d1158e797c8da8260ba2ff380..154aa8daa2572953d2f3a8beb35fc707424fc1ec 100644 (file)
@@ -89,13 +89,10 @@ class RouteHandler extends SingletonFactory {
         * Adds default routes.
         */
        protected function addDefaultRoutes() {
+               $acpRoute = new FlexibleRoute(true);
+               $this->addRoute($acpRoute);
+               
                if (URL_LEGACY_MODE) {
-                       $acpRoute = new Route('ACP_default', true);
-                       $acpRoute->setSchema('/{controller}/{id}');
-                       $acpRoute->setParameterOption('controller', 'Index', null, true);
-                       $acpRoute->setParameterOption('id', null, '\d+', true);
-                       $this->addRoute($acpRoute);
-                       
                        $defaultRoute = new Route('default');
                        $defaultRoute->setSchema('/{controller}/{id}');
                        $defaultRoute->setParameterOption('controller', null, null, true);
@@ -103,9 +100,6 @@ class RouteHandler extends SingletonFactory {
                        $this->addRoute($defaultRoute);
                }
                else {
-                       $acpRoute = new FlexibleRoute(true);
-                       $this->addRoute($acpRoute);
-                       
                        $defaultRoute = new FlexibleRoute(false);
                        $this->addRoute($defaultRoute);
                }