mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
Fix hard-coded parameter information and add comment for newest functions
This commit is contained in:
parent
7607a8f4ec
commit
71480875d4
1 changed files with 46 additions and 20 deletions
|
@ -189,7 +189,19 @@ LSerror :: defineError('POSIX_01',
|
|||
return true;
|
||||
}
|
||||
|
||||
function generateMemberFromMemberUid($ldapObject) {
|
||||
/**
|
||||
* Generate member attribute value from memberUid
|
||||
*
|
||||
* IMPORTANT : The attribute memberUid must be define in configuration
|
||||
* of the same object and must use HTML type select_object.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param[in] $ldapObject The LSldapObject
|
||||
*
|
||||
* @retval array|null array of member attribute values or null in case of error
|
||||
*/
|
||||
function generateMemberFromMemberUid($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'memberUid', 'attr' => 'member'));
|
||||
return;
|
||||
|
@ -200,18 +212,34 @@ function generateMemberFromMemberUid($ldapObject) {
|
|||
return;
|
||||
}
|
||||
|
||||
$obj_type=LSconfig::get('LSobjects.'.get_class($ldapObject).'.attrs.memberUid.html_options.selectable_object.object_type');
|
||||
if (empty($obj_type))
|
||||
return;
|
||||
|
||||
$uids = $ldapObject -> attrs[ 'memberUid' ] -> getValue();
|
||||
$member = array();
|
||||
if (is_array($uids)) {
|
||||
foreach ( $uids as $uid ) {
|
||||
$member[]='uid='.$uid.','.LSconfig::get('LSobjets.LSehessPerson.container_dn').','.LSsession::getTopDn();
|
||||
$member[]='uid='.$uid.','.LSconfig::get('LSobjects.'.$obj_type.'.container_dn').','.LSsession::getTopDn();
|
||||
}
|
||||
}
|
||||
return $member;
|
||||
|
||||
}
|
||||
|
||||
function generate_memberUidFromUniqueMember($ldapObject) {
|
||||
/**
|
||||
* Generate memberUid attribute value from uniqueMember
|
||||
*
|
||||
* IMPORTANT : The attribute uniqueMember must be define in configuration
|
||||
* of the same object.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param[in] $ldapObject The LSldapObject
|
||||
*
|
||||
* @retval array|null array of memberUid values or null in case of error
|
||||
*/
|
||||
function generate_memberUidFromUniqueMember($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'memberUid', 'attr' => 'memberUid'));
|
||||
return;
|
||||
|
@ -232,7 +260,5 @@ function generate_memberUidFromUniqueMember($ldapObject) {
|
|||
}
|
||||
}
|
||||
return $uids;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue