1 5 6 package com.quikj.application.communicator.applications.webtalk.controller; 7 8 import java.sql.Connection ; 9 10 import javax.servlet.http.HttpServletRequest ; 11 import javax.servlet.http.HttpServletResponse ; 12 13 import org.apache.struts.action.Action; 14 import org.apache.struts.action.ActionError; 15 import org.apache.struts.action.ActionErrors; 16 import org.apache.struts.action.ActionForm; 17 import org.apache.struts.action.ActionForward; 18 import org.apache.struts.action.ActionMapping; 19 20 import com.quikj.application.communicator.admin.model.AccountElement; 21 22 26 public class DisplayDropCustomerIntroAction extends Action 27 { 28 29 30 public DisplayDropCustomerIntroAction() 31 { 32 } 33 34 public ActionForward execute(ActionMapping mapping, 35 ActionForm form, 36 HttpServletRequest request, 37 HttpServletResponse response) 38 { 39 ActionErrors errors = new ActionErrors(); 40 41 Connection c = (Connection )request.getSession().getAttribute("connection"); 42 if (c == null) 43 { 44 errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.not.logged.in")); 45 saveErrors(request, errors); 46 47 return mapping.findForward("logon"); 48 } 49 50 AccountElement element = (AccountElement)request.getSession().getAttribute("userInfo"); 51 if (element.isAdminLevel() == false) 52 { 53 errors.add(ActionErrors.GLOBAL_ERROR, 54 new ActionError("error.insufficient.privilege")); 55 saveErrors(request, errors); 56 57 return mapping.findForward("main_menu"); 58 } 59 60 WebTalkRelatedTasks menu = new WebTalkRelatedTasks(); 62 request.setAttribute("menu", menu); 63 64 return mapping.getInputForward(); 65 } 66 } 67 | Popular Tags |