Skip to content

Commit

Permalink
Groups are now sorted alphabetically and can list all web groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfranco committed Sep 3, 2009
1 parent 64d5323 commit 735ba24
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions actions/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
}
$groups = array_values($groups);

// Sort the groups
$sortKeys = array();
foreach ($groups as $group)
$sortKeys[] = implode(' / ', dnToLevels($group['dn']));
array_multisort($sortKeys, $groups);

// PRint the groups
foreach ($groups as $group) {
printGroupHtml($ldap, $group);
}
Expand Down
30 changes: 30 additions & 0 deletions actions/list_web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<ul class='menu'>
<li><a href="<?php echo getUrl('list'); ?>">My Groups</a></li>
<li>All Web Groups</li>
<li><a href="<?php echo getUrl('list_all'); ?>">All Groups</a></li>
</ul>

<div id='groups'>

<?php
$groups = array();
foreach ($ldapConfig['WritableGroupContainers'] as $baseDN) {
$query = '(objectClass=group)';
$groups = array_merge($groups, $ldap->search($query, $baseDN, array('cn', 'managedby', 'member')));
}
$groups = array_values($groups);

// Sort the groups
$sortKeys = array();
foreach ($groups as $group)
$sortKeys[] = implode(' / ', dnToLevels($group['dn']));
array_multisort($sortKeys, $groups);

// Print the groups
foreach ($groups as $group) {
printGroupHtml($ldap, $group);
}

?>

</div>

0 comments on commit 735ba24

Please sign in to comment.