Skip to content
Snippets Groups Projects
Commit 832a89bf authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Merge pull request #184 from thijskh/master

Disable login button with JS after first click.
parents 6595d4fa 506331f4
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
"login_button": { "login_button": {
"en": "Login" "en": "Login"
}, },
"processing": {
"en": "Processing..."
},
"username": { "username": {
"en": "Username" "en": "Username"
}, },
......
...@@ -67,7 +67,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled']) ...@@ -67,7 +67,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
} else { } else {
$text = $this->t('{login:login_button}'); $text = $this->t('{login:login_button}');
echo str_repeat("\t", 4); echo str_repeat("\t", 4);
echo "<input type=\"submit\" tabindex=\"4\" id=\"regularsubmit\" value=\"{$text}\" />"; echo "<input onclick=\"this.value='" . $this->t('{login:processing}') . "';this.disabled=true;this.form.submit();return true;\" type=\"submit\" tabindex=\"4\" id=\"regularsubmit\" value=\"{$text}\" />";
} }
?> ?>
</td> </td>
...@@ -81,7 +81,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled']) ...@@ -81,7 +81,7 @@ if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
$rowspan = (array_key_exists('organizations', $this->data) ? 2 : 1); $rowspan = (array_key_exists('organizations', $this->data) ? 2 : 1);
?> ?>
<td style="padding: .4em;" rowspan="<?php echo $rowspan; ?>"> <td style="padding: .4em;" rowspan="<?php echo $rowspan; ?>">
<input type="submit" tabindex="5" id="regularsubmit" value="<?php echo $this->t('{login:login_button}'); ?>" /> <input onclick="this.value='<?php echo $this->t('{login:processing}'); ?>';this.disabled=true;this.form.submit();return true;" type="submit" tabindex="5" id="regularsubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td> </td>
<?php <?php
} }
...@@ -121,7 +121,7 @@ foreach ($this->data['organizations'] as $orgId => $orgDesc) { ...@@ -121,7 +121,7 @@ foreach ($this->data['organizations'] as $orgId => $orgDesc) {
} }
?> ?>
<tr><td></td><td> <tr><td></td><td>
<input type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login:login_button}'); ?>" /> <input onclick="this.value='<?php echo $this->t('{login:processing}'); ?>';this.disabled=true;this.form.submit();return true;" type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td></tr> </td></tr>
</table> </table>
<?php <?php
......
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