check if RDN attribute is set

This commit is contained in:
Roland Gruber 2011-03-26 12:47:30 +00:00
parent 4458bd627f
commit 24981e396a
2 changed files with 18 additions and 0 deletions

View File

@ -225,6 +225,18 @@ class eduPerson extends baseModule {
$this->messages['affiliation'][0] = array('ERROR', _('Account %s:') . ' eduPerson_affiliation', _('Please enter a valid list of affiliations.'));
}
/**
* This functions return true if all needed settings are done.
*
* @return boolean true, if all is ok
*/
function module_complete() {
if (($this->getAccountContainer()->rdn == 'eduPersonPrincipalName') && !isset($this->attributes['eduPersonPrincipalName'][0])) {
return false;
}
return true;
}
/**
* Returns the HTML meta data for the main account page.
*

View File

@ -668,6 +668,12 @@ class inetOrgPerson extends baseModule implements passwordService {
}
}
if (!isset($this->attributes['sn'][0]) || ($this->attributes['sn'][0] == '')) return false;
$modules = $_SESSION['config']->get_AccountModules($this->get_scope());
if (!in_array('posixAccount', $modules)) {
if (($this->getAccountContainer()->rdn == 'uid') && !isset($this->attributes['uid'][0])) {
return false;
}
}
return true;
}