muc-room-delete.jsp 3.65 KB
Newer Older
Gaston Dombiak's avatar
Gaston Dombiak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<%--
  -	$RCSfile$
  -	$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.*,
                 org.jivesoftware.admin.*,
                 org.jivesoftware.messenger.muc.MUCRoom"
    errorPage="error.jsp"
%>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
19
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<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);
        }
        // Done, so redirect
        response.sendRedirect("muc-room-summary.jsp?deletesuccess=true");
        return;
    }
%>

<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<%  // Title of this page and breadcrumbs
54
    String title = LocaleUtils.getLocalizedString("muc.room.delete.title");
Gaston Dombiak's avatar
Gaston Dombiak committed
55
    pageinfo.setTitle(title);
56
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp"));
Gaston Dombiak's avatar
Gaston Dombiak committed
57 58 59 60 61 62 63 64
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-delete.jsp?roomName="+roomName));
    pageinfo.setSubPageID("muc-room-delete");
    pageinfo.setExtraParams("roomName="+roomName);
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />

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

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

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

<br><br>

109 110
<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
111 112 113
</form>

<jsp:include page="bottom.jsp" flush="true" />