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

View file

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