Guest account deleted

Guest account deleted

by Jay Schupp -
Number of replies: 5

Somehow our Moodle guest account was deleted from the Moodle database...not sure how.  I have tried to re-create the Moodle account from MySQL (emulated from guest account on test server).  I can get the account created and the password set.  However, this shows up in Moodle as to what looks like a regular user account.  I am able to login to a course with the guest user I created and it logs into Moodle like a regular user....I can bounce around and also edit the Guest user profile ... change the name and password.

I have read every thread about this...it is not the mnethostid issue.

I have uninstalled the guest enrollment plugin and reinstalled it.

There must be some magic sauce for Moodle to link the guest account to the guest role somehow.

We are on Moodle 2.5.1+ ... just pulled down from Git.  There was a mention about cron deleting the guest account as by default it is an imcomplete account.  

There is no mention of how to re-create the guest account sad

We are stuck.

Thanks in advance for any help.

Jay

Average of ratings: -
In reply to Jay Schupp

Re: Guest account deleted

by Jay Schupp -

Did some more investigating...somehow the original guest account (with id=1) had the username changed from guest to root@localhost.1325442607 !!!  

I was able to change the username back to guest and now the guest account is working properly for our Moodle !!!

So, I'm guessing that the guest account is tied to the guest account id = 1 perhaps.

Happy Friday!

Attachment Moodle_guest.png
In reply to Jay Schupp

Re: Guest account deleted

by Ken Task -
Picture of Particularly helpful Moodlers

Yep, that's what I've found ... when moodle is first installed one has a guest user auto created and that user is ID 1.  The initial admin account is ID 2.  What's strange however, is that in all previous versions, 'clean up' of the Moodle excluded the guest account (ID 1) from 'disabling' or 'deleting' (which really aren't deleted, just obscured - ie, fields in DB changed).

Something to watch, I guess.  But, glad you've resolved it and thanks for sharing back the solution.  Others might experience same.

'spirit of sharing', Ken

 

In reply to Ken Task

Re: Guest account deleted

by Greg Padberg -

I have a similar issue on my Moodle server.  Currently running version 2.4.7 although upgraded too many times to count throughout the years (since way before version 2.0).  Recently I had a request to enable Guest access.  Got everything ready on the server to the extent that I can.  Not sure if the Guest account got deleted at some point or what.

I did the same mysql query as Jay Schupp above for ID 1 (Admin on my system) and ID 2 (query yields "Empty set").  I have a test server with a default Moodle install which I noticed that the Guest account is ID 1.  ID 3 and onwards are (or have previously been) legitimate users.  So what do I need to do to create a new Guest account, can this be done from within Moodle or will some mysql trickery be involved?

In reply to Greg Padberg

Re: Guest account deleted

by Greg Padberg -

I reinstated the Guest account by creating a new one.

Login:  guest

Password:  guest

The "Login as a guest" button seems to work OK, and a course that has been configured to allow guest access seems to work as expected with the guest account.

In reply to Greg Padberg

Re: Guest account deleted

by Greg Padberg -

I find myself revisiting the Guest account issue again.  The newly created Guest account can be logged into automatically, which is great.  Underneath the covers however it is still a normal User account.  I have found that in the last couple of weeks users have discovered that this Guest account can be enrolled in courses.  My Test Moodle (with all defaults) does not allow the Guest account to enroll in courses.