From 24981e396ad4cc8824dc2dec9b8c5fefd6aa7671 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 26 Mar 2011 12:47:30 +0000 Subject: [PATCH] check if RDN attribute is set --- lam/lib/modules/eduPerson.inc | 12 ++++++++++++ lam/lib/modules/inetOrgPerson.inc | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/lam/lib/modules/eduPerson.inc b/lam/lib/modules/eduPerson.inc index 0fe503d6..3a5a3c69 100644 --- a/lam/lib/modules/eduPerson.inc +++ b/lam/lib/modules/eduPerson.inc @@ -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. * diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 238ac48b..f4c37537 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -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; }