Moodle Tip – Changing from External DB to Manual Authentication

Problem: I set up an external database to facilitate students logging in (our teachers use LDAP authentication). Moodle refers to this external database, which is great when students are creating their account for the first time, but then it continues to refer to the database for their password, even though the Moodle admin has changed their password in Moodle. We end up with authentication errors…is there a way to disable external database authentication for students who are already in the system?

The short answer to that is YES. Here’s how:
The command below changes authenticated users via external database to manual. The purpose of this is to ensure that admins can force password change among student users.

update mdl_user

set auth=’manual’

WHERE username=’s741514′

You can modify the WHERE command to be a bit more inclusive…for example:

WHERE username like ‘s%’

which would address every student account in our system (which is based on “s” placed in front of the student ID #).

How useful is this tip?


Subscribe to Around the Corner-MGuhlin.org


Everything posted on Miguel Guhlin’s blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure


Discover more from Another Think Coming

Subscribe to get the latest posts sent to your email.

2 comments

  1. Hi again,It is also possible to change the authentication method while editing the user's profile (of course you need to be logged in as an admin to do that). The auth method is one of the advanced settings, so you have to click the "show advanced" button first.Obviously, doing it in the user's profile is OK if you need to change the auth method for a couple of users, but if you need to do it in bulk, your database command will be much more efficient 🙂 However, if it's not really necessary, I'd say people should always try to avoid tampering with the database directly.Best regards,Przemek

  2. Hi again,It is also possible to change the authentication method while editing the user's profile (of course you need to be logged in as an admin to do that). The auth method is one of the advanced settings, so you have to click the “show advanced” button first.Obviously, doing it in the user's profile is OK if you need to change the auth method for a couple of users, but if you need to do it in bulk, your database command will be much more efficient 🙂 However, if it's not really necessary, I'd say people should always try to avoid tampering with the database directly.Best regards,Przemek

Leave a comment