If you are not aware of OHRM, then please go to www.orangehrm.com
I have implemented this facility using adLDAP which is nothing but a PHP class that provides LDAP authentication and integration with Active Directory. Another thing that I have installed OrangeHRM on win XP.
Please follow below steps to achieve LDAP implementation
- Download adLDAP from adLDAP Download
- Extract the zip containing adLDAP PHP class and place the adLDAP.php to OrangeHRM root directory as web_content(PHP root)/OrangeHRM/lib/common/ldap/adLDAP.php (create ldap directory as it is not present there)
- Now before start coding, please read the documentation of adLDAP at adLDAP Documentation because adLDAP class needs some information related to your ADS server to get connected
- Find login.php of OrangeHRM in which modification will be done
- Comment the existing code to handle LDAP module
- Below that write following piece of code
require_once(dirname(__FILE__) . '/lib/common/ldap/adLDAP.php');
$adldap = new adLDAP();
$ldapFile = ROOT_PATH . "/lib/common/ldap/adLDAP.php";
$_SESSION['ldap'] = "enabled";
$_SESSION['ldapStatus'] = "enabled"; - Now call the adLDAP class's method authenticate() using adLDAP object in place of ldapAuth() as shown at the place of authentication code
$ldapAuth = $adldap->authenticate($rset[0][0], $_POST['txtPassword']);
- Create the users in OrangeHRM same as ADS server with blank passwords
- Now start login with ADS authentication credentials
Hey as above has done with OrangeHRM using adLDAP, both are opensource projects developed using PHP. In my case it has been worked successfully. As I have also searched for this issue drastically but didn't got any solution so after achieved the solution me presenting this piece of work to you. Please let me know your reviews and comments if any...
Thanks
Thanks brother I googled like crazy guns to handle this issue but got complete solution at you...
ReplyDeleteAnd it's working too
Thank u very much
Hi Please, could you help with doing this step by step as I am not very old with PHP yet
DeleteDear All,
ReplyDeleteIs it possible to send me all completed files?
Much appreciate if you could help on this.
Thank you,
My email address: terence.kiat@gmail.com
Thank you so much..
i got this error, somebody can help me? very upset here
ReplyDeleteFatal error: Uncaught exception 'adLDAPException' with message 'No LDAP support for PHP. See: http://www.php.net/ldap' in C:\xampp\htdocs\hrm\lib\common\ldap\adLDAP.php:338 Stack trace: #0 C:\xampp\htdocs\hrm\login.php(65): adLDAP->__construct() #1 {main} thrown in C:\xampp\htdocs\hrm\lib\common\ldap\adLDAP.php on line 338
Seems that LDAP facility not been enabled, Please follow
ReplyDeletehttp://www.php.net/manual/en/ldap.installation.php
Reply if not resolved...
Hey can you let me know the version of OrangeHRM and adLDAP used, because i am facing lot of problem while configuring same.
ReplyDeleteAlso, can you please mail me those configuration file, will be very thankful. Stuck with this project.
Mail : rick.rocx@gmail.com
Thank you in advance
The implementation has been done on
ReplyDeleteOrangeHRM 2.5
adLDAP 3.3.1
This doesn't work for me either, I commented out everything within the first /* LDAP Module */ and the 2nd /* LDAP Module */ and added this below it:
ReplyDeleterequire_once(dirname(__FILE__) . '/lib/common/ldap/adLDAP.php');
$adldap = new adLDAP();
$ldapFile = ROOT_PATH . "/lib/common/ldap/adLDAP.php";
$_SESSION['ldap'] = "enabled";
$_SESSION['ldapStatus'] = "enabled";
$ldapAuth = $adldap->authenticate($rset[0][0], $_POST['txtPassword']);
I got error saying "Undefined variable: rset"
Can you clarify? Thanks
This comment has been removed by the author.
ReplyDeleteSeems you didn't configured your adLDAP class. It requires some information related to your ADS server please refer to the link http://adldap.sourceforge.net/wiki/doku.php?id=api for further details and set the adLDAP class variables such as
ReplyDeleteprotected $_account_suffix = "@example.local";
protected $_base_dn = "DC=example,DC=local";
protected $_domain_controllers = array ("example-controller.example.local");
Use your server credentials
It is easy
This comment has been removed by the author.
DeleteI am getting this error after admin login and can't create users.
DeleteWarning
require_once(C:\xampp\htdocs\orangehrm25/plugins/ldap/LdapDetails.php) [function.require-once]: failed to open stream: No such file or directory
Technical Details
Encountered the problem in C:\xampp\htdocs\orangehrm25\lib\controllers\ViewController.php Line 69
Please help me out.
I use the same adLDAP class together with putting some other files (and not modifying login.php) under plugins/ldap folder and successfully enabled LDAP authentication. Now I want to implement IWA (Integrated Windows Authentication) so that our users don't have to keyin username/password. Do you have any idea about that?
ReplyDeletecan you please provide the other files you have put under plugins/ldap folder ?
Deletenaeem.ijaz@hotmail.com
naeem.ijaz81@gmail.com
Regards,
Hi,
ReplyDeleteI tried to implement adldap in the version 2.6.11 of orangehrm. And I cannot connect to the application using my ldap login.
The only message I have is invalid credentials. I already tried the adldap classes and they are ok.
Did you tried to implement adldap with this version ?
I will be pleased to here your feedbacks.
Thanks.
Best regards
Paps
I installed OpenHRM 2.6.11 and tried to implement ldap login, but could not find the login.php file referenced in your post. I assume they have changed structure of how authentication works since. How do I implement LDAP authentication in this new version? Thanks!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi
ReplyDeleteI am also looking into ldap authentication for orangehrm , I am not able to find the common folder in orangehrm location , as you mention in your previous posts /OrangeHRM/lib/common/ldap/adLDAP.php .
I am not able to find the "common folder" please kindly help to solve this
we are using orangehrm 3.0.1 version. please help us in implementing ldap authentication in orangehrm 3.0.1..
ReplyDeleteThankyou..
Hi, I'm using orangeHRM 3.0.1. The Structure of orangeHRM is quite different as well as how the program works. So could you guide me toward implementing the above mentioned functionality in orangeHRM 3.0.1. I'm very new to symfony and orangeHRM , so it will be a great help if you do
ReplyDeletewere you helped when you sent this request comment
DeleteHi!
ReplyDeleteWe already have an LDAP Server configured,so how can i just bind it to HRM? Do I have to follow the same procedure? Thank you
I am also using orangeHRM 3.0.1, could you send me the config file for this version.
ReplyDeletemasanafu@gmail.com
Much appreciated.
I installed OpenHRM 3.1.1 and tried to implement ldap login, but could not find the login.php file referenced in your post. I assume they have changed structure of how authentication works since. How do I implement LDAP authentication in this new version? Thanks!
ReplyDeleteI installed OrangeHRM 3.0.1 how to implement adldap process please help me
ReplyDeleteGood Enhancement Sandeep Sir!!!
ReplyDeletewhat is the path for login.php in orangeHRM directory ? I am unable to find it. Please help
ReplyDeleteCan u plz make a short tutorial video for best option
ReplyDelete