提交 348997b9 编写于 作者: K kohsuke

sort the users by name when displaying them

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16230 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a3350379
......@@ -89,7 +89,7 @@ import java.util.logging.Logger;
* @author Kohsuke Kawaguchi
*/
@ExportedBean
public class User extends AbstractModelObject implements AccessControlled, Saveable {
public class User extends AbstractModelObject implements AccessControlled, Saveable, Comparable<User> {
private transient final String id;
......@@ -110,6 +110,10 @@ public class User extends AbstractModelObject implements AccessControlled, Savea
load();
}
public int compareTo(User that) {
return this.id.compareTo(that.id);
}
/**
* Loads the other data from disk if it's available.
*/
......
......@@ -61,6 +61,7 @@ import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import groovy.lang.Binding;
......@@ -233,6 +234,7 @@ public class HudsonPrivateSecurityRealm extends SecurityRealm implements ModelOb
if(u.getProperty(Details.class)!=null)
r.add(u);
}
Collections.sort(r);
return r;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册