Skip to content
Snippets Groups Projects
Commit 9a8dea57 authored by André Noack's avatar André Noack
Browse files

Resolve #3605 "Barriere in der Nutzung des Login-Formulars"

Closes #3605

Merge request !2531
parent f08b2109
Branches
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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';
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment