diff --git a/templates/loginform.php b/templates/loginform.php index 712d3addb48db233f0b4bdb7cf10cc5475db91a1..5ca87381d9ad200b6f48d5811ea901c83bbf954a 100644 --- a/templates/loginform.php +++ b/templates/loginform.php @@ -103,7 +103,9 @@ if ($this->data['errorCode'] !== NULL) } else { ?> - <label for="username"></label> + <label for="username" class="sr-only"> + <?php echo $this->t('{login:username}'); ?> + </label> <input type="text" id="username" tabindex="1" name="username" value="<?php echo htmlspecialchars($this->data['username'], ENT_QUOTES) ?>" placeholder="<?php echo htmlspecialchars($this->t('{login:username}'), ENT_QUOTES) ?>" @@ -146,13 +148,17 @@ if ($this->data['errorCode'] !== NULL) } ?> <!-- Pass and OTP fields --> - <label for="password"></label> + <label for="password" class="sr-only"> + <?php echo $this->t('{privacyidea:privacyidea:password}'); ?> + </label> <input id="password" name="password" tabindex="1" type="password" value="" class="text" placeholder="<?php echo htmlspecialchars($passHint, ENT_QUOTES) ?>"/> <strong id="message"><?php echo $this->data['message'] ?></strong> - <label for="otp"></label> + <label for="otp" class="sr-only"> + <?php echo $this->t('{privacyidea:privacyidea:otp}'); ?> + </label> <input id="otp" name="otp" tabindex="1" type="password" value="" class="text" placeholder="<?php echo htmlspecialchars($otpHint, ENT_QUOTES) ?>"/> <br> @@ -203,38 +209,35 @@ if ($this->data['errorCode'] !== NULL) { ?> <div class="identifier-shown"> - <?php echo htmlspecialchars($this->t('{login:organization}')); ?> - <label> - <select name="organization" tabindex="3"> + <label for="organization"><?php echo htmlspecialchars($this->t('{login:organization}')); ?></label> + <select id="organization" name="organization" tabindex="3"> + <?php + if (array_key_exists('selectedOrg', $this->data)) + { + $selectedOrg = $this->data['selectedOrg']; + } else + { + $selectedOrg = NULL; + } + + foreach ($this->data['organizations'] as $orgId => $orgDesc) + { + if (is_array($orgDesc)) + { + $orgDesc = $this->t($orgDesc); + } - <?php - if (array_key_exists('selectedOrg', $this->data)) + if ($orgId === $selectedOrg) { - $selectedOrg = $this->data['selectedOrg']; + $selected = 'selected="selected" '; } else { - $selectedOrg = NULL; + $selected = ''; } - foreach ($this->data['organizations'] as $orgId => $orgDesc) - { - if (is_array($orgDesc)) - { - $orgDesc = $this->t($orgDesc); - } - - if ($orgId === $selectedOrg) - { - $selected = 'selected="selected" '; - } else - { - $selected = ''; - } - - echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId, ENT_QUOTES) . '">' . htmlspecialchars($orgDesc) . '</option>'; - } ?> - </select> - </label> + echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId, ENT_QUOTES) . '">' . htmlspecialchars($orgDesc) . '</option>'; + } ?> + </select> </div> <?php } ?> </div> <!-- focused --> @@ -242,7 +245,7 @@ if ($this->data['errorCode'] !== NULL) </div> <!-- form-panel --> <div id="AlternateLoginOptions" class="groupMargin"> - <h3><label><?php echo $this->t('{privacyidea:privacyidea:alternate_login_options}'); ?></label></h3> + <h3><?php echo $this->t('{privacyidea:privacyidea:alternate_login_options}'); ?></h3> <!-- Alternate Login Options--> <input id="useWebAuthnButton" name="useWebAuthnButton" type="button" value="WebAuthn"/> <input id="usePushButton" name="usePushButton" type="button" value="Push"/> diff --git a/www/css/loginform.css b/www/css/loginform.css index 1efde344e2705ea3d59d0918c710d9073eda1a71..a05240ef63cdee5c3a27f33fe1eb383acf85b9d2 100644 --- a/www/css/loginform.css +++ b/www/css/loginform.css @@ -59,3 +59,17 @@ label[for=otp] { .hidden { display: none; } + +.sr-only { + border: 0 !important; + clip: rect(1px, 1px, 1px, 1px) !important; + -webkit-clip-path: inset(50%) !important; + clip-path: inset(50%) !important; + height: 1px !important; + margin: -1px !important; + overflow: hidden !important; + padding: 0 !important; + position: absolute !important; + width: 1px !important; + white-space: nowrap !important; +}