/*
 * $Id: LostFoldersAction.java,v 1.2 2007/08/14 14:49:57 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * $Log: LostFoldersAction.java,v $
 * Revision 1.2  2007/08/14 14:49:57  marbobo
 * + Licenseverwaltung komplett umgeschrieben
 * + Kategoriesuche und verlorene Kategorien anzeigen komplett umgeschrieben
 * + Fehler beim Speichern von Beschreibenungsfeldern für Entitäten beseitigt.
 *
 */
package vkc.administration.action;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import vkc.administration.form.LostFoldersForm;
import vkc.db.entities.VKCUser;
import vkc.view.WebShare;

public class LostFoldersAction extends SystemMaintenanceAction {
    public ActionForward execute(ActionMapping mapping, 
                                 ActionForm f, 
                                 HttpServletRequest request, 
                                 HttpServletResponse response) 
    throws ServletException {
        try {
            LostFoldersForm form = (LostFoldersForm) f;
            VKCUser user = form.getUser();

            if (!user.hasAdminPrivileges()) {
                request.setAttribute(WebShare.INFO_KEY, "vkc.info.access_denied");

                return getInfoForward();
            }

            return handleInitializeAction(form, request);
        } catch (Exception ex) {
            throw new ServletException(ex);
        }
    }
}