Merge branch 'next' into next-lantia
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 3 Dec 2015 14:36:32 +0000 (15:36 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 3 Dec 2015 14:36:32 +0000 (15:36 +0100)
1  2 
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

Simple merge
index 7256ed8b5eb06c39a86137295139035db49227a9,cdd73edf095e5aef5e6ec0f78ba8719606996372..e1cfe6af6fa893cd3fe2c816b90b1d0343d13580
@@@ -1,8 -1,10 +1,9 @@@
  <?php
  namespace wcf\system\request;
  use wcf\system\application\ApplicationHandler;
 -use wcf\system\cache\builder\ControllerCacheBuilder;
  use wcf\system\exception\AJAXException;
  use wcf\system\exception\IllegalLinkException;
+ use wcf\system\exception\NamedUserException;
  use wcf\system\exception\SystemException;
  use wcf\system\menu\page\PageMenu;
  use wcf\system\SingletonFactory;
@@@ -70,49 -98,52 +71,55 @@@ class RequestHandler extends SingletonF
        
        /**
         * Handles a http request.
 -       * 
 +       *
         * @param       string          $application
         * @param       boolean         $isACPRequest
 +       * @throws      AJAXException
 +       * @throws      IllegalLinkException
 +       * @throws      SystemException
         */
        public function handle($application = 'wcf', $isACPRequest = false) {
-               $this->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();
        }
        
        /**
Simple merge
Simple merge