Open Journal Systems  3.3.0
LDAPAuthPlugin Class Reference
Inheritance diagram for LDAPAuthPlugin:
AuthPlugin Plugin

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, $mainContextId=null)
 
 setUserInfo ($user)
 
 setUserPassword ($username, $password)
 
 userExists ($username)
 
 userFromAttr (&$user, &$uattr)
 
 userToAttr (&$user, &$attr)
 
- Public Member Functions inherited from AuthPlugin
 __construct ($settings=array(), $authId=null)
 
 doCreateUser ($user)
 
 doGetUserInfo ($user)
 
 doSetUserInfo ($user)
 
 doSetUserPassword ($username, $password)
 
 getSettingsTemplate ()
 
 isSitePlugin ()
 
- Public Member Functions inherited from Plugin
 __construct ()
 
 _overridePluginTemplates ($hookName, $args)
 
 addLocaleData ($locale=null)
 
 getActions ($request, $actionArgs)
 
 getCanDisable ()
 
 getCanEnable ()
 
 getCategory ()
 
 getContextSpecificPluginSettingsFile ()
 
 getCurrentVersion ()
 
 getDirName ()
 
 getEnabled ()
 
 getHideManagement ()
 
 getInstallControlledVocabFiles ()
 
 getInstallDataFile ()
 
 getInstallEmailTemplateDataFile ()
 
 getInstallEmailTemplatesFile ()
 
 getInstallFilterConfigFiles ()
 
 getInstallMigration ()
 
 getInstallSchemaFile ()
 
 getInstallSitePluginSettingsFile ()
 
 getLocaleFilename ($locale)
 
 getPluginPath ()
 
getRequest ()
 
 getSeq ()
 
 getSetting ($contextId, $name)
 
 getTemplatePath ($inCore=false)
 
 getTemplateResource ($template=null, $inCore=false)
 
 import ($class)
 
 installContextSpecificSettings ($hookName, $args)
 
 installControlledVocabs ($hookName, $args)
 
 installData ($hookName, $args)
 
 installEmailTemplateData ($hookName, $args)
 
 installEmailTemplates ($hookName, $args)
 
 installFilters ($hookName, $args)
 
 installLocale ($hookName, $args)
 
 installSiteSettings ($hookName, $args)
 
 manage ($args, $request)
 
 smartyPluginUrl ($params, $smarty)
 
 updateSchema ($hookName, $args)
 
 updateSetting ($contextId, $name, $value, $type=null)
 

Data Fields

 $conn
 
- Data Fields inherited from AuthPlugin
 $authId
 
 $settings
 
- Data Fields inherited from Plugin
 $pluginCategory
 
 $pluginPath
 
 $request
 

Additional Inherited Members

- Protected Member Functions inherited from Plugin
 _registerTemplateResource ($inCore=false)
 

Detailed Description

LDAP authentication plugin.

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

Member Function Documentation

◆ authenticate()

LDAPAuthPlugin::authenticate (   $username,
  $password 
)

Authenticate a username and password.

Parameters
$usernamestring
$passwordstring
Returns
boolean true if authentication is successful

Reimplemented from AuthPlugin.

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

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

◆ bind()

LDAPAuthPlugin::bind (   $binddn = null,
  $password = null 
)

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

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

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

◆ close()

LDAPAuthPlugin::close ( )

Close connection.

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

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

◆ createUser()

LDAPAuthPlugin::createUser (   $user)

Create a user on the LDAP server.

Parameters
$userUser to create
Returns
boolean true if successful

Reimplemented from AuthPlugin.

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

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

◆ deleteUser()

LDAPAuthPlugin::deleteUser (   $username)

Delete a user from the LDAP server.

Parameters
$usernamestring user to delete
Returns
boolean true if successful

Reimplemented from AuthPlugin.

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

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

◆ encodePassword()

LDAPAuthPlugin::encodePassword (   $password)

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

Parameters
$passwordstring
Returns
string hashed string (with prefix).

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

Referenced by setUserPassword().

◆ getDescription()

LDAPAuthPlugin::getDescription ( )

Return the localized description of this plugin.

Returns
string

Reimplemented from Plugin.

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

◆ getDisplayName()

LDAPAuthPlugin::getDisplayName ( )

Return the localized name of this plugin.

Returns
string

Reimplemented from Plugin.

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

◆ getInstance()

LDAPAuthPlugin::getInstance (   $settings,
  $authId 
)

Returns an instance of the authentication plugin

Parameters
$settingsarray settings specific to this instance.
$authIdint identifier for this instance
Returns
LDAPuthPlugin

Reimplemented from AuthPlugin.

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

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

◆ getName()

LDAPAuthPlugin::getName ( )

Return the name of this plugin.

Returns
string

Reimplemented from Plugin.

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

◆ getUserEntry()

LDAPAuthPlugin::getUserEntry (   $username)

Lookup a user entry in the directory.

Parameters
$usernamestring

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

References bind().

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

◆ getUserInfo()

LDAPAuthPlugin::getUserInfo (   $user)

Retrieve user profile information from the LDAP server.

Parameters
$userUser to update
Returns
boolean true if successful

Reimplemented from AuthPlugin.

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

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

◆ open()

LDAPAuthPlugin::open ( )

Open connection to the server.

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

References $conn.

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

◆ register()

LDAPAuthPlugin::register (   $category,
  $path,
  $mainContextId = null 
)

Load and initialize the plug-in and register plugin hooks.

For backwards compatibility this method will be called whenever the plug-in's category is being loaded. If, however, registerOn() returns an array then this method will only be called when the plug-in is enabled and an entry in the result set of registerOn() matches the current request operation. An empty array matches all request operations.

Parameters
$categoryString Name of category plugin was registered to
$pathString The path the plugin was found in
$mainContextIdinteger To identify if the plugin is enabled we need a context. This context is usually taken from the request but sometimes there is no context in the request (e.g. when executing CLI commands). Then the main context can be given as an explicit ID.
Returns
boolean True iff plugin registered successfully; if false, the plugin will not be executed.

Reimplemented from Plugin.

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

References Plugin\addLocaleData().

◆ setUserInfo()

LDAPAuthPlugin::setUserInfo (   $user)

Store user profile information on the LDAP server.

Parameters
$userUser to store
Returns
boolean true if successful

Reimplemented from AuthPlugin.

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

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

◆ setUserPassword()

LDAPAuthPlugin::setUserPassword (   $username,
  $password 
)

Change a user's password on the LDAP server.

Parameters
$usernamestring user to update
$passwordstring the new password
Returns
boolean true if successful

Reimplemented from AuthPlugin.

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

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

◆ userExists()

LDAPAuthPlugin::userExists (   $username)

Check if a username exists.

Parameters
$usernamestring
Returns
boolean

Reimplemented from AuthPlugin.

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

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

◆ userFromAttr()

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
$userUser
$uattrarray

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

References DAORegistry\getDAO(), and AppLocale\getLocale().

Referenced by getUserInfo().

◆ userToAttr()

LDAPAuthPlugin::userToAttr ( $user,
$attr 
)

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

Parameters
$userUser
$attrarray

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

References DAORegistry\getDAO().

Referenced by createUser(), and setUserInfo().

Field Documentation

◆ $conn

resource LDAPAuthPlugin::$conn

the LDAP connection

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

Referenced by open().


The documentation for this class was generated from the following file: