Skip to content
Snippets Groups Projects
Commit f78f2a5e authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Set autocomplete=username attribute on username field.

In the modern template also clean up HTML a bit.
parent 5cf5cd84
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ if ($this->data['errorcode'] !== null) {
<td><label for="username"><?php echo $this->t('{login:username}'); ?></label></td>
<td>
<input id="username" <?php echo ($this->data['forceUsername']) ? 'disabled="disabled"' : ''; ?>
type="text" name="username"<?php echo $this->data['forceUsername'] ? '' : ' tabindex="1"'; ?>
type="text" name="username"<?php echo $this->data['forceUsername'] ? '' : ' autocomplete="username" tabindex="1"'; ?>
value="<?php echo htmlspecialchars($this->data['username']); ?>" />
</td>
<?php
......
......@@ -46,15 +46,15 @@
<div class="pure-control-group">
<label for="username">{{ 'Username'|trans }}</label>
<input id="username" {{ forceUsername ? 'disabled="disabled"' }} placeholder="{{ username }}" type="text" name="username" class="edge"
{%- if not forceUsername %} tabindex="1" value="{{ username }}" {% endif %}
{%- if not forceUsername and not username %} autofocus {% endif %} />
<input id="username" {{ forceUsername ? 'disabled' }} placeholder="{{ username }}" type="text" name="username" class="edge"
{%- if not forceUsername %} tabindex="1" value="{{ username }}" autocomplete="username" {% endif %}
{%- if not forceUsername and not username %} autofocus {% endif %} >
{% if rememberUsernameEnabled and not forceUsername -%}
</div>
<div class="pure-controls pure-form-message">
<label for="remember_username" class="pure-checkbox">
<input id="remember_username" type="checkbox" tabindex="4"
{{ rememberUsernameChecked ? 'checked="checked"' }} name="remember_username" value="Yes"/>
{{ rememberUsernameChecked ? 'checked' }} name="remember_username" value="Yes">
<small>{{ 'Remember my username'|trans }}</small>
</label>
{%- endif %}
......@@ -70,7 +70,7 @@
<div class="pure-controls pure-form-message">
<label for="remember_me" class="pure-checkbox">
<input id="remember_me" type="checkbox" tabindex="5"
{{ rememberMeChecked ? 'checked="checked"' }} name="remember_me" value="Yes"/>
{{ rememberMeChecked ? 'checked="checked"' }} name="remember_me" value="Yes">
<small>{{ 'Remember me'|trans }}</small>
</label>
{%- endif %}
......@@ -97,7 +97,7 @@
<div class="pure-controls pure-form-message">
<label for="remember_organization" class="pure-checkbox">
<input type="checkbox" id="remember_organization" tabindex="5" name="remember_organization" value="Yes"
{{ rememberOrganizationChecked ? 'checked="checked"' }} />
{{ rememberOrganizationChecked ? 'checked="checked"' }} >
<small>{{ 'Remember my organization'|trans }}</small>
</label>
</div>
......@@ -109,7 +109,7 @@
<br><br>
{%- for name, value in stateparams %}
<input type="hidden" name="{{ name }}" value="{{ value }}"/>
<input type="hidden" name="{{ name }}" value="{{ value }}">
{%- endfor %}
<button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" id="submit_button"
......
......@@ -24,7 +24,7 @@ if (isset($this->data['error'])) {
<tr>
<td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td>
<td style="padding: .3em;"><?php echo $this->t('username'); ?></td>
<td><input type="text" tabindex="1" name="username"
<td><input type="text" tabindex="1" name="username" autocomplete="username"
<?php
if (isset($this->data['username'])) {
echo 'value="'.htmlspecialchars($this->data['username']).'"';
......
......@@ -28,7 +28,7 @@
if (array_key_exists('admin', $this->data)) {
echo '<strong style="font-size: medium">Administrator</strong>';
} else {
echo '<input type="text" id="username" tabindex="1" name="username" ';
echo '<input type="text" id="username" tabindex="1" name="username" autocomplete="username" ';
if (isset($this->data['username'])) {
echo 'value="'.htmlspecialchars($this->data['username']).'"';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment