Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22205: Underline inline link in CSRF confirmation Panel #3200

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,13 @@ XWiki.SearchSuggestSourceClass_activated=Activated
XWiki.SearchSuggestSourceClass_activated.hint=Whether this source is used or not (as long as the source search engine matches the search engine used by the current wiki).

### CSRFToken resources
csrf.confirmation=<p>This request contains an invalid authentication information.</p><p>This might happen in the following situations:</p><ul><li>You left the editor open in another window/tab and logged off and on again</li><li>Your authentication token expired after a long period of inactivity</li><li>Somebody tried to perform a CSRF attack</li></ul><p>If you are sure that none of these situations apply in your case, you might have found a bug. We are sorry about that, please report it on <a href="http://jira.xwiki.org/">XWiki JIRA</a></p><p>Do you want to resend the request? If unsure, say <strong>No</strong>.</p>
csrf.confirmation.status=This request contains an invalid authentication information.
csrf.confirmation.possibleReasons.description=This might happen in the following situations:
csrf.confirmation.possibleReasons.firstReason=You left the editor open in another window/tab and logged off and on again
csrf.confirmation.possibleReasons.secondReason=Your authentication token expired after a long period of inactivity
csrf.confirmation.possibleReasons.thirdReason=Somebody tried to perform a CSRF attack
csrf.confirmation.unsure=If you are sure that none of these situations apply in your case, you might have found a bug. We are sorry about that, please report it on {0}XWiki JIRA{1}.
csrf.confirmation.question=Do you want to resend the request? If unsure, say {0}No{1}.

### Extension Manager application resources
admin.extensions=Extension Manager
Expand Down Expand Up @@ -5665,6 +5671,7 @@ platform.index.spaceIndexDocumentListCreate=Create a new page
#######################################
## until 16.10.0RC1
#######################################
csrf.confirmation=<p>This request contains an invalid authentication information.</p><p>This might happen in the following situations:</p><ul><li>You left the editor open in another window/tab and logged off and on again</li><li>Your authentication token expired after a long period of inactivity</li><li>Somebody tried to perform a CSRF attack</li></ul><p>If you are sure that none of these situations apply in your case, you might have found a bug. We are sorry about that, please report it on <a href="http://jira.xwiki.org/">XWiki JIRA</a></p><p>Do you want to resend the request? If unsure, say <strong>No</strong>.</p>
core.register.successful={0} ({1}): Registration successful.

## Used to indicate where deprecated keys end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,28 @@ $response.addHeader( "X-FRAME-OPTIONS", "DENY" )
<div class="main layoutsubsection">
## Set as an HTML main for better DOM tree semantics to facilitate navigation with assistive technologies.
<main id="mainContentArea">
#xwikimessageboxstart($services.localization.render('warning') $services.localization.render('csrf.confirmation'))
#define ($messageBoxContent)
<p>
$services.localization.render('csrf.confirmation.status')
</p>
<p>
$services.localization.render('csrf.confirmation.possibleReasons.description')
</p>
<ul><li>
$services.localization.render('csrf.confirmation.possibleReasons.firstReason')
</li><li>
$services.localization.render('csrf.confirmation.possibleReasons.secondReason')
</li><li>
$services.localization.render('csrf.confirmation.possibleReasons.thirdReason')
</li></ul>
<p class="force-underline">
$services.localization.render('csrf.confirmation.unsure', ["<a href='http://jira.xwiki.org/'>", "</a>"])
</p>
<p>
$services.localization.render('csrf.confirmation.question', ["<strong>", "</strong>"])
</p>
#end
#xwikimessageboxstart($services.localization.render('warning') $messageBoxContent)
#getSanitizedURLAttributeValue('form','action', $request.getParameter('resubmit'), '', $resubmit)
#getSanitizedURLAttributeValue('a','href', $request.getParameter('xback'), $doc.getURL(), $xback)
<form action="$resubmit" method="post">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,15 @@ var XWiki = (function(XWiki) {
var buttonsDiv = new Element('div');

// the confirmation message contains some double quotes that should be escaped.
content.insert("$escapetool.json($services.localization.render('csrf.confirmation'))");
content.insert("<p>$services.localization.render('csrf.confirmation.status')</p>" +
"<p>$services.localization.render('csrf.confirmation.possibleReasons.description')</p>" +
"<ul><li>$services.localization.render('csrf.confirmation.possibleReasons.firstReason')</li>" +
"<li>$services.localization.render('csrf.confirmation.possibleReasons.secondReason')</li>" +
"<li>$services.localization.render('csrf.confirmation.possibleReasons.thirdReason')</li></ul>" +
"<p class='force-underline'>" +
"$services.localization.render('csrf.confirmation.unsure', ["<a href='http://jira.xwiki.org/'>", "</a>"])" +
"</p>" +
"<p>$services.localization.render('csrf.confirmation.question', ['<strong>', '</strong>'])</p>");
content.insert(new Element('br'));
var buttonCreate = new Element('button', {'class': 'btn btn-default', 'id': 'force-save-csrf'});
buttonCreate.insert("$services.localization.render('yes')");
Expand Down
Loading