From: Tim Düsterhus Date: Thu, 3 Dec 2015 14:36:32 +0000 (+0100) Subject: Merge branch 'next' into next-lantia X-Git-Tag: 3.0.0_Beta_1~2030^2~212^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=655ba5fa395d47b489e55b47775aea6942a09a47;p=GitHub%2FWoltLab%2FWCF.git Merge branch 'next' into next-lantia --- 655ba5fa395d47b489e55b47775aea6942a09a47 diff --cc wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 7256ed8b5e,cdd73edf09..e1cfe6af6f --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@@ -1,8 -1,10 +1,9 @@@ isACPRequest = $isACPRequest; - - if (!RouteHandler::getInstance()->matches()) { - if (ENABLE_DEBUG_MODE) { - throw new SystemException("Cannot handle request, no valid route provided."); - } - else { - throw new IllegalLinkException(); - } - } - - // build request - $this->buildRequest($application); - - // handle offline mode - if (!$isACPRequest && defined('OFFLINE') && OFFLINE) { - if (!WCF::getSession()->getPermission('admin.general.canViewPageDuringOfflineMode') && !$this->activeRequest->isAvailableDuringOfflineMode()) { - if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) { - throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS); + try { + $this->isACPRequest = $isACPRequest; + + if (!RouteHandler::getInstance()->matches()) { + if (ENABLE_DEBUG_MODE) { + throw new SystemException("Cannot handle request, no valid route provided."); } else { - @header('HTTP/1.1 503 Service Unavailable'); - WCF::getTPL()->assign(array( - 'templateName' => 'offline', - 'templateNameApplication' => 'wcf' - )); - WCF::getTPL()->display('offline'); + throw new IllegalLinkException(); + } + } + + // build request + $this->buildRequest($application); + + // handle offline mode + if (!$isACPRequest && defined('OFFLINE') && OFFLINE) { + if (!WCF::getSession()->getPermission('admin.general.canViewPageDuringOfflineMode') && !$this->activeRequest->isAvailableDuringOfflineMode()) { + if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) { + throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS); + } + else { + @header('HTTP/1.1 503 Service Unavailable'); + WCF::getTPL()->assign(array( + 'templateName' => 'offline', + 'templateNameApplication' => 'wcf' + )); + WCF::getTPL()->display('offline'); + } + + exit; } - - exit; } + + // start request + $this->activeRequest->execute(); + } + catch (NamedUserException $e) { + $e->show(); + exit; } - - // start request - $this->activeRequest->execute(); } /**