+ Post New Thread
Results 1 to 11 of 11
Virtual Learning Platforms Thread, Moodle + LDAP authentication + cron in Technical; I'm well on my way with my first Moodle installation on Windows. I've worked through LDAP authentication - MoodleDocs and ...
  1. #1
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30

    Moodle + LDAP authentication + cron

    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?

  2. #2

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    do you mean new ad users are not working in moodle?

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

  3. #3
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30
    Quote Originally Posted by glennda View Post
    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.

  4. #4

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    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?

  5. #5

    Hightower's Avatar
    Join Date
    Jun 2008
    Location
    Cloud 9
    Posts
    4,920
    Thank Post
    494
    Thanked 690 Times in 444 Posts
    Rep Power
    241
    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.

  6. #6
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30
    Quote Originally Posted by glennda View Post
    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.
    Last edited by OverWorked; 13th December 2011 at 03:20 PM.

  7. #7
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30
    Quote Originally Posted by Hightower View Post
    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.

  8. #8

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    Quote Originally Posted by OverWorked View Post
    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

  9. Thanks to glennda from:

    OverWorked (13th December 2011)

  10. #9
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30
    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.

  11. #10
    OverWorked's Avatar
    Join Date
    Jul 2005
    Location
    N. Yorks
    Posts
    1,014
    Thank Post
    198
    Thanked 42 Times in 34 Posts
    Rep Power
    30
    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.

    Last edited by OverWorked; 13th December 2011 at 04:40 PM.

  12. #11

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    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!

SHARE:
+ Post New Thread

Similar Threads

  1. Moodle 2.1 LDAP Authentication IIS 404
    By apearce in forum Virtual Learning Platforms
    Replies: 1
    Last Post: 18th October 2011, 11:33 AM
  2. Moodle Installation. Ldap Authentication
    By Chunks_ in forum Learning Network Manager
    Replies: 7
    Last Post: 19th July 2011, 11:59 AM
  3. Moodle - LDAP Authentication
    By Hightower in forum Virtual Learning Platforms
    Replies: 8
    Last Post: 25th January 2010, 06:04 PM
  4. Moodle LDAP authentication stopped working for new users?
    By reggiep in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 5th January 2010, 08:33 PM
  5. Moodle LDAP authentication
    By FN-GM in forum Virtual Learning Platforms
    Replies: 10
    Last Post: 25th May 2008, 11:58 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •