Guest access without the [Login as Guest] button...

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Matt Hobbs -
Number of replies: 16

Hi everyone,

Could we please have some info on how to allow guest access to our Moodle sites without needing to use the 'guest login' button on the frontpage? Most of the info in this thread is from 2004 and it seems not applicable to the latest versions of Moodle.

My particular goal is to have some parts of my Moodle site accessible just like a standard website, so that people can get an idea of what is on there without being presented with the barrier of a login screen. So:-

  • User receives a link for example to the main page of the website, or say a link to a gallery (I have the lightbox gallery plugin and created a course that uses it to hold some images)
  • User click on this link and goes straight to the content without facing a login screen

I don't mind if this is done by URL, e.g. adding &username=guest after the standard URL - this was mentioned earlier but I can't get it to work, I assume because it applied to older versions of Moodle.

Any other suggestions or workarounds as to how to accomplish the same thing would be much appreciated.

Matt

In reply to Matt Hobbs

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Matt,

For up-to-date info on how guest access works, please see the documentation Guest access.

Guests can be logged in automatically when entering courses with guest access i.e. no login screen by ticking the 'Auto-login guests' checkbox in Administration > Site administration > Users > Permissions > User policies.

Average of ratings: Useful (3)
In reply to Helen Foster

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Emma Coles -

I have asked our Moodle Admin to switch this on but they report back "Turning on the "auto-login guests" makes the whole system unacceptably slow." Has anyone else experienced this problem? If so, was there a workaround? Many thanks (in advance). Emma

In reply to Emma Coles

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I have never heard of that  one before - let's see what others say.

In reply to Helen Foster

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Night Owl -

I have configured all of the settings listed in this document, but I still cannot view an individual course as guest without the guest login button setting being set to show in the authentication plugin. If I turn that setting on, i can go directly to a course by adding the &username=guest extension onto the course URL, but if I turn it off it doesn't work. I don't want that turned on because I don't want anyone else to have guest access, and I don't want anyone to go to our Moodle main site URL and see anything as guest. (ie: when you go to our URL I just want the login screen).  How can I do this?

In reply to Night Owl

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Andre Paz Leal -

Somebody found a way of doing this? AUto-login set on but still the guest is returned to the login page to click the login button.

In reply to Andre Paz Leal

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Paul Nijbakker -

Bump. I also have all the settings suggested in the Documentation for Moodle 2.5 switched on (except the guest access password and the Open to Google setting), but still cannot enter any course as a guest, not even when clicking the Login as a guest button and the "&username=guest" addition to the course URL does not work either.

Yet it must be possible to allow guest access without passing via a login page, because this Moodle.org site allows just that.

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Paul Nijbakker -

Hi,

I tried to follow these instructions found elsewhere in the forums:

  1. Login to your database in PHPMyAdmin
  2. On the lefthand side, scroll down and click on the little icon (not the text) for mdl_user (the icon or the text makes no difference in my case; the view is the same)
  3. This will open a table, where the top entry in the "username" column is "guest". Click on the pencil icon on the lefthand side. (Interestingly, I did not find any user with the username "guest" in my Moodle database, but I find no fewer than 41 users that have coded usernames and whose firstname is "Guest User". Is that normal?)
  4. This will open another table. On the sixth or so entry from the top is a row with "mnethostid" in the "field" category. Change its value to "0", then scroll to the bottom of the page and click "Go". That's it. (Changing the setting mnethostid to "0" for all the "guest User"s did not have any result in my case.)

In my other Moodle 2.5 installation there is a user (id = 1) that has the username "guest". I changed the coded username for id = 1 in my former installation to "guest", but that did not help either. Even if I also change the password of the "guest" account to "guest" and I try logging in normally as "guest/guest" I cannot get in.

I also tried combining the Guest enrolment in a course with a Self-enrolment for the Guest role, without an enrolment key... nada. I keep getting returned to the login page where clicking the Login as a guest button just puts the username "guest" in the username box, clicking it again, results in "Invalid login, please try again".

Who would have any suggestions?

Rgrds,
Paul

In reply to Paul Nijbakker

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Paul Nijbakker -

I also tried taking away the password for the "guest" ID altogether, but the site just keeps refusing any kind of guest access.

Happy Valentine's Day sad

Paul.

In reply to Paul Nijbakker

Re: Guest access without the [Login as Guest] button...

by Paul Nijbakker -

Hi all,

We finally got guest login working again, by opening the mdl_user table in the database and returning the id=1 user to username = "guest" with as password "guest" (We used a random user to change the password to guest and then in the database we copied that salted password to the Guest User ID.)

We also changed the "1" under Deleted to "0" (As it appeared Moodle had been removing and recreating the Guest User in the past).

Then we opened the mdl_config table in the database and changed the siteguest value to "1".

And then we Purged all cache.

And then it started working again normally (before this the guest ID was treated as a normal user by Moodle (i.e. it could edit its profile and post in forums etc.) So, issue fixed, solution and solved (in case someone is searching wih these words as search terms wink).

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Barbara Taylor -

Paul,

I put guest courses into a guest category.  The course is set to be visible and guest access yes.  When I go to my site -> click on the Courses link in the Navigation block -> I see the Guest category -> click on one of the courses listed -> have instant access

 

Barbara

In reply to Barbara Taylor

Re: Guest access without the [Login as Guest] button...

by Paul Nijbakker -

Hi Barbara,

Thank you for your response but it does not address my problem. My site does not allow guest access at all, despite all the right settings being in place. I suspect the system was corrupted at some time, but my attempts to fix it have been fruitless.

Rgrds,
Paul.

In reply to Helen Foster

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Trevor Wood -

Trying this now. yes you can set this option but the Guest login button still has to be there.

So if a user has a direct link to X course go straight in, bypassing login screen, but those who go to login page will still see guest login button.


Would be nice to hide that because users who do login from homepage can't really do much (presented with a whole bunch of courses that are inaccessible).

In reply to Trevor Wood

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Dave Perry -
Picture of Testers

The lack of '&username=guest' working is a real pain for some of our pages (e.g. college documents, which needs to be accessible by students who haven't got their moodle access yet). Are there plans to re-instate it?

In reply to Dave Perry

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Mitchell Kennard -
I would also appreciate something like this. I am trying to open up a particular course to non account holders without them having to click on 'Log in as guest.' I have turned on auto-login for guest, and that works fine. The problem is that anytime a user clicks on a link to any other course on the site (e.g., a post link from a post email), the system logs them in as guest and says that guests do not have access to that course. They then have to login to the system, go back to the email, and then click on the link. That is far too much trouble for everyone on the site. Being able to modify a single link with '&username=guest' would resolve the issue.


Any suggestions?

Thanks,

Mitchell

In reply to Mitchell Kennard

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by srinu g -

In Settings > Site administration > Users > Permissions > User policies, you can tick the box so that visitors are automatically logged in as guests when accessing a course with guest access (i.e. they don't have to click the "login as guest button".

In reply to srinu g

Re: תשובה ל: Re: Guest access without the [Login as Guest] button...

by Dave Perry -
Picture of Testers

The problem on our site (2.9) is that this setting means it does this for EVERY page even if you don't have guest logins enabled on the page. Which is a bug to me, but would like someone to confirm this before I file it as one officially.

If guest logins aren't enabled on a page, it should force a proper login for any page that uses the require login function.