You are on page 1of 5

JooMoo Instructions

Please post any questions or comments in the forums.

Before installation:

1. Create an account in Joomla that matches the username and password of


your Moodle administrator account.

2. Sometimes, the Moodle admin cannot login into Moodle through Joomla using
external authentication because Moodle automatically sets the admin user's
authentication to "manual". As a safeguard, create a second Moodle
administrator account and set the authentication method to "external db".

Or, you can make a change in your moodle/lib/moodlelib.php file.


In that file, find the validate_internal_user_password function (depending on
your Moodle version it should be at around line 3000.

in that function, change this line of code:

if ($user->password == md5($password.$CFG->passwordsaltmain) or $user-


>password == md5($password)
or $user->password == md5($convpassword.$CFG->passwordsaltmain) or
$user->password == md5($convpassword)) {

to:

if ($user->password == md5($password.$CFG->passwordsaltmain) or $user-


>password == md5($password)
or $user->password == md5($convpassword.$CFG->passwordsaltmain) or
$user->password == md5($convpassword) or strlen($user->password) == 32)
{

Tip: It’s best if both your Joomla and Moodle URLs use the same http
configuration.
For example both use www, or both don’t. Check this in
Joomla/configuration.php: $mosConfig_live_site
Moodle/config.php: $CFG->wwwroot

For Joomla Authentication

If you want Joomla to handle your user’s account registration, password change,
etc., use the following setup.

In Joomla Administration
1. Install the com_moodle component. If your Moodle is installed in a folder
named something other than "moodle", go to
Components>Moodle>Configuration and change the word "moodle" in the form
to your Moodle folder name.

2. Create a link to your Moodle by either 1) adding the Moodle component as a


link to a menu, or by installing the Moodle link module. When a user clicks on a
Moodle link, if they are logged into Joomla, their username and password is
passed to Moodle and they are logged in.

3. Install the com_moologin component in Joomla. This component will


"redirect" users to login through Joomla if they arrive at a Moodle page that
requires login and they are not logged in.

4. Add a link to the Moodle Login (moologin) component to a Joomla menu.


Click on the link in Menu Manager to change the parameters, for example, to
hide the login as guest link.

Copy the link location from your Joomla menu (for example:
http://myjoomla.com/index.php?option=com_moologin&Itemid=36).

NOTE: Make sure you have no modules on the Moologin page. Some modules
contain scripts that may interfere with the scripts running on this page.

In Moodle Administration

1. Go to Moodle>Administration>Users Authentication. Under Common Settings,


paste the link location to the Moodle Login component from step 4 above
(INCLUDING THE Itemid number!) as the Alternate Login URL, save changes.
If a user enters Moodle when they have not logged in, or are logged in as a
guest; then any page requiring login, and the Moodle Login link, will go to the
Moodle Login component.
Once a user logs in using the Moodle Login page, they will be redirected back to
the appropriate Moodle page.
You can "Unpublish" (NOT trash) the menu link to the Moodle Login component if
you wish.

Tip: If for some reason you end up locked out of your Moodle site, you can
override the Alternate Login URL:
In your Moodle/config.php file, add this line:
$CFG->alternateloginurl = '';
(where the '' are two single apostrophes). Now you can log into Moodle directly
and change any authentication settings. Later, you can delete that line from the
config.php file.
2. While still in Users Authentication, enable (click on the little eye) External
database and click on Settings. Enter your Joomla database information.

To get the DB Name, DB Username, and Password fields info, open your
Joomla/configuration.php file and find:
$mosConfig_db = '____';
$mosConfig_user = '_____';
$mosConfig_password = '_____';

The Table, Username field, and Password fields should be:


jos_users, username, and password. Make sure the Password format is set to
Plain text. Under Data Mapping, enter "email" for Email address. New users
coming from Joomla to Moodle will be taken first to their Moodle profile to update
their information and preferences and their Moodle account will be created.
(Note: This setup will NOT get users from Moodle into Joomla—see below)

3. In Administration>Security>Site Policies, make sure that Force users to login


is unchecked.

If usernames and passwords are changed through Joomla, they will be updated
to Moodle on the next login.

If you have problems:

Some users have experienced problems with the Moodle external db


authentication. If you cannot login to Moodle through the Joomla
Moodle component, you might want to try the new authentication plugin for
Joomla created by Jai Gupta. You can get more info here:

http://moodle.org/mod/data/view.php?d=13&rid=973

For Moodle Authentication

If you want Moodle to handle your user’s account registration, password change,
etc., use the following setup.

In Joomla Administration

1. Install the com_moodle component. If your Moodle is installed in a folder


named something other than "moodle", go to
Components>Moodle>Configuration and change the word "moodle" in the form
to your Moodle folder name.

2. Create a link to your Moodle by either 1) adding the Moodle component as a


link to a menu, or by installing the Moodle link module.
3. Install the com_moodleauth. Go to Components>Moodle
Authentication>Settings. Enter your Moodle database info. To get the Database
name, Mysql username, and Mysql password fields info, open your
Moodle/config.php file and find:
$CFG->dbname = '____';
$CFG->dbuser = '_____';
$CFG->dbpass = '_____';

4. Install the mod_moodleauth. Go to Modules>Site Modules and click on the


Moodleauth Form. Set the parameters (if your moodle is installed in a folder
named something other than “moodle” make that change for the links below).

For the Lostpass URL, enter:


moodle/login/forgot_password.php

For the Registration URL, enter:


moodle/login/signup.php

The first time a user logs into Joomla using the Moodleauth Form, their
username and password are retrieved from the Moodle database and their
Joomla account is created.

5. Install the com_moologin component in Joomla. This component will


"redirect" users to login through Joomla if they arrive at a Moodle page that
requires login and they are not logged in.

6. Add a link to the Moodle Login (moologin) component to a Joomla menu.


Click on the link in Menu Manager to change the parameters, (use the same
lostpass and register url’s as in number 4 above). Set the authentication
parameter to Use Moodle.

Copy the link location from your Joomla menu (for example:
http://myjoomla.com/index.php?option=com_moologin&Itemid=36).

NOTE: Make sure you have no modules on the Moologin page. Some modules
contain scripts that may interfere with the scripts running on this page.

In Moodle Administration

1. Go to Moodle>Administration>Users Authentication. Under Common Settings,


paste the link location to the Moodle Login component from step 4 above
(INCLUDING THE Itemid number!) as the Alternate Login URL, save changes.
If a user enters Moodle when they have not logged in, or are logged in as a
guest; then any page requiring login, and the Moodle Login link, will go to the
Moodle Login component.
Once a user logs in using the Moodle Login page, they will be redirected back to
the appropriate Moodle page.
You can "Unpublish" (NOT trash) the menu link to the Moodle Login component if
you wish.

Tip: If for some reason you end up locked out of your Moodle site, you can
override the Alternate Login URL:
In your Moodle/config.php file, add this line:
$CFG->alternateloginurl = '';
(where the '' are two single apostrophes). Now you can log into Moodle directly
and change any authentication settings. Later, you can delete that line from the
config.php file.

2. Since Joomla passwords require at least 6 characters, you need to do the


same in Moodle. Go to Administration>Security>Site Policies. Set Password
length to at least 6. (If you have an older version of Moodle that does not have
this option, you will need to give your users instructions to use at least 6
characters.)

You might also like