forked from Public/pics
Allow resetting password through email.
This also adopts the use of an Alert template for error and success messages.
This commit is contained in:
@@ -21,6 +21,7 @@ class Dispatcher
|
||||
'managetags' => 'ManageTags',
|
||||
'manageusers' => 'ManageUsers',
|
||||
'people' => 'ViewPeople',
|
||||
'resetpassword' => 'ResetPassword',
|
||||
'suggest' => 'ProvideAutoSuggest',
|
||||
'timeline' => 'ViewTimeline',
|
||||
'uploadmedia' => 'UploadMedia',
|
||||
@@ -77,6 +78,11 @@ class Dispatcher
|
||||
else
|
||||
self::trigger403();
|
||||
}
|
||||
catch (UserFacingException $e)
|
||||
{
|
||||
$debug_info = ErrorHandler::getDebugInfo($e->getTrace());
|
||||
ErrorHandler::display($e->getMessage(), $debug_info, false);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
ErrorHandler::handleError(E_USER_ERROR, 'Unspecified exception: ' . $e->getMessage(), $e->getFile(), $e->getLine());
|
||||
@@ -93,7 +99,7 @@ class Dispatcher
|
||||
public static function kickGuest()
|
||||
{
|
||||
$form = new LogInForm('Log in');
|
||||
$form->setErrorMessage('Admin access required. Please log in.');
|
||||
$form->adopt(new Alert('', 'You need to be logged in to view this page.', 'error'));
|
||||
$form->setRedirectUrl($_SERVER['REQUEST_URI']);
|
||||
|
||||
$page = new MainTemplate('Login required');
|
||||
|
||||
Reference in New Issue
Block a user