com.konakart.bl
Class LDAPMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
      extended by com.konakart.bl.LDAPMgr
All Implemented Interfaces:
LDAPMgrIf

public class LDAPMgr
extends BaseMgr
implements LDAPMgrIf

Called when LDAP is enabled to use LDAP for authenticating the user


Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakart.bl.BaseMgr
templateBaseDir
 
Constructor Summary
LDAPMgr(KKEngIf eng)
          Constructor used when instantiated by the application engine
 
Method Summary
 int checkCredentials(java.lang.String emailAddr, java.lang.String password)
          Called if the LDAP module is installed and active.
 
Methods inherited from class com.konakart.bl.BaseMgr
addInsertAttr, addInsertAttr, checkRequired, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isEnterprise, isMultiStoreShareCustomers, isMultiStoreShareProducts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

LDAPMgr

public LDAPMgr(KKEngIf eng)
        throws java.lang.Exception
Constructor used when instantiated by the application engine

Parameters:
eng - Application engine
Throws:
java.lang.Exception
Method Detail

checkCredentials

public int checkCredentials(java.lang.String emailAddr,
                            java.lang.String password)
                     throws KKException
Called if the LDAP module is installed and active. This method should return: This method may need to be modified slightly depending on the structure of your LDAP. The example works when importing the exampleData.ldif file in the LDAP module jar: dn: cn=Robert Smith,ou=people,dc=example,dc=com
objectclass: inetOrgPerson
cn: Robert Smith
cn: Robert J Smith
cn: bob smith
sn: smith
uid: rjsmith
userpassword: rJsmitH
carlicense: HISCAR 123
homephone: 555-111-2222
mail: r.smith@example.com
mail: rsmith@example.com
mail: bob.smith@example.com
description: swell guy
The code attempts to connect to LDAP using the username, password and URL in the configuration variables set when the module was installed through the admin app.
After having connected, the person object is searched for using the email address of the user. If found we use the "cn" attribute and the password of the user to attempt to bind to LDAP. If the bind is successful, we return a positive number which means that authentication was successful.

Specified by:
checkCredentials in interface LDAPMgrIf
Parameters:
emailAddr - The user name required to log in
password - The log in password
Returns:
Returns an integer
Throws:
KKException


Copyright © 2011 DS Data Systems UK Ltd.