mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
supann: rename supannCheckEduPersonAffiliation as validate_eduPersonAffiliation
This commit is contained in:
parent
a529b8ce2b
commit
2239120912
1 changed files with 30 additions and 7 deletions
|
@ -826,23 +826,46 @@ function supannGetRessourceSousEtatPossibleValues($options=null, $name=null, $ld
|
|||
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||
*
|
||||
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||
*
|
||||
* @return boolean True si les valeurs sont valides, False sinon
|
||||
**/
|
||||
global $_supannCheckEduPersonAffiliation_checked;
|
||||
$_supannCheckEduPersonAffiliation_checked = false;
|
||||
function supannCheckEduPersonAffiliation(&$ldapObject) {
|
||||
global $_supannCheckEduPersonAffiliation_checked;
|
||||
global $_validate_eduPersonAffiliation_checked;
|
||||
$_validate_eduPersonAffiliation_checked = false;
|
||||
function validate_eduPersonAffiliation(&$ldapObject) {
|
||||
global $_validate_eduPersonAffiliation_checked;
|
||||
$values = $ldapObject->getValue('eduPersonAffiliation');
|
||||
|
||||
if (!$_supannCheckEduPersonAffiliation_checked && in_array('affiliate', $values) && in_array('member', $values)) {
|
||||
$_supannCheckEduPersonAffiliation_checked = true;
|
||||
if (!$_validate_eduPersonAffiliation_checked && in_array('affiliate', $values) && in_array('member', $values)) {
|
||||
$_validate_eduPersonAffiliation_checked = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie les valeurs de l'attribut eduPersonAffiliation
|
||||
*
|
||||
* Note: ancien nom de la fonction validate_eduPersonPrimaryAffiliation conservé pour
|
||||
* rétro-compatibilié. Une erreur sera affichée lorsqu'on utilise cette fonction.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||
*
|
||||
* @return boolean True si les valeurs sont valides, False sinon
|
||||
**/
|
||||
function supannCheckEduPersonAffiliation(&$ldapObject) {
|
||||
LSerror :: addErrorCode(
|
||||
'LSsession_27',
|
||||
array(
|
||||
'old' => 'supannCheckEduPersonAffiliation()',
|
||||
'new' => 'validate_eduPersonAffiliation()',
|
||||
'context' => LSlog :: get_debug_backtrace_context(),
|
||||
)
|
||||
);
|
||||
return validate_eduPersonAffiliation($ldapObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie la valeur de l'attribut eduPersonPrimaryAffiliation
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue