From 1d0c786bacab35a47d3b8d3ebde532b8f0cfb4eb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 4 Aug 2010 12:21:43 +0200 Subject: [PATCH] LSaddon::Posix : Added function generateMemberFromMemberUid() --- .../includes/addons/LSaddons.posix.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/public_html/includes/addons/LSaddons.posix.php b/public_html/includes/addons/LSaddons.posix.php index 39adc411..c655eb72 100644 --- a/public_html/includes/addons/LSaddons.posix.php +++ b/public_html/includes/addons/LSaddons.posix.php @@ -188,4 +188,27 @@ LSerror :: defineError('POSIX_01', return true; } +function generateMemberFromMemberUid($ldapObject) { + if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) { + LSerror :: addErrorCode('POSIX_01',array('dependency' => 'memberUid', 'attr' => 'member')); + return; + } + + if ( get_class($ldapObject -> attrs[ 'member' ]) != 'LSattribute' ) { + LSerror :: addErrorCode('POSIX_01',array('dependency' => 'member', 'attr' => 'member')); + 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(); + } + } + return $member; + + } + + ?>