Dokeos ldap configuration guide

afbeelding van Noel

Hre is a small ldap configuration guide.

To activate ldap in dokeos : 

1. check if your php configuration is "ldap ready".

Creata a file named phpinfo.php with only this content  in a web accessible directory: 

<?php

phpinfo();

?>

Open a browser and go to this file (for example http://localhost/phpinfo.php).

Then check if you have an ldap section. For axample :

ldap

LDAP Support enabled
RCS Version $Id: ldap.c,v 1.161.2.3.2.12 2007/12/31 07:20:07 sebastian Exp $
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20411
SASL Support Enabled

If you don't, install ldap extension. On debian based linux distribution, just do  sudo apt-get install php5-ldap.


2. Install dokeos normally

3. Edit your main/inc/conf/configuration.php and uncomment (remove the "//")  those 2 line :

// $extAuthSource["ldap"]["login"]            = $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/login.php";
// $extAuthSource["ldap"]["newUser"]        =$_configuration['root_sys'].$_configuration['code_append']."auth/ldap/newUser.php";
4. If you have dokeos 2.1 or less, please apply patch I gave here http://www.dokeos.com/en/node/10712

5. go to http://yourplatformrooturl/main/admin/settings.php?category=LDAP and configure your parameters

6. If you use microsoft active directory. open the file main/auth/ldap/authldap.php change "uid=$uname" by "sAMAccountName=$uname" in fuction ldap_authentication_check and in function ldap_find_user_info.

Maybe I forgot something, if you have problems, please post here and I'll try to help you

Thanks for you help!!!

Thank youuuuuuuuuuuuuuuuu!! it works!!! :D good job!!! congrats!

Fatal error

I really appreciate you posting a guide. It clarifies some things I had doubts with.

However, I am still having trouble. At no point in time do I ever see the ldap extension present when i look for it in phpinfo.php file.

I get the following fatal error message after everything is installed and all the edits are made except for the patch. I try to login using an MS Active Directory account.

 

Fatal Error: Call to undefined function ldap_connect() in C:\wamp\www\Dokeos\main\auth\ldap\authldap.php on line 385.

Here are lines 380-390: 

    //error_log('Entering ldap_authentication_check('.$uname.','.$passwd.')',0);
    global $ldap_host, $ldap_port, $ldap_basedn, $ldap_host2, $ldap_port2,$ldap_rdn,$ldap_pass;
    //error_log('Entering ldap_authentication_check('.$uname.','.$passwd.')',0);
    // Establish anonymous connection with LDAP server
    // Etablissement de la connexion anonyme avec le serveur LDAP
    $ds=ldap_connect($ldap_host,$ldap_port);
    ldap_set_version($ds);

    $test_bind = false;
    $test_bind_res = ldap_handle_bind($ds,$test_bind);
       //en cas de probleme on utlise le replica

Could you help me out with this ? A push in the right direction will get me going.

Thanks !

 

For techincal purposes: I am using WAMP server 2.2a-32x

     

afbeelding van Noel

Missing ldap extension

Hi,

 

It's because you are missing php ldap extension.  ldap_connect() is a function of this extension.

Please follow this instructions for wamp (I am actually a linux only user and can help you much with windows installations)

http://php.net/manual/en/install.windows.extensions.php

 

Noel

Severe Difficulties

Hi Noel.

Thanks for posting the link . Im still working on trying to make this work. I feel like throwing my computer off a cliff.

This is incredibly hard to get working so when I do get a solution I will post here.

Thanks,

dummytron 

 

Hi Noel. I redid my computer

Hi Noel.

I redid my computer from scratch and I got the LDAP extension to work ! Now im just working on steps 4-6.  From what I understand I went ahead and substituted uid=$uname with sAMAccountName=$uname since I am using Microsoft Active Directory.

However, I get these error messages kicked back to me:

( ! ) Notice: Undefined variable: uname in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 401

line 401 reads:  $filter="(sAMAccountName=$uname)";

( ! ) Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 408

line 408 reads: $sr=ldap_search($ds,$ldap_basedn,$filter);


( ! ) Warning: ldap_get_entries() expects parameter 2 to be resource, boolean given in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 410

line 410 reads: $info = ldap_get_entries($ds, $sr);


( ! ) Notice: Undefined variable: _user in C:\wamp\www\dokeos\main\auth\ldap\newUser.php on line 65

line 65 reads: unset($_user['user_id']);

Maybe I'm missing something or I understood it differently from what you typed.

I'm almost there!

Thank you again for posting the guide.

Phil

3 Errors Remaining.

I was searching on the internet for a way to edit it for MS Active Directory. Basically I replaced the authldap file with the one found on this website:

http://pix-mania.dyndns.org/mediawiki/index.php/Dokeos_-_authldap

Now I have 3 errors Remaining:

#1 Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 368

#2 Warning: ldap_get_entries() expects parameter 2 to be resource, boolean given in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 370

365        $ldap_bind_res = ldap_handle_bind($ds,$result);
366        // Execution de la recherche avec $filtre en parametre
367        //error_log('Searching for '.$filter.' on LDAP server',0);
368        $sr=ldap_search($ds,$ldap_basedn,$filter);
369        // La variable $info recoit le resultat de la requete
370        $info = ldap_get_entries($ds, $sr);
371        $dn=($info[0]["dn"]);
372        //affichage debug !!    echo"<br> dn = $dn<br> pass = $passwd<br>";
373        // fermeture de la 1ere connexion
374        ldap_close($ds);
375         }

The third error has to do with the newUser.php:

#3 Notice: Undefined variable: _user in C:\wamp\www\dokeos\main\auth\ldap\newUser.php on line 65

Here are lines 63-68:

    //error_log('Could not find '.$login.' on LDAP server',0);
    $loginFailed = true;
    unset($_user['user_id']);
    $uidReset = false;
}
?>

I am almost there. Any help would be greatly appreciated.

Thanks!

-Phil

afbeelding van Sarah MAMAN

Dokeos 1.8.6.1 - LDAP -Login and password not take into account

Hello,

When I complete my LDAP login and password in the login window, the window closes then opens again regardless of my login and password.
 
Here's what I changed in my serverand in Dokeos 1.8.6.1 interface (Administration / LDAP) :
1 - Dokeos installation  - LDAP settings was written in orange.
2 - I install openldap-clients so the commande LDAP search , on my seveur, in now OK. So php configuration is now "ldap ready"
3 - The 2 lines in main/inc/conf/configuration.php are uncommented.
4 - The dokeos interface "LDAP" is saved with all LDAP parametrers ($uname is uid).
 
But it doesn't work.
 
Could you please help me ?
Thanks in advance,
Sarah
afbeelding van Sarah MAMAN

Patch for LDAP identification ?

Helleo,

 

Could you please informe me if the patch have to be applied for dokeos 1.8.6.1 ?

"4. If you have dokeos 2.1 or less, please apply patch I gave here http://www.dokeos.com/en/node/10712"

Thanks a lot,

Sarah

 

 

afbeelding van theHAAG

Solution to LDAP search

@Phil

 

Did you find a solution to the Ldap problem you were having? the 3 errors?? I am also having the same issues with all dokeos and its clones something is wrong with the code, had to be.......

afbeelding van Sarah MAMAN

Ldap Problem solved

Hello,

 

I have solved my ldap problem.

I have installed dokeos 1.8.6.1. The patch was already coded in this version. I just have to follow steps explain at the top of this page.

Just one important step to validate : during the installation of Dokeos, be careful of your URL (localhost or DNS used). For instance, first, I have installed Dokeos on my local virtual machine (so with an URL like localhost ..) and after, I use a DNS.

Consequently, I have to re-install Dokeos...

Do not hesitate to explain your questions...

 

But I have another question : only LDAP password is Ok, but the login is not the LDAP login. I need a solution but I didn't find it yet. Do you have any idea ?

 

Faithfully,

Sarah

afbeelding van theHAAG

LDAP Urgency

Dear Dokeos Developers,

Our school would really like to start using LDAP with Dokeos however we cannot get it to work still... I have tried almost ever possible combination and still nothing is able to fix this issue.

Is there going to be an update soon? This (as well as calender issues) are the only things stopping us using Dokeos as our main portal for our school.. A new version of Chamilo is out soon, I wonder if that could address this LDAP issue??

Is someone able to email me please at tripytrev@hotmail.com to assist in trying to get this LDAP login up and running please?? I have another system called "Student Manager" that uses both PHP and SQL and have no issues with that and its ability to login via LDAP.

If someone would be able to email me please at tripytrev 'at' hotmail.com that would be great as myself and a number of other people are having the same problem. I hope so see Dokeos to be a great alernative to Nixty (Open Classroom learning) together with the power of "OpenStudy".

thank you

Kind Regards

Trev

afbeelding van mohan

hi,

Hi,

I will ask our dev team and update you ASAP.

Thanking you.

afbeelding van theHAAG

dokeos 2.2 beta LDAP issue

I must be doing something wrong im getting error newUser.php on line 66

I have a clean setup with everything installed except xampian i removed the two commends in the configuration.php file?? what must i be missing?

If you don't, install ldap

If you don't, install ldap extension. On debian based linux distribution, just do sudo apt-get install php5-ldap.-James Stuckey