From 5b5ca2b88058fe62bbe33b5597d15a72dab7308c Mon Sep 17 00:00:00 2001 From: hangum Date: Tue, 30 Jan 2018 12:35:00 +0900 Subject: [PATCH] =?utf8?q?-=20LDAPUtil=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?utf8?q?=ED=8C=A9=ED=86=A0=EB=A7=81=20-=20=EC=A0=9C=ED=92=88=EC=97=90=20?= =?utf8?q?=EB=94=B0=EB=9D=BC=20=EB=A1=9C=EA=B7=B8=EA=B0=80=20=EB=8B=A4?= =?utf8?q?=EB=A5=B4=EA=B2=8C=20=EC=A0=80=EC=9E=A5=EB=90=98=EB=8F=84?= =?utf8?q?=EB=A1=9D=20=EA=B0=9C=EC=84=A0=20-=20LDAP=20=EC=9C=A0=EC=A0=80?= =?utf8?q?=20=EC=B4=88=EA=B8=B0=20=ED=8C=A8=EC=8A=A4=EC=9B=8C=EB=93=9C?= =?utf8?q?=EB=A5=BC=20=EB=9E=9C=EB=8D=A4=EC=9C=BC=EB=A1=9C=20=EC=A0=80?= =?utf8?q?=EC=9E=A5=EB=90=98=EB=8F=84=EB=A1=9D=20=EA=B0=9C=EC=84=A0.(?= =?utf8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?utf8?q?=ED=8C=A8=EC=8A=A4=EC=9B=8C=EB=93=9C=EB=9D=BC=EB=8F=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../commons/libs/core/define/PublicTadpoleDefine.java | 6 +++--- .../tadpole/engine/query/sql/TadpoleSystem_UserQuery.java | 3 ++- .../src/com/hangum/tadpole/commons/util/LDAPUtil.java | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/com.hangum.tadpole.commons.libs/src/com/hangum/tadpole/commons/libs/core/define/PublicTadpoleDefine.java b/com.hangum.tadpole.commons.libs/src/com/hangum/tadpole/commons/libs/core/define/PublicTadpoleDefine.java index 22ccc8c2e..3d4e92289 100644 --- a/com.hangum.tadpole.commons.libs/src/com/hangum/tadpole/commons/libs/core/define/PublicTadpoleDefine.java +++ b/com.hangum.tadpole.commons.libs/src/com/hangum/tadpole/commons/libs/core/define/PublicTadpoleDefine.java @@ -23,7 +23,7 @@ import org.apache.commons.io.IOUtils; * */ public class PublicTadpoleDefine { -// /** URL system version information */ + /** URL system version information */ public static final String URL_SYSTEM_VERION = String.format("?%s%s=%s", SystemDefine.DBHUB_MAJOR_VERSION, SystemDefine.DBHUB_SUB_VERSION, SystemDefine.DBHUB_RELEASE_DATE); /** product type */ @@ -40,8 +40,8 @@ public class PublicTadpoleDefine { public static final String DEFAULT_TIME_ZONE = "Asia/Seoul"; /** default log file name*/ - public static final String DEFAULT_LOG_FILE = String.format("./logs/%s.log", ACTIVE_PRODUCT_TYPE.name()); - public static final String DEFAULT_VELOCITY_LOG_FILE = String.format("./logs/%sVelocity.log", ACTIVE_PRODUCT_TYPE.name()); + public static String DEFAULT_LOG_FILE = String.format("./logs/%s.log", ACTIVE_PRODUCT_TYPE.name()); + public static String DEFAULT_VELOCITY_LOG_FILE = String.format("./logs/%sVelocity.log", ACTIVE_PRODUCT_TYPE.name()); /** * 환경 정보 파일 diff --git a/com.hangum.tadpole.commons.sql/src/com/hangum/tadpole/engine/query/sql/TadpoleSystem_UserQuery.java b/com.hangum.tadpole.commons.sql/src/com/hangum/tadpole/engine/query/sql/TadpoleSystem_UserQuery.java index 0786522e0..7d1760442 100644 --- a/com.hangum.tadpole.commons.sql/src/com/hangum/tadpole/engine/query/sql/TadpoleSystem_UserQuery.java +++ b/com.hangum.tadpole.commons.sql/src/com/hangum/tadpole/engine/query/sql/TadpoleSystem_UserQuery.java @@ -31,6 +31,7 @@ import com.hangum.tadpole.commons.libs.core.utils.LicenseValidator; import com.hangum.tadpole.commons.libs.core.utils.SHA256Utils; import com.hangum.tadpole.commons.util.ApplicationArgumentUtils; import com.hangum.tadpole.commons.util.DateUtil; +import com.hangum.tadpole.commons.util.Utils; import com.hangum.tadpole.engine.Messages; import com.hangum.tadpole.engine.initialize.TadpoleEngineUserDB; import com.hangum.tadpole.engine.manager.TadpoleSQLManager; @@ -129,7 +130,7 @@ public class TadpoleSystem_UserQuery { * @throws SQLException */ public static UserDAO newLDAPUser(String userName, String email, String external_id, String useOPT) throws TadpoleSQLManagerException, SQLException, Exception { - return newUser(PublicTadpoleDefine.INPUT_TYPE.LDAP.name(), email, "LDAP", "YES", "TadpoleLDAPLogin", PublicTadpoleDefine.USER_ROLE_TYPE.USER.name(), + return newUser(PublicTadpoleDefine.INPUT_TYPE.LDAP.name(), email, "LDAP", "YES", Utils.getUniqueDigit(12), PublicTadpoleDefine.USER_ROLE_TYPE.USER.name(), userName, "KO", "Asia/Seoul", "YES", useOPT, "", "*", external_id, new Timestamp(System.currentTimeMillis())); } diff --git a/com.hangum.tadpole.commons/src/com/hangum/tadpole/commons/util/LDAPUtil.java b/com.hangum.tadpole.commons/src/com/hangum/tadpole/commons/util/LDAPUtil.java index 8373c1e97..fd22c8bd8 100644 --- a/com.hangum.tadpole.commons/src/com/hangum/tadpole/commons/util/LDAPUtil.java +++ b/com.hangum.tadpole.commons/src/com/hangum/tadpole/commons/util/LDAPUtil.java @@ -33,8 +33,8 @@ public class LDAPUtil { private static final Logger logger = Logger.getLogger(LDAPUtil.class); public static LDAPUtil instance = null; - private static String ldapHost; // LDAP 호스트 - private static String principal; // LDAP 쿼리 + private static String _ldapHost; // LDAP 호스트 + private static String _principal; // LDAP 쿼리 private LDAPUtil() {} @@ -42,8 +42,8 @@ public class LDAPUtil { if(instance == null) { Properties prop = LoadConfigFile.getConfigFile(); - ldapHost = StringUtils.trim(prop.getProperty("LDAP.HOST.URL")); - principal = StringUtils.trim(prop.getProperty("LDAP.PRINCIPAL")); + _ldapHost = StringUtils.trim(prop.getProperty("LDAP.HOST.URL")); + _principal = StringUtils.trim(prop.getProperty("LDAP.SEARCHBASE")); instance = new LDAPUtil(); } @@ -60,9 +60,9 @@ public class LDAPUtil { public static void ldapLogin(String strEmail, String strPass) throws TadpoleAuthorityException { Hashtable properties = new Hashtable(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); - properties.put(Context.PROVIDER_URL, ldapHost); + properties.put(Context.PROVIDER_URL, _ldapHost); properties.put(Context.SECURITY_AUTHENTICATION, "simple"); - properties.put(Context.SECURITY_PRINCIPAL, String.format(principal, strEmail)); + properties.put(Context.SECURITY_PRINCIPAL, String.format(_principal, strEmail)); properties.put(Context.SECURITY_CREDENTIALS, strPass); DirContext con = null; -- 2.11.4.GIT