diff --git a/pom.xml b/pom.xml index ca37dc6b..8af80a43 100644 --- a/pom.xml +++ b/pom.xml @@ -593,14 +593,6 @@ 2.9.0 - - org.apache.poi poi diff --git a/src/main/java/kr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java b/src/main/java/kr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java index 0fedab11..ef1c51fa 100644 --- a/src/main/java/kr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java +++ b/src/main/java/kr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java @@ -342,7 +342,7 @@ public class XitFrameAnonymousController extends AbstractController { */ @RequestMapping(name = "", value = "captcha", method={RequestMethod.GET, RequestMethod.POST}) public void captcha(HttpServletRequest request, HttpServletResponse response) { - //XitCaptchaUtil.getImage(request, response); + } diff --git a/src/main/java/kr/xit/fims/framework/core/utils/captcha/XitCaptchaUtil.java b/src/main/java/kr/xit/fims/framework/core/utils/captcha/XitCaptchaUtil.java deleted file mode 100644 index 6e01d789..00000000 --- a/src/main/java/kr/xit/fims/framework/core/utils/captcha/XitCaptchaUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -package kr.xit.fims.framework.core.utils.captcha;// package kr.xit.fims.framework.core.utils.captcha; -// -// import java.awt.*; -// import java.io.IOException; -// import java.util.ArrayList; -// import java.util.List; -// -// import javax.servlet.http.HttpServletRequest; -// import javax.servlet.http.HttpServletResponse; -// import javax.servlet.http.HttpSession; -// -// import org.slf4j.Logger; -// import org.slf4j.LoggerFactory; -// import org.springframework.stereotype.Controller; -// -// import kr.xit.fims.framework.support.captcha.SimpleCaptchaUtil; -// import nl.captcha.Captcha; -// import nl.captcha.audio.AudioCaptcha; -// import nl.captcha.backgrounds.GradiatedBackgroundProducer; -// import nl.captcha.servlet.CaptchaServletUtil; -// import nl.captcha.text.producer.NumbersAnswerProducer; -// import nl.captcha.text.renderer.DefaultWordRenderer; -// -// @Controller -// public class XitCaptchaUtil { -// private Logger logger = LoggerFactory.getLogger(getClass()); -// -// /** -// *
메소드 설명: 캡차인증 이미지를 생성 한다.
-// 	 * 	-자동로그인 방지를 위해 특정문구가 입력된 캡차 이미지를 생성 한다.
-// 	 * 	-캡차 이미지에 입력된 문구는 요청 session의 attribute에 "captcha"란 이름으로 저장 된다.
-// 	 * 
-// * @param request -// * @param response void 요청처리 후 응답객체 -// * @author: 박민규 -// * @date: 2020. 9. 22. -// */ -// public static void getImage(HttpServletRequest request, HttpServletResponse response) { -// -// /*폰트 및 컬러 설정*/ -// List fontList = new ArrayList(); -// fontList.add(new Font("", Font.HANGING_BASELINE, 40)); -// fontList.add(new Font("Courier", Font.ITALIC, 40)); -// fontList.add(new Font("", Font.PLAIN, 40)); -// List colorList = new ArrayList(); -// colorList.add(Color.BLACK); -// -// //Captcha captcha = new Captcha.Builder(250, 50) //캡차 이미지 크기(가로,세로) -// Captcha captcha = new Captcha.Builder(250, 50) //캡차 이미지 크기(가로,세로) -// .addText(new NumbersAnswerProducer(6), new DefaultWordRenderer(colorList, fontList)) //이미지문구 생성(default: 5자리의 랜덤한 알파벳과 숫자 생성) -// // .addText(new NumbersAnswerProducer()) //이미지문구 생성(5자리의 랜덤한 숫자 생성) -// .addBackground(new GradiatedBackgroundProducer()) //바탕색 흰색 - Default -// .addNoise() //한번 호출할 떄마다 하나의 라인이 추가된다. -// .gimp() //Gradiated 백그라운드 -// // .gimp(new DropShadowGimpyRenderer()) //그림자 효과 추가 -// .addBorder() //검정 테두리 선 생성 -// .build(); //필수 호출 함수 -// /* -// -// response.setHeader("Cache-Control", "no-store"); -// response.setHeader("Pragma", "no-cache"); //브라우저 캐시 설정 -// response.setDateHeader("Expires", 0); -// response.setContentType("image/jpeg"); //리턴 컨텐츠타입 설정 -// -// Capchas.net -// JCAPCHA -// */ -// -// //image 생성 -// CaptchaServletUtil.writeImage(response, captcha.getImage()); -// //image 문자 -// // String captchaImgStr = captcha.getAnswer(); -// -// //요청세션에 저장 -// request.getSession().setAttribute("captcha", captcha); -// } -// -// public void getAudioCaptCha(HttpServletRequest req, HttpServletResponse res, String answer) throws IOException { -// HttpSession session = req.getSession(); -// -// Captcha captcha = (Captcha) session.getAttribute(Captcha.NAME); -// String getAnswer = answer; -// -// if(getAnswer == null || getAnswer.equals("")) getAnswer = captcha.getAnswer(); -// -// AudioCaptcha audiocaptcha = new AudioCaptcha.Builder() -// .addAnswer(new SimpleCaptchaUtil.SetTextProducer(getAnswer)) -// .addNoise() /*잡음 추가*/ -// .build(); -// -// CaptchaServletUtil.writeAudio(res, audiocaptcha.getChallenge()); -// } -// -// } diff --git a/src/main/java/kr/xit/fims/framework/support/captcha/SimpleCaptchaUtil.java b/src/main/java/kr/xit/fims/framework/support/captcha/SimpleCaptchaUtil.java deleted file mode 100644 index e06e94cb..00000000 --- a/src/main/java/kr/xit/fims/framework/support/captcha/SimpleCaptchaUtil.java +++ /dev/null @@ -1,229 +0,0 @@ -package kr.xit.fims.framework.support.captcha;// package kr.xit.fims.framework.support.captcha; -// -// import kr.xit.fims.framework.support.util.Checks; -// import nl.captcha.Captcha; -// import nl.captcha.audio.AudioCaptcha; -// import nl.captcha.backgrounds.GradiatedBackgroundProducer; -// import nl.captcha.servlet.CaptchaServletUtil; -// import nl.captcha.text.producer.TextProducer; -// -// import javax.servlet.http.HttpServletRequest; -// import javax.servlet.http.HttpServletResponse; -// import java.awt.*; -// import java.util.Arrays; -// import java.util.Collections; -// import java.util.List; -// import java.util.Objects; -// -// /** -// * @author Lim, Jong Uk (minuk926) -// * @since 2021-11-30 -// */ -// public class SimpleCaptchaUtil { -// -// private static final int WIDTH = 100; -// private static final int HEIGHT = 30; -// private static final int FONT_SIZE = 20; -// -// -// /** -// * -// * @param req -// * @param res -// */ -// public static void getImgCaptcha(final HttpServletRequest req, final HttpServletResponse res) { -// int width = Objects.isNull(req.getParameter("width"))? WIDTH : Integer.parseInt(req.getParameter("width")); -// int height = Objects.isNull(req.getParameter("height"))? HEIGHT : Integer.parseInt(req.getParameter("height")); -// -// List fonts = Arrays.asList( -// new Font("", Font.HANGING_BASELINE, FONT_SIZE), -// new Font("Courier", Font.ITALIC, FONT_SIZE), -// new Font("", Font.PLAIN, FONT_SIZE) -// ); -// List colors = Collections.singletonList(Color.BLACK); -// -// Captcha captcha = -// new Captcha.Builder(150, 50) -// .addText() -// //new Captcha.Builder(width, height) -// //.addText(new NumbersAnswerProducer(5), new DefaultWordRenderer(colors, fonts)) -// // 호출될때마다 라인 추가 -// .addNoise() -// .gimp() -// // black border 생성 -// .addBorder() -// .addBackground(new GradiatedBackgroundProducer()) -// .build(); -// /* -// res.setHeader("Cache-Control", "no-cache"); -// res.setDateHeader("Expires", 0); -// res.setHeader("Pragma", "no-cache"); -// res.setDateHeader("Max-Age", 0); -// res.setContentType("image/png"); -// */ -// CaptchaServletUtil.writeImage(res, captcha.getImage()); -// req.getSession().setAttribute(Captcha.NAME, captcha); -// //req.getSession().setAttribute("captcha", captcha.getAnswer());// 값 저장 -// } -// -// /** -// * -// * @param req -// * @param res -// * @param answer -// */ -// public static void getAudioCaptcha(final HttpServletRequest req, final HttpServletResponse res, String answer) { -// -// if(Checks.isEmpty(answer)){ -// Captcha captcha = (Captcha) req.getSession().getAttribute(Captcha.NAME); -// answer = captcha.getAnswer(); -// } -// -// AudioCaptcha audioCaptcha = new AudioCaptcha.Builder() -// .addAnswer(new SetTextProducer(answer)) -// .addNoise() -// .build(); -// -// CaptchaServletUtil.writeAudio(res, audioCaptcha.getChallenge()); -// } -// -// /** -// * -// * @param req -// * @param res -// * @param ans -// * @return -// */ -// public static boolean isCorrect(final HttpServletRequest req, final HttpServletResponse res, String ans) { -// -// if(Checks.isEmpty(ans)) return false; -// -// Captcha captcha = (Captcha) req.getSession().getAttribute(Captcha.NAME); -// if(captcha != null && captcha.isCorrect(ans)){ -// req.getSession().removeAttribute(Captcha.NAME); -// return true; -// } -// return false; -// /* -// String answer = (String)req.getSession().getAttribute("captcha"); -// if(Objects.equals(ans, answer)) { -// req.getSession().removeAttribute("captcha"); -// return true; -// } -// return false; -// */ -// -// } -// -// public static class SetTextProducer implements TextProducer { -// private final String str; -// -// public SetTextProducer(String answer){ -// this.str = answer; -// } -// -// @Override -// public String getText(){ -// return this.str; -// } -// } -// } -// -// -// /* -// -// -// @RequestMapping(method = RequestMethod.GET, value = "/captcha/image") -// public void getCaptchaImage(final HttpServletRequest req, final HttpServletResponse res) { -// SimpleCaptchaUtil -// .getImgCaptcha(req, res); -// -// -// } -// -// @RequestMapping(method = RequestMethod.GET, value = "/captcha/audio") -// public void getCaptchaAudio(final HttpServletRequest req, final HttpServletResponse res) { -// SimpleCaptchaUtil.getAudioCaptcha(req, res, null); -// -// -// } -// -// @RequestMapping(method = RequestMethod.POST, value = "/captcha/check") -// @ResponseBody -// public String isCorrect(final HttpServletRequest req, final HttpServletResponse res, String answer) { -// //modelMap.addAttribute("OK", new SimpleCaptchaUtil().isCorrect(req, res, req.getParameter("answer"))); -// -// Gson gson = new GsonBuilder().create(); -// return gson.toJson(SimpleCaptchaUtil.isCorrect(req, res, req.getParameter("answer"))); -// } -// -// -// -// -// 필수입력* -// -// 보안문자를 입력해 주세요. -// -// -// -// -// -// -// -// -// -// -// this.captchaReload = function(){ -// const rand = Math.random(); -// const url = '${wwwHost}/support/captcha/image?rand='+rand; -// document.querySelector('#captchaImg').setAttribute('src', url); -// -// } -// -// this.audio = function(){ -// const rand = Math.random(); -// const uAgent = navigator.userAgent; -// -// const url = '${wwwHost}/support/captcha/audio?rand='+rand; -// -// // IE -// if(uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MISE') > -1){ -// document.querySelector('#ccaudio').innerHTML = ''; -// -// // Chrome -// }else if(!!document.createElement('audio').canPlayType){ -// try{ -// new Audio(url).play() -// }catch (e){ -// document.querySelector('#ccaudio').innerHTML = ''; -// } -// }else{ -// window.open(url, '', 'width=1,height=1'); -// } -// } -// this.captchaConfirm = function(){ -// const ans = document.querySelector('#captchaAns').value; -// if(!ans){ -// alert("보안문자를 입력해 주세요."); -// return true; -// } -// -// $http({ -// method: 'POST', -// url: '${wwwHost}/support/captcha/check', -// data: {answer: ans} -// }).success(function (data, status, headers, config) { -// if(data){ -// -// }else{ -// alert('보안문자가 일치하지 않습니다.\n다시 입력해 주세요'); -// captchaReload(); -// } -// -// }).error(function (data, status, headers, config) { -// alert(data.message); -// }); -// -// } -// -// */