| 1 package com.quikj.application.communicator.admin.controller; 2 3 import java.io.*; 4 import java.util.*; 5 import javax.servlet.*; 6 import javax.servlet.http.*; 7 import org.apache.struts.action.*; 8 import java.sql.*; 9 10 import com.quikj.application.communicator.admin.model.*; 11 12 19 20 public final class DisplayLogDeleteAction extends Action 21 { 22 37 public ActionForward execute(ActionMapping mapping, 38 ActionForm form, 39 HttpServletRequest request, 40 HttpServletResponse response) 41 throws IOException, ServletException 42 { 43 Locale locale = getLocale(request); 45 ActionErrors errors = new ActionErrors(); 46 47 Connection c = (Connection)request.getSession().getAttribute("connection"); 49 if (c == null) 50 { 51 errors.add(ActionErrors.GLOBAL_ERROR, 52 new ActionError("error.not.logged.in")); 53 saveErrors(request, errors); 54 return mapping.findForward("logon"); 55 } 56 57 AccountElement element = (AccountElement)request.getSession().getAttribute("userInfo"); 58 if (element.isAdminLevel() == false) 59 { 60 errors.add(ActionErrors.GLOBAL_ERROR, 61 new ActionError("error.insufficient.privilege")); 62 saveErrors(request, errors); 63 64 return mapping.findForward("main_menu"); 65 } 66 67 RelatedTasks menu = new RelatedTasks(); 69 menu.addLink(new LinkAttribute("View logs", "display_log_search")); 70 request.setAttribute("menu", menu); 71 72 return (new ActionForward(mapping.getInput())); 73 } 74 } 75 | Popular Tags |