muc-room-delete.jsp 3.45 KB
Newer Older
Gaston Dombiak's avatar
Gaston Dombiak committed
1 2 3 4 5 6 7 8 9 10 11
<%--
  -	$Revision$
  -	$Date$
  -
  - Copyright (C) 2004 Jive Software. All rights reserved.
  -
  - This software is the proprietary information of Jive Software.
  - Use is subject to license terms.
--%>

<%@ page import="org.jivesoftware.util.*,
12
                 org.jivesoftware.openfire.muc.MUCRoom,
Gaston Dombiak's avatar
Gaston Dombiak committed
13
                 java.net.URLEncoder"
Gaston Dombiak's avatar
Gaston Dombiak committed
14 15 16 17
    errorPage="error.jsp"
%>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
18
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>

<%  // Get parameters //
    boolean cancel = request.getParameter("cancel") != null;
    boolean delete = request.getParameter("delete") != null;
    String roomName = ParamUtils.getParameter(request,"roomName");
    String alternateJID = ParamUtils.getParameter(request,"alternateJID");
    String reason = ParamUtils.getParameter(request,"reason");

    // Handle a cancel
    if (cancel) {
        response.sendRedirect("muc-room-summary.jsp");
        return;
    }

    // Load the room object
    MUCRoom room = webManager.getMultiUserChatServer().getChatRoom(roomName);

    // Handle a room delete:
    if (delete) {
        // Delete the room
        if (room !=  null) {
            // If the room still exists then destroy it
            room.destroyRoom(alternateJID, reason);
44 45
            // Log the event
            webManager.logEvent("destroyed MUC room "+roomName, "reason = "+reason+"\nalt jid = "+alternateJID);
Gaston Dombiak's avatar
Gaston Dombiak committed
46 47 48 49 50 51 52
        }
        // Done, so redirect
        response.sendRedirect("muc-room-summary.jsp?deletesuccess=true");
        return;
    }
%>

53 54 55 56 57 58 59 60
<html>
    <head>
        <title><fmt:message key="muc.room.delete.title"/></title>
        <meta name="subPageID" content="muc-room-delete"/>
        <meta name="extraParams" content="<%= "roomName="+URLEncoder.encode(roomName, "UTF-8") %>"/>
        <meta name="helpPage" content="delete_a_group_chat_room.html"/>
    </head>
    <body>
Gaston Dombiak's avatar
Gaston Dombiak committed
61 62

<p>
63
<fmt:message key="muc.room.delete.info" />
Gaston Dombiak's avatar
Gaston Dombiak committed
64
<b><a href="muc-room-edit-form.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"><%= room.getName() %></a></b>
65
<fmt:message key="muc.room.delete.detail" />
Gaston Dombiak's avatar
Gaston Dombiak committed
66 67 68 69 70 71
</p>

<form action="muc-room-delete.jsp">
<input type="hidden" name="roomName" value="<%= roomName %>">

<fieldset>
72
    <legend><fmt:message key="muc.room.delete.destructon_title" /></legend>
Gaston Dombiak's avatar
Gaston Dombiak committed
73 74 75 76 77
    <div>
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
    <tbody>
        <tr>
            <td class="c1">
78
                <fmt:message key="muc.room.delete.room_id" />
Gaston Dombiak's avatar
Gaston Dombiak committed
79 80 81 82 83 84 85
            </td>
            <td>
                <%= room.getName() %>
            </td>
        </tr>
        <tr>
            <td class="c1">
86
                <fmt:message key="muc.room.delete.reason" />
Gaston Dombiak's avatar
Gaston Dombiak committed
87 88 89 90 91 92 93
            </td>
            <td>
                <input type="text" size="50" maxlength="150" name="reason">
            </td>
        </tr>
        <tr>
            <td class="c1">
94
                <fmt:message key="muc.room.delete.alternate_address" />
Gaston Dombiak's avatar
Gaston Dombiak committed
95 96 97 98 99 100 101 102 103 104 105 106
            </td>
            <td>
                <input type="text" size="30" maxlength="150" name="alternateJID">
            </td>
        </tr>
    </tbody>
    </table>
    </div>
</fieldset>

<br><br>

107 108
<input type="submit" name="delete" value="<fmt:message key="muc.room.delete.destroy_room" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
Gaston Dombiak's avatar
Gaston Dombiak committed
109 110
</form>

111 112
    </body>
</html>