Modifying Moodle login

Modifying Moodle login

by Zbigniew Fiedorowicz -
Number of replies: 7

I have been demonstrating Moodle to various people at Ohio State by pointing them to various pages they might find interesting and telling them to "Login as guest". However some of them are intimidated/confused by the login page.

I have therefore made a simple change to login/index.php to allow bypassing the login page by adding a parameter "username=guest" to the URL:

Replace the line:

if($frm = data_submitted()) {

by the following:

$frm = false;
if (strstr($SESSION->wantsurl,"username=guest")) {
  $frm->username = "guest";
  $frm->password = "guest";
} else {
  $frm = data_submitted();
}

if ($frm) {
Perhaps other Moodlers might find this modification useful in their installations.
Average of ratings: -
In reply to Zbigniew Fiedorowicz

Re: Modifying Moodle login

by Zbigniew Fiedorowicz -
In reply to Zbigniew Fiedorowicz

Re: Modifying Moodle login

by Tom Murdock -
cool course. (aside) I think it is valuable to see how other teachers organize (and utilize) their Moodle courses.

if there are not any security dangers with this hack, I think it has a real functionality by getting strangers close to the material very quickly.
In reply to Tom Murdock

Re: Modifying Moodle login

by Zbigniew Fiedorowicz -

I can't see how this modification can affect security. If username=guest is not present in the requested URL, then clearly the flow of control is the same as without the modification. If it is present, then the flow of control is the same as if the "Login as a guest" button were clicked.

In reply to Zbigniew Fiedorowicz

Re: Modifying Moodle login

by Paula Edmiston -
Zbigniew Fiedorowicz offered access to one of his courses: https://webwork.math.ohio-state.edu/moodle1_1/course/view.php?id=3&username=guest

and I went and visited and I'm intrigued by a module there that I've not seen before

"icon.gif WeBWork" (Print Practice WeBWorK Hmwk0)

What is this please? I don't see it in the "official" moodle and I'm wondering if it's something you invented and could you please talk about it a little?

Thanks!
In reply to Paula Edmiston

Re: Modifying Moodle login

by Zbigniew Fiedorowicz -

Briefly the WeBWorK module is an interface to a mathematics homework system with symbolic math capabilities. This open source system from the University of Rochester is called WeBWorK.

The WeBWorK module can be downloaded from the optional modules page on moodle.org: http://moodle.org/download/modules/. You will find some links to forum discussion here and a link to the University of Rochester WeBWorK page.  You can find additional information by searching the forums here on the key "WeBWorK"