Jump to content

Recommended Posts

Posted

I'm well on my way with my first Moodle installation on Windows.

 

I've worked through LDAP authentication - MoodleDocs and set up LDAP.

 

New user accounts are not being created. If I log on as a new user, I just get "Invalid login, please try again", no other errors are displayed.

 

I thought that will LDAP configured, Moodle would look up new users when they try to log on and set up their accounts as necessary - is this not right?

 

I think I'm supposed to set up a cron job to automate LDAP synchronisation. I've installed MoodleCron, and it appear to be working, runing the standard cron job.

 

How do I add another cron job to sync LDAP?

Posted
do you mean new ad users are not working in moodle?

 

or the other way around? new moodle users don't work in ad?

 

No AD users are working in Moodle. If I look at Home/ ► Site administration/ ► Users/ ► Accounts/ ► Browse list of users, it shows only the two accounts I set up manually.

 

I can create new users in AD, then try to log on with those credentials in Moodle, it says "Invalid login, please try again". I expected it to look them up in AD and create the account.

Posted (edited)
what type of account are you using to bind the account? do you get any errors in the apache error log?

 

Do you have the ldap php plugin installed?

 

Thanks.

 

The account was a standard user. I've changed it to a member of domain admins, but it didn't make any difference. I've entered the name in the form "CN=Moodle LDAP,CN=Users,DC=domain,DC=local"

 

I'm running it on IIS, not Apache, as I installed it via the MS Web Platform Installer.

 

I've installed the ldap php plugin. The LDAP Server page won't appear without it.

Edited by OverWorked
Posted
Moodle will look up the accounts in AD and create where necessary, so it sounds to me that you haven't got your LDAP configured correctly.

 

I agree. But I've worked carefully through the Moodle Docs and can't see what's wrong.

Posted
Thanks.

 

The account was a standard user. I've changed it to a member of domain admins, but it didn't make any difference. I've entered the name in the form "CN=Moodle LDAP,CN=Users,DC=domain,DC=local"

 

I'm running it on IIS, not Apache, as I installed it via the MS Web Platform Installer.

 

Ok, well I presume IIS still needs to have the PHP module for Ldap (I've never used IIS)

 

is the Ldap entry correct for where the moodle user is? what ou is the user in?

 

If you go to View with AD open select advanced features and open properties of the moodle bind user account you can select attribute editor and then you should be able to see the full DN name so you can paste this in. (see attached)

 

Also do you have the Search Sub-context's selected to yes? as this will then search the sub ou's within the main ou selected.

 

attribute editor.png

  • Thanks 1
Posted

The LDAP entry for the Moodle user is correct. I'd already copied the full DN from the attribute editor so I could be sure of getting it right.

Search sub contexts is 'yes'.

 

The Moodle bind user is in a different OU to the rest of the users (set in contexts, 3 lines down). Should this make a difference?

 

Update:-

 

I can manually run sync_users.php, and it returns:-

 

Connecting to LDAP server... Creating temporary table tmp_extuser ................................................................................ ....................................................................!!! Error writing to database !!!

 

This suggests (to me) that Moodle is connecting to AD, but there's another problem afterwards.

Posted (edited)

I am so embarrassed.

 

I was using the wrong password for the test account. Moodle was correctly reporting "Invalid login, please try again", with no other errors.

 

I've wasted two hours on this, and your time too. I need a break.

 

(It doesn't explain the error running sync_users.php manually, but that's something else).

 

I really am sorry. I was just stuck in a groove and not thinking of the full problem.

 

:doh:

Edited by OverWorked
Posted
Don't worry! we all do stupid things once in a while, i was remote desktoped onto a server earlier and accidentally rebooted it instead of my machine!!! From the command line so not even got the option to cancel!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...