Add explanatory text to AuthorizeException generated by feedback page permission failure (trivial change)

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4455 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Larry Stone
2009-10-16 20:56:44 +00:00
parent cb102d4e62
commit 514c1efcdc
2 changed files with 6 additions and 3 deletions

View File

@@ -50,6 +50,8 @@ browse.sort-by.dateaccessioned = submit date
browse.order.asc = Ascending
browse.order.desc = Descending
feedback.error.forbidden = The feedback mail page may only be invoked from another DSpace page
help.collection-admin = /help/collection-admin.html
help.index = /help/index.html
help.site-admin = /help/site-admin.html

View File

@@ -97,14 +97,14 @@ public class SendFeedbackAction extends AbstractAction
if(fromPage.indexOf(allowedReferrersSplit[i]) != -1)
{
validReferral = true;
break;
break;
}
}
}
String basicHost = "";
if (host.equals("localhost") || host.equals("127.0.0.1")
|| host.equals(InetAddress.getLocalHost().getHostAddress()))
|| host.equals(InetAddress.getLocalHost().getHostAddress()))
basicHost = host;
else
{
@@ -116,7 +116,8 @@ public class SendFeedbackAction extends AbstractAction
if ((fromPage == null) || ((fromPage.indexOf(basicHost) == -1) && (validReferral == false)))
{
throw new AuthorizeException();
// N.B. must use old message catalog because Cocoon i18n is only available to transformed pages.
throw new AuthorizeException(I18nUtil.getMessage("feedback.error.forbidden"));
}
// User email from context