Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
684ca884
Commit
684ca884
authored
Feb 15, 2008
by
Nigel McNie
Browse files
Make the login form autofocus if an error occurs while logging in.
A bit of a hack - see the comment in the diff.
parent
2aa7ca06
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/auth/lib.php
View file @
684ca884
...
...
@@ -992,6 +992,15 @@ function auth_get_login_form() {
* @private
*/
function
get_login_form_js
(
$form
)
{
// Add the autofocus class to the username input. This is because Mahara
// doesn't always render the login form when it is built. Sometimes, the
// form is built to process a login attempt, and then built again when that
// attempt fails. This makes sure that every time the login form is
// actually displayed it has the autofocus class.
$form
=
str_replace
(
'class="required text" id="login_login_username"'
,
'class="required text autofocus" id="login_login_username"'
,
$form
);
$form
=
str_replace
(
'/'
,
'\/'
,
str_replace
(
"'"
,
"\'"
,
(
str_replace
(
array
(
"
\n
"
,
"
\t
"
),
''
,
$form
))));
$strcookiesnotenabled
=
json_encode
(
get_string
(
'cookiesnotenabled'
));
$cookiename
=
get_config
(
'cookieprefix'
)
.
'ctest'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment