Fixed route usage
authorAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2011 17:59:27 +0000 (19:59 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2011 17:59:27 +0000 (19:59 +0200)
15 files changed:
com.woltlab.wcf/acpMenu.xml
wcfsetup/install/files/acp/templates/acpSessionLog.tpl
wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php
wcfsetup/install/files/lib/acp/form/OptionForm.class.php
wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php
wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php
wcfsetup/install/files/lib/acp/page/PackageListPage.class.php
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php
wcfsetup/install/files/lib/system/option/TextareaI18nOptionType.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/util/HeaderUtil.class.php

index 28f0a71932dc3f3058e554f1b4c306752decb2c7..e6224abf1b2e1eb4fc76780ff30135c2d4609eeb 100644 (file)
@@ -42,7 +42,7 @@
                </acpmenuitem>
                
                <acpmenuitem name="wcf.acp.menu.link.package.list">
-                       <link>index.php/PackageList</link>
+                       <link>index.php/PackageList/</link>
                        <parent>wcf.acp.menu.link.package.management</parent>
                        <permissions>admin.system.package.canUpdatePackage,admin.system.package.canUninstallPackage</permissions>
                        <showorder>1</showorder>
index e73b3cb307797464502f1dd170ced024d84cdbaa..28d759eddeefa61ce418fc78c3329bdc96311fc2 100644 (file)
@@ -56,6 +56,6 @@
        <div class="contentFooter">
                {@$pagesLinks}
        </div>
-{/if}
+{/hascontent}
 
 {include file='footer'}
index 989d61f12a3be6297cef9c392e7c4b166406fb2c..82b5d5ae71f43a4385c38c79309189d53d3b0e0f 100755 (executable)
@@ -44,7 +44,7 @@ class CronjobEditForm extends CronjobAddForm {
        public function readParameters() {
                parent::readParameters();
                
-               if (isset($_REQUEST['cronjobID'])) $this->cronjobID = intval($_REQUEST['cronjobID']);
+               if (isset($_REQUEST['id'])) $this->cronjobID = intval($_REQUEST['id']);
                $this->cronjob = new Cronjob($this->cronjobID);
                if (!$this->cronjob->cronjobID) {
                        throw new IllegalLinkException();
index 4cc31b202203ac5066cd51f9184b7ba36be501e3..a6b56fd4bc67fe29f84397967cf557c0752a1d66 100644 (file)
@@ -60,7 +60,7 @@ class OptionForm extends AbstractOptionListForm {
        public function readParameters() {
                parent::readParameters();
                
-               if (isset($_REQUEST['categoryID'])) $this->categoryID = intval($_REQUEST['categoryID']);
+               if (isset($_REQUEST['id'])) $this->categoryID = intval($_REQUEST['id']);
                $this->category = new OptionCategory($this->categoryID);
                if (!isset($this->category->categoryID)) {
                        throw new IllegalLinkException();
index 054d2bc8a304fd381cc8385327a2ace9fb3b4402..ece5371c10001832da2ed16b0d16a27c3c42a4e5 100755 (executable)
@@ -40,7 +40,7 @@ class UpdateServerEditForm extends UpdateServerAddForm {
        public function readParameters() {
                parent::readParameters();
                
-               if (isset($_REQUEST['packageUpdateServerID'])) $this->packageUpdateServerID = intval($_REQUEST['packageUpdateServerID']);
+               if (isset($_REQUEST['id'])) $this->packageUpdateServerID = intval($_REQUEST['id']);
                $this->updateServer = new PackageUpdateServer($this->packageUpdateServerID);
                if (!$this->updateServer->packageUpdateServerID) {
                        throw new IllegalLinkException();
index 29359b31702590e3df82a33334dde0f1854bf006..0d086b1383e20e5b0262a660df45a662d01392f1 100755 (executable)
@@ -49,17 +49,16 @@ class UserEditForm extends UserAddForm {
        public function readParameters() {
                parent::readParameters();
                
-               if (isset($_REQUEST['userID'])) {
-                       $this->userID = intval($_REQUEST['userID']);
-                       $user = new User($this->userID);
-                       if (!$user->userID) {
-                               throw new IllegalLinkException();
-                       }
-                       
-                       $this->user = new UserEditor($user);
-                       if (!UserGroup::isAccessibleGroup($this->user->getGroupIDs())) {
-                               throw new PermissionDeniedException();
-                       }
+               if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
+               
+               $user = new User($this->userID);
+               if (!$user->userID) {
+                       throw new IllegalLinkException();
+               }
+               
+               $this->user = new UserEditor($user);
+               if (!UserGroup::isAccessibleGroup($this->user->getGroupIDs())) {
+                       throw new PermissionDeniedException();
                }
        }
        
index 7441214ef012b0fc3e84004a54e31c2754c5a7ab..ee07b7066616af5209d4354b1cd09ea4c989ca18 100755 (executable)
@@ -50,7 +50,7 @@ class UserGroupEditForm extends UserGroupAddForm {
                parent::readParameters();
                
                // get group
-               if (isset($_REQUEST['groupID'])) $this->groupID = intval($_REQUEST['groupID']);
+               if (isset($_REQUEST['id'])) $this->groupID = intval($_REQUEST['id']);
                $group = new UserGroup($this->groupID);
                if (!$group->groupID) {
                        throw new IllegalLinkException();
index dfe10e4da4f53204f2df1d8e214544b9b4f918c8..efcd45e9d01e6edd6ac07af59bc327b5791d11b0 100755 (executable)
@@ -214,7 +214,7 @@ class UserSearchForm extends UserOptionListForm {
                $this->saved();
                
                // forward to result page
-               HeaderUtil::redirect('index.php/UserList/?searchID='.$this->searchID.'&sortField='.rawurlencode($this->sortField).'&sortOrder='.rawurlencode($this->sortOrder).''.SID_ARG_2ND_NOT_ENCODED);
+               HeaderUtil::redirect('index.php/UserList/'.$this->searchID.'/?sortField='.rawurlencode($this->sortField).'&sortOrder='.rawurlencode($this->sortOrder).''.SID_ARG_2ND_NOT_ENCODED);
                exit;
        }
        
index a2ad57d0bd3bb6edf38a10bfc9b59e04aa732131..b533beca22203d6975a211977c8c4dd298b14de4 100755 (executable)
@@ -61,7 +61,7 @@ class ACPSessionLogPage extends SortablePage {
                parent::readParameters();
                
                // get session log
-               if (isset($_REQUEST['sessionLogID'])) $this->sessionLogID = intval($_REQUEST['sessionLogID']);
+               if (isset($_REQUEST['id'])) $this->sessionLogID = intval($_REQUEST['id']);
                $this->sessionLog = new ACPSessionLog($this->sessionLogID);
                if (!$this->sessionLog->sessionLogID) {
                        throw new IllegalLinkException();
index d3dd9f8a8515aaf2615268649e3254c873db2fc7..2bc1b3242483322dc6abf0f3166561bf3f1c8216 100755 (executable)
@@ -6,6 +6,16 @@ use wcf\page\AbstractPage;
 use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
+/**
+ * Shows a list of installed packages and plugins.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2009 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage acp.page
+ * @category   Community Framework
+ */
 class PackageListPage extends AbstractPage {
        /**
         * list of applications
index 1004d6f276e9544291450683676447d8dc9261e3..5c6a181bd954b66742cbbab3af88879681f6e21f 100755 (executable)
@@ -74,8 +74,8 @@ class UserListPage extends SortablePage {
                
                $this->conditions = new PreparedStatementConditionBuilder();
                
-               if (!empty($_REQUEST['searchID'])) {
-                       $this->searchID = intval($_REQUEST['searchID']);
+               if (!empty($_REQUEST['id'])) {
+                       $this->searchID = intval($_REQUEST['id']);
                        if ($this->searchID) $this->readSearchResult();
                        if (!count($this->userIDs)) {
                                throw new IllegalLinkException();
index 5283210001575e3a6793810be5236f0092eed355..855208c0e130d912004f8bd4ea98748f1335c71d 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\option;
 use wcf\data\option\Option;
+use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
 
index b63366f03e7fbbc3c0a7f159511bd704d85bfd1d..e6808706b157f152ce8590c693aaa3eb59c958a2 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\option;
 use wcf\data\option\Option;
+use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
 
index 33c8f2412f45f391d0f246313bafc4acb755b02b..dd681ec471955f2d84511eab569efb25098aafec 100644 (file)
@@ -217,9 +217,18 @@ class PackageInstallationDispatcher {
                        $this->package = null;
                        
                        if ($package->standalone) {
+                               $domainPath = '';
+                               if (isset($_SERVER['PHP_SELF'])) {
+                                       $domainPath = $_SERVER['PHP_SELF'];
+                                       if (strpos($domainPath, '.php') !== false) {
+                                               $domainPath = preg_replace('~index\.php$~', '', $domainPath);
+                                       }
+                               }
+                               
                                // insert as application
                                ApplicationEditor::create(array(
-                                       'domainName' => '',
+                                       'domainName' => (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : '',
+                                       'domainPath' => $domainPath,
                                        'packageID' => $package->packageID
                                ));
                        }
index 192296bc2c5855fd97ecc9d18141fbe04ce6a35d..984284ece8be1125e46efec2e3bc9e08a8ce08b7 100644 (file)
@@ -87,7 +87,16 @@ class HeaderUtil {
         * @param       boolean         $sendStatusCode
         */
        public static function redirect($location, $prependDir = true, $sendStatusCode = false) {
-               if ($prependDir) $location = FileUtil::addTrailingSlash(FileUtil::unifyDirSeperator(dirname(WCF::getSession()->requestURI))) . $location;
+               if ($prependDir) {
+                       // remove path info from request URI
+                       $requestURI = WCF::getSession()->requestURI;
+                       if (($pos = strpos($requestURI, '.php')) !== false) {
+                               $requestURI = substr($requestURI, 0, ($pos + 4));
+                       }
+                       
+                       $location = FileUtil::addTrailingSlash(FileUtil::unifyDirSeperator(dirname($requestURI))) . $location;
+               }
+               
                //if ($sendStatusCode) @header('HTTP/1.0 301 Moved Permanently');
                if ($sendStatusCode) @header('HTTP/1.1 307 Temporary Redirect');
                header('Location: '.$location);