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
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-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-text; The VPS you selected was not found.

@ -234,9 +234,12 @@ try
}
catch (UnauthorizedException $e)
{
/* TODO: Create a proper template for this. */
$sPageTitle = "Unauthorized";
$sMainContents = "You are not authorized to view this page.";
$sPageTitle = $locale->strings['title-unauthorized'];
$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(

Loading…
Cancel
Save