General help

 
 
Picture of Jari Järvelä
Guest login problem
 

Hi,

I'm having a problem with the guest login. The Moodle version in use is 1.8.1+. We have direct links on the Moodle front page (made with html -block), which takes the user to the course and directly to the forum in course. The problem is that when the guest user clicks the link, the login window appears and nothing happens. For example if the user clicks login as guest button in the login window the login window just stays on. The link created in the html block is correct.

The interesting part is that in the settings the guest user option is set in a way that the login window shouldn't even appear. The guest autologin setting is on. The course settings are also ok, allowing guest access to the course.

Any ideas on what the problem would be? Thanks in advance for any information.

 
Average of ratings: -
Picture of Howard Miller
Re: Guest login problem
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Did it ever work. If 'yes' what changed?

I would try again after enabling Debugging - it's just possible that the 'dummy' account for Guest in the database has got lost or corrupted - I take other logins are fine?

I would also note that 1.8.1+ is somewhat ancient history now. I would encourage you to consider an upgrade to (at least) the latest 1.8 version
 
Average of ratings:Useful (1)
Picture of Jari Järvelä
Re: Guest login problem
 

Hi Howard,

and thanks for your advice. Guest login worked fine just few days ago. Our server service provider did updates to our server, so there could be problem there (Java Runtime Environment were installed).

The debugging didn't show any error messages. If the 'dummy' guest account is corrupted, how it can be repaired? The guest account haven't disappeared, it is visible in database (but it is not visible in the user list of our Moodle). Other logins works just fine.

The Moodle will be updated to latest 1.8 version.

 
Average of ratings: -
Picture of Howard Miller
Re: Guest login problem
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
It's highly unlikely an update to the JRE would make any odds - still, stranger things smile

Can you do an 'ordinary' login using the credentials...

username: guest
password: guest

(this is the username and password of the guest user in the database)
 
Average of ratings: -
Picture of Jari Järvelä
Re: Guest login problem
 

I cannot make ordinary login with guest username and password. I got login failed error message.

 
Average of ratings: -
Picture of Mauno Korpelainen
Re: Guest login problem
Group Particularly helpful Moodlers

Hi Jari,

you could try to edit guest user account (reset password to guest with MD5) for example with phpmyadmin...

 I remember one case where some cracker had somehow managed to edit guest user account but this problem might be caused by some change of default settings as well... if other user accounts work like before.

EDIT: Check table mdl_user... (forgot to mention it)


 
Average of ratings: -
Picture of Jari Järvelä
Re: Guest login problem
 

Hi Mauno,

and thanks for the info. Sadly, I just did the operations you suggested in phpMyAdmin (renewed the password as guest), but no success. Still I see login screen when clicking into course as guest, and get error message login failed.

A big mystery. Any other suggestions?

 
Average of ratings: -
Picture of Mauno Korpelainen
Re: Guest login problem
Group Particularly helpful Moodlers

Can you send a link to your site?

One possible reason could be hidden Login as guest button... but you did not change any settings, right?

Some changes in file login/index.php might also cause unexpected trouble - if guest is not guest...

 
Average of ratings: -
Picture of Eduardo Gomez
Re: Guest login problem
 

Thanks that solve my problem!!!!

 

 

 
Average of ratings: -
Picture of Tanya ONeil
Re: Guest login problem
 
WAIT
If you do not know how to go into your database and manually disable debugging I would suggest you do NOT do this. It can (and has) made the gui inaccessible to everyone (noone can log in, anywhere, at all). If you have access to your SQL database or can get a hold of someone who does - here are the commands to turn it off:

UPDATE mdl_config SET value = 0 WHERE name = 'debug';
UPDATE mdl_config SET value = 0 WHERE name = 'debugdisplay';
Save your sanity, make a BACKUP before performing any environmental changes to your Moodle site.
 
Average of ratings: -
Picture of Antonia Martinez
Re: Guest login problem
 
Any resoultion to this? I am having the same problem with the current version of moodle. Course is set to allow guest access with a key but instead of allowing access when the guest login button is clicked, the page just reloads with 'guest' as the username and a blank password field. And the password doesn't work.
 
Average of ratings: -
Picture of Mauno Korpelainen
Re: Guest login problem
Group Particularly helpful Moodlers
Jari did send me email in October but he never posted the solution to his problem here.

If I remember it correct Guest had a wrong value in field mnethostid in the mdl_user table and changing that one value with phpMyAdmin made Guest access functional again (I suppose they had made some tests with MNET)
 
Average of ratings: -
Picture of allen mauer
Re: Guest login problem
 
what do you change that value to?

 
Average of ratings: -
Picture of allen mauer
Re: Guest login problem
 
Thanks a lot this was the solution. I set the value to 0.
 
Average of ratings: -
Rob in companionway of S.V. "Milonga"
Re: Guest login problem
 
Hi,

I have the same problem (guest login not working) and after changing the mnethostid value to "0" I now get the error message "toomanylogins."

This message is repeated even if I wait the suggested "15 mins" before trying again.

Rbryn




 
Average of ratings: -
Picture of David Dunn
Re: Guest login problem
 
Followed Mauno's tweak and solved my guest login problem. Thanks for the clear instructions, Mauno.
 
Average of ratings: -
Picture of Stephen Gashler
Re: Guest login problem
 
I'm having the same or a similar problem. I changed the table value in as mentioned in PHPMyAdmin to 0, but no success. I've enabled auto guest login, and I've set my courses to allow guest login. I've tried adding "&username=guest" to the end of the links to my course pages, but I'm always directed to the login page. Entering "guest" in the username field and clicking "login" simply reloads the page. And after dealing with this, if I try to login as admin, it doesn't work. I don't get an failed authentication message for any of this. No message at all. It is very strange.

Here's a link to my site: http://maeserprep.org. The links "about" and "staff" are supposed to take any user straight to the course without authentication.

Any ideas? Thanks
 
Average of ratings: -
Picture of Stephen Gashler
Re: Guest login problem
 
I don't know much about PHPMyAdmin, but it appears that when i change the value of "mnethostid" under mdl_user, nothing happens. The "Length/Values" field is set to 20, and I change it to 0 and save, but the value is always set back to 20. Am I doing something wrong?
 
Average of ratings: -
Picture of simon serverin
Re: Guest login problem
 
I'm also looking for a solution. Tried the mnethost thing, and didn't work out. The lenght/value field keep coming back to 20. If someone has the solution please post an explanation. No guest login means we just can't use our site anymore ^^;
 
Average of ratings: -
Picture of Tanya ONeil
Re: Guest login problem
 
I copied this in from elsewhere on the forum:

Here's all the steps:
  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
  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.
  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.

 
Average of ratings:Useful (2)
The Renewable Network Logo
Re: Guest login problem
 
Thank you, thank you, thank you Tanya.
I had exact same problem. Forum q'd it and was told to check this thread. I have never entered a PHYMyAdmin but figured I had nothing to loose so followed your instructions to the T. At first I was not able to find the PHPMyAdmin in the Site Admin>Server... as stated in Moodle Docs but did go to the Control Panel where I host my site and they have access to it there. Your instructions matched everything I found there and site is now back and running with guest access like it should.

Mike
 
Average of ratings: -
Picture of raul lozada
Re: Guest login problem
 

I would like to confirm that the procedures that Tanya shared DO work! Thank you!

Ragu

 
Average of ratings: -
mymug
Re: Guest login problem
 

Tanya - Thank you thank you thank you.

Screams of joy.

Thank you.

Darren

 
Average of ratings: -
Picture of Doug Holton
Re: Guest login problem
 

I see this problem after upgrading to moodle 2.0 (and now 2.02).

New courses when you go to 'edit settings' there isn't even listed a guest access option or a textfield to put an enrolment key.

And I had it set before that any course has guest access by default.  Guests can't access any of our courses created after the moodle 2.0 upgrade.

I tried changing mnethostid to 0 for the guest user, but it doesn't work.  It does give a different error when trying guest access.  It says "Invalid login, please try again", with "guest" filled in for the username field, but no password.

Before it just said something like 'this course doesn't allow guests'.

 
Average of ratings: -
Picture of kiran s
Re: Guest login problem
 

I am facing the same problem .

 
Average of ratings: -
Picture of Charles Brewster
Re: Guest login problem
 

I recently upgraded to 2.02. I am trying desperatly to find where I can enable guest access to a course. This was never a problem under 1.9 settings. Now I cannot find the place to toggle the default.

 

For the love of god, please just tell me the field to toggle in mysql and I will go in and set the access to guests allowed for a course.

 

Failing that please provide a screen shot of the place to toggle. Don't send me and more verbage about "settings" when there is no way to find the "settings"

 
Average of ratings: -
Mary Cooch
Re: Guest login problem
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

In site admin>plugins>enrolments>manage enrol plugins, make sure the eye of guest access is enabled. Then go to your course and to course administration>users>enrolment methods and ensure it is enabled there

 
Average of ratings: -
Picture of Charles Brewster
Re: Guest login , yes but first must drill down users etc
 

Fair enough but the first 40 miles is enabling guest access by drilling down in the course>users>enrolment methods and enabling guest access.

 

 
Average of ratings: -
Picture of Neil Spurgeon
Re: Guest login , yes but first must drill down users etc
 

I have 2 Moodle 2.0 sites, both hosted on the same domain.

One allows guest access, one does not allow guest access.

I have checked the plugins, enrolment options, both identical

I have checked the database md whatever it is fields both identicial

I have checked very damn thing I can find between the two and they are all identical but one lets me right in and the other throws the mysterious user name: guest and doesnot accept guest (or anything else) as a password (on in the database the passwords are identical - even though encrypted) Please help becuase currently one of my sites simply is out of operation until I can once again allow people to access it without needing a password. Oh neither site has been upgraded both are 2.0.1 !!!

 
Average of ratings: -
Picture of Timothy Hunkele
Re: Guest login , yes but first must drill down users etc
 

I was having a similar issue with moodle 2.0.1

What solved the issue for me was:

Site administration => Plugins => Authentication => Manage authentication

 

Now set "Guest login button" to "Show"

 

Click "Save changes"

 

Not sure why this works, but prior to changing this setting, automatic guest logins to a guest login enabled course was not working. Goodluck! Please post back if this works or not. Thanks!

 
Average of ratings: -
Picture of Neil Spurgeon
Re: Guest login , yes but first must drill down users etc
 

Hi Timnothy

 

that wasn't enough for my problem - I ended up having a corrupted guest password, but i have solved it now and it is NOT version related

 

thanks for your help

 

Neil

 
Average of ratings: -
Picture of stephen S
Re: Guest login , yes but first must drill down users etc
 

I am going to pitch in on this issue. I also have guest login issue. Moodle 2.0.2+ (build 20110413). If I try to login as guest on the login page using the username, password fields I get "Invalid login, please try again". I also get this error if I use the "login as a guest" button.

However, if I set Auto-login guests in User Policies and click on a course that permits guest access I am given a password field and when the same password is entered (same one as on the login screen by the way) I get access.

I have looked at all the suggestions on this thread and none of them help with this issue. Guests just cannot login from the login screen.

 
Average of ratings: -
Picture of Marcus Green
Re: Guest login , yes but first must drill down users etc
Group Particularly helpful Moodlers

Stephen, you said

"If I try to login as guest on the login page using the username, password fields"

Could you explain this, do you mean you type in a username and password and then click the login as guest button? My understanding was that a guest is someone who has clicked on the Login as Guest button.

 
Average of ratings: -
Picture of stephen S
Re: Guest login , yes but first must drill down users etc
 

On the login page there is username, password fields and login button. Also, a "login as a guest" button. Pressing the login as guest button give the error "invalid login, please try again" . If I use the username and password field with "guest" and the password, I get the same error (my localhost version works both ways and logs in as the guest!). If I click on a course configured to allow guests I am given a password field and when the password is entered I get access as a guest.

(you are welcome to try it here the only course is a test of the yui effects I have experimented with, it allows guest access, password = password1).

 
Average of ratings: -
Mary Cooch
Re: Guest login , yes but first must drill down users etc
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

Stephen - have you tried the database solution mentioned above? My only recollection of this issue was in 1.9 with an mnet problem but it worked for those users of 1.9 (copied/pasted here_

Here's all the steps:

  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
  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.
  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.
 
Average of ratings: -
Picture of stephen S
Re: Guest login , yes but first must drill down users etc
 

Mary - yep. did that. wink made no difference.

 
Average of ratings: -
Picture of stephen S
Re: Guest login , yes but first must drill down users etc
 

I have come across a bug report sounds like the problem I have. Maybe I just have to wait for a fix ...

see ...  MDL-27054

 
Average of ratings: -
Picture of Stefan Nychka
Re: Guest login , yes but first must drill down users etc
 

Got the same problem, and the old mnethostid bug/fix do not seem to apply (it's 1 in the db, which is correct).

There is currently what some may consider a workaround, where you allow guests in w/o using the Login as a guest button.  (Not a true workaround, as guests are not required to click the Login as a guest button, and I believe your front page must now be visible to everyone.)

Please vote for the bug Stephen linked to.

P.S. Does this still happen in 2.0.3?

 
Average of ratings: -
Picture of Stefan Nychka
Re: Guest login , yes but first must drill down users etc
 

If you want guest to login, and have tried all of the above to no avail, there's another potential workaround, almost a fix.
I couldn't get things to work because guest's password was not "guest", so I had to change Moodle 2.0.2 settings appropriately so guests must login, and I also had to change the guest password.
See my post in the thread "Prevent authenticated guest user role from changing password" for more info. .. I didn't try it, but I'm assuming changing the password to "guest" again would work fine.

 
Average of ratings: -
Picture of Kalei Stockstill
Re: Guest login , yes but first must drill down users etc
 

Thanks Timothy, worked perfectly for me.

 
Average of ratings: -
Picture of james mergenthaler
Re: Guest login , yes but first must drill down users etc
 

Check the Site Admin |Users|Permissons|User policies - then check the Auto-login guests checkbox.  When I did that, my guess access starting working like a charm, but not a moment before.  I am using 2.3.1.

 
Average of ratings: -
Picture of Bob Brown
Re: Guest login problem
 

I had the very same problem with Guest access and was so happy when I discovered this fix.  It worked perfectly.

Thanks-

 
Average of ratings: -
Picture of Bob Brown
Re: Guest login problem
 

Interesting, I now seem to have the problem of guests being able to login to all courses.  They seem to have view privlidges only but they can view even courses that have enrollment keys.  I did make sure guests can "view courses" in Admin/Users/Permissions/Define Roles and when I remove this they can't view any courses.  How can I permit them to view only those courses that permit guests?  Thanks.

 
Average of ratings: -
Picture of Rob Welsh
Re: Guest login problem
 

I used the MD5 password change on my hosted M2.0.2 site and it worked perfectly.

Used these instructions:

  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
  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.
  4. This will open another table. On the sixth or so entry from the top is a row with "password" in the "field" category. Change the dropdown menu value to "MD5", change the password field from whatever random numbers you have to the lowercase word "guest", scroll to the bottom of the page and click "Go". That's it.

Screen shot below:-

Interestingly this didn't work for my local MAMP versions!? Something is definately awry here.

 
Average of ratings: -
Picture of Mike Blyth
Re: Guest login problem
 

I followed Rob Welsh's example above, since it was the most recent, and now when someone logs in with the guest option, this is what appears:

If I type the password ("guest") into the field and press submit, I get a message about the service is unavailable.

I'm brand new to Moodle but have used lots of other open source software. Now, it strikes me as significant that this issue is two years old (though apparently it worked in some versions), is fundamental ("guests should be able to sign in") and yet occurs in a "stable" release. For solutions, people are referred to this thread where there are many ideas but no true solutions (ones that work for everyone). A bug report ("major") was filed two months ago and no progress is listed. Some of you veteran users, please tell me, is this a bad time to get started with Moodle, perhaps it's losing steam or has become so complicated that no one understands it? Or is this issue just a fluke?

 
Average of ratings:Useful (1)
Picture of Francois Evans
Re: Guest login problem | Moole 2.0
 

Gosh this is frustrating.

Am going to try Rob Welsh's solution. For newbies, see info. on MD5.

Distilling the guest access settings discussed so far (in Moodle 2.0), we see guests' settings having to be made in no fewer than five separate course-generic pages in Moodle:

Settings>Site administration>Plugins>Authentication>Manage authentication
Settings>Site administration>Plugins>Enrolments>Guest access
Settings>Site administration>Plugins>Enrolments>Manage enrol plugin
Settings>Site administration>Users>Permissions>Define roles
Settings>Site administration>Users>Permissions>User policies

It would be great if all guest access settings could be settable in one place. I'm assuming, these separate page settings for guests have to relate logically - difficult to do if one has to skip from one page to another.

F.

 
Average of ratings: -
Gmads
Re: Guest login problem | Moole 2.0
Group Particularly helpful MoodlersGroup Testers

Hi Francois,

That is because it depends on what you're trying to manage:

Authentication - to log into Moodle.
Enrolment - to have access into a course.
Permissions - to handle situations which require enabling/disabling particular permissions.

 
Average of ratings:Useful (1)
Picture of Francois Evans
Re: Guest login problem | Moodle 2.0
 

Point taken Guillermo. Many thanks.

 
Average of ratings: -
Picture of Abraham Zeyohannis
Re: Guest login problem
 

I am having the same problem, which by the way was discussed even back in 2004. On the other hand, one year after Mike's post, am still not seing any definitive solution. Is there any hope for this issue?

 
Average of ratings: -
Picture of Paul Nijbakker
Re: Guest login problem
Group Particularly helpful Moodlers

Hi,

Interestingly, I find no 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?

Setting mnethostid to "0" for all of them did not have any result, by the way.

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.

Rgrds,
Paul.

 
Average of ratings: -