Commit cde93bc2 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Updating to new admin ui


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@303 b35dd754-fafc-0310-a699-88a17e54d16e
parent d8e99631
...@@ -108,14 +108,15 @@ ...@@ -108,14 +108,15 @@
</p> </p>
<% } %> <% } %>
<form name="f" action="user-create.jsp" method="post">
<table class="box" cellpadding="3" cellspacing="1" border="0" width="600"> <table class="box" cellpadding="3" cellspacing="1" border="0" width="600">
<form name="f" action="user-create.jsp" method="post">
<tr><td class="text" colspan="2"> <tr><td class="text" colspan="2">
Use the form below to create a new user in the system. Use the form below to create a new user in the system.
</td></tr> </td></tr>
<tr class="jive-even"> <tr class="jive-even">
<td> <td>
Username: * Username: *
</td> </td>
<td> <td>
......
<%@ taglib uri="core" prefix="c"%><%-- <%@ taglib uri="core" prefix="c"%>
<%--
- $RCSfile$ - $RCSfile$
- $Revision$ - $Revision$
- $Date$ - $Date$
...@@ -6,10 +7,11 @@ ...@@ -6,10 +7,11 @@
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.*,
org.jivesoftware.messenger.user.*" org.jivesoftware.messenger.user.*,
org.jivesoftware.admin.*"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out ); %> <% webManager.init(request, response, session, application, out ); %>
<% // Get parameters // <% // Get parameters //
...@@ -24,13 +26,13 @@ ...@@ -24,13 +26,13 @@
} }
// Load the user object // Load the user object
User user = admin.getUserManager().getUser(username); User user = webManager.getUserManager().getUser(username);
// Handle a user delete: // Handle a user delete:
if (delete) { if (delete) {
admin.getUserManager().deleteUser(user); webManager.getUserManager().deleteUser(user);
// Deleted your own user account, force login // Deleted your own user account, force login
if (username.equals(admin.getAuthToken().getUsername())){ if (username.equals(webManager.getAuthToken().getUsername())){
session.removeAttribute("jive.admin.authToken"); session.removeAttribute("jive.admin.authToken");
response.sendRedirect("login.jsp"); response.sendRedirect("login.jsp");
} }
...@@ -47,15 +49,18 @@ ...@@ -47,15 +49,18 @@
<c:set var="sbar" value="users" scope="page" /> <c:set var="sbar" value="users" scope="page" />
<!-- Define BreadCrumbs --> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<c:set var="title" value="Delete User" /> <% // Title of this page and breadcrumbs
<c:set var="breadcrumbs" value="${admin.breadCrumbs}" /> String title = "Change Password";
<c:set target="${breadcrumbs}" property="Home" value="main.jsp" /> pageinfo.setTitle(title);
<c:set target="${breadcrumbs}" property="User Summary" value="user-summary.jsp" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
<c:set target="${breadcrumbs}" property="User Properties" value="user-properties.jsp?userID=${param.userID}" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-password.jsp?username="+username));
<c:set target="${breadcrumbs}" property="${title}" value="user-delete.jsp?userID=${param.userID}" /> pageinfo.setSubPageID("user-delete");
pageinfo.setExtraParams("username="+username);
%>
<c:set var="tab" value="delete" /> <c:set var="tab" value="delete" />
<jsp:include page="top.jsp" flush="true" /> <jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
org.jivesoftware.messenger.user.*, org.jivesoftware.messenger.user.*,
org.jivesoftware.messenger.*, org.jivesoftware.messenger.*,
java.text.DateFormat, java.text.DateFormat,
org.jivesoftware.admin.*,
java.util.HashMap, java.util.HashMap,
java.util.Map" java.util.Map"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<jsp:useBean id="userData" class="org.jivesoftware.messenger.user.spi.UserPrivateData" /> <jsp:useBean id="userData" class="org.jivesoftware.messenger.user.spi.UserPrivateData" />
<% // Get parameters <% // Get parameters
...@@ -28,10 +29,10 @@ ...@@ -28,10 +29,10 @@
} }
// Load the user object // Load the user object
User user = admin.getUserManager().getUser(username); User user = webManager.getUserManager().getUser(username);
// Get a private data manager // // Get a private data manager //
final PrivateStore privateStore = admin.getPrivateStore(); final PrivateStore privateStore = webManager.getPrivateStore();
userData.setState( user.getUsername(), privateStore ); userData.setState( user.getUsername(), privateStore );
// Handle a save // Handle a save
...@@ -58,20 +59,21 @@ ...@@ -58,20 +59,21 @@
<c:set var="sbar" value="users" scope="page" />
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<!-- Define BreadCrumbs --> <% // Title of this page and breadcrumbs
<c:set var="title" value="Edit User Properties" /> String title = "Edit User";
<c:set var="breadcrumbs" value="${admin.breadCrumbs}" /> pageinfo.setTitle(title);
<c:set target="${breadcrumbs}" property="Home" value="main.jsp" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
<c:set target="${breadcrumbs}" property="User Summary" value="user-summary.jsp" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-summary.jsp"));
<c:set target="${breadcrumbs}" property="User Properties" value="user-properties.jsp?userID=${param.userID}" /> pageinfo.setSubPageID("user-edit");
<c:set var="tab" value="edit" /> pageinfo.setExtraParams("username="+username);
%>
<jsp:include page="top.jsp" flush="true" /> <jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<c:set var="tab" value="edit" />
<%@ include file="user-tabs.jsp" %> <%@ include file="user-tabs.jsp" %>
<br>
<% if (success) { %> <% if (success) { %>
<p class="jive-success-text"> <p class="jive-success-text">
...@@ -80,18 +82,21 @@ ...@@ -80,18 +82,21 @@
<% } %> <% } %>
<table cellpadding="3" cellspacing="1" border="0" width="600">
<form action="user-edit-form.jsp"> <form action="user-edit-form.jsp">
<table class="box" cellpadding="3" cellspacing="1" border="0" width="600"> <tr><td colspan="2">
<tr class="tableHeaderBlue"><td colspan="2" align="center">Edit User Properties for <%= user.getUsername() %></td></tr>
<tr><td class="text" colspan="2">
Use the form below to edit user properties. Use the form below to edit user properties.
</td></tr> </td></tr>
</table>
<table cellpadding="3" cellspacing="1" border="0">
<input type="hidden" name="username" value="<%= username %>"> <input type="hidden" name="username" value="<%= username %>">
<input type="hidden" name="save" value="true"> <input type="hidden" name="save" value="true">
<tr class="jive-odd"> <tr>
<td> <td>
Username: Username:
</td> </td>
...@@ -99,8 +104,8 @@ Use the form below to edit user properties. ...@@ -99,8 +104,8 @@ Use the form below to edit user properties.
<%= user.getUsername() %> <%= user.getUsername() %>
</td> </td>
</tr> </tr>
<tr class="jive-odd"> <tr>
<td class="jive-label"> <td>
Name: Name:
</td> </td>
<td> <td>
...@@ -116,7 +121,7 @@ Use the form below to edit user properties. ...@@ -116,7 +121,7 @@ Use the form below to edit user properties.
<% } %> <% } %>
</td> </td>
</tr> </tr>
<tr class="jive-even"> <tr>
<td> <td>
Email: Email:
</td> </td>
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
org.jivesoftware.messenger.user.UserManager, org.jivesoftware.messenger.user.UserManager,
java.text.DateFormat, java.text.DateFormat,
org.jivesoftware.messenger.auth.AuthFactory, org.jivesoftware.messenger.auth.AuthFactory,
org.jivesoftware.messenger.user.*" org.jivesoftware.messenger.user.*,
org.jivesoftware.admin.AdminPageBean"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
...@@ -46,20 +47,18 @@ ...@@ -46,20 +47,18 @@
%> %>
<c:set var="sbar" value="users" scope="page" /> <c:set var="sbar" value="users" scope="page" />
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs
String title = "Change Password";
pageinfo.setTitle(title);
<!-- Define BreadCrumbs --> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
<c:set var="title" value="User Password" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-password.jsp?username="+username));
<c:set var="breadcrumbs" value="${admin.breadCrumbs}" /> pageinfo.setSubPageID("user-edit-password");
<c:set target="${breadcrumbs}" property="Home" value="main.jsp" /> pageinfo.setExtraParams("username="+username);
<c:set target="${breadcrumbs}" property="User Summary" value="user-summary.jsp" /> %>
<c:set target="${breadcrumbs}" property="User Properties" value="user-properties.jsp?userID=${param.userID}" />
<c:set target="${breadcrumbs}" property="${title}" value="user-password.jsp?userID=${param.userID}" />
<c:set var="tab" value="pass" /> <c:set var="tab" value="pass" />
<jsp:include page="top.jsp" flush="true" /> <jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<%@ include file="user-tabs.jsp" %> <%@ include file="user-tabs.jsp" %>
<br> <br>
...@@ -72,46 +71,46 @@ ...@@ -72,46 +71,46 @@
</p> </p>
<% } %> <% } %>
<table cellpadding="3" cellspacing="1" border="0" width="600">
<form action="user-password.jsp" name="passform"> <form action="user-password.jsp" name="passform">
<table class="box" cellpadding="3" cellspacing="1" border="0" width="600">
<tr class="tableHeaderBlue"><td colspan="2" align="center">Change Password For <%= user.getUsername() %></td></tr>
<tr><td colspan="2" class="text"> <tr><td colspan="2" class="text">
Use the form below to change the user's password Use the form below to change the user's password
</td></tr> </td></tr>
</table>
<table cellpadding="3" cellspacing="1" border="0">
<input type="hidden" name="username" value="<%= username %>"> <input type="hidden" name="username" value="<%= username %>">
<tr class="jive-even"> <tr>
<td class="jive-label"> <td class="c1">
User ID: User ID:
</td> </td>
<td> <td class="c2">
<%= user.getUsername() %> <%= user.getUsername() %>
</td> </td>
</tr> </tr>
<tr class="jive-odd"> <tr>
<td> <td class="c1">
Username: Username:
</td> </td>
<td> <td class="c2">
<%= user.getUsername() %> <%= user.getUsername() %>
</td> </td>
</tr> </tr>
<tr class="jive-even"> <tr>
<td class="jive-label"> <td class="c1">
New Password: New Password:
</td> </td>
<td> <td clas="c2">
<input type="password" name="password" value="" size="20" maxlength="50"> <input type="password" name="password" value="" size="20" maxlength="50">
</td> </td>
</tr> </tr>
<tr class="jive-odd"> <tr>
<td> <td class="c1">
Confirm New Password: Confirm New Password:
</td> </td>
<td> <td class="c2">
<input type="password" name="passwordConfirm" value="" size="20" maxlength="50"> <input type="password" name="passwordConfirm" value="" size="20" maxlength="50">
</td> </td>
</tr> </tr>
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
org.jivesoftware.messenger.user.*, org.jivesoftware.messenger.user.*,
java.text.DateFormat, java.text.DateFormat,
java.util.Iterator, java.util.Iterator,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.*" org.jivesoftware.messenger.*"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<jsp:useBean id="userData" class="org.jivesoftware.messenger.user.spi.UserPrivateData" /> <jsp:useBean id="userData" class="org.jivesoftware.messenger.user.spi.UserPrivateData" />
...@@ -49,42 +50,42 @@ ...@@ -49,42 +50,42 @@
// Load the user object // Load the user object
User user = null; User user = null;
try { try {
user = admin.getUserManager().getUser(username); user = webManager.getUserManager().getUser(username);
} }
catch (UserNotFoundException unfe) { catch (UserNotFoundException unfe) {
user = admin.getUserManager().getUser(username); user = webManager.getUserManager().getUser(username);
} }
// Date formatter for dates // Date formatter for dates
DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM); DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM);
%> %>
<% <%
// Get a private data manager // // Get a private data manager //
final PrivateStore privateStore = admin.getPrivateStore(); final PrivateStore privateStore = webManager.getPrivateStore();
userData.setState( user.getUsername(), privateStore ); userData.setState( user.getUsername(), privateStore );
String nickname = userData.getProperty( "nickname" ); String nickname = userData.getProperty( "nickname" );
if(nickname == null){ if(nickname == null){
nickname = ""; nickname = "";
} }
%> %>
<c:set var="sbar" value="users" scope="page" /> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs
String title = "User Properties";
pageinfo.setTitle(title);
<!-- Define BreadCrumbs --> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
<c:set var="title" value="User Properties" /> pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-properties.jsp"));
<c:set var="breadcrumbs" value="${admin.breadCrumbs}" /> pageinfo.setSubPageID("user-properties");
<c:set target="${breadcrumbs}" property="User Summary" value="user-summary.jsp" /> pageinfo.setExtraParams("username="+username);
<c:set target="${breadcrumbs}" property="${title}" value="user-properties.jsp?userID=${param.userID}" /> %>
<c:set var="tab" value="props" /> <c:set var="tab" value="props" />
<jsp:include page="top.jsp" flush="true" /> <%@ include file="top.jsp" %>
<jsp:include page="title.jsp" flush="true" />
<%@ include file="user-tabs.jsp" %> <%@ include file="user-tabs.jsp" %>
<br/> <br/>
<table class="box" cellpadding="3" cellspacing="1" border="0" width="600"> <table class="box" cellpadding="3" cellspacing="1" border="0" width="600">
<tr class="tableHeaderBlue"><td colspan="2" align="center">User Properties For <%= user.getUsername() %></td></tr>
<tr><td class="text" colspan="2"> <tr><td class="text" colspan="2">
Below is a summary of user properties. Use the tabs above to do things like edit user properties, Below is a summary of user properties. Use the tabs above to do things like edit user properties,
send the user a message (if they're online) or delete the user. send the user a message (if they're online) or delete the user.
......
...@@ -10,21 +10,10 @@ ...@@ -10,21 +10,10 @@
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
java.util.Map" %> java.util.Map" %>
<%-- Define Administration Bean --%> <%-- Define Administration Bean --%>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out ); %> <% webManager.init(request, response, session, application, out ); %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <%
<% // Title of this page and breadcrumbs
String title = "User Search";
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-search.jsp"));
pageinfo.setPageID("user-search");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<%
// Get parameters // Get parameters
boolean search = ParamUtils.getBooleanParameter(request,"search"); boolean search = ParamUtils.getBooleanParameter(request,"search");
...@@ -41,7 +30,7 @@ ...@@ -41,7 +30,7 @@
if (search) { if (search) {
User user = null; User user = null;
try { try {
user = admin.getUserManager().getUser(username); user = webManager.getUserManager().getUser(username);
} }
catch (Exception e2) { catch (Exception e2) {
errors.put("username","username"); errors.put("username","username");
...@@ -53,6 +42,18 @@ ...@@ -53,6 +42,18 @@
} }
} }
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs
String title = "User Search";
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "main.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "user-search.jsp"));
pageinfo.setPageID("user-search");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<% if (errors.size() > 0) { %> <% if (errors.size() > 0) { %>
<p class="jive-error-text"> <p class="jive-error-text">
...@@ -60,8 +61,8 @@ ...@@ -60,8 +61,8 @@
</p> </p>
<% } %> <% } %>
<form name="f" action="user-search.jsp">
<table cellpadding="3" cellspacing="1" border="0" width="600"> <table cellpadding="3" cellspacing="1" border="0" width="600">
<form name="f" action="user-search.jsp">
<tr><td class="text" colspan="2"> <tr><td class="text" colspan="2">
Use the form below to search for users in the system. Use the form below to search for users in the system.
......
...@@ -84,11 +84,11 @@ Sorted by User ID ...@@ -84,11 +84,11 @@ Sorted by User ID
<% } %> <% } %>
<table cellpadding="3" cellspacing="1" border="0" width="600"> <table cellpadding="3" cellspacing="0" border="0" width="600">
<tr class="tableHeader"><td colspan="7" align="left">List Of Users</td></tr> <tr class="tableHeader"><td colspan="7" align="left">List Of Users</td></tr>
</table> </table>
<table class="box" cellpadding="3" cellspacing="1" border="0" width="600"> <table class="jive-table" cellpadding="3" cellspacing="0" border="0" width="600">
<tr class="tableHeaderBlue"> <tr >
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Online</th> <th>Online</th>
<th>Username</th> <th>Username</th>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment