diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java index 98c8ea93..055c0149 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java @@ -49,23 +49,19 @@ public class XitLoginController extends AbstractController { private XitFrameCrudService xitFrameCrudService; - - private String LOGIN_PAGE ="framework/biz/login/XitLoginUsr"; + private String LOGIN_PAGE = "fimslogin"; private String ACCESS_DENIED_PAGE = "login/XitAccessDenied"; private String MAIN_PAGE = "/framework/biz/cmm/mainPage.do"; - - private String MAIN_PAGE_USR =""; - /** * 로그인 후 메인화면으로 들어간다 - * + * * @param * @return 로그인 페이지 - * @exception Exception + * @throws Exception */ @RequestMapping(name = "", value = "/actionMain") public String actionMain() @@ -78,15 +74,14 @@ public class XitLoginController extends AbstractController { return LOGIN_PAGE; } - String url = this.getMainPageUrlByUserSe(); - return "forward:"+url; + return "forward:" + "/framework/biz/cmm/mainPage.do"; } /** *
 	 * 메소드 설명: 일반(스프링 시큐리티) 로그인을 처리 한다.
 	 * 
- * + * * @param loginVO 아이디, 비밀번호가 담긴 LoginVO * @param response 로그인결과(세션정보) * @param request 세션처리를 위한 HttpServletRequest @@ -98,7 +93,7 @@ public class XitLoginController extends AbstractController { */ @RequestMapping(name = "", value = "/actionSecurityLogin") public String actionSecurityLogin(@ModelAttribute("loginVO") XitLoginVO loginVO, HttpServletResponse response, - HttpServletRequest request, ModelMap model, @RequestParam Map paraMap) throws Exception { + HttpServletRequest request, ModelMap model, @RequestParam Map paraMap) throws Exception { String message = null; @@ -109,12 +104,12 @@ public class XitLoginController extends AbstractController { * :해당 요청에 대해 메세지 출력을 하도록 처리 */ //비인증 상태에서 인가되지 않은 URL 호출에 대한 처리 - if(XitCmmnUtil.isEmpty(paraMap)) { + if (XitCmmnUtil.isEmpty(paraMap)) { - return "forward:/login/accessDenied.do"; + return "forward:/login/accessDenied.do"; } - + /** * 처리 */ @@ -129,7 +124,7 @@ public class XitLoginController extends AbstractController { } - + /** * 결과 반환 */ @@ -155,22 +150,18 @@ public class XitLoginController extends AbstractController { throw new IllegalStateException("No AuthenticationProcessingFilter"); } - springSecurity.doFilter(new RequestWrapperForSecurity(request, - xitLoginVO.getUniqId(), - xitLoginVO.getPasswd()), - response, null); + xitLoginService.actionLoginSuccess();//로그인 Log 생성 // 2. 메인 페이지 이동 - String url = this.getMainPageUrlByUserSe(); - return "forward:"+url; // 성공 시 페이지.. (redirect 불가) + return "forward:" + "/framework/biz/cmm/mainPage.do"; } else { - model.addAttribute("message", message==null?"로그인정보가 올바르지 않습니다.":message); + model.addAttribute("message", message == null ? "로그인정보가 올바르지 않습니다." : message); return LOGIN_PAGE; } @@ -178,16 +169,16 @@ public class XitLoginController extends AbstractController { /** * 로그아웃한다. - * + * * @return String - * @exception Exception + * @throws Exception */ @RequestMapping(name = "", value = "/actionLogout") public String actionLogout(HttpServletRequest request) { request.getSession().setAttribute("XitLoginSession", null); ApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext()); - SecurityConfig config = (SecurityConfig)act.getBean(SecurityConfig.class); + SecurityConfig config = (SecurityConfig) act.getBean(SecurityConfig.class); String logoutSuccessUrl = config.getLogoutSuccessUrl(); SecurityContext context = SecurityContextHolder.getContext(); @@ -196,96 +187,99 @@ public class XitLoginController extends AbstractController { //return "redirect:/egov_security_logout.do"; return "forward:" + logoutSuccessUrl; } - + /** * 권한제한 화면 이동 + * * @return String - * @exception Exception + * @throws Exception */ - @RequestMapping(name = "", value="accessDenied") + @RequestMapping(name = "", value = "accessDenied") public void accessDenied(HttpServletRequest request, HttpServletResponse response) throws Exception { /** * 호출 유형에 따른 분기 */ - if(AjaxUtils.isAjaxRequest(request)){ //ajax + if (AjaxUtils.isAjaxRequest(request)) { //ajax //Response & Message Set response.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); - PrintWriter writer=response.getWriter(); + PrintWriter writer = response.getWriter(); String msg = "요청에 대한 권한이 없습니다."; - + //응답 writer.println(msg); - - }else { //submit + + } else { //submit Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - + //인증사용자 - if(isAuthenticated) { + if (isAuthenticated) { //응답 - response.sendRedirect(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +ACCESS_DENIED_PAGE); - - //미인증사용자 - }else { + response.sendRedirect(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + ACCESS_DENIED_PAGE); + + //미인증사용자 + } else { //Response & Message Set response.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); - PrintWriter writer=response.getWriter(); + PrintWriter writer = response.getWriter(); String msg = "요청에 대한 권한이 없습니다."; - + //응답 String contextPath = request.getContextPath(); - boolean isExistsContextPath = "/".equals(contextPath)?false:true; - if(isExistsContextPath) - writer.println(""); + boolean isExistsContextPath = "/".equals(contextPath) ? false : true; + if (isExistsContextPath) + writer.println(""); else - writer.println(""); + writer.println(""); } } - + } - + /** *
메소드 설명: 아이디 찾기 페이지 요청별  팝업
+ * * @param page * @param vo * @return + * @throws Exception * @author: 김동규 - * @throws Exception * @date: 2020. 10. 21. */ @RequestMapping(name = "", value = "/findIdPopup/{page}") - public ModelAndView findIdPopup(@PathVariable String page, @ModelAttribute("xitLoginVO") XitLoginVO vo) throws Exception{ + public ModelAndView findIdPopup(@PathVariable String page, @ModelAttribute("xitLoginVO") XitLoginVO vo) throws Exception { ModelAndView mav = new ModelAndView(); - if(page.endsWith(".do") || page.endsWith(".ajax")){ - page = page.substring(0,page.lastIndexOf(".")); + if (page.endsWith(".do") || page.endsWith(".ajax")) { + page = page.substring(0, page.lastIndexOf(".")); } switch (page) { - case "input": //아이디 찾기 -정보입력 페이지 - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findIdFormPopup.popup"); + case "input": //아이디 찾기 -정보입력 페이지 + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findIdFormPopup.popup"); break; - case "inputEvr": //(모든사용자)아이디 찾기 -정보입력 페이지 - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findIdEvrFormPopup.popup"); + case "inputEvr": //(모든사용자)아이디 찾기 -정보입력 페이지 + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findIdEvrFormPopup.popup"); break; - - case "result": //아이디 찾기 -결과 - XitLoginVO loginVO = xitLoginService.findId(vo); - mav.addObject("userAcnt",loginVO.getId()); - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findIdResultFormPopup.popup"); + + case "result": //아이디 찾기 -결과 + XitLoginVO loginVO = xitLoginService.findId(vo); + mav.addObject("userAcnt", loginVO.getId()); + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findIdResultFormPopup.popup"); break; - + default: throw new RuntimeException("유효하지 않은 요청 입니다."); } return mav; } - - + + /** *
메소드 설명: 비밀번호 찾기 페이지 요청별 팝업
+ * * @param xitUserInfoVO * @param page * @throws IOException @@ -298,20 +292,20 @@ public class XitLoginController extends AbstractController { public ModelAndView findPwdPopup(@ModelAttribute("xitUserInfoVO") XitUserInfoVO xitUserInfoVO, @PathVariable String page) throws RuntimeException { ModelAndView mav = new ModelAndView(); - if(page.endsWith(".do") || page.endsWith(".ajax")){ - page = page.substring(0,page.lastIndexOf(".")); + if (page.endsWith(".do") || page.endsWith(".ajax")) { + page = page.substring(0, page.lastIndexOf(".")); } switch (page) { - case "input": //비밀번호 찾기 -정보입력 페이지 - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findPwdFormPopup.popup"); + case "input": //비밀번호 찾기 -정보입력 페이지 + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findPwdFormPopup.popup"); break; - case "inputEvr": //(모든사용자)비밀번호 찾기 -정보입력 페이지 - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findPwdEvrFormPopup.popup"); + case "inputEvr": //(모든사용자)비밀번호 찾기 -정보입력 페이지 + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findPwdEvrFormPopup.popup"); break; - case "result": //비밀번호 찾기 -결과 - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"login/findPwdResultFormPopup.popup"); + case "result": //비밀번호 찾기 -결과 + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "login/findPwdResultFormPopup.popup"); break; default: @@ -319,45 +313,46 @@ public class XitLoginController extends AbstractController { } return mav; } - + /** *
메소드 설명: 비밀번호 찾기 CRUD 처리
+ * * @param res * @param model * @param session - * @param vo xitUserInfoVO + * @param vo xitUserInfoVO * @return + * @throws Exception * @author: 김동규 - * @throws Exception * @date: 2020. 10. 21. */ - @RequestMapping(name = "", value = "FindPwd_{cmd}_proc", method=RequestMethod.POST) + @RequestMapping(name = "", value = "FindPwd_{cmd}_proc", method = RequestMethod.POST) public void FindPwd_cmd_proc(HttpServletResponse res, Model model - , HttpSession session - , @ModelAttribute("xitLoginVO") XitLoginVO vo - , @PathVariable String cmd - , HttpServletRequest request - , HttpServletResponse response - ) throws Exception { - + , HttpSession session + , @ModelAttribute("xitLoginVO") XitLoginVO vo + , @PathVariable String cmd + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception { + String sLocationUrl = null; Map resultMap = new HashMap(); switch (cmd) { - case "select": //조회 + case "select": //조회 XitLoginVO loginVO = xitLoginService.findPassword(vo); - - resultMap.put("result", XitCmmnUtil.isEmpty(loginVO.getId())?"N":"Y"); - break; - + + resultMap.put("result", XitCmmnUtil.isEmpty(loginVO.getId()) ? "N" : "Y"); + break; + // case "insert": //등록 // break; - + // case "inserts": //다건 등록 // break; - - case "update": //수정 - + + case "update": //수정 + boolean result = false; String message = null; String failDetail = null; @@ -370,122 +365,56 @@ public class XitLoginController extends AbstractController { message = "변경에 실패하였습니다."; failDetail = e.getMessage(); } - model.addAttribute("result", result?"Y":"N"); + model.addAttribute("result", result ? "Y" : "N"); model.addAttribute("message", message); model.addAttribute("failDetail", failDetail); model.addAttribute("tempPwd", vo.getPasswd()); - + sLocationUrl = "forward:/login/findPwdPopup/result.do"; break; - + // case "delete": //삭제 // break; - + // case "deletes": //다건 삭제 // break; - + default: new RuntimeException("유효하지 않은 요청 입니다."); } - + /** * 응답 설정 */ - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 + if (AjaxUtils.isAjaxRequest(request)) { //ajax 요청시 //반환 데이터 설정 Iterator keys = resultMap.keySet().iterator(); - while(keys.hasNext()) { + while (keys.hasNext()) { String key = keys.next(); Object value = resultMap.get(key); request.setAttribute(key, value); } request.getRequestDispatcher("/login/responseJson").forward(request, response); - }else { //submit 요청 시 + } else { //submit 요청 시 XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); } } - @RequestMapping(name = "", value="responseJson", method={RequestMethod.GET, RequestMethod.POST}) + + @RequestMapping(name = "", value = "responseJson", method = {RequestMethod.GET, RequestMethod.POST}) @ResponseBody public Map responseJson(HttpServletRequest request - ) { + ) { /** * 반환 */ Map resultMap = new HashMap(); Object respData = request.getAttribute("result"); - if(XitCmmnUtil.notEmpty(respData)) + if (XitCmmnUtil.notEmpty(respData)) resultMap.put("result", respData); - - return resultMap; - } - - - - /** - *
메소드 설명: (일반/기업/업무)사용자 유형별 메인페이지 경로를 반환 한다.
-	 * 	-사용자 유형별 지정한 메인페이지 설정값이 없을 경우 default경로(Globals.Xit.MainPage)를 반환 한다.
-	 * 	[사용자 유형별 메인페이지 설정]
-	 * 	 Globals.Xit.MainPage.Gnr //일반회원
-	 * 	 Globals.Xit.MainPage.Ent //기업회원
-	 * 	 Globals.Xit.MainPage.Usr //업무사용자
-	 * 
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 11. 20. - */ - private String getMainPageUrlByUserSe() { - String url = MAIN_PAGE; - XitLoginVO loginVO = XitCmmnUtil.getUserInfo(); - USER_SE userSe = USER_SE.valueOf(loginVO.getUserSe()); - if(!XitCmmnUtil.isEmpty(userSe)) { - switch (userSe) { - case USR: //업무사용자 - if(XitCmmnUtil.notEmpty(MAIN_PAGE_USR)) - url = MAIN_PAGE_USR; - break; - default: - break; - } - } - - return url; - } - - -} - -class RequestWrapperForSecurity extends HttpServletRequestWrapper { - private String username = null; - private String password = null; - - public RequestWrapperForSecurity(HttpServletRequest request, String id, String passwd) { - super(request); - this.username = id; - this.password = passwd; - } - - @Override - public String getServletPath() { - return ((HttpServletRequest) super.getRequest()).getContextPath() + "/xit_security_login"; - } - - @Override - public String getRequestURI() { - return ((HttpServletRequest) super.getRequest()).getContextPath() + "/xit_security_login"; + return resultMap; } - @Override - public String getParameter(String name) { - if (name.equals("xit_security_username")) { - return username; - } - - if (name.equals("xit_security_password")) { - return password; - } - return super.getParameter(name); - } } diff --git a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginEvrUsr.jsp b/src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginEvrUsr.jsp deleted file mode 100644 index 1b4fa014..00000000 --- a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginEvrUsr.jsp +++ /dev/null @@ -1,322 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> -<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %> -<%@ include file="/WEB-INF/jsp/include/fims/taglib.jsp" %> - - - - - - - -로그인 - - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginUsr.jsp b/src/main/webapp/WEB-INF/jsp/fimslogin.jsp similarity index 98% rename from src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginUsr.jsp rename to src/main/webapp/WEB-INF/jsp/fimslogin.jsp index 72af8464..a3386e81 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/login/XitLoginUsr.jsp +++ b/src/main/webapp/WEB-INF/jsp/fimslogin.jsp @@ -43,7 +43,6 @@

Logo Image