head	1.16;
access;
symbols
	TIGRIS_1_1_0RC2:1.10
	TIGRIS_1_1_0RC1:1.10
	TIGRIS_1_1:1.10.0.4
	TIGRIS_1_0_8:1.10
	TIGRIS_1_0_8RC3:1.10
	TIGRIS_1_0_8RC2:1.10
	TIGRIS_1_0_8RC1:1.10
	TIGRIS_1_0_7:1.10
	TIGRIS_1_0_7RC3:1.10
	TIGRIS_1_0_7RC2:1.10
	TIGRIS_1_0_7RC1:1.10
	TIGRIS_1_0_6:1.10
	TIGRIS_1_0_6RC5:1.10
	TIGRIS_1_0_6RC4:1.10
	TIGRIS_1_0_6RC3:1.10
	TIGRIS_1_0_6RC2:1.10
	TIGRIS_1_0_6RC1:1.10
	TIGRIS_1_0_5:1.10
	TIGRIS_1_0_5RC6:1.10
	TIGRIS_1_0_5RC5:1.10
	TIGRIS_1_0_5RC4:1.10
	TIGRIS_1_0_5RC3:1.10
	TIGRIS_1_0_5RC2:1.10
	TIGRIS_1_0_5RC1:1.10
	TIGRIS_1_0_4:1.10
	TIGRIS_1_0_3:1.10
	TIGRIS_1_0_2:1.10
	TIGRIS_1_0_1:1.10
	TIGRIS_1_0:1.10.0.6
	TIGRIS_1_0_0:1.10
	TIGRIS_1_0_0_RC1:1.10.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.5
	TIGRIS_0_9_2_3:1.5
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.8
	TIGRIS_0_9_2_1:1.8
	TIGRIS_0_9_2:1.5.0.4
	TIGRIS_0_9_0:1.5.0.2
	TIGRIS_0_8_4:1.2.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.16
date	2001.08.11.09.08.01;	author dlr;	state Exp;
branches;
next	1.15;

1.15
date	2001.07.24.00.02.27;	author leonardr;	state Exp;
branches;
next	1.14;

1.14
date	2001.07.18.10.05.12;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2001.07.17.17.55.45;	author leonardr;	state Exp;
branches;
next	1.12;

1.12
date	2001.06.04.22.12.14;	author leonardr;	state Exp;
branches;
next	1.11;

1.11
date	2001.05.23.01.50.10;	author dlr;	state Exp;
branches;
next	1.10;

1.10
date	2001.03.07.01.53.20;	author lucas;	state Exp;
branches;
next	1.9;

1.9
date	2001.02.21.01.08.21;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2001.01.26.18.29.02;	author edk;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2001.01.26.05.24.06;	author edk;	state dead;
branches;
next	1.6;

1.6
date	2001.01.24.21.41.49;	author leonardr;	state Exp;
branches;
next	1.5;

1.5
date	2000.12.21.02.34.32;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2000.12.21.01.45.29;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2000.12.21.00.35.36;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.14.07.55.42;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.12.21.15.42;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.15.42;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.32.31;	author dlr;	state Exp;
branches;
next	;

1.8.2.1
date	2001.01.28.01.02.17;	author dlr;	state dead;
branches;
next	1.8.2.2;

1.8.2.2
date	2001.02.12.20.25.45;	author leonardr;	state Exp;
branches;
next	1.8.2.3;

1.8.2.3
date	2001.02.15.20.50.35;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.16
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */


package org.tigris.helm.domain;

import java.util.*;
import java.sql.Connection;

import org.apache.velocity.context.Context;

import org.apache.turbine.util.Log;
import org.apache.commons.util.exception.NestableException;

import org.tigris.helm.security.RedirectException;

import org.tigris.helm.security.*;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.ContextAPI;

/**
 * Confirm deletion of one or more users.
 *
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: UserDelete.java,v 1.15 2001/07/24 00:02:27 leonardr Exp $
 */
public class UserDelete extends HelmServlet
{
    private static final boolean DEBUG = true;
  
    private static final String DELETE_ACTION = "Delete Users";
    private static final String CONFIRM_DELETE_ACTION = "Confirm Delete";
    private static final String USERS_TO_DELETE_FIELD = "usersToDelete";
    private static final String MASS_DELETE_FIELD = "massDelete";

    protected String processRequest(Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        String action = getAction(context);

        List usersToDelete = null;
        User userToDelete = getCurrentUser(context);

        try
        {
            User loginUser = getLoginUser(context);
            if (!loginUser.equals(userToDelete))
            {
                //They want to delete a particular user.
                usersToDelete = new ArrayList(1);
                usersToDelete.add(userToDelete);
                context.put(MASS_DELETE_FIELD, userToDelete.getLoginName());
            }
            else
            {
                //No one user was specified to delete. See if a bunch
                //of users were specified.
                String massDelete = 
                    ContextAPI.processField(context, MASS_DELETE_FIELD);
                usersToDelete = UserPeer.parseDesignantList
                    (massDelete, getCurrentDomain(context), 
                     ContextAPI.getValidationErrors(context));
            }                        
            
            context.put(USERS_TO_DELETE_FIELD, usersToDelete);


            if (CONFIRM_DELETE_ACTION.equals(action))
            {

                if (ContextAPI.isValidUserInput(context) && 
                    (usersToDelete == null || usersToDelete.size() == 0))
                {
                    ContextAPI.addValidationError
                        (context, 
                         "You must specify at least one user to delete.");
                    usersToDelete = new ArrayList(0);
                }

                if (ContextAPI.isValidUserInput(context))
                {

                    int usersDeleted = usersToDelete.size();
                    for (Iterator i = usersToDelete.iterator(); i.hasNext();)
                    {
                        User user = (User)i.next();
                        user.delete(loginUser.getACL());
                    }
                
                    // TODO: Preserve the user message that is
                    // currently lost during the client redirect.
                    // Calling redirectTo(String) instead leaves a
                    // userID in the context of a deleted user.  The
                    // following does not clear it:
                    //context.put("userID", "");
                    String message = String.valueOf(usersDeleted) + " user" +
                        (usersDeleted==1?"":"s") + "deleted.";
                    ContextAPI.addMessage(context, message);
                    redirectToURL(context, "UserList");
                }
            }
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error("Error deleting user(s)", e);
            throw new NestableException(e);
        }

        return templateName;
    }
}
@


1.15
log
@The final pieces of the error handling revolution.
@
text
@d56 1
a56 1
import org.apache.turbine.util.TurbineException;
d69 1
a69 1
 * @@version $Id: UserDelete.java,v 1.14 2001/07/18 10:05:12 dlr Exp $
d81 1
a81 1
        throws TurbineException, RedirectException
d155 1
a155 1
            throw new TurbineException(e);
@


1.14
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d69 1
a69 1
 * @@version $Id: UserDelete.java,v 1.13 2001/07/17 17:55:45 leonardr Exp $
d143 1
a143 1
                    appendToMessage(context, message);
@


1.13
log
@Porting of domain package to new error handling API.
@
text
@d58 1
a58 1
import org.joist.security.RedirectException;
d69 1
a69 1
 * @@version $Id: UserDelete.java,v 1.12 2001/06/04 22:12:14 leonardr Exp $
@


1.12
log
@Gave UserDelete the capability for mass deletes.
@
text
@d62 1
d69 1
a69 1
 * @@version $Id: UserDelete.java,v 1.11 2001/05/23 01:50:10 dlr Exp $
a88 3
        List missingFields = new ArrayList();
        List validationErrors = new ArrayList();

d104 1
a104 1
                    processField(context, MASS_DELETE_FIELD);
d106 2
a107 1
                    (massDelete, getCurrentDomain(context), validationErrors);
d112 2
a113 2
            if (validationErrors.isEmpty() && 
                CONFIRM_DELETE_ACTION.equals(action))
d116 1
a116 1
                if (validationErrors.isEmpty() && 
d119 3
a121 2
                    validationErrors.add
                        ("You must specify at least one user to delete.");
d125 1
a125 2
                int usersDeleted = usersToDelete.size();
                for (Iterator i = usersToDelete.iterator(); i.hasNext();)
d127 18
a144 2
                    User user = (User)i.next();
                    user.delete(loginUser.getACL());
a145 16
                
                // TODO: Preserve the user message that is currently lost
                // during the client redirect.  Calling redirectTo(String)
                // instead leaves a userID in the context of a deleted user.
                // The following does not clear it:
                //context.put("userID", "");
                String message = String.valueOf(usersDeleted) + " user" +
                    (usersDeleted==1?"":"s") + "deleted.";
                appendToMessage(context, message);
                redirectToURL(context, "UserList");
            }

            if (!validationErrors.isEmpty())
            {
                reportInvalidUserInput(context, missingFields, 
                                       validationErrors);                
@


1.11
log
@Ported Helm from WebMacro to Velocity.
@
text
@d50 1
a56 1
import org.apache.turbine.util.TurbineException;
d62 1
d64 1
a64 1
 * Confirm deletion of a user.
d67 2
a68 1
 * @@version $Id: UserDelete.java,v 1.10 2001/03/07 01:53:20 lucas Exp $
d74 4
a77 4
    private static final String DELETE_ACTION = "Confirm Delete";
    private static final String IS_DELETING_SELF_FIELD = "isDeletingSelf";
    private static final String SELF_DELETE_ERROR 
        = "You may not delete yourself.";
d83 8
a90 1
        User user = getCurrentUser(context);
d94 1
a94 2
            boolean isDeletingSelf = loginUser.equals(user);
            if (isDeletingSelf)
d96 4
a99 1
                appendToError(context, SELF_DELETE_ERROR);
d103 16
a118 3
                // Handle button press.
                String action = getAction(context);
                if (action.equals(DELETE_ACTION))
d120 9
a128 1
                    // Consider this action to be confirmation by the user.
a129 7
                    // TODO: Preserve the user message that is currently lost
                    // during the client redirect.  Calling redirectTo(String)
                    // instead leaves a userID in the context of a deleted user.
                    // The following does not clear it:
                    //context.put("userID", "");
                    appendToMessage(context, "User deleted");
                    redirectToURL(context, "UserList");
d131 16
a147 6
            addBooleanToContext(context, IS_DELETING_SELF_FIELD,
                                isDeletingSelf);
        }
        catch (ACLException e)
        {
            throw e;
d155 1
a155 1
            Log.error("Error deleting user", e);
@


1.10
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d52 1
a52 1
import org.webmacro.servlet.*;
d55 2
d66 1
a66 1
 * @@version $Id: UserDelete.java,v 1.9 2001/02/21 01:08:21 dlr Exp $
d77 2
a78 2
    protected String processRequest (Connection conn, WebContext context)
        throws HandlerException, RedirectException
d80 1
a80 2
        String templateName = super.processRequest(conn, context);

d89 3
a91 1
            } else {
d107 2
a108 1
            addBooleanToContext(context, IS_DELETING_SELF_FIELD, isDeletingSelf);
d120 2
a121 2
            Log.error("Exception thrown in UserDelete: ", e);
            throw new HandlerException(e.getMessage());
@


1.9
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@a59 1

d64 1
a64 1
 * @@version $Id: UserDelete.java,v 1.8.2.3 2001/02/15 20:50:35 leonardr Exp $
@


1.8
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d2 1
a2 1
 * Copyright (c) 2000 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by CollabNet (http://www.CollabNet/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
a50 1
import java.sql.SQLException;
a51 1
import org.webmacro.util.Log;
d54 2
a56 1
import org.joist.database.UserManager;
d59 1
d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.5 2000/12/21 02:34:32 dlr Exp $
d69 1
a69 3
    private static Log log = new Log("usrDel", "UserDelete");

    private static final boolean debug = true;
d71 4
a74 1
    private static final String DEL_ACTION = "Confirm Delete";
d76 1
a76 1
    protected String processRequest (Connection conn, WebContext ctx)
d79 1
a79 2
        if (debug) log.debug("started");
        String templateName = super.processRequest(conn, ctx);
d81 1
a81 1
        User user = getCurrentUser(ctx);
d84 3
a86 3
            AccessControlList acl = getACL(ctx, conn);
            boolean isDeletingSelf = acl.getUserID().equals(user.getID());
            if (!isDeletingSelf)
d88 2
d91 2
a92 3
                String action = getAction(ctx);
                if (debug) log.info("action=" + action);
                if (action.equals(DEL_ACTION))
d95 1
a95 2
                    if (debug) log.debug("Deleting user");
                    user.delete(acl);
d100 3
a102 3
                    //ctx.put("userID", "");
                    appendToMessage(ctx, "User deleted");
                    redirectToURL(ctx, "UserList");
d105 1
a105 5
            else
            {
                appendToError(ctx, "You cannot delete yourself");
            }
            addBooleanToContext(ctx, "isDeletingSelf", isDeletingSelf);
d117 1
a117 1
            log.exception(e);
@


1.8.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.8 2001/01/26 18:29:02 edk Exp $
@


1.8.2.2
log
@Ported UserDelete method.
@
text
@d2 1
a2 1
 * Copyright (c) 2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by CollabNet (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d51 1
d53 1
a55 2
import org.apache.turbine.util.Log;

d57 1
a59 1
import org.tigris.helm.om.*;
d69 3
a71 1
    private static final boolean DEBUG = true;
d73 1
a73 4
    private static final String DELETE_ACTION = "Confirm Delete";
    private static final String IS_DELETING_SELF_FIELD = "isDeletingSelf";
    private static final String SELF_DELETE_ERROR 
        = "You may not delete yourself.";
d75 1
a75 1
    protected String processRequest (Connection conn, WebContext context)
d78 2
a79 1
        String templateName = super.processRequest(conn, context);
d81 1
a81 1
        User user = getCurrentUser(context);
d84 3
a86 3
            User loginUser = getLoginUser(context);
            boolean isDeletingSelf = loginUser.equals(user);
            if (isDeletingSelf)
a87 2
                appendToError(context, SELF_DELETE_ERROR);
            } else {
d89 3
a91 2
                String action = getAction(context);
                if (action.equals(DELETE_ACTION))
d94 2
a95 1
                    user.delete(loginUser.getACL());
d100 3
a102 3
                    //context.put("userID", "");
                    appendToMessage(context, "User deleted");
                    redirectToURL(context, "UserList");
d105 5
a109 1
            addBooleanToContext(context, IS_DELETING_SELF_FIELD, isDeletingSelf);
d121 1
a121 1
            Log.error("Exception thrown in UserDelete: ", e);
@


1.8.2.3
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.8.2.2 2001/02/12 20:25:45 leonardr Exp $
@


1.7
log
@revert this stuff to its state as of 2001/01/24 12:42:00 GMT -- with
the following exceptions, which have some different modifications so
they'll work with changes which have happened in joist:

ProjectNewsEdit.java
SkinManager.java
SkinStyleElementValueManager.java
StyleElementManager.java
StyleManager.java

it compiles.  i dunno if it works, though.
@
text
@d57 1
a57 1
import org.tigris.helm.database.UserManager;
d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.6 2001/01/24 21:41:49 leonardr Exp $
@


1.6
log
@Ported UserManager and RoleManager to Helm. Started moving other TableManagers toward a grab-connection-on-demand model. Massive breakage ensues. dlr and I are working on it.
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.5 2000/12/21 02:34:32 dlr Exp $
@


1.5
log
@Make user deletion work at the expense of a lost user delete
confirmation message.  This lost info is due to the pitiful state of
WebMacro--it provides no API for clearing values at actually works.
@
text
@d57 1
a57 1
import org.joist.database.UserManager;
d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.4 2000/12/21 01:45:29 dlr Exp $
@


1.4
log
@Remove userID from the context before handing off to a new servlet.
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.3 2000/12/21 00:35:36 dlr Exp $
d96 5
a100 1
                    ctx.clear();
d102 1
a102 1
                    redirectTo("UserList");
@


1.3
log
@Do not allow users to delete themselves.
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.2 2000/11/14 07:55:42 dlr Exp $
d96 1
@


1.2
log
@Nice when the debugging info actually shows up.
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.1.1.1 2000/11/12 21:15:42 dlr Exp $
d75 1
a75 3
    private static final String USER_CONTEXT_KEY = "userID";

    protected String processRequest (Connection conn, WebContext context)
d79 1
a79 4
        String templateName = super.processRequest(conn, context);

        String userID = (String)context.getForm(USER_CONTEXT_KEY);
        if (debug) log.debug("userID=" + userID);
d81 2
a82 4
        // Determine which button was pushed
        String action = (String)context.get("action");
        if (debug) log.info("action=" + action);
        if (action.equals(DEL_ACTION))
d84 3
a86 3
            // Consider this action to be confirmation by the user.
            if (debug) log.debug("Deleting user");
            try
d88 11
a98 5
                String domainID = getCurrentDomain(context).getID();
                User user = new User(conn, dMgr, userID);
                user.delete(getACL(context, conn));
                appendToMessage(context, "User deleted");
                redirectToURL(context, "UserList");
d100 1
a100 1
            catch (ACLException e)
d102 1
a102 10
                throw e;
            }
            catch (RedirectException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                log.exception(e);
                throw new HandlerException(e.getMessage());
d104 9
d114 1
a114 1
        else
d116 2
a117 2
            // Display the UI.
            context.put(USER_CONTEXT_KEY, userID);
d119 1
a119 2
    
        if (debug) log.debug("done");
@


1.1
log
@Initial revision
@
text
@d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.12 2000/11/11 03:33:32 dlr Exp $
d88 1
a88 1
        if (debug) log.debug("action=" + action);
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by CollabNet (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d51 1
d53 1
a55 2
import org.apache.turbine.util.Log;

d57 1
a59 1
import org.tigris.helm.om.*;
d65 1
a65 1
 * @@version $Id: UserDelete.java,v 1.8.2.3 2001/02/15 20:50:35 leonardr Exp $
d69 3
a71 1
    private static final boolean DEBUG = true;
d73 3
a75 4
    private static final String DELETE_ACTION = "Confirm Delete";
    private static final String IS_DELETING_SELF_FIELD = "isDeletingSelf";
    private static final String SELF_DELETE_ERROR 
        = "You may not delete yourself.";
d80 1
d83 7
a89 2
        User user = getCurrentUser(context);
        try
d91 15
a105 3
            User loginUser = getLoginUser(context);
            boolean isDeletingSelf = loginUser.equals(user);
            if (isDeletingSelf)
d107 6
a112 16
                appendToError(context, SELF_DELETE_ERROR);
            } else {
                // Handle button press.
                String action = getAction(context);
                if (action.equals(DELETE_ACTION))
                {
                    // Consider this action to be confirmation by the user.
                    user.delete(loginUser.getACL());
                    // TODO: Preserve the user message that is currently lost
                    // during the client redirect.  Calling redirectTo(String)
                    // instead leaves a userID in the context of a deleted user.
                    // The following does not clear it:
                    //context.put("userID", "");
                    appendToMessage(context, "User deleted");
                    redirectToURL(context, "UserList");
                }
a113 5
            addBooleanToContext(context, IS_DELETING_SELF_FIELD, isDeletingSelf);
        }
        catch (ACLException e)
        {
            throw e;
d115 1
a115 1
        catch (RedirectException e)
d117 2
a118 1
            throw e;
d120 2
a121 6
        catch (Exception e)
        {
            Log.error("Exception thrown in UserDelete: ", e);
            throw new HandlerException(e.getMessage());
        }

@

