Commit 7d1cec7f authored by Matt Tucker's avatar Matt Tucker Committed by matt

UI updates.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@666 b35dd754-fafc-0310-a699-88a17e54d16e
parent c5696f2a
...@@ -123,11 +123,8 @@ muc.form.reg.email=Email Address ...@@ -123,11 +123,8 @@ muc.form.reg.email=Email Address
muc.form.reg.faqentry=FAQ Entry muc.form.reg.faqentry=FAQ Entry
# Labels for room configuration data form # Labels for room configuration data form
muc.form.conf.title=Room configuration muc.form.conf.title=Room configuration
muc.form.conf.instruction=The room "{0}" has been created. The default configuration is as \ muc.form.conf.instruction=The room "{0}" has been created. To accept the default configuration, \
follows: \n - No logging\n - No moderation\n - Up to 30 participants\n - No password required\ click the "OK" button. Or, modify the settings by completing the following form:
\n - No invitation required\n - Room is not persistent\n - Only admins may change the subject\n\n\
To accept the default configuration, click OK. To select a different configuration, complete\
the following form:
muc.form.conf.owner_roomname=Room Name muc.form.conf.owner_roomname=Room Name
muc.form.conf.owner_roomdesc=Description muc.form.conf.owner_roomdesc=Description
muc.form.conf.owner_changesubject=Allow Occupants to Change Subject muc.form.conf.owner_changesubject=Allow Occupants to Change Subject
...@@ -138,10 +135,10 @@ muc.form.conf.moderator=Moderator ...@@ -138,10 +135,10 @@ muc.form.conf.moderator=Moderator
muc.form.conf.participant=Participant muc.form.conf.participant=Participant
muc.form.conf.visitor=Visitor muc.form.conf.visitor=Visitor
muc.form.conf.owner_publicroom=List Room in Directory muc.form.conf.owner_publicroom=List Room in Directory
muc.form.conf.owner_persistentroom=Make Room Persistent muc.form.conf.owner_persistentroom=Room is Persistent
muc.form.conf.owner_moderatedroom=Make Room Moderated muc.form.conf.owner_moderatedroom=Room is Moderated
muc.form.conf.owner_inviteonly=Invitation Required to Enter muc.form.conf.owner_inviteonly=Invitation Required to Enter
muc.form.conf.allowinvitesfixed=Note: by default, only admins can send invites in an invite-only room. muc.form.conf.allowinvitesfixed=Note: by default, only admins can send invitations in an invitation-only room.
muc.form.conf.owner_allowinvites=Allow Occupants to Invite Others muc.form.conf.owner_allowinvites=Allow Occupants to Invite Others
muc.form.conf.owner_passwordprotectedroom=Password Required to Enter Room muc.form.conf.owner_passwordprotectedroom=Password Required to Enter Room
muc.form.conf.roomsecretfixed=If a password is required to enter this room, you must specify the \ muc.form.conf.roomsecretfixed=If a password is required to enter this room, you must specify the \
......
...@@ -35,37 +35,35 @@ import org.xmpp.packet.Presence; ...@@ -35,37 +35,35 @@ import org.xmpp.packet.Presence;
import org.xmpp.packet.Roster; import org.xmpp.packet.Roster;
/** /**
* Reads XMPP XML from a socket.
*
* @author Derek DeMoro * @author Derek DeMoro
*/ */
public class SocketReadThread extends Thread { public class SocketReadThread extends Thread {
private Socket sock;
/** /**
* The utf-8 charset for decoding and encoding Jabber packet streams. * The utf-8 charset for decoding and encoding Jabber packet streams.
*/ */
private String charset = "UTF-8"; private static String CHARSET = "UTF-8";
private Session session;
private Connection connection;
private static final String ETHERX_NAMESPACE = "http://etherx.jabber.org/streams"; private static final String ETHERX_NAMESPACE = "http://etherx.jabber.org/streams";
private Socket sock;
private Session session;
private Connection connection;
private String serverName; private String serverName;
/** /**
* Router used to route incoming packets to the correct channels. * Router used to route incoming packets to the correct channels.
*/ */
private PacketRouter router; private PacketRouter router;
/** /**
* Audits incoming data * Audits incoming data
*/ */
private Auditor auditor; private Auditor auditor;
private boolean clearSignout = false; private boolean clearSignout = false;
XmlPullParserFactory factory = null; XmlPullParserFactory factory = null;
XPPPacketReader reader = null; XPPPacketReader reader = null;
/** /**
* Create dedicated read thread for this socket. * Create dedicated read thread for this socket.
* *
...@@ -98,10 +96,8 @@ public class SocketReadThread extends Thread { ...@@ -98,10 +96,8 @@ public class SocketReadThread extends Thread {
reader = new XPPPacketReader(); reader = new XPPPacketReader();
reader.setXPPFactory(factory); reader.setXPPFactory(factory);
reader.getXPPParser().setInput(new InputStreamReader(sock.getInputStream(), reader.getXPPParser().setInput(new InputStreamReader(sock.getInputStream(),
charset)); CHARSET));
// Read in the opening tag and prepare for packet stream // Read in the opening tag and prepare for packet stream
createSession(); createSession();
...@@ -248,7 +244,7 @@ public class SocketReadThread extends Thread { ...@@ -248,7 +244,7 @@ public class SocketReadThread extends Thread {
} }
Writer writer = connection.getWriter(); Writer writer = connection.getWriter();
String startPacket = "<?xml version='1.0' encoding='"+charset+"'?><stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" from=\""+serverName+"\" id=\""+session.getStreamID().toString()+"\">"; String startPacket = "<?xml version='1.0' encoding='"+CHARSET+"'?><stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" from=\""+serverName+"\" id=\""+session.getStreamID().toString()+"\">";
writer.write(startPacket); writer.write(startPacket);
writer.flush(); writer.flush();
// TODO: check for SASL support in opening stream tag // TODO: check for SASL support in opening stream tag
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
url="muc-create-permission.jsp" url="muc-create-permission.jsp"
description="" /> description="" />
<item id="muc-tasks" name="Tasks Settings" <item id="muc-tasks" name="Other Settings"
url="muc-tasks.jsp" url="muc-tasks.jsp"
description="" /> description="" />
</sidebar> </sidebar>
......
...@@ -98,9 +98,8 @@ ...@@ -98,9 +98,8 @@
<jsp:include page="title.jsp" flush="true" /> <jsp:include page="title.jsp" flush="true" />
<p> <p>
Group Chat rooms can replay conversation histories to provide context to new members joining a room. Group chat rooms can replay conversation histories to provide context to new members joining a room.
<fmt:message key="short.title"/> provides several options for controlling how much Thre are several options for controlling how much history to store for each room.
history to store for each room.
</p> </p>
<% if ("true".equals(request.getParameter("success"))) { %> <% if ("true".equals(request.getParameter("success"))) { %>
...@@ -121,7 +120,7 @@ history to store for each room. ...@@ -121,7 +120,7 @@ history to store for each room.
<form action="muc-history-settings.jsp" method="post"> <form action="muc-history-settings.jsp" method="post">
<fieldset> <fieldset>
<legend>Set Conflict Policy</legend> <legend>History Settings</legend>
<div> <div>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody> <tbody>
...@@ -132,7 +131,7 @@ history to store for each room. ...@@ -132,7 +131,7 @@ history to store for each room.
<td width="99%"> <td width="99%">
<label for="rb01"> <label for="rb01">
<b>Don't Show History</b> <b>Don't Show History</b>
</label>- Do not show the entire chat history. </label>- Do not show a chat history to users joining a room.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
...@@ -142,7 +141,7 @@ history to store for each room. ...@@ -142,7 +141,7 @@ history to store for each room.
<td width="99%"> <td width="99%">
<label for="rb02"> <label for="rb02">
<b>Show Entire Chat History</b> <b>Show Entire Chat History</b>
</label>- Show the entire chat history to the user. </label>- Show the entire chat history to users joining a room.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs <% // Title of this page and breadcrumbs
String title = "Group Chat Properties"; String title = "Group Chat Service Properties";
pageinfo.setTitle(title); pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "index.jsp")); pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-server-props-edit-form.jsp")); pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-server-props-edit-form.jsp"));
...@@ -94,7 +94,7 @@ a server restart. ...@@ -94,7 +94,7 @@ a server restart.
<tbody> <tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<td class="jive-icon-label"> <td class="jive-icon-label">
Server properties edited successfully. You must <b>restart</b> the server in order for Service properties edited successfully. You must <b>restart</b> the server in order for
the changes to take effect. the changes to take effect.
</td></tr> </td></tr>
</tbody> </tbody>
...@@ -119,23 +119,16 @@ a server restart. ...@@ -119,23 +119,16 @@ a server restart.
<form action="muc-server-props-edit-form.jsp?save" method="post"> <form action="muc-server-props-edit-form.jsp?save" method="post">
<fieldset> <fieldset>
<legend>Set Conflict Policy</legend> <legend>Service Name</legend>
<div> <div>
<table cellpadding="3" cellspacing="0" border="0"> <table cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="c1">
Server name:
</td>
<td>
<%= name %>
</td>
</tr>
<tr> <tr>
<td class="c1"> <td class="c1">
Group chat service name: Group chat service name:
</td> </td>
<td> <td>
<input type="text" size="30" maxlength="150" name="mucname" value="<%= (muc != null ? muc : "") %>">.<%=name%> <input type="text" size="30" maxlength="150" name="mucname" value="<%= (muc != null ? muc : "") %>">
<% if (errors.get("mucname") != null) { %> <% if (errors.get("mucname") != null) { %>
......
...@@ -103,7 +103,7 @@ enter any group chat room and their permissions are the same as the room owner. ...@@ -103,7 +103,7 @@ enter any group chat room and their permissions are the same as the room owner.
<tbody> <tbody>
<tr><td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td> <tr><td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<td class="jive-icon-label"> <td class="jive-icon-label">
Error adding the admin. Please verify the JID is correct. Error adding the user. Please verify the JID is correct.
</td></tr> </td></tr>
</tbody> </tbody>
</table> </table>
...@@ -114,9 +114,9 @@ enter any group chat room and their permissions are the same as the room owner. ...@@ -114,9 +114,9 @@ enter any group chat room and their permissions are the same as the room owner.
<form action="muc-sysadmins.jsp?add" method="post"> <form action="muc-sysadmins.jsp?add" method="post">
<fieldset> <fieldset>
<legend>Admin Users</legend> <legend>Administrators</legend>
<div> <div>
<label for="userJIDtf">Add Admin (JID):</label> <label for="userJIDtf">Add Administrator (JID):</label>
<input type="text" name="userJID" size="30" maxlength="100" value="<%= (userJID != null ? userJID : "") %>" <input type="text" name="userJID" size="30" maxlength="100" value="<%= (userJID != null ? userJID : "") %>"
id="userJIDtf"> id="userJIDtf">
<input type="submit"s value="Add"> <input type="submit"s value="Add">
...@@ -135,7 +135,7 @@ enter any group chat room and their permissions are the same as the room owner. ...@@ -135,7 +135,7 @@ enter any group chat room and their permissions are the same as the room owner.
<tr> <tr>
<td colspan="2"> <td colspan="2">
No admins specified, use the form above to add one. No administrators specified, use the form above to add one.
</td> </td>
</tr> </tr>
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<% // Get parameters <% // Get parameters
boolean kickEnabled = ParamUtils.getBooleanParameter(request,"kickEnabled"); boolean kickEnabled = ParamUtils.getBooleanParameter(request,"kickEnabled");
String kickfreq = ParamUtils.getParameter(request,"kickfreq");
String idletime = ParamUtils.getParameter(request,"idletime"); String idletime = ParamUtils.getParameter(request,"idletime");
String logfreq = ParamUtils.getParameter(request,"logfreq"); String logfreq = ParamUtils.getParameter(request,"logfreq");
String logbatchsize = ParamUtils.getParameter(request,"logbatchsize"); String logbatchsize = ParamUtils.getParameter(request,"logbatchsize");
...@@ -47,32 +46,24 @@ ...@@ -47,32 +46,24 @@
return; return;
} }
// do validation // do validation
if (kickfreq == null) {
errors.put("kickfreq","kickfreq");
}
if (idletime == null) { if (idletime == null) {
errors.put("idletime","idletime"); errors.put("idletime","idletime");
} }
int frequency = 0;
int idle = 0; int idle = 0;
// Try to obtain an int from the provided strings // Try to obtain an int from the provided strings
if (errors.size() == 0) { if (errors.size() == 0) {
try { try {
frequency = Integer.parseInt(kickfreq) * 1000; idle = Integer.parseInt(idletime) * 1000 * 60;
} }
catch (NumberFormatException e) { catch (NumberFormatException e) {
errors.put("kickfreq","kickfreq"); errors.put("idletime","idletime");
}
try {
idle = Integer.parseInt(idletime) * 1000;
} }
catch (NumberFormatException e) { if (idle < 0) {
errors.put("idletime","idletime"); errors.put("idletime","idletime");
} }
} }
if (errors.size() == 0) { if (errors.size() == 0) {
mucServer.setKickIdleUsersTimeout(frequency);
mucServer.setUserIdleTime(idle); mucServer.setUserIdleTime(idle);
response.sendRedirect("muc-tasks.jsp?kickSettingSuccess=true"); response.sendRedirect("muc-tasks.jsp?kickSettingSuccess=true");
return; return;
...@@ -117,18 +108,18 @@ ...@@ -117,18 +108,18 @@
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs <% // Title of this page and breadcrumbs
String title = "Tasks Settings"; String title = "Other Settings";
pageinfo.setTitle(title); pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "index.jsp")); pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Tasks Settings", "muc-tasks.jsp")); pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Other Settings", "muc-tasks.jsp"));
pageinfo.setPageID("muc-tasks"); pageinfo.setPageID("muc-tasks");
%> %>
<jsp:include page="top.jsp" flush="true" /> <jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" /> <jsp:include page="title.jsp" flush="true" />
<p> <p>
Use the forms below to configure the task for kicking idle users from group chat rooms and to configure the task Use the forms below to configure settings for kicking idle users from group chat rooms and to
that logs room conversations to the database. configure the task that logs room conversations to the database.
</p> </p>
<% if (kickSettingSuccess || logSettingSuccess) { %> <% if (kickSettingSuccess || logSettingSuccess) { %>
...@@ -140,11 +131,11 @@ that logs room conversations to the database. ...@@ -140,11 +131,11 @@ that logs room conversations to the database.
<td class="jive-icon-label"> <td class="jive-icon-label">
<% if (kickSettingSuccess) { %> <% if (kickSettingSuccess) { %>
Kicking settings updated successfully. Idle user settings updated successfully.
<% } else if (logSettingSuccess) { %> <% } else if (logSettingSuccess) { %>
Conversations logging settings updated successfully. Conversation logging settings updated successfully.
<% } %> <% } %>
</td></tr> </td></tr>
...@@ -154,76 +145,54 @@ that logs room conversations to the database. ...@@ -154,76 +145,54 @@ that logs room conversations to the database.
<% } %> <% } %>
<% if (errors.size() != 0) { %>
<table class="jive-error-message" cellpadding="3" cellspacing="0" border="0" width="350"> <tr valign="top">
<td width="1%"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<td width="99%" class="jive-error-text">
<% if (errors.get("idletime") != null) { %>
Please enter a valid number for max idle minutes.
<% }
else if (errors.get("logfreq") != null) { %>
Please enter a valid number for the frequency.
<% }
else if (errors.get("logbatchsize") != null) { %>
Please enter a valid number for the batch size.
<% } %>
</td>
</tr>
</table><br>
<% } %>
<form action="muc-tasks.jsp?kickSettings" method="post"> <form action="muc-tasks.jsp?kickSettings" method="post">
<fieldset> <fieldset>
<legend>Kicking settings</legend> <legend>Idle User Settings</legend>
<div> <div>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody> <tbody>
<tr valign="top"> <tr valign="middle">
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="radio" name="kickEnabled" value="false" id="rb01" <input type="radio" name="kickEnabled" value="false" id="rb01"
<%= ((mucServer.getUserIdleTime() == -1) ? "checked" : "") %>> <%= ((mucServer.getUserIdleTime() < 0) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb01">Disable kicking idle users.</label> <label for="rb01">Never kick idle users.</label>
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="middle">
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="radio" name="kickEnabled" value="true" id="rb02" <input type="radio" name="kickEnabled" value="true" id="rb02"
<%= ((mucServer.getUserIdleTime() > -1) ? "checked" : "") %>> <%= ((mucServer.getUserIdleTime() > -1) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb02">Enable kicking idle users.</label> <label for="rb02">Kick users after they have been idle for</label>
</td> <input type="text" name="idletime" size="5" maxlength="5"
</tr>
<tr valign="top">
<td width="1%" nowrap>
&nbsp;
</td>
<td width="99%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr valign="top">
<td width="1%" nowrap class="c1">
Check frequency (seconds):
</td>
<td width="99%">
<input type="text" name="kickfreq" size="15" maxlength="50"
onclick="this.form.kickEnabled[1].checked=true;"
value="<%= mucServer.getKickIdleUsersTimeout() / 1000 %>">
<% if (errors.get("kickfreq") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td>
</tr>
<tr valign="top">
<td width="1%" nowrap class="c1">
Idle time (seconds):
</td>
<td width="99%">
<input type="text" name="idletime" size="15" maxlength="50"
onclick="this.form.kickEnabled[1].checked=true;" onclick="this.form.kickEnabled[1].checked=true;"
value="<%= mucServer.getUserIdleTime() == -1 ? 1800 : mucServer.getUserIdleTime() / 1000 %>"> value="<%= mucServer.getUserIdleTime() == -1 ? 30 : mucServer.getUserIdleTime() / 1000 / 60 %>">
minutes.
<% if (errors.get("idletime") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -242,43 +211,25 @@ that logs room conversations to the database. ...@@ -242,43 +211,25 @@ that logs room conversations to the database.
<form action="muc-tasks.jsp?logSettings" method="post"> <form action="muc-tasks.jsp?logSettings" method="post">
<fieldset> <fieldset>
<legend>Conversation logging settings</legend> <legend>Conversation Logging</legend>
<div> <div>
<table cellpadding="3" cellspacing="0" border="0" width="100%"> <table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr valign="top"> <tr valign="middle">
<td width="1%" nowrap class="c1"> <td width="1%" nowrap class="c1">
Flush interval (seconds): Flush interval (seconds):
</td> </td>
<td width="99%"> <td width="99%">
<input type="text" name="logfreq" size="15" maxlength="50" <input type="text" name="logfreq" size="15" maxlength="50"
value="<%= mucServer.getLogConversationsTimeout() / 1000 %>"> value="<%= mucServer.getLogConversationsTimeout() / 1000 %>">
<% if (errors.get("logfreq") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="middle">
<td width="1%" nowrap class="c1"> <td width="1%" nowrap class="c1">
Batch size: Batch size:
</td> </td>
<td width="99%"> <td width="99%">
<input type="text" name="logbatchsize" size="15" maxlength="50" <input type="text" name="logbatchsize" size="15" maxlength="50"
value="<%= mucServer.getLogConversationBatchSize() %>"> value="<%= mucServer.getLogConversationBatchSize() %>">
<% if (errors.get("logbatchsize") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td> </td>
</tr> </tr>
</table> </table>
......
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