class CredentialsStorage in Lightweight Directory Access Protocol (LDAP) 8.3
Same name and namespace in other branches
- 8.4 ldap_servers/src/Helper/CredentialsStorage.php \Drupal\ldap_servers\Helper\CredentialsStorage
Temporarily stores credentials from user input.
This temporary storage is required so that LDAP can work with them in the clear indepedent of the login form process and to avoid passend them around dozens of functions.
Hierarchy
- class \Drupal\ldap_servers\Helper\CredentialsStorage
Expanded class hierarchy of CredentialsStorage
6 files declare their use of CredentialsStorage
- CredentialsStorageTests.php in ldap_servers/
tests/ src/ Unit/ CredentialsStorageTests.php - ldap_user.module in ldap_user/
ldap_user.module - Module for the LDAP User Entity.
- LoginValidator.php in ldap_authentication/
src/ Controller/ LoginValidator.php - Server.php in ldap_servers/
src/ Entity/ Server.php - ServerTestForm.php in ldap_servers/
src/ Form/ ServerTestForm.php
File
- ldap_servers/
src/ Helper/ CredentialsStorage.php, line 12
Namespace
Drupal\ldap_servers\HelperView source
class CredentialsStorage {
private static $userDn = NULL;
private static $userPassword = NULL;
private static $validate = FALSE;
/**
* Stores the user DN as provided by other LDAP modules.
*
* @param string $userDn
* DN to store.
*/
public static function storeUserDn($userDn) {
self::$userDn = $userDn;
}
/**
* Stores the password from user input.
*
* @param string $password
* Password to store.
*/
public static function storeUserPassword($password) {
self::$userPassword = $password;
}
/**
* Turn testing of user credentials on or off.
*
* @param bool $validate
* Defaults to false.
*/
public static function testCredentials($validate) {
self::$validate = $validate;
}
/**
* Return the temporarily saved user DN.
*
* @return null|string
* Login name.
*/
public static function getUserDn() {
return self::$userDn;
}
/**
* Return the temporarily saved user password.
*
* @return null|string
* Login password.
*/
public static function getPassword() {
return self::$userPassword;
}
/**
* Whether the bind function will use these credentials.
*
* @return bool
* Defaults to false.
*/
public static function validateCredentials() {
return self::$validate;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CredentialsStorage:: |
private static | property | ||
CredentialsStorage:: |
private static | property | ||
CredentialsStorage:: |
private static | property | ||
CredentialsStorage:: |
public static | function | Return the temporarily saved user password. | |
CredentialsStorage:: |
public static | function | Return the temporarily saved user DN. | |
CredentialsStorage:: |
public static | function | Stores the user DN as provided by other LDAP modules. | |
CredentialsStorage:: |
public static | function | Stores the password from user input. | |
CredentialsStorage:: |
public static | function | Turn testing of user credentials on or off. | |
CredentialsStorage:: |
public static | function | Whether the bind function will use these credentials. |