My Moodle: Prevent auto guest login in my moodle

My Moodle: Prevent auto guest login in my moodle

by Itamar Tzadok -
Number of replies: 8

Does anyone need that?

By current implementation my moodle auto logs in guests if config auto-guest login is enbabled. On my site this results in a (totally) blank page such that the guest user has to browse back or renter the site url to get back to a contentful page. The point of annoyance happens to registered users whose session times out when they are on my moodle. If they refresh the page they just get that blank page rather than the login page.

A fix to prevent auto guest login in my moodle is very easy. If however anyone actually wants or uses the auto guest login in my moodle the fix would have to be by adding a config setting and hence a bit more work.

I'd appreciate any comments before I open (or revive) a tracker issue on that. smile

Average of ratings: -
In reply to Itamar Tzadok

Re: My Moodle: Prevent auto guest login in my moodle

by Jenny Gray -

You might get a better response to this if you post in the general developer forum rather than this one which is specific to the /my myMoodle feature.

To answer your question though, yes, autologin guest does have a use - in fact I can't really see why anyone would want it to be switched off.  Personally I think it is a usability problem to make people click an button to get access to stuff they already have permission to access.

We've been using it on OpenLearn for years but no-one has ever reported the bug you're describing to me.

May I suggest you switch the debugging level right up on your site and see if any extra information appears on that blank screen.  There's probably some other error - to do with session time out by your comment - that is being suppressed. 

In reply to Jenny Gray

Re: My Moodle: Prevent auto guest login in my moodle

by Itamar Tzadok -

Thanks Jenny.

Perhaps I wasn't clear. I don't question the general usefulness of autologinguest, only its usefulness on mymoodle page. That's user functionality, not a development issue.

You are right about the bug though, and I should have debugged it, but I just didn't expect such a core bug (has to do with page navigation initialization) in something so simple.

If this is an old bug and has never been reported, it suggests that no one really uses auto guest access on mymoodle, although the code was clearly written to allow guests there.

smile

In reply to Itamar Tzadok

Re: My Moodle: Prevent auto guest login in my moodle

by Laura Koepke -

I've tried several other forums with this question with no responses and since you've touched on part of my issue, I'm hoping you can help us.  We upgraded to 2.2 and since then, all guests are being directed to a login page in order to see a site that has guest access allowed.

We use NTLM with Active Directory and make My Moodle the home page for students and staff.  In 1.9 we enabled Auto-login as guest and all worked swimmingly...students and teachers were automatically authenticated and logged in as themselves while non-district users were logged in as guest and allowed to browse courses.

In 2.2 if we enable auto-login as guests, NTLM breaks and our staff and students are logged in as guests.  Either something is different in 2.0 or there is a bug.  Either way, we need to get this fixed.  Any help you can give would be GREATLY appreciated.

In reply to Laura Koepke

Re: My Moodle: Prevent auto guest login in my moodle

by Itamar Tzadok -

Unfortunately I'm not familiar with ntlm. Have you tried to see how it works when default home page is set to 'user preference' rather than 'my moodle'? smile

In reply to Itamar Tzadok

Re: My Moodle: Prevent auto guest login in my moodle

by Laura Koepke -

Thanks for responding.  We need to force students to My Moodle since we've developed a custom block that gives them access to all of our paid research subscriptions.  Is there a way to block guests from My Moodle?  Perhaps we could use the auto-login as guest if guests were not allowed to get to My Moodle. 

In reply to Laura Koepke

Re: My Moodle: Prevent auto guest login in my moodle

by Itamar Tzadok -

You may want to watch and/or participate in MDL-32688. smile

Average of ratings:Useful (1)
In reply to Itamar Tzadok

Re: My Moodle: Prevent auto guest login in my moodle

by Kristina Schneider -

Hi Itamar,

It's unfortunate no one answered your question until now. I had forgotten how to do it, so I was searching the forums for help.

But luckily, I finally remembered how!

First, go to Site Administration > Users > Permissions > User Policies and make sure that Auto-login guests is set to No, which should be the default.

Next, in Site Administration, go to Plugings > Authentication > Manage authentication and set the Guest login button to hide. This is also where you can set up some fancy customization as to what your login page looks like. 

Anyhow, I'm probably too late in responding to this but I figured that the next person who searched this info should not appear on a dead end thread!

Kristina

In reply to Kristina Schneider

Re: My Moodle: Prevent auto guest login in my moodle

by Itamar Tzadok -

Thanks Kristina. It just that I want Auto-login guests set to Yes. This is actually a bug for which I need to contribute the fix and hoping to do that very soon. smile