"Invalid Login" if country code is lowercase

"Invalid Login" if country code is lowercase

i le Derek Chaplin -
Number of replies: 0

Scenario:

  1. Did a bulk upload of users from a CSV file using the proper field input format and all the users came in just fine. 
  2. When users tried to login they received an "Invalid login" 
  3. Checked security settings, tried setting a different password - strong or weak it didn't matter

Apparent source of the problem:

After much head scratching and Moodle/Google searching it seems that Moodle requires the 2 letter country codes to be UPPERCASE. I had them as lowercase in my CSV file.

Solution:

  • Using the PHPMyAdmin tool on the hosting site, changed all country codes to uppercase using the following SQL:
  • UPDATE mdl_user SET country = UCASE(country)

After making this change users were able to login without issues.

While the Moodle documentation (shown below and found here) hints at it with the text, I didn't get the hint. Should state explicitly that country must be UPPERCASE (for slow people like me)

  • Country- use a country TWO LETTER CODE

Average of ratings: -