Issue Details (XML | Word | Printable)

Key: MDL-10375
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Eloy Lafuente (stronk7)
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Wrong (undefined) mnethostid prevents guest access sometimes...

Created: 07/Jul/07 01:01 AM   Updated: 29/Oct/07 04:01 PM
Return to search
Component/s: Authentication
Affects Version/s: 1.8.1, 1.9
Fix Version/s: 1.8.2, 1.9

Environment: Any

Database: Any
Participants: Daniele Cordella and Eloy Lafuente (stronk7)
Security Level: None
Resolved date: 07/Jul/07
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
There are two places where the "guest" user is created. Both admin/index.php and login/index.php are able to create such record in the user tables.

But when the user is created from login/index.php, the mnethostid isn't set, so defaults to 0, and with that value, it doesn't work anymore.

So plan is:

1) Create one new create_guest_user() function under moodlelib.php with correct settings.
2) Use it from admin/index.php and login/index.php
3) Provide a small upgrade to fix broken sites (I've seen some of them).

Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 07/Jul/07 01:37 AM
Adding new, central, create_guest_record() function. MDL-10375
MODIFY lib/moodlelib.php   Rev. 1.837.2.61    (+30 -2 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 07/Jul/07 01:39 AM
Use the new, central, create_guest_record() function. MDL-10375
MODIFY login/index.php   Rev. 1.109.2.13    (+2 -13 lines)
MODIFY admin/index.php   Rev. 1.265.2.7    (+2 -14 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 07/Jul/07 01:43 AM
Small upgrade to fix some guest->mnethostid. MDL-10375
MODIFY lib/db/upgrade.php   Rev. 1.27.2.16    (+6 -1 lines)
MODIFY version.php   Rev. 1.425.2.15    (+1 -1 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 07/Jul/07 01:51 AM
Adding new, central, create_guest_record() function. MDL-10375

Merged from MOODLE_18_STABLE
MODIFY lib/moodlelib.php   Rev. 1.908    (+30 -2 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' - 07/Jul/07 01:54 AM
Use the new, central, create_guest_record() function. MDL-10375

Merged from MOODLE_18_STABLE
MODIFY login/index.php   Rev. 1.125    (+2 -14 lines)
MODIFY admin/index.php   Rev. 1.278    (+2 -14 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' - 07/Jul/07 02:01 AM
Small upgrade to fix some guest->mnethostid. MDL-10375

Merged from MOODLE_18_STABLE
MODIFY version.php   Rev. 1.476    (+1 -1 lines)
MODIFY lib/db/upgrade.php   Rev. 1.75    (+5 -1 lines)