[BUGFIX] Include RSA JS files in HTML header 81/29581/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 20 Apr 2014 10:25:26 +0000 (12:25 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 22 Apr 2014 15:45:08 +0000 (17:45 +0200)
Due to an oddity in page renderer, we cannot
add the required JavaScript to the footer
as it would not be rendered.

Clean up the JavaScript to correctly work even
when included in the header and change the hook
to add the JS files to the header.

Resolves: #58010
Related: #57294
Releases: 6.2
Change-Id: I354de3b0aeaf2b163b5df5301de6f0a0aaae34a6
Reviewed-on: https://review.typo3.org/29581
Reviewed-by: Oliver Klee
Tested-by: Dirk Klimpel
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/rsaauth/Classes/Hook/LoginFormHook.php
typo3/sysext/rsaauth/resources/BackendLoginFormRsaEncryption.js

index ed261e5..9b29a54 100644 (file)
@@ -55,7 +55,7 @@ class LoginFormHook {
                                'BackendLoginFormRsaEncryption.js'
                        );
                        foreach ($files as $file) {
-                               $pageRenderer->addJsFooterFile($javascriptPath . $file);
+                               $pageRenderer->addJsFile($javascriptPath . $file);
                        }
 
                        return '<form action="index.php" id="typo3-login-form" method="post" name="loginform">';
index 7d47588..456da95 100644 (file)
@@ -6,17 +6,19 @@ TYPO3RsaBackendLogin = {
        /**
         * Field in which users enter their password
         */
-       userPasswordField: document.loginform.p_field,
+       userPasswordField: '',
 
        /**
         * Field that is used by TYPO3 to evaluate the password during login process
         */
-       typo3PasswordField: document.loginform.userident,
+       typo3PasswordField: '',
 
        /**
         * Replace event handler of submit button
         */
        initialize: function() {
+               this.userPasswordField = document.loginform.p_field;
+               this.typo3PasswordField = document.loginform.userident;
                var submitButton = $('t3-login-submit');
                Event.stopObserving(
                        submitButton,