diff --git a/db/migrations/5.5.16_add_tooltip_fields_for_login.php b/db/migrations/5.5.16_add_tooltip_fields_for_login.php index f4d536b41da6e551c7a9ece6d15bba8d655a9818..a375b3ffcf82145e00361e8b8e9a02df32eff148 100644 --- a/db/migrations/5.5.16_add_tooltip_fields_for_login.php +++ b/db/migrations/5.5.16_add_tooltip_fields_for_login.php @@ -15,7 +15,7 @@ class AddTooltipFieldsForLogin extends Migration $statement = DBManager::get()->prepare($query); $statement->execute([ 'name' => 'USERNAME_TOOLTIP_TEXT', - 'value' => 'Geben Sie hier Ihren Stud.IP-Benutzernamen ein.', + 'value' => '', 'type' => 'i18n', 'section' => 'Loginseite', 'range' => 'global', @@ -24,31 +24,13 @@ class AddTooltipFieldsForLogin extends Migration $statement->execute([ 'name' => 'PASSWORD_TOOLTIP_TEXT', - 'value' => 'Geben Sie hier Ihr Stud.IP-Passwort ein. Achten Sie bei der Eingabe auf Groß- und Kleinschreibung.', + 'value' => '', 'type' => 'i18n', 'section' => 'Loginseite', 'range' => 'global', 'description' => 'Text für den Tooltip des Benutzernamens auf der Loginseite' ]); - $statement->execute([ - 'name' => 'USERNAME_TOOLTIP_ACTIVATED', - 'value' => '1', - 'type' => 'boolean', - 'section' => 'Loginseite', - 'range' => 'global', - 'description' => 'Soll der Tooltip beim Benutzernamen auf der Loginseite sichtbar sein?' - ]); - - $statement->execute([ - 'name' => 'PASSWORD_TOOLTIP_ACTIVATED', - 'value' => '1', - 'type' => 'boolean', - 'section' => 'Loginseite', - 'range' => 'global', - 'description' => 'Soll der Tooltip beim Passwort auf der Loginseite sichtbar sein?' - ]); - } public function down() @@ -62,9 +44,7 @@ class AddTooltipFieldsForLogin extends Migration AND `object_id` = MD5(`config`.`field`) WHERE `field` IN ( 'USERNAME_TOOLTIP_TEXT', - 'PASSWORD_TOOLTIP_TEXT', - 'USERNAME_TOOLTIP_ACTIVATED', - 'PASSWORD_TOOLTIP_ACTIVATED' + 'PASSWORD_TOOLTIP_TEXT' )"; DBManager::get()->exec($query); } diff --git a/db/migrations/5.5.18_add_login_faq_config.php b/db/migrations/5.5.18_add_login_faq_config.php index 3196e34e6a43d71441d964b81726b6a8ce6c4bc4..fd2a658c0e57c9d42ac7e052b09aa9816fd8ecc2 100644 --- a/db/migrations/5.5.18_add_login_faq_config.php +++ b/db/migrations/5.5.18_add_login_faq_config.php @@ -44,9 +44,7 @@ class AddLoginFaqConfig extends Migration AND `object_id` = MD5(`config`.`field`) WHERE `field` IN ( 'LOGIN_FAQ_TITLE', - 'LOGIN_FAQ_VISIBILITY', - 'USERNAME_TOOLTIP_ACTIVATED', - 'PASSWORD_TOOLTIP_ACTIVATED' + 'LOGIN_FAQ_VISIBILITY' )"; DBManager::get()->exec($query); } diff --git a/resources/assets/javascripts/bootstrap/application.js b/resources/assets/javascripts/bootstrap/application.js index 830f2c025f2a588513c6ae9a48da7d0c3c9bbdef..c831261868732305bb44686faa815987384bdc56 100644 --- a/resources/assets/javascripts/bootstrap/application.js +++ b/resources/assets/javascripts/bootstrap/application.js @@ -370,7 +370,7 @@ STUDIP.domReady(function () { [usernameInput, passwordInput].forEach((input) => { input.addEventListener('keydown', (event) => { - if (event.getModifierState('CapsLock')) { + if (typeof event.getModifierState === 'function' && event.getModifierState('CapsLock')) { passwordCapsText.style.display = 'block'; } else { passwordCapsText.style.display = 'none'; diff --git a/templates/_standard_loginform.php b/templates/_standard_loginform.php index 0a8be593313c208aac6d9b5e349df3acd982617d..a300cb608e0c1123f05f8c514027c885bfed5e24 100644 --- a/templates/_standard_loginform.php +++ b/templates/_standard_loginform.php @@ -6,6 +6,8 @@ use Studip\Button; * @var bool $hidden * @var string $uname; */ +$username_tooltip_text = (string)Config::get()->USERNAME_TOOLTIP_TEXT; +$password_tooltip_text = (string)Config::get()->PASSWORD_TOOLTIP_TEXT; ?> <form class="default <?= $hidden ? 'hide' : '' ?>" @@ -18,8 +20,8 @@ use Studip\Button; <section> <label> <span class="required"><?= _('Benutzername') ?></span> - <? if (Config::get()->USERNAME_TOOLTIP_ACTIVATED) : ?> - <?= tooltipIcon(htmlReady((string)Config::get()->USERNAME_TOOLTIP_TEXT)) ?> + <? if ($username_tooltip_text) : ?> + <?= tooltipIcon($username_tooltip_text) ?> <? endif ?> <input type="text" <?= (mb_strlen($uname) || $hidden) ? '' : 'autofocus' ?> id="loginname" @@ -28,17 +30,18 @@ use Studip\Button; size="20" spellcheck="false" autocapitalize="off" - title="<?= _('Der Benutzername entspricht nicht den Anforderungen') ?>" + autocomplete="username" required> </label> <label for="password" style="position: relative"> <span class="required"><?= _('Passwort') ?></span> - <? if (Config::get()->PASSWORD_TOOLTIP_ACTIVATED) : ?> - <?= tooltipIcon(htmlReady((string)Config::get()->PASSWORD_TOOLTIP_TEXT)) ?> + <? if ($password_tooltip_text) : ?> + <?= tooltipIcon($password_tooltip_text) ?> <? endif ?> <input type="password" <?= mb_strlen($uname) && !$hidden ? 'autofocus' : '' ?> id="password" name="password" + autocomplete="current-password" size="20" required>