47 $this->realm = trim($config->get_cfg_value(
'saslRealm',
''));
48 $this->exop = trim($config->get_cfg_value(
'saslExop',
''));
50 if ($dn ==
'' || $dn ==
'new') {
54 $attr = (empty($this->exop) ?
'uid' : $this->exop);
56 if (($userTab !== NULL) && isset($userTab->$attr)) {
57 $this->uid = $userTab->$attr;
59 $ldap = $config->get_ldap_link();
60 $ldap->cd($config->current[
'BASE']);
61 $ldap->cat($dn, [$attr]);
62 if ($ldap->count() == 1) {
63 $attrs = $ldap->fetch();
64 $this->uid = $attrs[$attr][0];
79 if (empty($this->realm) && empty($this->exop)) {
93 public function generate_hash (
string $pwd,
bool $locked = FALSE): string
95 if (empty($this->exop)) {
96 if (empty($this->realm)) {
100 return '{SASL}'.($locked ?
'!' :
'').$this->uid.
'@'.$this->realm;
103 return '{SASL}'.($locked ?
'!' :
'').$this->uid;
107 function checkPassword ($pwd, $hash):
bool 129 return ($config->get_cfg_value(
'forceSaslPasswordAsk',
'FALSE') ==
'TRUE');
need_password()
Password needed.
htmlescape(string $str)
Escape string for HTML output.
is_available()
Is available.
static get_hash_name()
Get the hash name.
This class contains all the basic function for password methods.
Parent class for all errors in FusionDirectory.
This class contains all the functions for sasl password method.
generate_hash(string $pwd, bool $locked=FALSE)
Generate template hash.
__construct($dn='', $userTab=NULL)
passwordMethodSasl Constructor