提交 ef5877bd 编写于 作者: K kohsuke

adding a page to see all the users who have login access.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9972 71c3de6d-444a-0410-be80-ed276b4c234a
上级 4c55f907
......@@ -30,6 +30,8 @@ import org.springframework.web.context.WebApplicationContext;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
/**
* {@link SecurityRealm} that performs authentication by looking up {@link User}.
......@@ -132,6 +134,18 @@ public class HudsonPrivateSecurityRealm extends SecurityRealm implements ModelOb
return "User Database";
}
/**
* All users who can login to the system.
*/
public List<User> getAllUsers() {
List<User> r = new ArrayList<User>();
for (User u : User.getAll()) {
if(u.getProperty(Details.class)!=null)
r.add(u);
}
return r;
}
// TODO
private static final GrantedAuthority[] TEST_AUTHORITY = {new GrantedAuthorityImpl("authenticated")};
......@@ -270,7 +284,7 @@ public class HudsonPrivateSecurityRealm extends SecurityRealm implements ModelOb
}
public String getUrlName() {
return "securityRealm/users";
return "securityRealm/";
}
public String getDisplayName() {
......
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout norefresh="true">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>Users</h1>
<p>
These users can log into Hudson. This is the super set of <a href="../people">this list</a>,
which also contains "users" who really just made some commits on some projects and has no
direct Hudson access.
</p>
<table class="sortable pane bigtable" id="people">
<tr>
<th />
<th>${%Name}</th>
</tr>
<j:forEach var="user" items="${it.allUsers}">
<tr>
<td><a href="${rootURL}/${user.url}"><img src="${imagesURL}/32x32/user.gif"/></a></td>
<td><a href="${rootURL}/${user.url}">${user}</a></td>
</tr>
</j:forEach>
</table>
</l:main-panel>
</l:layout>
</j:jelly>
\ No newline at end of file
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<l:header />
<l:side-panel>
<l:tasks>
<l:task icon="images/24x24/up.gif" href="${rootURL}/" title="${%Back to Dashboard}" />
<l:task icon="images/24x24/new-user.gif" href="addUser" title="${%Create User}" />
</l:tasks>
</l:side-panel>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册