* Sat May 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme

- edit LDAP entries using Net::LDAP rather than cpu [SME: 12687]
This commit is contained in:
2024-05-18 15:21:54 -04:00
parent 1d67d9bd64
commit e61e1a8096
2 changed files with 7 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ if ($event eq 'ibay-create')
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
$result = $ldap->modify("cn=$grp,ou=Groups,$base",
add => {
"memberUid"=> [ $ibay->prop("Uid")]
"memberUid" => [ $ibayName ]
});
# error code 20 is entry already exits.
$result->code && ( $result->code != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
@@ -200,11 +200,11 @@ elsif ($event eq 'ibay-modify' and $ibayName ne 'Primary')
#------------------------------------------------------------
# Loop to add new user to groups "shared,". $ibay->prop("Group")
#------------------------------------------------------------
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
foreach my $grp ( 'shared', $ibay->prop("Group") ) {
$result = $ldap->modify("cn=$grp,ou=Groups,$base",
add=> {
"memberUid"=> [ $ibay->prop("Uid")]
} );
add => {
"memberUid" => [ $ibayName ]
});
# error code 20 is entry already exits.
$result->code && ( $result->code != 20 ) && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to add (ldap) account $ibayName to supplementary group $grp.\n" );
}