I find it annoying to have to manually click ‘Login’ on the login page when administering ClearOS. I use Firefox’s password manager and when I type my password for the password manager I am used to hitting enter twice, once to press ‘OK’ for the password manager and once to submit the page since most login pages’ input fields are automatically focused. This is not true for ClearOS’s login page but, today we are going to fix that.
The fix is quite simple really. First you will need to SSH into ClearOS. Then find and edit your login page:
vi /var/webconfig/htdocs/templates/standard-5.1/widgets/login.inc
Add the following just before the closing quote for the ‘echo’ statement, which is located just before the ‘WebFormClose();’ statement:
<script type='text/javascript'> document.getElementsByName('reserved_username')[0].select(); </script>
If you happen to be using a theme other than the standard, then you will need to adjust this tip accordingly. ie. Find the login page for your theme and edit the Javascript to suit your needs.
That’s it! Congratulations, you’ve made the login page automatically focus it’s username field! Simple, eh?
UPDATE:
For ClearOS 6, the file you’ll need to edit is ‘page.php‘ located at ‘/usr/clearos/themes/default/core‘. You’ll also need to replace ‘reserved_username‘ with ‘username‘ within the above script. You need to add the script just before the ‘</body>‘ tag under the section labeled ‘Returns login type page‘.
Comments are closed.