Allow editing of LDAP group description

This commit is contained in:
Jamie Cameron
2010-01-28 15:39:43 -08:00
parent 17c095c492
commit cc190cb36a
4 changed files with 20 additions and 0 deletions

View File

@ -120,6 +120,7 @@ else {
}
$in{'gid'} =~ /^[0-9]+$/ || &error(&text('gsave_egid', $in{'gid'}));
$gid = $in{'gid'};
$desc = $in{'desc'} || undef;
@members = split(/\r?\n/, $in{members});
if ($in{'new'} || $oldgroup ne $group) {
# Check for collision
@ -232,6 +233,14 @@ if (!$in{'new'}) {
$newdn = $in{'dn'};
}
# Add or remove description
if ($desc) {
push(@props, "description" => $desc);
}
else {
push(@rprops, "description");
}
# Update group properties
$rv = $ldap->modify($newdn, replace =>
{ "gidNumber" => $gid,
@ -285,6 +294,9 @@ else {
if (&in_schema($schema, "sambaGrouptype") &&
$samba_group_schema == 3);
}
if ($desc) {
push(@props, "description" => $desc);
}
$rv = $ldap->add($newdn, attr =>
[ "cn" => $group,
"gidNumber" => $gid,