Commit 4973c4ed authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Encoded links.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1618 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8e1b97e6
......@@ -16,7 +16,8 @@
java.util.Iterator,
org.jivesoftware.messenger.muc.*,
org.xmpp.packet.IQ,
org.dom4j.Element"
org.dom4j.Element,
java.net.URLEncoder"
errorPage="error.jsp"
%>
......@@ -72,7 +73,7 @@
room.getIQAdminHandler().handleIQ(iq, room.getRole());
}
// done, return
response.sendRedirect("muc-room-affiliations.jsp?addsuccess=true&roomName="+roomName);
response.sendRedirect("muc-room-affiliations.jsp?addsuccess=true&roomName="+URLEncoder.encode(roomName, "UTF-8"));
return;
}
catch (ConflictException e) {
......@@ -95,7 +96,7 @@
// Send the IQ packet that will modify the room's configuration
room.getIQOwnerHandler().handleIQ(iq, room.getRole());
// done, return
response.sendRedirect("muc-room-affiliations.jsp?deletesuccess=true&roomName="+roomName);
response.sendRedirect("muc-room-affiliations.jsp?deletesuccess=true&roomName="+URLEncoder.encode(roomName, "UTF-8"));
return;
}
catch (ConflictException e) {
......@@ -109,16 +110,16 @@
String title = LocaleUtils.getLocalizedString("muc.room.affiliations.title");
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-affiliations.jsp?roomName="+roomName));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-affiliations.jsp?roomName="+URLEncoder.encode(roomName, "UTF-8")));
pageinfo.setSubPageID("muc-room-affiliations");
pageinfo.setExtraParams("roomName="+roomName);
pageinfo.setExtraParams("roomName="+URLEncoder.encode(roomName, "UTF-8"));
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p>
<fmt:message key="muc.room.affiliations.info" />
<b><a href="muc-room-edit-form.jsp?roomName=<%= room.getName() %>"><%= room.getName() %></a></b>.
<b><a href="muc-room-edit-form.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"><%= room.getName() %></a></b>.
<fmt:message key="muc.room.affiliations.info_detail" />
</p>
......@@ -218,7 +219,7 @@
<%= user %>
</td>
<td width="1%" align="center">
<a href="muc-room-affiliations.jsp?roomName=<%= roomName %>&userJID=<%= user %>&delete=true&affiliation=owner"
<a href="muc-room-affiliations.jsp?roomName=<%= URLEncoder.encode(roomName, "UTF-8") %>&userJID=<%= user %>&delete=true&affiliation=owner"
title="<fmt:message key="global.click_delete" />"
onclick="return confirm('<fmt:message key="muc.room.affiliations.confirm_removed" />');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
......@@ -246,7 +247,7 @@
<%= user %>
</td>
<td width="1%" align="center">
<a href="muc-room-affiliations.jsp?roomName=<%= roomName %>&userJID=<%= user %>&delete=true&affiliation=admin"
<a href="muc-room-affiliations.jsp?roomName=<%= URLEncoder.encode(roomName, "UTF-8") %>&userJID=<%= user %>&delete=true&affiliation=admin"
title="<fmt:message key="global.click_delete" />"
onclick="return confirm('<fmt:message key="muc.room.affiliations.confirm_removed" />');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
......@@ -276,7 +277,7 @@
<%= user %><%= nickname %>
</td>
<td width="1%" align="center">
<a href="muc-room-affiliations.jsp?roomName=<%= roomName %>&userJID=<%= user %>&delete=true&affiliation=member"
<a href="muc-room-affiliations.jsp?roomName=<%= URLEncoder.encode(roomName, "UTF-8") %>&userJID=<%= user %>&delete=true&affiliation=member"
title="<fmt:message key="global.click_delete" />"
onclick="return confirm('<fmt:message key="muc.room.affiliations.confirm_removed" />');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
......@@ -304,7 +305,7 @@
<%= user %>
</td>
<td width="1%" align="center">
<a href="muc-room-affiliations.jsp?roomName=<%= roomName %>&userJID=<%= user %>&delete=true&affiliation=outcast"
<a href="muc-room-affiliations.jsp?roomName=<%= URLEncoder.encode(roomName, "UTF-8") %>&userJID=<%= user %>&delete=true&affiliation=outcast"
title="<fmt:message key="global.click_delete" />"
onclick="return confirm('<fmt:message key="muc.room.affiliations.confirm_removed" />');"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
......
......@@ -11,7 +11,8 @@
<%@ page import="org.jivesoftware.util.*,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.muc.MUCRoom"
org.jivesoftware.messenger.muc.MUCRoom,
java.net.URLEncoder"
errorPage="error.jsp"
%>
......@@ -54,16 +55,16 @@
String title = LocaleUtils.getLocalizedString("muc.room.delete.title");
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-delete.jsp?roomName="+roomName));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-delete.jsp?roomName="+URLEncoder.encode(roomName, "UTF-8")));
pageinfo.setSubPageID("muc-room-delete");
pageinfo.setExtraParams("roomName="+roomName);
pageinfo.setExtraParams("roomName="+URLEncoder.encode(roomName, "UTF-8"));
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p>
<fmt:message key="muc.room.delete.info" />
<b><a href="muc-room-edit-form.jsp?roomName=<%= room.getName() %>"><%= room.getName() %></a></b>
<b><a href="muc-room-edit-form.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"><%= room.getName() %></a></b>
<fmt:message key="muc.room.delete.detail" />
</p>
......
......@@ -17,15 +17,14 @@
org.jivesoftware.messenger.forms.spi.*,
org.jivesoftware.messenger.forms.*,
org.dom4j.Element,
org.dom4j.DocumentHelper,
org.dom4j.QName,
org.xmpp.packet.IQ,
org.xmpp.packet.Message,
org.xmpp.packet.JID,
org.jivesoftware.messenger.auth.UnauthorizedException,
org.jivesoftware.util.LocaleUtils,
org.jivesoftware.stringprep.Stringprep,
org.jivesoftware.stringprep.StringprepException"
org.jivesoftware.stringprep.StringprepException,
java.net.URLEncoder"
errorPage="error.jsp"
%>
......@@ -242,10 +241,10 @@
// Changes good, so redirect
String params = "";
if (create) {
params = "addsuccess=true&roomName=" + roomName;
params = "addsuccess=true&roomName=" + URLEncoder.encode(roomName, "UTF-8");
}
else {
params = "success=true&roomName=" + roomName;
params = "success=true&roomName=" + URLEncoder.encode(roomName, "UTF-8");
}
response.sendRedirect("muc-room-edit-form.jsp?" + params);
return;
......@@ -285,6 +284,7 @@
}
// Formatter for dates
DateFormat dateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
roomName = roomName == null ? "" : roomName;
%>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
......@@ -297,10 +297,10 @@
pageinfo.setPageID("muc-room-create");
}
else {
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-edit-form.jsp?roomName="+roomName));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-edit-form.jsp?roomName="+URLEncoder.encode(roomName, "UTF-8")));
pageinfo.setSubPageID("muc-room-edit-form");
}
pageinfo.setExtraParams("roomName="+roomName+"&create="+create);
pageinfo.setExtraParams("roomName="+URLEncoder.encode(roomName, "UTF-8")+"&create="+create);
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
......@@ -406,7 +406,7 @@
<% if (create) { %>
<tr>
<td><fmt:message key="muc.room.edit.form.room_id" />:</td>
<td><input type="text" name="roomName" value="<%= roomName != null ? roomName : ""%>"> @<%= webManager.getMultiUserChatServer().getServiceDomain()%>
<td><input type="text" name="roomName" value="<%= roomName %>"> @<%= webManager.getMultiUserChatServer().getServiceDomain()%>
</td>
</tr>
<% } %>
......
......@@ -14,7 +14,8 @@
java.text.DateFormat,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.muc.MUCRoom,
java.util.*"
java.util.*,
java.net.URLEncoder"
errorPage="error.jsp"
%>
......@@ -165,12 +166,12 @@
<%= room.getOccupantsCount() %> / <%= room.getMaxUsers() %>
</td>
<td width="1%" align="center">
<a href="muc-room-edit-form.jsp?roomName=<%= room.getName() %>"
<a href="muc-room-edit-form.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"
title="<fmt:message key="global.click_edit" />"
><img src="images/edit-16x16.gif" width="17" height="17" border="0"></a>
</td>
<td width="1%" align="center" style="border-right:1px #ccc solid;">
<a href="muc-room-delete.jsp?roomName=<%= room.getName() %>"
<a href="muc-room-delete.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"
title="<fmt:message key="global.click_delete" />"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
</td>
......
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