Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-80967

Login page - Give the option to hide the login form with only a configuration

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_405_STABLE
    • MDL-80967-main
    • Hide
      1. Login as admin.
      2. Navigate to Site Administration > Plugin > Authentication > Manage authentication
      3. Verify that you will see a new setting called: Display default login form
      4. Verify that the default value of that setting is: Yes (Checked)
      5. Verify that the short name of that setting is: showloginform
      6. Uncheck the Display default login form.
      7. Set the Guest login button to Show.
      8. Save changes.
      9. Open a new incognito browser.
      10. Navigate to your Moodle site.
      11. Click login.
      12. Verify that you will not see the normal login form.
      13. Verify that you will see the Access as a guest only.
      14. Switch to the admin browser.
      15. Check the Display default login form.
      16. Save changes.
      17. Switch back to the incognito browser.
      18. Reload the page.
      19. Verify that you will see the normal login form again.
      20. Login with any account.
      21. Verify that you can log in normally.
      Show
      Login as admin. Navigate to Site Administration > Plugin > Authentication > Manage authentication Verify that you will see a new setting called: Display default login form Verify that the default value of that setting is: Yes ( Checked ) Verify that the short name of that setting is: showloginform Uncheck the Display default login form. Set the Guest login button to Show . Save changes. Open a new incognito browser. Navigate to your Moodle site. Click login. Verify that you will not see the normal login form. Verify that you will see the Access as a guest only. Switch to the admin browser. Check the Display default login form. Save changes. Switch back to the incognito browser. Reload the page. Verify that you will see the normal login form again. Login with any account. Verify that you can log in normally.

      We are using OAuth2 to authenticate our users. We don't have any "manual" users. Technically we only got the admin user which we never use (it's bad to share an account). Our first gess was to use the alternateloginurl configuration. Not a bad idea, but we realised that the only thing we want was to hide the login form.

      So we decided to add a new configuration showloginform (with a default to "yes") and add a mustache tag to hide/show the login form. With the default to "yes" there is not breaking anything and it's offer a simple way to just use the OAuth2 authentication. If necessary, it can be check and the login form will show again.

      You can see an example of what it can look like after.

        1. MDL-80967.png
          MDL-80967.png
          559 kB
        2. StudiUMAuth.png
          StudiUMAuth.png
          18 kB

            massicos Steve Massicotte
            massicos Steve Massicotte
            Meirza Meirza
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 26 minutes
                5h 26m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.