mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-23 00:43:48 +01:00
supann: add generate_supannRessourceEtat
This commit is contained in:
parent
1534a40c7b
commit
aae4751a41
1 changed files with 30 additions and 0 deletions
|
@ -307,6 +307,36 @@ function generate_eduPersonOrgDN($ldapObject) {
|
|||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generation de la valeur de l'attribut supannRessourceEtat
|
||||
* à partir de la valeur de l'attribut supannRessourceEtatDate.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param LSldapObject $ldapObject L'objet ldap
|
||||
*
|
||||
* @return array|null|false La valeur de l'attribut supannRessourceEtat, null si aucune valeur peut
|
||||
* être déterminée ou false si il y a un problème durant la génération.
|
||||
*/
|
||||
function generate_supannRessourceEtat($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'supannRessourceEtatDate' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array(
|
||||
'dependency' => 'supannRessourceEtatDate',
|
||||
'attr' => 'supannRessourceEtat'
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
$values = array();
|
||||
foreach ($ldapObject -> attrs[ 'supannRessourceEtatDate' ] -> getValue() as $value) {
|
||||
$value[] = explode(':', $value)[0];
|
||||
}
|
||||
return $values;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Fonction de parsing des valeurs spécifiques SUPANN
|
||||
**********************************************************************/
|
||||
|
|
Loading…
Reference in a new issue