취약점수정 , 소장자료 각자료유형별 폼 추가 더보기버튼추가

This commit is contained in:
JSYOO 2021-12-02 17:42:09 +09:00
parent cdb5514686
commit 6fe21dd11e
4 changed files with 120 additions and 129 deletions

View File

@ -172,14 +172,6 @@ public class NlibCmmUtil {
Matcher matcher = pattern.matcher(str); Matcher matcher = pattern.matcher(str);
return matcher.find(); return matcher.find();
} }
public static String generateRandomString(String allowed, int length) {
Random random = new Random();
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
sb.append(allowed.charAt(random.nextInt(allowed.length())));
}
return sb.toString();
}
public static String getIpAddress(HttpServletRequest req) { public static String getIpAddress(HttpServletRequest req) {
String ipAddress = ""; String ipAddress = "";
if (req.getHeader("X-Forwarded-For") == null) { if (req.getHeader("X-Forwarded-For") == null) {
@ -317,59 +309,6 @@ public class NlibCmmUtil {
str = map.get(key)+""; str = map.get(key)+"";
return str; return str;
} }
@SuppressWarnings("rawtypes")
public static Integer getInteger(Map map, String key) {
Integer value = null;
if (isEmpty(map, key)) return value;
try {
value = new Integer(map.get(key)+"");
} catch (NumberFormatException e1) {
LOGGER.error("fail in getInteger() key="+key+", map="+map, e1);
} catch (Exception e2) {
LOGGER.error("fail in getInteger() key="+key+", map="+map, e2);
}
return value;
}
@SuppressWarnings("rawtypes")
public static BigDecimal getBigDecimal(Map map, String key) {
BigDecimal value = null;
if (isEmpty(map, key)) return value;
try {
value = new BigDecimal(map.get(key)+"");
} catch (NumberFormatException e1) {
LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e1);
} catch (Exception e2) {
LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e2);
}
return value;
}
public static String getPassStr() {
String str = "";
Random r = new Random();
for(int i = 0; i < 10; i++){
char lowerStr = (char)(r.nextDouble() * 26 + 97);
if(i%2 == 0){
str += (int)(r.nextDouble() * 10);
}else{
str += lowerStr;
}
}
return str;
}
public static String getPassStr(int cnt) {
String str = "";
Random r = new Random();
for(int i = 0; i < cnt; i++){
char lowerStr = (char)(r.nextDouble() * 26 + 97);
if(i%2 == 0){
str += (int)(r.nextDouble() * cnt);
}else{
str += lowerStr;
}
}
return str;
}
public static String getIp(HttpServletRequest request) throws IOException, InvocationTargetException, SQLException, Exception { public static String getIp(HttpServletRequest request) throws IOException, InvocationTargetException, SQLException, Exception {
String ip = request.getHeader("X-Forwarded-For"); String ip = request.getHeader("X-Forwarded-For");
@ -392,45 +331,6 @@ public class NlibCmmUtil {
return ip; return ip;
} }
public static boolean checkIPMatching(String pattern, String address)
{
if (pattern.equals("*.*.*.*") || pattern.equals("*"))
return true;
String[] mask = pattern.split("\\.");
String[] ip_address = address.split("\\.");
for (int i = 0; i < mask.length; i++)
{
if (mask[i].equals("*") || mask[i].equals(ip_address[i]))
continue;
else if (mask[i].contains("-"))
{
byte min = Byte.parseByte(mask[i].split("-")[0]);
byte max = Byte.parseByte(mask[i].split("-")[1]);
byte ip = Byte.parseByte(ip_address[i]);
if (ip < min || ip > max)
return false;
}
else
return false;
}
return true;
}
public static String getRandomNum(int size) {
String strRandom = "";
Random rand = new Random();
for (int i = 0; i < size; i++) {
strRandom += String.valueOf(rand.nextInt(10));
}
return strRandom;
}
public static boolean isMobile(final HttpServletRequest req) {
String ua = StringUtils.defaultString(req.getHeader("User-Agent"), "").toLowerCase();
if (ua.indexOf(Constant.ANDROID) > -1 || ua.indexOf(Constant.IOS) > -1 || ua.indexOf("mobile") > -1) {
return true;
}
return false;
}
public static void setNfsPathModelMap(HttpServletRequest req, ModelMap modelMap){ public static void setNfsPathModelMap(HttpServletRequest req, ModelMap modelMap){
// ams 경로 // ams 경로
String nfsNasPath = getPropertyStr(Constant.NFS_NAS_KEY); String nfsNasPath = getPropertyStr(Constant.NFS_NAS_KEY);

View File

@ -1,8 +1,10 @@
package nlib.user.service.impl; package nlib.user.service.impl;
import java.security.SecureRandom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -89,7 +91,7 @@ public class MemberServiceImpl implements MemberService
*/ */
public String numberGen(int len, int dupCd ) { public String numberGen(int len, int dupCd ) {
Random rand = new Random(); SecureRandom rand = new SecureRandom();
String numStr = ""; //난수가 저장될 변수 String numStr = ""; //난수가 저장될 변수
for(int i=0;i<len;i++) { for(int i=0;i<len;i++) {
@ -155,11 +157,11 @@ public class MemberServiceImpl implements MemberService
boolean whileFlag = true; boolean whileFlag = true;
do { do {
int loopNum=(int)(Math.random()*4); int loopNum=(int)(inner_random() * 4);
// 대문자생성 // 대문자생성
if((whileFlag && upperStr.equals("1")) || (!whileFlag && useU == 1 && loopNum == 0)){ if((whileFlag && upperStr.equals("1")) || (!whileFlag && useU == 1 && loopNum == 0)){
do { do {
upperChar = (char)(Math.random() * 26 + 65); upperChar = (char)(inner_random() * 26 + 65);
upperStr=String.valueOf(upperChar); upperStr=String.valueOf(upperChar);
} while (exceptionKey.indexOf(upperStr)!=-1); } while (exceptionKey.indexOf(upperStr)!=-1);
dummylist.add(upperStr); dummylist.add(upperStr);
@ -169,7 +171,7 @@ public class MemberServiceImpl implements MemberService
// 소문자생성 // 소문자생성
if((whileFlag && lowerStr.equals("1")) || (!whileFlag && useL == 1 && loopNum == 1)){ if((whileFlag && lowerStr.equals("1")) || (!whileFlag && useL == 1 && loopNum == 1)){
do { do {
lowerChar = (char)(Math.random() * 26 + 97); lowerChar = (char)(inner_random() * 26 + 97);
lowerStr=String.valueOf(lowerChar); lowerStr=String.valueOf(lowerChar);
} while (exceptionKey.indexOf(lowerStr)!=-1); } while (exceptionKey.indexOf(lowerStr)!=-1);
dummylist.add(lowerStr); dummylist.add(lowerStr);
@ -178,7 +180,7 @@ public class MemberServiceImpl implements MemberService
// 숫자생성(숫자 0,1 제외) // 숫자생성(숫자 0,1 제외)
if((whileFlag && ranNumberStr.equals("1")) || (!whileFlag && useN == 1 && loopNum == 2)){ if((whileFlag && ranNumberStr.equals("1")) || (!whileFlag && useN == 1 && loopNum == 2)){
ranNumber=(int)(Math.random() * 8 + 2); ranNumber=(int)(inner_random() * 8 + 2);
ranNumberStr=String.valueOf(ranNumber); ranNumberStr=String.valueOf(ranNumber);
dummylist.add(ranNumberStr); dummylist.add(ranNumberStr);
whileNum++; whileNum++;
@ -186,7 +188,7 @@ public class MemberServiceImpl implements MemberService
// 특수문자생성 // 특수문자생성
if((whileFlag && ranSkeyStr.equals("1")) || (!whileFlag && useS == 1 && loopNum == 3)){ if((whileFlag && ranSkeyStr.equals("1")) || (!whileFlag && useS == 1 && loopNum == 3)){
startSkey=(int)(Math.random()* (specialKey.length()-1))+1; startSkey=(int)(inner_random() * (specialKey.length()-1))+1;
ranSkey=specialKey.charAt(startSkey); ranSkey=specialKey.charAt(startSkey);
ranSkeyStr=String.valueOf(ranSkey); ranSkeyStr=String.valueOf(ranSkey);
dummylist.add(ranSkeyStr); dummylist.add(ranSkeyStr);
@ -201,6 +203,12 @@ public class MemberServiceImpl implements MemberService
} }
return dummyPW; return dummyPW;
} }
public double inner_random() {
long seed= new Date().getTime();
seed = (seed*9301 +49297) % 233280;
return seed/(233280.0);
}
public NlibLoginVO selectAlreadySignUpId(OAuthUniversalUser oauthUser) throws Exception { public NlibLoginVO selectAlreadySignUpId(OAuthUniversalUser oauthUser) throws Exception {
//이메일 암호화 //이메일 암호화

View File

@ -848,7 +848,6 @@ public class MemberController extends NlibCommonController{
//비밀번호 초기화 변수 생성 //비밀번호 초기화 변수 생성
String initPwd=memberService.createInitPwd(); String initPwd=memberService.createInitPwd();
//vo.decodePrivateInfo();
if(loginVO!=null) if(loginVO!=null)
{ {

View File

@ -179,42 +179,126 @@ function goList(){
<c:out value="${result.subjectNm}"/> <c:out value="${result.subjectNm}"/>
</span> </span>
</li> </li>
<li>
<span>저자</span>
<span><c:if test="${empty result.bookAuthor}">-</c:if><c:out value="${result.bookAuthor}"/></span>
</li>
<li> <li>
<span>생산기관</span> <span>생산기관</span>
<span><c:if test="${empty result.orgNm}">-</c:if><c:out value="${result.orgNm}"/></span> <span><c:if test="${empty result.orgNm}">-</c:if><c:out value="${result.orgNm}"/></span>
</li> </li>
<li>
<span>출판사</span>
<span><c:if test="${empty result.bookPublisher}">-</c:if><c:out value="${result.bookPublisher}"/></span>
</li>
<li>
<span>생산년도</span>
<span><c:if test="${empty result.creatYyyy}">-</c:if><c:out value="${result.creatYyyy}"/></span>
</li>
<li>
<span>발간유형</span>
<span><c:if test="${empty result.bookPlbcTypeNm}">-</c:if><c:out value="${result.bookPlbcTypeNm}"/></span>
</li>
<li> <li>
<span>테마</span> <span>테마</span>
<span><c:if test="${empty result.themeCodeNm}">-</c:if><c:out value="${result.themeCodeNm}"/></span> <span><c:if test="${empty result.themeCodeNm}">-</c:if><c:out value="${result.themeCodeNm}"/></span>
</li> </li>
<li>
<span>발간매체</span>
<span><c:if test="${empty result.bookPlbcMda}">-</c:if><c:out value="${result.bookPlbcMda}"/></span>
</li>
<li> <li>
<span>시대</span> <span>시대</span>
<span><c:if test="${empty result.ageCodeNm}">-</c:if><c:out value="${result.ageCodeNm}"/></span> <span><c:if test="${empty result.ageCodeNm}">-</c:if><c:out value="${result.ageCodeNm}"/></span>
</li> </li>
<li> <li>
<span>청구기호</span> <span>생산년도</span>
<span><c:if test="${empty result.bookCallNo}">-</c:if><c:out value="${result.bookCallNo}"/></span> <span><c:if test="${empty result.creatYyyy}">-</c:if><c:out value="${result.creatYyyy}"/></span>
</li> </li>
<c:if test="${result.typeDivCd eq 'IT_BOOK'}">
<li>
<span>저자</span>
<span><c:if test="${empty result.bookAuthor}">-</c:if><c:out value="${result.bookAuthor}"/></span>
</li>
<li>
<span>출판사</span>
<span><c:if test="${empty result.bookPublisher}">-</c:if><c:out value="${result.bookPublisher}"/></span>
</li>
<li>
<span>발간유형</span>
<span><c:if test="${empty result.bookPlbcTypeNm}">-</c:if><c:out value="${result.bookPlbcTypeNm}"/></span>
</li>
<li>
<span>발간매체</span>
<span><c:if test="${empty result.bookPlbcMda}">-</c:if><c:out value="${result.bookPlbcMda}"/></span>
</li>
<li>
<span>청구기호</span>
<span><c:if test="${empty result.bookCallNo}">-</c:if><c:out value="${result.bookCallNo}"/></span>
</li>
</c:if>
<c:if test="${result.typeDivCd eq 'IT_DOC'}">
<li>
<span>문서번호</span>
<span><c:if test="${empty result.docNo}">-</c:if><c:out value="${result.docNo}"/></span>
</li>
</c:if>
<c:if test="${result.typeDivCd eq 'IT_PHOTO'}">
<li>
<span>매체</span>
<span><c:if test="${empty result.photoMediaNm}">-</c:if><c:out value="${result.photoMediaNm}"/></span>
</li>
<li>
<span>규격</span>
<span><c:if test="${empty result.photoSizeNm}">-</c:if><c:out value="${result.photoSizeNm}"/></span>
</li>
<li class="detail-accordion">
<span>미디어 설명</span>
<div class="desc-wrap">
<div class="desc"><c:if test="${empty result.photoDescription}">-</c:if><c:out value="${result.photoDescription}"/><button type="button" class="btn-hide">접기 -</button></div>
<button type="button" class="btn-more">더보기+</button>
</div>
</li>
<li class="detail-accordion">
<span>미디어 부가설명</span>
<div class="desc-wrap">
<div class="desc"><c:if test="${empty result.photoAdditionalDescription}">-</c:if><c:out value="${result.photoAdditionalDescription}"/><button type="button" class="btn-hide">접기 -</button></div>
<button type="button" class="btn-more">더보기+</button>
</div>
</li>
</c:if>
<c:if test="${result.typeDivCd eq 'IT_VIDEO'}">
<li>
<span>미디어 유형</span>
<span><c:if test="${empty result.videoMediaNm}">-</c:if><c:out value="${result.videoMediaNm}"/></span>
</li>
<li>
<span>재생시간</span>
<span><c:if test="${empty result.videoTime}">-</c:if><c:out value="${result.videoTime}"/></span>
</li>
<li>
<span>재생화질상태</span>
<span><c:if test="${empty result.videoStat}">-</c:if><c:out value="${result.videoStat}"/></span>
</li>
<li class="detail-accordion">
<span>미디어 설명</span>
<div class="desc-wrap">
<div class="desc"><c:if test="${empty result.videoDescription}">-</c:if><c:out value="${result.videoDescription}"/><button type="button" class="btn-hide">접기 -</button></div>
<button type="button" class="btn-more">더보기+</button>
</div>
</li>
<li class="detail-accordion">
<span>미디어 부가설명</span>
<div class="desc-wrap">
<div class="desc"><c:if test="${empty result.videoAdditionalDescription}">-</c:if><c:out value="${result.videoAdditionalDescription}"/><button type="button" class="btn-hide">접기 -</button></div>
<button type="button" class="btn-more">더보기+</button>
</div>
</li>
</c:if>
<c:if test="${result.typeDivCd eq 'IT_MAP'}">
<li>
<span>도면/지도유형</span>
<span><c:if test="${empty result.mapTypeNm}">-</c:if><c:out value="${result.mapTypeNm}"/></span>
</li>
<li>
<span>위치(주소)</span>
<span><c:if test="${empty result.mapLoc}">-</c:if><c:out value="${result.mapLoc}"/></span>
</li>
</c:if>
<c:if test="${result.typeDivCd eq 'IT_MUSE'}">
<li>
<span>박물유형</span>
<span><c:if test="${empty result.museTypeNm}">-</c:if><c:out value="${result.museTypeNm}"/></span>
</li>
<li>
<span>박물형태</span>
<span><c:if test="${empty result.museKindNm}">-</c:if><c:out value="${result.museKindNm}"/></span>
</li>
<li>
<span>재질</span>
<span><c:if test="${empty result.museMeterialNm}">-</c:if><c:out value="${result.museMeterialNm}"/></span>
</li>
</c:if>
</ul> </ul>
</div> </div>
<div class="b-btn"> <div class="b-btn">