LDAPAuthPlugin Class Reference
[Plugins_auth_ldap]

LDAP authentication plugin. More...

Inheritance diagram for LDAPAuthPlugin:

AuthPlugin Plugin List of all members.

Public Member Functions

 authenticate ($username, $password)
 bind ($binddn=null, $password=null)
 close ()
 createUser (&$user)
 deleteUser ($username)
 encodePassword ($password)
 getDescription ()
 getDisplayName ()
getInstance ($settings, $authId)
 getName ()
 getUserEntry ($username)
 getUserInfo (&$user)
 open ()
 register ($category, $path)
 setUserInfo (&$user)
 setUserPassword ($username, $password)
 userExists ($username)
 userFromAttr (&$user, &$uattr)
 userToAttr (&$user, &$attr)

Public Attributes

 $conn

Detailed Description

LDAP authentication plugin.

Definition at line 20 of file LDAPAuthPlugin.inc.php.


Member Function Documentation

LDAPAuthPlugin.authenticate ( username,
password 
)

Authenticate a username and password.

Parameters:
$username string
$password string
Returns:
boolean true if authentication is successful

Reimplemented from AuthPlugin.

Definition at line 92 of file LDAPAuthPlugin.inc.php.

References bind(), close(), getUserEntry(), and open().

LDAPAuthPlugin.bind ( binddn = null,
password = null 
)

Bind to a directory. $binddn string directory to bind (optional) $password string (optional)

Definition at line 257 of file LDAPAuthPlugin.inc.php.

Referenced by authenticate(), createUser(), deleteUser(), getUserEntry(), setUserInfo(), setUserPassword(), and userExists().

LDAPAuthPlugin.close (  ) 

Close connection.

Definition at line 247 of file LDAPAuthPlugin.inc.php.

Referenced by authenticate(), createUser(), deleteUser(), getUserInfo(), setUserInfo(), setUserPassword(), and userExists().

LDAPAuthPlugin.createUser ( &$  user  ) 

Create a user on the LDAP server.

Parameters:
$user User to create
Returns:
boolean true if successful

Reimplemented from AuthPlugin.

Definition at line 191 of file LDAPAuthPlugin.inc.php.

References bind(), close(), encodePassword(), getUserEntry(), open(), and userToAttr().

LDAPAuthPlugin.deleteUser ( username  ) 

Delete a user from the LDAP server.

Parameters:
$username string user to delete
Returns:
boolean true if successful

Reimplemented from AuthPlugin.

Definition at line 216 of file LDAPAuthPlugin.inc.php.

References bind(), close(), getUserEntry(), and open().

LDAPAuthPlugin.encodePassword ( password  ) 

Encode password for the 'userPassword' field using the specified hash.

Parameters:
$password string
Returns:
string hashed string (with prefix).

Definition at line 368 of file LDAPAuthPlugin.inc.php.

Referenced by createUser(), and setUserPassword().

LDAPAuthPlugin.getDescription (  ) 

Return the localized description of this plugin.

Returns:
string

Reimplemented from AuthPlugin.

Definition at line 65 of file LDAPAuthPlugin.inc.php.

LDAPAuthPlugin.getDisplayName (  ) 

Return the localized name of this plugin.

Returns:
string

Reimplemented from AuthPlugin.

Definition at line 57 of file LDAPAuthPlugin.inc.php.

& LDAPAuthPlugin.getInstance ( settings,
authId 
)

Returns an instance of the authentication plugin

Parameters:
$settings array settings specific to this instance.
$authId int identifier for this instance
Returns:
LDAPuthPlugin

Reimplemented from AuthPlugin.

Definition at line 81 of file LDAPAuthPlugin.inc.php.

References AuthPlugin.$authId, and AuthPlugin.$settings.

LDAPAuthPlugin.getName (  ) 

Return the name of this plugin.

Returns:
string

Reimplemented from AuthPlugin.

Definition at line 49 of file LDAPAuthPlugin.inc.php.

LDAPAuthPlugin.getUserEntry ( username  ) 

Lookup a user entry in the directory.

Parameters:
$username string

Definition at line 269 of file LDAPAuthPlugin.inc.php.

References bind().

Referenced by authenticate(), createUser(), deleteUser(), getUserInfo(), setUserInfo(), and setUserPassword().

LDAPAuthPlugin.getUserInfo ( &$  user  ) 

Retrieve user profile information from the LDAP server.

Parameters:
$user User to update
Returns:
boolean true if successful

Reimplemented from AuthPlugin.

Definition at line 133 of file LDAPAuthPlugin.inc.php.

References close(), getUserEntry(), open(), and userFromAttr().

LDAPAuthPlugin.open (  ) 

Open connection to the server.

Definition at line 238 of file LDAPAuthPlugin.inc.php.

Referenced by authenticate(), createUser(), deleteUser(), getUserInfo(), setUserInfo(), setUserPassword(), and userExists().

LDAPAuthPlugin.register ( category,
path 
)

Called as a plugin is registered to the registry

Parameters:
$category String Name of category plugin was registered to
Returns:
boolean True iff plugin initialized successfully; if false, the plugin will not be registered.

Reimplemented from Plugin.

Definition at line 27 of file LDAPAuthPlugin.inc.php.

LDAPAuthPlugin.setUserInfo ( &$  user  ) 

Store user profile information on the LDAP server.

Parameters:
$user User to store
Returns:
boolean true if successful

Reimplemented from AuthPlugin.

Definition at line 151 of file LDAPAuthPlugin.inc.php.

References bind(), close(), getUserEntry(), open(), and userToAttr().

LDAPAuthPlugin.setUserPassword ( username,
password 
)

Change a user's password on the LDAP server.

Parameters:
$username string user to update
$password string the new password
Returns:
boolean true if successful

Reimplemented from AuthPlugin.

Definition at line 173 of file LDAPAuthPlugin.inc.php.

References bind(), close(), encodePassword(), getUserEntry(), and open().

LDAPAuthPlugin.userExists ( username  ) 

Check if a username exists.

Parameters:
$username string
Returns:
boolean

Reimplemented from AuthPlugin.

Definition at line 116 of file LDAPAuthPlugin.inc.php.

References bind(), close(), and open().

LDAPAuthPlugin.userFromAttr ( &$  user,
&$  uattr 
)

Update User object from entry attributes. TODO Abstract this to allow arbitrary LDAP <-> OJS schema mappings. For now must be subclassed for other schemas. TODO How to deal with deleted fields.

Parameters:
$user User
$uattr array

Definition at line 288 of file LDAPAuthPlugin.inc.php.

References AppLocale.getLocale().

Referenced by getUserInfo().

LDAPAuthPlugin.userToAttr ( &$  user,
&$  attr 
)

Update entry attributes from User object. TODO How to deal with deleted fields.

Parameters:
$user User
$attr array

Definition at line 343 of file LDAPAuthPlugin.inc.php.

Referenced by createUser(), and setUserInfo().


The documentation for this class was generated from the following file:
Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7