|
|
@ -38,9 +38,9 @@ my $a = esmith::AccountsDB->open_ro; |
|
|
|
my $i = $c->get('ipasserelle'); |
|
|
|
my $i = $c->get('ipasserelle'); |
|
|
|
my $ip = $i->prop('status') || 'disabled'; |
|
|
|
my $ip = $i->prop('status') || 'disabled'; |
|
|
|
my $reverse = $i->prop('LdapReverseGroups') || 'disabled'; |
|
|
|
my $reverse = $i->prop('LdapReverseGroups') || 'disabled'; |
|
|
|
|
|
|
|
my $x = 0; |
|
|
|
|
|
|
|
|
|
|
|
exit (0) if (($ip eq 'disabled') || ($reverse eq 'disabled')){ |
|
|
|
exit (0) if (($ip eq 'disabled') || ($reverse eq 'disabled')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $l = $c->get('ldap'); |
|
|
|
my $l = $c->get('ldap'); |
|
|
|
my $status = $l->prop('status') || "disabled"; |
|
|
|
my $status = $l->prop('status') || "disabled"; |
|
|
@ -101,7 +101,7 @@ foreach my $acct (@accounts){ |
|
|
|
scope => 'sub', |
|
|
|
scope => 'sub', |
|
|
|
filter => "uid=$key" |
|
|
|
filter => "uid=$key" |
|
|
|
); |
|
|
|
); |
|
|
|
$result->code && warn "Error looking for entry uid=$key,ou=Users,$base: ", $result->error; |
|
|
|
$result->code && ($x = 255, warn "Error looking for entry uid=$key,ou=Users,$base: ", $result->error); |
|
|
|
my @oc = (); |
|
|
|
my @oc = (); |
|
|
|
my @oldgroups = (); |
|
|
|
my @oldgroups = (); |
|
|
|
foreach my $entry ($result->all_entries()){ |
|
|
|
foreach my $entry ($result->all_entries()){ |
|
|
@ -118,7 +118,7 @@ foreach my $acct (@accounts){ |
|
|
|
objectClass => \@oc |
|
|
|
objectClass => \@oc |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
$result->code && warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error; |
|
|
|
$result->code && ($x = 255, warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
my @groups = $a->user_group_list($key); |
|
|
|
my @groups = $a->user_group_list($key); |
|
|
@ -134,9 +134,10 @@ foreach my $acct (@accounts){ |
|
|
|
posixMemberOf => \@groups |
|
|
|
posixMemberOf => \@groups |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
$result->code && warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error; |
|
|
|
$result->code && ($x = 255, warn "failed to modify entry uid=$key,ou=Users,$base: ", $result->error); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$ldap->unbind; |
|
|
|
$ldap->unbind; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exit ($x); |
|
|
|