Commit 3538d3d5 authored by Bill Lynch's avatar Bill Lynch Committed by bill

More UI work, calling new APIs


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@438 b35dd754-fafc-0310-a699-88a17e54d16e
parent e6e13842
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
for (String user : removeables) { for (String user : removeables) {
mucServer.removeUserAllowedToCreate(user); mucServer.removeUserAllowedToCreate(user);
} }
mucServer.setRoomCreationRestricted(false);
response.sendRedirect("muc-create-permission.jsp?success=true");
return;
}
else {
mucServer.setRoomCreationRestricted(true);
response.sendRedirect("muc-create-permission.jsp?success=true"); response.sendRedirect("muc-create-permission.jsp?success=true");
return; return;
} }
...@@ -69,10 +75,6 @@ ...@@ -69,10 +75,6 @@
response.sendRedirect("muc-create-permission.jsp?deletesuccess=true"); response.sendRedirect("muc-create-permission.jsp?deletesuccess=true");
return; return;
} }
if (errors.size() == 0) {
openPerms = mucServer.getUsersAllowedToCreate().size() == 0;
}
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
...@@ -87,8 +89,7 @@ ...@@ -87,8 +89,7 @@
<jsp:include page="title.jsp" flush="true" /> <jsp:include page="title.jsp" flush="true" />
<p> <p>
Below is a list of users allowed to create rooms. An empty list means that <b>anyone</b> can create Use the form below to set the policy for who can create chat rooms.
a room.
</p> </p>
<% if (errors.size() > 0) { %> <% if (errors.size() > 0) { %>
...@@ -141,7 +142,7 @@ a room. ...@@ -141,7 +142,7 @@ a room.
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="openPerms" value="true" id="rb01" <input type="radio" name="openPerms" value="true" id="rb01"
<%= ((openPerms) ? "checked" : "") %>> <%= ((!mucServer.isRoomCreationRestricted()) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb01">Anyone can create a chat room.</label> <label for="rb01">Anyone can create a chat room.</label>
...@@ -151,80 +152,80 @@ a room. ...@@ -151,80 +152,80 @@ a room.
<td width="1%"> <td width="1%">
<input type="radio" name="openPerms" value="false" id="rb02" <input type="radio" name="openPerms" value="false" id="rb02"
onfocus="this.form.userJID.focus();" onfocus="this.form.userJID.focus();"
<%= ((!openPerms) ? "checked" : "") %>> <%= ((mucServer.isRoomCreationRestricted()) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb02">Only specific users can create a chat room:</label> <label for="rb02">Only specific users can create a chat room.</label>
</td>
</tr>
<tr>
<td width="1%">
&nbsp;
</td>
<td width="99%">
<fieldset>
<legend>Allowed Users</legend>
<div>
<p>
Add User (enter JID):
<input type="text" name="userJID" size="30" maxlength="100" value="<%= (userJID != null ? userJID : "") %>"
onclick="this.form.openPerms[1].checked=true;">
<input type="submit" name="add" value="Add">
</p>
<div class="jive-table" style="width:400px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<tr>
<th width="99%">User</th>
<th width="1%">Remove</th>
</tr>
</thead>
<tbody>
<% if (mucServer.getUsersAllowedToCreate().size() == 0) { %>
<tr>
<td colspan="2">
No allowed users, use the form above to add one.
</td>
</tr>
<% } %>
<% for (Object obj : mucServer.getUsersAllowedToCreate()) {
String user = (String)obj;
%>
<tr>
<td width="99%">
<%= user %>
</td>
<td width="1%" align="center">
<a href="muc-create-permission.jsp?userJID=<%= user %>&delete=true"
title="Click to delete..."
onclick="return confirm('Are you sure you want to remove this user from the list?');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
</fieldset>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br>
<input type="submit" name="save" value="Save Settings">
</div> </div>
</fieldset> </fieldset>
<br><br> </form>
<input type="submit" name="save" value="Save Settings"> <br>
</form> <% if (mucServer.isRoomCreationRestricted()) { %>
<form action="muc-create-permission.jsp" method="post">
<fieldset>
<legend>Allowed Users</legend>
<div>
<p>
Add User (enter JID):
<input type="text" name="userJID" size="30" maxlength="100" value="<%= (userJID != null ? userJID : "") %>"
onclick="this.form.openPerms[1].checked=true;">
<input type="submit" name="add" value="Add">
</p>
<div class="jive-table" style="width:400px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<tr>
<th width="99%">User</th>
<th width="1%">Remove</th>
</tr>
</thead>
<tbody>
<% if (mucServer.getUsersAllowedToCreate().size() == 0) { %>
<tr>
<td colspan="2">
No allowed users, use the form above to add one.
</td>
</tr>
<% } %>
<% for (Object obj : mucServer.getUsersAllowedToCreate()) {
String user = (String)obj;
%>
<tr>
<td width="99%">
<%= user %>
</td>
<td width="1%" align="center">
<a href="muc-create-permission.jsp?userJID=<%= user %>&delete=true"
title="Click to delete..."
onclick="return confirm('Are you sure you want to remove this user from the list?');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
</fieldset>
</form>
<% } %>
<jsp:include page="bottom.jsp" flush="true" /> <jsp:include page="bottom.jsp" flush="true" />
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