Sort users page by date joined

This commit is contained in:
Citlali del Rey 2023-02-05 14:06:34 -08:00
parent 48e2c4da8c
commit e475479e50
Signed by: nullobsi
GPG key ID: 933A1F44222C2634

View file

@ -52,11 +52,13 @@ sub user_pages ($self) {
$mesg = $ldap->search(
base => 'OU=Dogs,DC=unix,DC=dog',
filter => '(objectClass=posixAccount)',
attrs => ['uid'],
attrs => ['uid', 'createTimestamp'],
);
$mesg->code and die $mesg->error;
for ($mesg->entries) {
my @sorted = sort {$a->get_value('createTimestamp') cmp $b->get_value('createTimestamp')} $mesg->entries;
for (@sorted) {
push @{$users}, $_->get_value('uid');
}
return $users;