Skip to content
Snippets Groups Projects
Commit 7b6231ec authored by Oliver Hader's avatar Oliver Hader Committed by Susanne Moog
Browse files

Revert "[BUGFIX] Simulate submit button for rsaauth form submit"

This reverts commit 1bd63f45.

This change caused a regression which basically affected users of Mozilla
Firefox - details are described in issue #84503. Besides that the initial
bug report address the frontend part, changing backend login behavior was
not required in order for the bug fix.

Releases: master, 8.7, 7.6
Resolves: #84503
Reverts: #76120
Change-Id: I45fe6086afa48eed71be635e8cf4a1f3fa138ab2
Reviewed-on: https://review.typo3.org/56396


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: default avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: default avatarSusanne Moog <susanne.moog@typo3.org>
parent 8f13a59d
......@@ -107,12 +107,15 @@
}
// Submit the form again but now with encrypted values
for (var j = rsaEncryption.form.elements.length; j--;) {
var submitField = rsaEncryption.form.elements[j];
if ((['input', 'button'].indexOf(submitField.nodeName.toLowerCase()) > -1)
&& (['submit', 'image', 'button'].indexOf(submitField.type.toLowerCase()) > -1)
) {
submitField.click();
var form = document.createElement('form');
if (form.submit.call) {
form.submit.call(rsaEncryption.form);
} else {
for (var j = rsaEncryption.form.elements.length; j--;) {
var submitField = rsaEncryption.form.elements[j];
if (submitField.nodeName.toLowerCase() === 'input' && submitField.type === "submit") {
submitField.click();
}
}
}
};
......
......@@ -118,22 +118,12 @@ define(['jquery', './RsaLibrary'], function($) {
});
// Try to fetch the field which submitted the form
var $currentField = RsaEncryption.$currentForm.find('input[type=submit]:focus,input[type=image]:focus,button:focus');
var $currentField = RsaEncryption.$currentForm.find('input[type=submit]:focus,input[type=image]:focus');
if ($currentField.length === 1) {
$currentField.trigger('click');
} else {
// Create a hidden input field to fake pressing the submit button
var name = 'commandLI',
value = 'Submit';
var $submitField = RsaEncryption.$currentForm.find('input[type=submit],input[type=image],input[type=button],button[name][type=submit]').first();
if ($submitField.length === 1) {
name = $submitField.attr('name') || name;
value = $submitField.attr('value') || value ;
}
var $hiddenField = $('<input type="hidden">')
.attr('name', name)
.val(value);
RsaEncryption.$currentForm.append($hiddenField);
RsaEncryption.$currentForm.append('<input type="hidden" name="commandLI" value="Submit">');
// Restore the original submit handler
var originalOnSubmit = RsaEncryption.$currentForm.data('original-onsubmit');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment