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
muc.form.reg.faqentry=FAQ Entry
# Labels for room configuration data form
muc.form.conf.title=Room configuration
muc.form.conf.instruction=The room "{0}" has been created. The default configuration is as \
follows: \n - No logging\n - No moderation\n - Up to 30 participants\n - No password required\
\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.instruction=The room "{0}" has been created. To accept the default configuration, \
click the "OK" button. Or, modify the settings by completing the following form:
muc.form.conf.owner_roomname=Room Name
muc.form.conf.owner_roomdesc=Description
muc.form.conf.owner_changesubject=Allow Occupants to Change Subject
......@@ -138,10 +135,10 @@ muc.form.conf.moderator=Moderator
muc.form.conf.participant=Participant
muc.form.conf.visitor=Visitor
muc.form.conf.owner_publicroom=List Room in Directory
muc.form.conf.owner_persistentroom=Make Room Persistent
muc.form.conf.owner_moderatedroom=Make Room Moderated
muc.form.conf.owner_persistentroom=Room is Persistent
muc.form.conf.owner_moderatedroom=Room is Moderated
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_passwordprotectedroom=Password Required to Enter Room
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;
import org.xmpp.packet.Roster;
/**
* Reads XMPP XML from a socket.
*
* @author Derek DeMoro
*/
public class SocketReadThread extends Thread {
private Socket sock;
/**
* The utf-8 charset for decoding and encoding Jabber packet streams.
*/
private String charset = "UTF-8";
private Session session;
private Connection connection;
private static String CHARSET = "UTF-8";
private static final String ETHERX_NAMESPACE = "http://etherx.jabber.org/streams";
private Socket sock;
private Session session;
private Connection connection;
private String serverName;
/**
* Router used to route incoming packets to the correct channels.
*/
private PacketRouter router;
/**
* Audits incoming data
*/
private Auditor auditor;
private boolean clearSignout = false;
XmlPullParserFactory factory = null;
XPPPacketReader reader = null;
/**
* Create dedicated read thread for this socket.
*
......@@ -98,10 +96,8 @@ public class SocketReadThread extends Thread {
reader = new XPPPacketReader();
reader.setXPPFactory(factory);
reader.getXPPParser().setInput(new InputStreamReader(sock.getInputStream(),
charset));
CHARSET));
// Read in the opening tag and prepare for packet stream
createSession();
......@@ -248,7 +244,7 @@ public class SocketReadThread extends Thread {
}
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.flush();
// TODO: check for SASL support in opening stream tag
......
......@@ -145,7 +145,7 @@
url="muc-create-permission.jsp"
description="" />
<item id="muc-tasks" name="Tasks Settings"
<item id="muc-tasks" name="Other Settings"
url="muc-tasks.jsp"
description="" />
</sidebar>
......
......@@ -98,9 +98,8 @@
<jsp:include page="title.jsp" flush="true" />
<p>
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
history to store for each room.
Group chat rooms can replay conversation histories to provide context to new members joining a room.
Thre are several options for controlling how much history to store for each room.
</p>
<% if ("true".equals(request.getParameter("success"))) { %>
......@@ -121,7 +120,7 @@ history to store for each room.
<form action="muc-history-settings.jsp" method="post">
<fieldset>
<legend>Set Conflict Policy</legend>
<legend>History Settings</legend>
<div>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
......@@ -132,7 +131,7 @@ history to store for each room.
<td width="99%">
<label for="rb01">
<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>
</tr>
<tr valign="top">
......@@ -142,7 +141,7 @@ history to store for each room.
<td width="99%">
<label for="rb02">
<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>
</tr>
<tr valign="top">
......
......@@ -73,7 +73,7 @@
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs
String title = "Group Chat Properties";
String title = "Group Chat Service Properties";
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-server-props-edit-form.jsp"));
......@@ -94,7 +94,7 @@ a server restart.
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<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.
</td></tr>
</tbody>
......@@ -119,23 +119,16 @@ a server restart.
<form action="muc-server-props-edit-form.jsp?save" method="post">
<fieldset>
<legend>Set Conflict Policy</legend>
<legend>Service Name</legend>
<div>
<table cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="c1">
Server name:
</td>
<td>
<%= name %>
</td>
</tr>
<tr>
<td class="c1">
Group chat service name:
</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) { %>
......
......@@ -103,7 +103,7 @@ enter any group chat room and their permissions are the same as the room owner.
<tbody>
<tr><td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"></td>
<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>
</tbody>
</table>
......@@ -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">
<fieldset>
<legend>Admin Users</legend>
<legend>Administrators</legend>
<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 : "") %>"
id="userJIDtf">
<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.
<tr>
<td colspan="2">
No admins specified, use the form above to add one.
No administrators specified, use the form above to add one.
</td>
</tr>
......
......@@ -25,7 +25,6 @@
<% // Get parameters
boolean kickEnabled = ParamUtils.getBooleanParameter(request,"kickEnabled");
String kickfreq = ParamUtils.getParameter(request,"kickfreq");
String idletime = ParamUtils.getParameter(request,"idletime");
String logfreq = ParamUtils.getParameter(request,"logfreq");
String logbatchsize = ParamUtils.getParameter(request,"logbatchsize");
......@@ -47,32 +46,24 @@
return;
}
// do validation
if (kickfreq == null) {
errors.put("kickfreq","kickfreq");
}
if (idletime == null) {
errors.put("idletime","idletime");
}
int frequency = 0;
int idle = 0;
// Try to obtain an int from the provided strings
if (errors.size() == 0) {
try {
frequency = Integer.parseInt(kickfreq) * 1000;
idle = Integer.parseInt(idletime) * 1000 * 60;
}
catch (NumberFormatException e) {
errors.put("kickfreq","kickfreq");
}
try {
idle = Integer.parseInt(idletime) * 1000;
errors.put("idletime","idletime");
}
catch (NumberFormatException e) {
if (idle < 0) {
errors.put("idletime","idletime");
}
}
if (errors.size() == 0) {
mucServer.setKickIdleUsersTimeout(frequency);
mucServer.setUserIdleTime(idle);
response.sendRedirect("muc-tasks.jsp?kickSettingSuccess=true");
return;
......@@ -117,18 +108,18 @@
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs
String title = "Tasks Settings";
String title = "Other Settings";
pageinfo.setTitle(title);
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");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p>
Use the forms below to configure the task for kicking idle users from group chat rooms and to configure the task
that logs room conversations to the database.
Use the forms below to configure settings for kicking idle users from group chat rooms and to
configure the task that logs room conversations to the database.
</p>
<% if (kickSettingSuccess || logSettingSuccess) { %>
......@@ -140,11 +131,11 @@ that logs room conversations to the database.
<td class="jive-icon-label">
<% if (kickSettingSuccess) { %>
Kicking settings updated successfully.
Idle user settings updated successfully.
<% } else if (logSettingSuccess) { %>
Conversations logging settings updated successfully.
Conversation logging settings updated successfully.
<% } %>
</td></tr>
......@@ -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">
<fieldset>
<legend>Kicking settings</legend>
<legend>Idle User Settings</legend>
<div>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<tr valign="top">
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="kickEnabled" value="false" id="rb01"
<%= ((mucServer.getUserIdleTime() == -1) ? "checked" : "") %>>
<%= ((mucServer.getUserIdleTime() < 0) ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb01">Disable kicking idle users.</label>
<label for="rb01">Never kick idle users.</label>
</td>
</tr>
<tr valign="top">
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="kickEnabled" value="true" id="rb02"
<%= ((mucServer.getUserIdleTime() > -1) ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb02">Enable kicking idle users.</label>
</td>
</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"
<label for="rb02">Kick users after they have been idle for</label>
<input type="text" name="idletime" size="5" maxlength="5"
onclick="this.form.kickEnabled[1].checked=true;"
value="<%= mucServer.getUserIdleTime() == -1 ? 1800 : mucServer.getUserIdleTime() / 1000 %>">
<% if (errors.get("idletime") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td>
</tr>
</table>
value="<%= mucServer.getUserIdleTime() == -1 ? 30 : mucServer.getUserIdleTime() / 1000 / 60 %>">
minutes.
</td>
</tr>
</tbody>
......@@ -242,43 +211,25 @@ that logs room conversations to the database.
<form action="muc-tasks.jsp?logSettings" method="post">
<fieldset>
<legend>Conversation logging settings</legend>
<legend>Conversation Logging</legend>
<div>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr valign="top">
<tr valign="middle">
<td width="1%" nowrap class="c1">
Flush interval (seconds):
</td>
<td width="99%">
<input type="text" name="logfreq" size="15" maxlength="50"
value="<%= mucServer.getLogConversationsTimeout() / 1000 %>">
<% if (errors.get("logfreq") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td>
</tr>
<tr valign="top">
<tr valign="middle">
<td width="1%" nowrap class="c1">
Batch size:
</td>
<td width="99%">
<input type="text" name="logbatchsize" size="15" maxlength="50"
value="<%= mucServer.getLogConversationBatchSize() %>">
<% if (errors.get("logbatchsize") != null) { %>
<span class="jive-error-text">
Please enter a valid number.
</span>
<% } %>
</td>
</tr>
</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