set DN suffix and RDN on profile loading

This commit is contained in:
Roland Gruber 2005-05-22 09:05:33 +00:00
parent e312e79e18
commit f5035cc2bb
1 changed files with 12 additions and 4 deletions

View File

@ -728,9 +728,6 @@ class accountContainer {
/** RDN attribute of this account */ /** RDN attribute of this account */
var $rdn; var $rdn;
/** RDN attribute of this account when it was loaded */
var $rdn_orig;
/** original LDAP attributes when account was loaded from LDAP */ /** original LDAP attributes when account was loaded from LDAP */
var $attributes_orig; var $attributes_orig;
@ -777,6 +774,12 @@ class accountContainer {
// pass profile to each module // pass profile to each module
$modules = array_keys($this->module); $modules = array_keys($this->module);
foreach ($modules as $module) $this->module[$module]->load_profile($profile); foreach ($modules as $module) $this->module[$module]->load_profile($profile);
if (isset($profile['ldap_rdn'][0])) {
$this->rdn = $profile['ldap_rdn'][0];
}
if (isset($profile['ldap_suffix'][0])) {
$this->dn = $profile['ldap_suffix'][0];
}
$result = 0; $result = 0;
} }
// save account // save account
@ -1333,7 +1336,6 @@ class accountContainer {
// extract RDN // extract RDN
$this->rdn = split("=", substr($dn, 0, strpos($dn, ','))); $this->rdn = split("=", substr($dn, 0, strpos($dn, ',')));
$this->rdn = $this->rdn[0]; $this->rdn = $this->rdn[0];
$this->rdn_orig = $this->rdn;
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
$attrNames = array_keys($attr); $attrNames = array_keys($attr);
// remove 'count' entries and numerical entries // remove 'count' entries and numerical entries
@ -1412,6 +1414,12 @@ class accountContainer {
// pass profile to each module // pass profile to each module
$modules = array_keys($this->module); $modules = array_keys($this->module);
foreach ($modules as $module) $this->module[$module]->load_profile($profile); foreach ($modules as $module) $this->module[$module]->load_profile($profile);
if (isset($profile['ldap_rdn'][0])) {
$this->rdn = $profile['ldap_rdn'][0];
}
if (isset($profile['ldap_suffix'][0])) {
$this->dn = $profile['ldap_suffix'][0];
}
return 0; return 0;
} }