From: Marcel Werk Date: Wed, 16 Nov 2011 14:45:28 +0000 (+0100) Subject: Added HeaderUtil::delayedRedirect() method X-Git-Tag: 2.0.0_Beta_1~1594 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=738e1028c61645be050a93083474d88c426e657c;p=GitHub%2FWoltLab%2FWCF.git Added HeaderUtil::delayedRedirect() method --- diff --git a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php index e8834aecd9..5215806885 100755 --- a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php @@ -95,12 +95,13 @@ class LoginForm extends AbstractForm { $this->user = EmailUserAuthentication::getInstance()->loginManually($this->username, $this->password); } catch (UserInputException $e2) { - if ($e->getField() == 'username') throw $e; + if ($e2->getField() == 'username') throw $e; throw $e2; } } - - throw $e; + else { + throw $e; + } } else { throw $e; diff --git a/wcfsetup/install/files/lib/util/HeaderUtil.class.php b/wcfsetup/install/files/lib/util/HeaderUtil.class.php index 984284ece8..c29bf4c250 100644 --- a/wcfsetup/install/files/lib/util/HeaderUtil.class.php +++ b/wcfsetup/install/files/lib/util/HeaderUtil.class.php @@ -101,4 +101,21 @@ class HeaderUtil { if ($sendStatusCode) @header('HTTP/1.1 307 Temporary Redirect'); header('Location: '.$location); } + + /** + * Does a delayed redirect. + * + * @param string $location + * @param string $message + * @param integer $delay + */ + public static function delayedRedirect($location, $message, $delay = 5) { + WCF::getTPL()->assign(array( + 'url' => $location, + 'message' => $message, + 'wait' => $delay, + 'templateName' => 'redirect' + )); + WCF::getTPL()->display('redirect'); + } }