user array is sorted at startup

fixes #7
This commit is contained in:
Jan Dittberner 2007-11-23 20:43:14 +00:00
parent 962d56ce4d
commit 90dbac0f20
1 changed files with 5 additions and 3 deletions

View File

@ -117,9 +117,11 @@ if (!empty($errmsgs)) {
errorAsHtml(implode("<br />", $errmsgs));
}
function cmp_by_usernames($user1, $user2) {
return strcmp($user1['username'], $user2['username']);
}
$namemapdata = file_get_contents($davconfig['namemap.file']);
$namemap = json_decode($namemapdata, true);
if ($namemap === NULL) {
$namemap = array();
}
uasort($namemap, "cmp_by_usernames");
?>