avoid guest login in Moodle 2 (confused)

Francis Vila
avoid guest login in Moodle 2 (confused)

I've searched a while for this one... mixed

I found a discussion saying the solution was in Admin > Users > Authentication, but I see no such entry in Moodle 2. The closest I get to that is Site Admin > Users > User policies and such.

I found a discussion saying to change the force_login variable. I found a number of occurrences of force_login in various .php files, with not much in the way of comments on how to change them, and in which file.

More generally, is there a place to find info specific to Moodle 2? All the resources I have seem to talk about Moodle 1, with a few Moodle 2 articles thrown in.

Average of ratings: -
Picture of Neil Spurgeon
Re: avoid guest login in Moodle 2 (confused)

I am having terrible trouble with Guest Access in Moodle 2. It works exactly as expected in 2.0 but unfortunately I have upgraded most of my sites to Moodle 2.0.2 and Guest now does not seem to work and when clicking the login as a guest access instead of going into the front page as normal, the user ID box is filled with 'Guest' and no amount of adding 'guest' or anything else into the password box lets one into the site. Please can one of you clever folks have a look at any changes between 2.0 and 2.0.2. which might have 'messed up' Guest access. Thanks

Average of ratings: -
Jim Judges
Re: avoid guest login in Moodle 2 (confused)

Hi Neil,

I managed to get this working in my Moodle 2.0.3 (build 20110505).

Try this:

(1) In Site administration > users > permissions > User policies
check that "Auto-login guests" is ticked (this allows visitors to be logged in as guests automatically when entering courses with guest access)

(2) In the course that you want to grant guest access to check that in Course settings that the Guest Access is set to give "Allow guest access" = Yes , note you can even use a guest password here if you want although this is optional. This same guest access setting can also be managed through Course admin > Users > Enrolment methods

If guest access isn't available in your course (it should be by default) then this can be turned on in Site admin. > plugins > enrolments > Manage enrol plugins

I think that should do it, hope that helps - good luck!

Jim smile

Average of ratings: Useful (1)
Picture of Stefan Nychka
Re: avoid guest login in Moodle 2 (confused)


Note this is a workaround--you circumvent the button.  There is a bug fix request in the tracker:  see a larger thread that's discussing related issues, to which at least Neil has already posted.  To consolidate things, I'd recommend (for others reading this) to instead post to the other thread.

In case it helps others, I've linked to this "workaround" from the other thread.

Average of ratings: -