Display a proper error message instead of just text when the user is not authorized

feature/node-rewrite
Sven Slootweg 12 years ago
parent 23c06fd694
commit f4d4008905

@ -27,8 +27,9 @@ event-years-ago; %1$d years ago
## Miscellaneous ## Miscellaneous
footer; CVM is a free and open source VPS control panel. <a href="http://cvm.cryto.net/">Want to contribute?</a> footer; CVM is a free and open source VPS control panel. <a href="http://cvm.cryto.net/">Want to contribute?</a>
title-unauthorized; Unauthorized
error-unauthorized-title; You are not authorized to view this page error-unauthorized-title; You are not authorized to view this page
error-unauthorized-text; Your access level is not sufficient. error-unauthorized-text; Your access level is not sufficient or you are not logged in.
error-notfound-title; VPS not found error-notfound-title; VPS not found
error-notfound-text; The VPS you selected was not found. error-notfound-text; The VPS you selected was not found.

@ -234,9 +234,12 @@ try
} }
catch (UnauthorizedException $e) catch (UnauthorizedException $e)
{ {
/* TODO: Create a proper template for this. */ $sPageTitle = $locale->strings['title-unauthorized'];
$sPageTitle = "Unauthorized";
$sMainContents = "You are not authorized to view this page."; $sMainContents = NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-unauthorized-title'],
'message' => $locale->strings['error-unauthorized-text']
));
} }
$sTemplateParameters = array_merge($sTemplateParameters, array( $sTemplateParameters = array_merge($sTemplateParameters, array(

Loading…
Cancel
Save