CMS integrations: Moodle Block for Drupal 6.x

CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
Number of replies: 11
As asked in another thread, I am explaining how my method to switch from a logged-in Drupal site to Moodle running under the same domain as Drupal, sharing the same user login data. The following screenshots demonstrate how it works. Since Moodle's forum only allows one attachment per post, I am posting each of the 4 screenshots in a separate posting.

In Drupal, a block called "Moodle" appears once a user has logged in (in the below screenshot, the username is "test"). If that user has not yet logged into Moodle, the Moodle block provides a link "Login to Moodle".

Attachment 01.Login_to_Moodle.png
Average of ratings: -
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
As shown in the mouse-over description of that link, clicking on it opens a new window with Moodle's login page, with the username pre-filled in. In the below screenshot,the password is also filled in (masked by dots) thanks to Mozilla Firefox's Password manager. Thus, the user only has to click the "Login" button and does not have to type in the username and password again. So it's not a full SSO. The disadvantage to require the user clicking one button allows the advantage that this method works with all authentication methods available to Moodle (in the shown example, LDAP server auth is used).

Attachment 02.Moodle_s_login_page.png
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
When we switch back to the original window, the link in Drupal's Moodle Block has automagically changed to "Switch to Moodle".

Attachment 03.Switch_to_Moodle.png
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
As shown in the mouse-over description of that link, clicking on it switches to the Moodle window. However, it does not open the login page anymore, but loads the start page instead.

Attachment 04.Moodle_s_start_page.png
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
I have now extended that block to have real SSO capabilities when using LDAP server user authentication.
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by José Álvarez Huete -
Hi Robert:

I am using Moodle 1.9 and Drupal 6.9. could I use your solution? Of course, with your credits.

This is my site, for your information. www.portaleva.es www.portaleva.eu

Thanks again, I came from the other trhead. smile
In reply to José Álvarez Huete

Re: CMS integrations: Moodle Block for Drupal 6.x

by Robert Allerstorfer -
Hi José,

of course you can use my solution -I'm glad to give something back to the great Drupal and Moodle communities. I am using it successfully at the sites I am administering, but it may be too early for public use yet.

First of all, here is all you need to check on the Moodle side before you can use it:
  • Requires Moodle 1.9.5 (or the weekly Moodle 1.9.4+ Build 20090211) or higher
  • Moodle does not need to be altered in any way - so it works with Moodle stock installations "out of the box" smile
  • Moodle must run under the same domain as Drupal and share the same user login data
  • Ensure that Moodle's config "sessioncookiepath", as set in "Site Administration -> Server -> Session Handling -> Cookie path" is kept on its default value of "/"!
I recommend to use LDAP server user authentication to both Moodle and Drupal, so your users get true SSO from Drupal to Moodle. Once you have assured to meet these Moodle requirements, let us please continue the discussion on the SSO thread.

Thanks,
rob.
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Panda Shark -
Hy Robert

Can i use your solution too?

Thanks
In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Giridhar S -

Drupal 6.10 and moodle 1.9 integration

Hello,
I have integrated drupal 6.10 and moodle 1.9 for single authentication using external database authentication mangament.

Procedures i followed:
1-installed moodle and drupal on same server on same level server.
2-added drupal moodle module 6.x in drupal and activated.
3-configured external database in moodle to access drupal database.
4-activated and added quick api plugin to moodle and specified the client hosts.

so everything is working fine, i can login to moodle using drupals username and password.

Problem:
When i click the moodle link in drupal it takes me to moodle without logged in, just i have to loggin another time to moodle when i go to moodle from drupal.

Please explain me to do this sir:
just i need to login automatically to moodle when i click the moodle link on the drupal.

In reply to Robert Allerstorfer

Re: CMS integrations: Moodle Block for Drupal 6.x

by Giridhar S -
Hello sir,,

can u please explain me how to use your block in drupal.