From: Alexander Ebert Date: Tue, 11 Oct 2011 17:59:27 +0000 (+0200) Subject: Fixed route usage X-Git-Tag: 2.0.0_Beta_1~1713 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=08d76680b841269493ff6e4e1543b6354ae48492;p=GitHub%2FWoltLab%2FWCF.git Fixed route usage --- diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index 28f0a71932..e6224abf1b 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -42,7 +42,7 @@ - index.php/PackageList + index.php/PackageList/ wcf.acp.menu.link.package.management admin.system.package.canUpdatePackage,admin.system.package.canUninstallPackage 1 diff --git a/wcfsetup/install/files/acp/templates/acpSessionLog.tpl b/wcfsetup/install/files/acp/templates/acpSessionLog.tpl index e73b3cb307..28d759edde 100644 --- a/wcfsetup/install/files/acp/templates/acpSessionLog.tpl +++ b/wcfsetup/install/files/acp/templates/acpSessionLog.tpl @@ -56,6 +56,6 @@ -{/if} +{/hascontent} {include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php b/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php index 989d61f12a..82b5d5ae71 100755 --- a/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/acp/form/OptionForm.class.php b/wcfsetup/install/files/lib/acp/form/OptionForm.class.php index 4cc31b2022..a6b56fd4bc 100644 --- a/wcfsetup/install/files/lib/acp/form/OptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/OptionForm.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php index 054d2bc8a3..ece5371c10 100755 --- a/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index 29359b3170..0d086b1383 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -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(); } } diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php index 7441214ef0..ee07b70666 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php index dfe10e4da4..efcd45e9d0 100755 --- a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php @@ -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; } diff --git a/wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php b/wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php index a2ad57d0bd..b533beca22 100755 --- a/wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php index d3dd9f8a85..2bc1b32424 100755 --- a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php @@ -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 + * @package com.woltlab.wcf + * @subpackage acp.page + * @category Community Framework + */ class PackageListPage extends AbstractPage { /** * list of applications diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index 1004d6f276..5c6a181bd9 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php b/wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php index 5283210001..855208c0e1 100644 --- a/wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php @@ -1,6 +1,7 @@ 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 )); } diff --git a/wcfsetup/install/files/lib/util/HeaderUtil.class.php b/wcfsetup/install/files/lib/util/HeaderUtil.class.php index 192296bc2c..984284ece8 100644 --- a/wcfsetup/install/files/lib/util/HeaderUtil.class.php +++ b/wcfsetup/install/files/lib/util/HeaderUtil.class.php @@ -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);