diff --git a/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java b/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java index d2d8057c..dbe64289 100644 --- a/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java +++ b/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java @@ -9,16 +9,26 @@ import org.springframework.context.annotation.PropertySource; public class LoginConfig { @Value("${config.login.captcha}") boolean captcha; + + //验证码类型 text 文本 , arithmetic算术验证码 + @Value("${config.login.captcha.type}") + String captchaType; + @Value("${config.login.onetimepwd}") boolean oneTimePwd; + @Value("${config.login.socialsignon}") boolean socialSignOn; + @Value("${config.login.kerberos}") boolean kerberos; + @Value("${config.login.remeberme}") boolean remeberMe; + @Value("${config.login.wsfederation}") boolean wsFederation; + @Value("${config.login.default.uri}") String defaultUri; @@ -84,6 +94,14 @@ public class LoginConfig { public void setWsFederation(boolean wsFederation) { this.wsFederation = wsFederation; } + + public String getCaptchaType() { + return captchaType; + } + + public void setCaptchaType(String captchaType) { + this.captchaType = captchaType; + } @Override public String toString() { diff --git a/maxkey-core/src/main/java/org/maxkey/domain/HistoryLogs.java b/maxkey-core/src/main/java/org/maxkey/domain/HistoryLogs.java index cb14b9f5..6c198adb 100644 --- a/maxkey-core/src/main/java/org/maxkey/domain/HistoryLogs.java +++ b/maxkey-core/src/main/java/org/maxkey/domain/HistoryLogs.java @@ -1,184 +1,195 @@ package org.maxkey.domain; import java.io.Serializable; - +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; import javax.persistence.Table; - import org.apache.mybatis.jpa.persistence.JpaBaseDomain; - /** + * . * @author Crystal.Sea * */ -@Table(name = "HISTORY_LOGS") +@Table(name = "HISTORY_LOGS") public class HistoryLogs extends JpaBaseDomain implements Serializable { + private static final long serialVersionUID = 6560201093784960493L; + @Id + @Column + @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid") + String id; + @Column + String serviceName; + @Column + String message; + @Column + String content; + @Column + String messageType; + @Column + String operateType; + @Column + String username; + @Column + String code; + @Column + String createdBy; + @Column + String createdDate; + @Column + String modifiedBy; + @Column + String modifiedDate; - /** - * - */ - private static final long serialVersionUID = 6560201093784960493L; - String id; - String serviceName; - String message; - String content; - String messageType; - String operateType; - String username; - String code; - String createdBy; - String createdDate; - String modifiedBy; - String modifiedDate; - - String startDate; - String endDate; - - public HistoryLogs() { - super(); - } + String startDate; + String endDate; - public HistoryLogs(String serviceName, String code, String message, - String content, String messageType, String operateType, - String createdBy, String username, String cname) { - super(); - this.serviceName = serviceName; - this.code = code; - this.message = message; - this.content = content; - this.messageType = messageType; - this.operateType = operateType; - this.createdBy = createdBy; - this.username = username; + public HistoryLogs() { + super(); + } - } + /** + * HistoryLogs. + * @param serviceName String + * @param code String + * @param message String + * @param content String + * @param messageType String + * @param operateType String + * @param createdBy String + * @param username String + * @param cname String + */ + public HistoryLogs(String serviceName, String code, + String message, String content, + String messageType,String operateType, + String createdBy, String username, String cname) { + super(); + this.serviceName = serviceName; + this.code = code; + this.message = message; + this.content = content; + this.messageType = messageType; + this.operateType = operateType; + this.createdBy = createdBy; + this.username = username; - public String getServiceName() { - return serviceName; - } + } - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } + public String getServiceName() { + return serviceName; + } - public String getMessage() { - return message; - } + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } - public void setMessage(String message) { - this.message = message; - } + public String getMessage() { + return message; + } - public String getContent() { - return content; - } + public void setMessage(String message) { + this.message = message; + } - public void setContent(String content) { - this.content = content; - } + public String getContent() { + return content; + } - public String getMessageType() { - return messageType; - } + public void setContent(String content) { + this.content = content; + } - public void setMessageType(String messageType) { - this.messageType = messageType; - } + public String getMessageType() { + return messageType; + } - public String getOperateType() { - return operateType; - } + public void setMessageType(String messageType) { + this.messageType = messageType; + } - public void setOperateType(String operateType) { - this.operateType = operateType; - } + public String getOperateType() { + return operateType; + } - /** - * @return the username - */ - public String getUsername() { - return username; - } + public void setOperateType(String operateType) { + this.operateType = operateType; + } - /** - * @param username - * the username to set - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * @return the code - */ - public String getCode() { - return code; - } - - /** - * @param code - * the code to set - */ - public void setCode(String code) { - this.code = code; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public String getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - - public String getModifiedBy() { - return modifiedBy; - } - - public void setModifiedBy(String modifiedBy) { - this.modifiedBy = modifiedBy; - } - - public String getModifiedDate() { - return modifiedDate; - } - - public void setModifiedDate(String modifiedDate) { - this.modifiedDate = modifiedDate; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(String createdDate) { + this.createdDate = createdDate; + } + + public String getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(String modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public String getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(String modifiedDate) { + this.modifiedDate = modifiedDate; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } } diff --git a/maxkey-core/src/main/java/org/maxkey/domain/UserInfo.java b/maxkey-core/src/main/java/org/maxkey/domain/UserInfo.java index a5a89ab0..fb0da808 100644 --- a/maxkey-core/src/main/java/org/maxkey/domain/UserInfo.java +++ b/maxkey-core/src/main/java/org/maxkey/domain/UserInfo.java @@ -1,1249 +1,1241 @@ package org.maxkey.domain; +import com.fasterxml.jackson.annotation.JsonIgnore; import java.io.IOException; import java.util.HashMap; - import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; - import org.apache.mybatis.jpa.persistence.JpaBaseDomain; import org.maxkey.util.StringUtils; import org.springframework.web.multipart.MultipartFile; -import com.fasterxml.jackson.annotation.JsonIgnore; - /** + * . * @author Crystal.Sea * */ -@Table(name = "USERINFO") +@Table(name = "USERINFO") public class UserInfo extends JpaBaseDomain { + private static final long serialVersionUID = 6402443942083382236L; + // + @Id + @Column + @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid") + String id; + @Column + protected String username; + @Column + protected String password; + @Column + protected String decipherable; + @Column + protected String sharedSecret; + @Column + protected String sharedCounter; + /** + * "Employee", "Supplier","Dealer","Contractor",Partner,Customer "Intern", + * "Temp", "External", and "Unknown" . + */ + @Column + protected String userType; + @Column + protected String windowsAccount; + + // for user name + @Column + protected String displayName; + @Column + protected String nickName; + @Column + protected String nameZhSpell; + @Column + protected String nameZhShortSpell; + @Column + protected String givenName; + @Column + protected String middleName; + @Column + protected String familyName; + @Column + protected String honorificPrefix; + @Column + protected String honorificSuffix; + @Column + protected String formattedName; + + @Column + protected int married; + @Column + protected int gender; + @Column + protected String birthDate; + @JsonIgnore + @Column + protected byte[] picture; + @JsonIgnore + protected MultipartFile pictureFile; + @Column + protected int idType; + @Column + protected String idCardNo; + @Column + protected String webSite; + @Column + protected String startWorkDate; + + // for security + @Column + protected int authnType; + @Column + protected String email; + + protected int emailVerified; + @Column + protected String mobile; + + protected int mobileVerified; + + protected String passwordQuestion; + + protected String passwordAnswer; + @Column + // for apps login protected + protected int appLoginAuthnType; + protected String appLoginPassword; + protected String protectedApps; + @JsonIgnore + protected HashMap protectedAppsMap; + + protected String passwordLastSetTime; + protected int badPasswordCount; + protected String unLockTime; + protected int isLocked; + protected String lastLoginTime; + protected String lastLoginIp; + protected String lastLogoffTime; + protected int passwordSetType; + protected Integer loginCount; + + @Column + protected String locale; + @Column + protected String timeZone; + @Column + protected String preferredLanguage; + + // for work + @Column + protected String workCountry; + @Column + protected String workRegion;// province; + @Column + protected String workLocality;// city; + @Column + protected String workStreetAddress; + @Column + protected String workAddressFormatted; + @Column + protected String workEmail; + @Column + protected String workPhoneNumber; + @Column + protected String workPostalCode; + @Column + protected String workFax; + // for home + @Column + protected String homeCountry; + @Column + protected String homeRegion;// province; + @Column + protected String homeLocality;// city; + @Column + protected String homeStreetAddress; + @Column + protected String homeAddressFormatted; + @Column + protected String homeEmail; + @Column + protected String homePhoneNumber; + @Column + protected String homePostalCode; + @Column + protected String homeFax; + // for company + @Column + protected String employeeNumber; + @Column + protected String costCenter; + @Column + protected String organization; + @Column + protected String division; + @Column + protected String departmentId; + @Column + protected String department; + @Column + protected String jobTitle; + @Column + protected String jobLevel; + @Column + protected String managerId; + @Column + protected String manager; + @Column + protected String assistantId; + @Column + protected String assistant; + @Column + protected String entryDate; + @Column + protected String quitDate; + + // for social contact + @Column + protected String defineIm; + protected int weixinFollow; + + /* + * for extended Attribute from userType extraAttribute for database + * extraAttributeName & extraAttributeValue for page submit + */ + protected String extraAttribute; + protected String extraAttributeName; + protected String extraAttributeValue; + @JsonIgnore + protected HashMap extraAttributeMap; + + protected int online; + + protected String ldapDn; + + protected int gridList; + + @Column + String createdBy; + @Column + String createdDate; + @Column + String modifiedBy; + @Column + String modifiedDate; + @Column + int status; + @Column + String description; + + public static class ONLINE { + // 在线 + public static final int ONLINE = 1; + // 下线 + public static final int OFFLINE = 0; + } + + public static class MARRIED { + // 未知 + public static final int UNKNOWN = 0; + // 单身 + public static final int SINGLE = 1; + // 结婚 + public static final int MARRIED = 2; + // 离异 + public static final int DIVORCE = 3; + // 丧偶 + public static final int WIDOWED = 4; + + } + + public static class GENDER { + // 未知 + public static final int UNKNOWN = 0; + // 女性 + public static final int FEMALE = 1; + // 男性 + public static final int MALE = 2; + } + + public static class IDTYPE { + // 未知 + public static final int UNKNOWN = 0; + // 身份证 + public static final int IDCARD = 1; + // 护照 + public static final int PASSPORT = 2; + // 学生证 + public static final int STUDENTCARD = 3; + // 军人证 + public static final int MILITARYCARD = 4; + } + + public static class AUTHNTYPE { + // 用户名密码 + public static final int NORMAL = 1; + // 手机 + public static final int MOBILE = 2; + // 短信 + public static final int SMS = 3; + // 邮箱 + public static final int EMAIL = 4; + + public static final int TIMEBASED_OPT = 5; + + public static final int COUNTERBASED_OPT = 6; + + public static final int HOTP_OPT = 7; + + public static final int RSA_OPT = 8; + // 证书 + public static final int CERTIFICATE = 9; + // usb证书 + public static final int USBKEY = 10; + + } + + public static class EMPLOYMENTSTATUS { + // 在册人员 + public static final int ACTIVE = 1; + // 离职人员 + public static final int WITHDRAWN = 2; + // 停薪留职人员 + public static final int INACTIVE = 3; + // 退休人员 + public static final int RETIREE = 4; + + } + + /** + * + */ + public UserInfo() { + super(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @param username + */ + public UserInfo(String username) { + super(); + this.username = username; + } + + /** + * @param username + * @param password + */ + public UserInfo(String username, String password) { + super(); + this.username = username; + this.password = password; + } + + public byte[] getPicture() { + if (pictureFile != null && !pictureFile.isEmpty()) { + try { + picture = pictureFile.getBytes(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return picture; + } + + /** + * @return the protectedAppsMap + */ + public HashMap getProtectedAppsMap() { + if (protectedAppsMap == null) { + protectedAppsMap = new HashMap(); + } + if (StringUtils.isNotEmpty(protectedApps)) { + String[] apps = protectedApps.split(","); + + for (String appid : apps) { + protectedAppsMap.put(appid, appid); + } + } + return protectedAppsMap; + } + + // auto gen setter and getter + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getDecipherable() { + return decipherable; + } + + public void setDecipherable(String decipherable) { + this.decipherable = decipherable; + } + + public String getSharedSecret() { + return sharedSecret; + } + + public void setSharedSecret(String sharedSecret) { + this.sharedSecret = sharedSecret; + } + + public String getSharedCounter() { + return sharedCounter; + } + + public void setSharedCounter(String sharedCounter) { + this.sharedCounter = sharedCounter; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public String getWindowsAccount() { + return windowsAccount; + } + + public void setWindowsAccount(String windowsAccount) { + this.windowsAccount = windowsAccount; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + + + public String getNameZhSpell() { + return nameZhSpell; + } + + public void setNameZhSpell(String nameZhSpell) { + this.nameZhSpell = nameZhSpell; + } + + public String getNameZhShortSpell() { + return nameZhShortSpell; + } - /** - * - */ - private static final long serialVersionUID = 6402443942083382236L; - // - @Id - @Column - @GeneratedValue(strategy=GenerationType.AUTO,generator="uuid") - String id; - @Column - protected String username; - @Column - protected String password; - @Column - protected String decipherable; - @Column - protected String sharedSecret; - @Column - protected String sharedCounter; - /** - * "Employee", "Supplier","Dealer","Contractor",Partner,Customer "Intern", - "Temp", "External", and "Unknown" - */ - @Column - protected String userType; - @Column - protected String windowsAccount; - - //for user name - @Column - protected String displayName; - @Column - protected String nickName; - @Column - protected String nameZHSpell; - @Column - protected String nameZHShortSpell; - @Column - protected String givenName; - @Column - protected String middleName; - @Column - protected String familyName; - @Column - protected String honorificPrefix; - @Column - protected String honorificSuffix; - @Column - protected String formattedName; - - @Column - protected int married; - @Column - protected int gender; - @Column - protected String birthDate; - @JsonIgnore - @Column - protected byte[] picture; - @JsonIgnore - protected MultipartFile pictureFile; - @Column - protected int idType; - @Column - protected String idCardNo; - @Column - protected String webSite; - @Column - protected String startWorkDate; - - //for security - @Column - protected int authnType; - @Column - protected String email; - - protected int emailVerified; - @Column - protected String mobile; - - protected int mobileVerified; - - protected String passwordQuestion; - - protected String passwordAnswer; - @Column - //for apps login protected - protected int appLoginAuthnType; - protected String appLoginPassword; - protected String protectedApps; - @JsonIgnore - protected HashMap protectedAppsMap; - - - protected String passwordLastSetTime; - protected int badPasswordCount; - protected String unLockTime; - protected int isLocked; - protected String lastLoginTime; - protected String lastLoginIp; - protected String lastLogoffTime; - protected int passwordSetType; - protected Integer loginCount; - - @Column - protected String locale; - @Column - protected String timeZone; - @Column - protected String preferredLanguage; - - //for work - @Column - protected String workCountry; - @Column - protected String workRegion;//province; - @Column - protected String workLocality;//city; - @Column - protected String workStreetAddress; - @Column - protected String workAddressFormatted; - @Column - protected String workEmail; - @Column - protected String workPhoneNumber; - @Column - protected String workPostalCode; - @Column - protected String workFax; - //for home - @Column - protected String homeCountry; - @Column - protected String homeRegion;//province; - @Column - protected String homeLocality;//city; - @Column - protected String homeStreetAddress; - @Column - protected String homeAddressFormatted; - @Column - protected String homeEmail; - @Column - protected String homePhoneNumber; - @Column - protected String homePostalCode; - @Column - protected String homeFax; - //for company - @Column - protected String employeeNumber; - @Column - protected String costCenter; - @Column - protected String organization; - @Column - protected String division; - @Column - protected String departmentId; - @Column - protected String department; - @Column - protected String jobTitle; - @Column - protected String jobLevel; - @Column - protected String managerId; - @Column - protected String manager; - @Column - protected String assistantId; - @Column - protected String assistant; - @Column - protected String entryDate; - @Column - protected String quitDate; - - //for social contact - @Column - protected String defineIm; - protected int weixinFollow; - - /* - * for extended Attribute from userType - * extraAttribute for database - * extraAttributeName & extraAttributeValue for page submit - */ - protected String extraAttribute; - protected String extraAttributeName; - protected String extraAttributeValue; - @JsonIgnore - protected HashMap extraAttributeMap; - - protected int online; - - protected String ldapDn; - - protected int gridList; - - @Column - String createdBy; - @Column - String createdDate; - @Column - String modifiedBy; - @Column - String modifiedDate; - @Column - int status; - @Column - String description ; - - - public static class ONLINE{ - //在线 - public static final int ONLINE=1; - //下线 - public static final int OFFLINE=0; - } - public static class MARRIED{ - //未知 - public static final int UNKNOWN=0; - //单身 - public static final int SINGLE=1; - //结婚 - public static final int MARRIED=2; - //离异 - public static final int DIVORCE =3; - //丧偶 - public static final int WIDOWED=4; - - } - - public static class GENDER{ - //未知 - public static final int UNKNOWN=0; - //女性 - public static final int FEMALE=1; - //男性 - public static final int MALE=2; - } - - public static class IDTYPE{ - //未知 - public static final int UNKNOWN=0; - //身份证 - public static final int IDCARD=1; - //护照 - public static final int PASSPORT=2; - //学生证 - public static final int STUDENTCARD=3; - //军人证 - public static final int MILITARYCARD=4; - } - - public static class AUTHNTYPE{ - //用户名密码 - public static final int NORMAL =1; - //手机 - public static final int MOBILE = 2; - //短信 - public static final int SMS=3; - //邮箱 - public static final int EMAIL = 4; - - public static final int TIMEBASED_OPT=5; - - public static final int COUNTERBASED_OPT=6; - - public static final int HOTP_OPT=7; - - public static final int RSA_OPT=8; - //证书 - public static final int CERTIFICATE = 9; - //usb证书 - public static final int USBKEY=10; - - } - - - public static class EMPLOYMENTSTATUS{ - //在册人员 - public static final int ACTIVE = 1; - //离职人员 - public static final int WITHDRAWN = 2; - //停薪留职人员 - public static final int INACTIVE = 3; - //退休人员 - public static final int RETIREE = 4; - - } - - /** - * - */ - public UserInfo() { - super(); - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @param username - */ - public UserInfo(String username) { - super(); - this.username = username; - } - - /** - * @param username - * @param password - */ - public UserInfo(String username, String password) { - super(); - this.username = username; - this.password = password; - } - - public byte[] getPicture() { - if(pictureFile!=null&&!pictureFile.isEmpty()){ - try { - picture=pictureFile.getBytes(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return picture; - } - - /** - * @return the protectedAppsMap - */ - public HashMap getProtectedAppsMap() { - if(protectedAppsMap==null){ - protectedAppsMap=new HashMap(); - } - if(StringUtils.isNotEmpty(protectedApps)){ - String []apps=protectedApps.split(","); - - for(String appid:apps){ - protectedAppsMap.put(appid, appid); - } - } - return protectedAppsMap; - } - - //auto gen setter and getter - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getDecipherable() { - return decipherable; - } - - public void setDecipherable(String decipherable) { - this.decipherable = decipherable; - } - - public String getSharedSecret() { - return sharedSecret; - } - - public void setSharedSecret(String sharedSecret) { - this.sharedSecret = sharedSecret; - } - - public String getSharedCounter() { - return sharedCounter; - } - - public void setSharedCounter(String sharedCounter) { - this.sharedCounter = sharedCounter; - } - - public String getUserType() { - return userType; - } - - public void setUserType(String userType) { - this.userType = userType; - } - - public String getWindowsAccount() { - return windowsAccount; - } - - public void setWindowsAccount(String windowsAccount) { - this.windowsAccount = windowsAccount; - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName = nickName; - } - - public String getNameZHSpell() { - return nameZHSpell; - } - - public void setNameZHSpell(String nameZHSpell) { - this.nameZHSpell = nameZHSpell; - } - - public String getNameZHShortSpell() { - return nameZHShortSpell; - } - - public void setNameZHShortSpell(String nameZHShortSpell) { - this.nameZHShortSpell = nameZHShortSpell; - } - - public String getGivenName() { - return givenName; - } - - public void setGivenName(String givenName) { - this.givenName = givenName; - } + public void setNameZhShortSpell(String nameZhShortSpell) { + this.nameZhShortSpell = nameZhShortSpell; + } - public String getMiddleName() { - return middleName; - } + public String getGivenName() { + return givenName; + } - public void setMiddleName(String middleName) { - this.middleName = middleName; - } + public void setGivenName(String givenName) { + this.givenName = givenName; + } - public String getFamilyName() { - return familyName; - } + public String getMiddleName() { + return middleName; + } - public void setFamilyName(String familyName) { - this.familyName = familyName; - } + public void setMiddleName(String middleName) { + this.middleName = middleName; + } - public String getHonorificPrefix() { - return honorificPrefix; - } + public String getFamilyName() { + return familyName; + } - public void setHonorificPrefix(String honorificPrefix) { - this.honorificPrefix = honorificPrefix; - } + public void setFamilyName(String familyName) { + this.familyName = familyName; + } - public String getHonorificSuffix() { - return honorificSuffix; - } + public String getHonorificPrefix() { + return honorificPrefix; + } - public void setHonorificSuffix(String honorificSuffix) { - this.honorificSuffix = honorificSuffix; - } + public void setHonorificPrefix(String honorificPrefix) { + this.honorificPrefix = honorificPrefix; + } - public String getFormattedName() { - return formattedName; - } + public String getHonorificSuffix() { + return honorificSuffix; + } - public void setFormattedName(String formattedName) { - this.formattedName = formattedName; - } + public void setHonorificSuffix(String honorificSuffix) { + this.honorificSuffix = honorificSuffix; + } - public int getMarried() { - return married; - } + public String getFormattedName() { + return formattedName; + } - public void setMarried(int married) { - this.married = married; - } + public void setFormattedName(String formattedName) { + this.formattedName = formattedName; + } - public int getGender() { - return gender; - } + public int getMarried() { + return married; + } - public void setGender(int gender) { - this.gender = gender; - } + public void setMarried(int married) { + this.married = married; + } - public String getBirthDate() { - return birthDate; - } + public int getGender() { + return gender; + } - public void setBirthDate(String birthDate) { - this.birthDate = birthDate; - } + public void setGender(int gender) { + this.gender = gender; + } - public MultipartFile getPictureFile() { - return pictureFile; - } + public String getBirthDate() { + return birthDate; + } - public void setPictureFile(MultipartFile pictureFile) { - this.pictureFile = pictureFile; - } + public void setBirthDate(String birthDate) { + this.birthDate = birthDate; + } - public int getIdType() { - return idType; - } + public MultipartFile getPictureFile() { + return pictureFile; + } - public void setIdType(int idType) { - this.idType = idType; - } + public void setPictureFile(MultipartFile pictureFile) { + this.pictureFile = pictureFile; + } - public String getIdCardNo() { - return idCardNo; - } + public int getIdType() { + return idType; + } - public void setIdCardNo(String idCardNo) { - this.idCardNo = idCardNo; - } + public void setIdType(int idType) { + this.idType = idType; + } - public String getWebSite() { - return webSite; - } + public String getIdCardNo() { + return idCardNo; + } - public void setWebSite(String webSite) { - this.webSite = webSite; - } + public void setIdCardNo(String idCardNo) { + this.idCardNo = idCardNo; + } - public String getStartWorkDate() { - return startWorkDate; - } + public String getWebSite() { + return webSite; + } - public void setStartWorkDate(String startWorkDate) { - this.startWorkDate = startWorkDate; - } + public void setWebSite(String webSite) { + this.webSite = webSite; + } - public int getAuthnType() { - return authnType; - } + public String getStartWorkDate() { + return startWorkDate; + } - public void setAuthnType(int authnType) { - this.authnType = authnType; - } + public void setStartWorkDate(String startWorkDate) { + this.startWorkDate = startWorkDate; + } - public String getEmail() { - return email; - } + public int getAuthnType() { + return authnType; + } - public void setEmail(String email) { - this.email = email; - } + public void setAuthnType(int authnType) { + this.authnType = authnType; + } - public int getEmailVerified() { - return emailVerified; - } + public String getEmail() { + return email; + } - public void setEmailVerified(int emailVerified) { - this.emailVerified = emailVerified; - } + public void setEmail(String email) { + this.email = email; + } - public String getMobile() { - return mobile; - } + public int getEmailVerified() { + return emailVerified; + } - public void setMobile(String mobile) { - this.mobile = mobile; - } + public void setEmailVerified(int emailVerified) { + this.emailVerified = emailVerified; + } - public int getMobileVerified() { - return mobileVerified; - } + public String getMobile() { + return mobile; + } - public void setMobileVerified(int mobileVerified) { - this.mobileVerified = mobileVerified; - } + public void setMobile(String mobile) { + this.mobile = mobile; + } - public String getPasswordQuestion() { - return passwordQuestion; - } + public int getMobileVerified() { + return mobileVerified; + } - public void setPasswordQuestion(String passwordQuestion) { - this.passwordQuestion = passwordQuestion; - } + public void setMobileVerified(int mobileVerified) { + this.mobileVerified = mobileVerified; + } - public String getPasswordAnswer() { - return passwordAnswer; - } + public String getPasswordQuestion() { + return passwordQuestion; + } - public void setPasswordAnswer(String passwordAnswer) { - this.passwordAnswer = passwordAnswer; - } + public void setPasswordQuestion(String passwordQuestion) { + this.passwordQuestion = passwordQuestion; + } - public int getAppLoginAuthnType() { - return appLoginAuthnType; - } + public String getPasswordAnswer() { + return passwordAnswer; + } - public void setAppLoginAuthnType(int appLoginAuthnType) { - this.appLoginAuthnType = appLoginAuthnType; - } + public void setPasswordAnswer(String passwordAnswer) { + this.passwordAnswer = passwordAnswer; + } - public String getAppLoginPassword() { - return appLoginPassword; - } + public int getAppLoginAuthnType() { + return appLoginAuthnType; + } - public void setAppLoginPassword(String appLoginPassword) { - this.appLoginPassword = appLoginPassword; - } + public void setAppLoginAuthnType(int appLoginAuthnType) { + this.appLoginAuthnType = appLoginAuthnType; + } - public String getProtectedApps() { - return protectedApps; - } + public String getAppLoginPassword() { + return appLoginPassword; + } - public void setProtectedApps(String protectedApps) { - this.protectedApps = protectedApps; - } + public void setAppLoginPassword(String appLoginPassword) { + this.appLoginPassword = appLoginPassword; + } - public String getPasswordLastSetTime() { - return passwordLastSetTime; - } + public String getProtectedApps() { + return protectedApps; + } - public void setPasswordLastSetTime(String passwordLastSetTime) { - this.passwordLastSetTime = passwordLastSetTime; - } + public void setProtectedApps(String protectedApps) { + this.protectedApps = protectedApps; + } - public int getBadPasswordCount() { - return badPasswordCount; - } + public String getPasswordLastSetTime() { + return passwordLastSetTime; + } - public void setBadPasswordCount(int badPasswordCount) { - this.badPasswordCount = badPasswordCount; - } + public void setPasswordLastSetTime(String passwordLastSetTime) { + this.passwordLastSetTime = passwordLastSetTime; + } - public String getUnLockTime() { - return unLockTime; - } + public int getBadPasswordCount() { + return badPasswordCount; + } - public void setUnLockTime(String unLockTime) { - this.unLockTime = unLockTime; - } + public void setBadPasswordCount(int badPasswordCount) { + this.badPasswordCount = badPasswordCount; + } - public int getIsLocked() { - return isLocked; - } + public String getUnLockTime() { + return unLockTime; + } - public void setIsLocked(int isLocked) { - this.isLocked = isLocked; - } + public void setUnLockTime(String unLockTime) { + this.unLockTime = unLockTime; + } - public String getLastLoginTime() { - return lastLoginTime; - } + public int getIsLocked() { + return isLocked; + } - public void setLastLoginTime(String lastLoginTime) { - this.lastLoginTime = lastLoginTime; - } + public void setIsLocked(int isLocked) { + this.isLocked = isLocked; + } - public String getLastLogoffTime() { - return lastLogoffTime; - } + public String getLastLoginTime() { + return lastLoginTime; + } - public void setLastLogoffTime(String lastLogoffTime) { - this.lastLogoffTime = lastLogoffTime; - } + public void setLastLoginTime(String lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } - public int getPasswordSetType() { - return passwordSetType; - } + public String getLastLogoffTime() { + return lastLogoffTime; + } - public void setPasswordSetType(int passwordSetType) { - this.passwordSetType = passwordSetType; - } + public void setLastLogoffTime(String lastLogoffTime) { + this.lastLogoffTime = lastLogoffTime; + } - public String getLocale() { - return locale; - } + public int getPasswordSetType() { + return passwordSetType; + } - public void setLocale(String locale) { - this.locale = locale; - } + public void setPasswordSetType(int passwordSetType) { + this.passwordSetType = passwordSetType; + } - public String getTimeZone() { - return timeZone; - } + public String getLocale() { + return locale; + } - public void setTimeZone(String timeZone) { - this.timeZone = timeZone; - } + public void setLocale(String locale) { + this.locale = locale; + } - public String getPreferredLanguage() { - return preferredLanguage; - } + public String getTimeZone() { + return timeZone; + } - public void setPreferredLanguage(String preferredLanguage) { - this.preferredLanguage = preferredLanguage; - } + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } - public String getWorkCountry() { - return workCountry; - } + public String getPreferredLanguage() { + return preferredLanguage; + } - public void setWorkCountry(String workCountry) { - this.workCountry = workCountry; - } + public void setPreferredLanguage(String preferredLanguage) { + this.preferredLanguage = preferredLanguage; + } - public String getWorkRegion() { - return workRegion; - } + public String getWorkCountry() { + return workCountry; + } - public void setWorkRegion(String workRegion) { - this.workRegion = workRegion; - } + public void setWorkCountry(String workCountry) { + this.workCountry = workCountry; + } - public String getWorkLocality() { - return workLocality; - } + public String getWorkRegion() { + return workRegion; + } - public void setWorkLocality(String workLocality) { - this.workLocality = workLocality; - } + public void setWorkRegion(String workRegion) { + this.workRegion = workRegion; + } - public String getWorkStreetAddress() { - return workStreetAddress; - } + public String getWorkLocality() { + return workLocality; + } - public void setWorkStreetAddress(String workStreetAddress) { - this.workStreetAddress = workStreetAddress; - } + public void setWorkLocality(String workLocality) { + this.workLocality = workLocality; + } - public String getWorkAddressFormatted() { - return workAddressFormatted; - } + public String getWorkStreetAddress() { + return workStreetAddress; + } - public void setWorkAddressFormatted(String workAddressFormatted) { - this.workAddressFormatted = workAddressFormatted; - } + public void setWorkStreetAddress(String workStreetAddress) { + this.workStreetAddress = workStreetAddress; + } - public String getWorkEmail() { - return workEmail; - } + public String getWorkAddressFormatted() { + return workAddressFormatted; + } - public void setWorkEmail(String workEmail) { - this.workEmail = workEmail; - } + public void setWorkAddressFormatted(String workAddressFormatted) { + this.workAddressFormatted = workAddressFormatted; + } - public String getWorkPhoneNumber() { - return workPhoneNumber; - } + public String getWorkEmail() { + return workEmail; + } - public void setWorkPhoneNumber(String workPhoneNumber) { - this.workPhoneNumber = workPhoneNumber; - } + public void setWorkEmail(String workEmail) { + this.workEmail = workEmail; + } - public String getWorkPostalCode() { - return workPostalCode; - } + public String getWorkPhoneNumber() { + return workPhoneNumber; + } - public void setWorkPostalCode(String workPostalCode) { - this.workPostalCode = workPostalCode; - } + public void setWorkPhoneNumber(String workPhoneNumber) { + this.workPhoneNumber = workPhoneNumber; + } - public String getWorkFax() { - return workFax; - } + public String getWorkPostalCode() { + return workPostalCode; + } - public void setWorkFax(String workFax) { - this.workFax = workFax; - } + public void setWorkPostalCode(String workPostalCode) { + this.workPostalCode = workPostalCode; + } - public String getHomeCountry() { - return homeCountry; - } + public String getWorkFax() { + return workFax; + } - public void setHomeCountry(String homeCountry) { - this.homeCountry = homeCountry; - } + public void setWorkFax(String workFax) { + this.workFax = workFax; + } - public String getHomeRegion() { - return homeRegion; - } + public String getHomeCountry() { + return homeCountry; + } - public void setHomeRegion(String homeRegion) { - this.homeRegion = homeRegion; - } + public void setHomeCountry(String homeCountry) { + this.homeCountry = homeCountry; + } - public String getHomeLocality() { - return homeLocality; - } + public String getHomeRegion() { + return homeRegion; + } - public void setHomeLocality(String homeLocality) { - this.homeLocality = homeLocality; - } + public void setHomeRegion(String homeRegion) { + this.homeRegion = homeRegion; + } - public String getHomeStreetAddress() { - return homeStreetAddress; - } + public String getHomeLocality() { + return homeLocality; + } - public void setHomeStreetAddress(String homeStreetAddress) { - this.homeStreetAddress = homeStreetAddress; - } + public void setHomeLocality(String homeLocality) { + this.homeLocality = homeLocality; + } - public String getHomeAddressFormatted() { - return homeAddressFormatted; - } + public String getHomeStreetAddress() { + return homeStreetAddress; + } - public void setHomeAddressFormatted(String homeAddressFormatted) { - this.homeAddressFormatted = homeAddressFormatted; - } + public void setHomeStreetAddress(String homeStreetAddress) { + this.homeStreetAddress = homeStreetAddress; + } - public String getHomeEmail() { - return homeEmail; - } + public String getHomeAddressFormatted() { + return homeAddressFormatted; + } - public void setHomeEmail(String homeEmail) { - this.homeEmail = homeEmail; - } + public void setHomeAddressFormatted(String homeAddressFormatted) { + this.homeAddressFormatted = homeAddressFormatted; + } - public String getHomePhoneNumber() { - return homePhoneNumber; - } + public String getHomeEmail() { + return homeEmail; + } - public void setHomePhoneNumber(String homePhoneNumber) { - this.homePhoneNumber = homePhoneNumber; - } + public void setHomeEmail(String homeEmail) { + this.homeEmail = homeEmail; + } - public String getHomePostalCode() { - return homePostalCode; - } + public String getHomePhoneNumber() { + return homePhoneNumber; + } - public void setHomePostalCode(String homePostalCode) { - this.homePostalCode = homePostalCode; - } + public void setHomePhoneNumber(String homePhoneNumber) { + this.homePhoneNumber = homePhoneNumber; + } - public String getHomeFax() { - return homeFax; - } + public String getHomePostalCode() { + return homePostalCode; + } - public void setHomeFax(String homeFax) { - this.homeFax = homeFax; - } + public void setHomePostalCode(String homePostalCode) { + this.homePostalCode = homePostalCode; + } - public String getEmployeeNumber() { - return employeeNumber; - } + public String getHomeFax() { + return homeFax; + } - public void setEmployeeNumber(String employeeNumber) { - this.employeeNumber = employeeNumber; - } + public void setHomeFax(String homeFax) { + this.homeFax = homeFax; + } - public String getCostCenter() { - return costCenter; - } + public String getEmployeeNumber() { + return employeeNumber; + } - public void setCostCenter(String costCenter) { - this.costCenter = costCenter; - } + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } - public String getOrganization() { - return organization; - } + public String getCostCenter() { + return costCenter; + } - public void setOrganization(String organization) { - this.organization = organization; - } + public void setCostCenter(String costCenter) { + this.costCenter = costCenter; + } - public String getDivision() { - return division; - } + public String getOrganization() { + return organization; + } - public void setDivision(String division) { - this.division = division; - } + public void setOrganization(String organization) { + this.organization = organization; + } - public String getDepartmentId() { - return departmentId; - } + public String getDivision() { + return division; + } - public void setDepartmentId(String departmentId) { - this.departmentId = departmentId; - } + public void setDivision(String division) { + this.division = division; + } - public String getDepartment() { - return department; - } + public String getDepartmentId() { + return departmentId; + } - public void setDepartment(String department) { - this.department = department; - } + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } - public String getJobTitle() { - return jobTitle; - } + public String getDepartment() { + return department; + } - public void setJobTitle(String jobTitle) { - this.jobTitle = jobTitle; - } + public void setDepartment(String department) { + this.department = department; + } - public String getJobLevel() { - return jobLevel; - } + public String getJobTitle() { + return jobTitle; + } - public void setJobLevel(String jobLevel) { - this.jobLevel = jobLevel; - } + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } - public String getManagerId() { - return managerId; - } + public String getJobLevel() { + return jobLevel; + } - public void setManagerId(String managerId) { - this.managerId = managerId; - } + public void setJobLevel(String jobLevel) { + this.jobLevel = jobLevel; + } - public String getManager() { - return manager; - } + public String getManagerId() { + return managerId; + } - public void setManager(String manager) { - this.manager = manager; - } + public void setManagerId(String managerId) { + this.managerId = managerId; + } - public String getAssistantId() { - return assistantId; - } + public String getManager() { + return manager; + } - public void setAssistantId(String assistantId) { - this.assistantId = assistantId; - } + public void setManager(String manager) { + this.manager = manager; + } - public String getAssistant() { - return assistant; - } + public String getAssistantId() { + return assistantId; + } - public void setAssistant(String assistant) { - this.assistant = assistant; - } + public void setAssistantId(String assistantId) { + this.assistantId = assistantId; + } - public String getEntryDate() { - return entryDate; - } - - public void setEntryDate(String entryDate) { - this.entryDate = entryDate; - } - - public String getQuitDate() { - return quitDate; - } - - public void setQuitDate(String quitDate) { - this.quitDate = quitDate; - } - - public String getExtraAttribute() { - return extraAttribute; - } + public String getAssistant() { + return assistant; + } - public void setExtraAttribute(String extraAttribute) { - this.extraAttribute = extraAttribute; - } + public void setAssistant(String assistant) { + this.assistant = assistant; + } - public String getExtraAttributeName() { - return extraAttributeName; - } + public String getEntryDate() { + return entryDate; + } - public void setExtraAttributeName(String extraAttributeName) { - this.extraAttributeName = extraAttributeName; - } - - public String getExtraAttributeValue() { - return extraAttributeValue; - } - - public void setExtraAttributeValue(String extraAttributeValue) { - this.extraAttributeValue = extraAttributeValue; - } - - public HashMap getExtraAttributeMap() { - return extraAttributeMap; - } - - public void setExtraAttributeMap(HashMap extraAttributeMap) { - this.extraAttributeMap = extraAttributeMap; - } - - - - public int getOnline() { - return online; - } - - public void setOnline(int online) { - this.online = online; - } - - public String getLdapDn() { - return ldapDn; - } - - public void setLdapDn(String ldapDn) { - this.ldapDn = ldapDn; - } - - public void setPicture(byte[] picture) { - this.picture = picture; - } - - public void setProtectedAppsMap(HashMap protectedAppsMap) { - this.protectedAppsMap = protectedAppsMap; - } - - - public String getLastLoginIp() { - return lastLoginIp; - } - - public void setLastLoginIp(String lastLoginIp) { - this.lastLoginIp = lastLoginIp; - } - - public Integer getLoginCount() { - return loginCount; - } - - public void setLoginCount(Integer loginCount) { - this.loginCount = loginCount; - } - - - public int getGridList() { - return gridList; - } - - public void setGridList(int gridList) { - this.gridList = gridList; - } - - - public String getDefineIm() { - return defineIm; - } - - public void setDefineIm(String defineIm) { - this.defineIm = defineIm; - } - - public int getWeixinFollow() { - return weixinFollow; - } - - public void setWeixinFollow(int weixinFollow) { - this.weixinFollow = weixinFollow; - } - - - - /** - * @return the status - */ - public int getStatus() { - return status; - } - - /** - * @param status the status to set - */ - public void setStatus(int status) { - this.status = status; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - @Override - public String toString() { - return "UserInfo [username=" + username + ", password=" + password - + ", decipherable=" + decipherable + ", sharedSecret=" - + sharedSecret + ", sharedCounter=" + sharedCounter - + ", userType=" + userType + ", windowsAccount=" - + windowsAccount + ", displayName=" + displayName - + ", nickName=" + nickName + ", nameZHSpell=" + nameZHSpell - + ", nameZHShortSpell=" + nameZHShortSpell + ", givenName=" - + givenName + ", middleName=" + middleName + ", familyName=" - + familyName + ", honorificPrefix=" + honorificPrefix - + ", honorificSuffix=" + honorificSuffix + ", formattedName=" - + formattedName + ", married=" + married + ", gender=" + gender - + ", birthDate=" + birthDate + ", pictureFile=" + pictureFile - + ", idType=" + idType + ", idCardNo=" + idCardNo - + ", webSite=" + webSite + ", startWorkDate=" + startWorkDate - + ", authnType=" + authnType + ", email=" + email - + ", emailVerified=" + emailVerified + ", mobile=" + mobile - + ", mobileVerified=" + mobileVerified + ", passwordQuestion=" - + passwordQuestion + ", passwordAnswer=" + passwordAnswer - + ", appLoginAuthnType=" + appLoginAuthnType - + ", appLoginPassword=" + appLoginPassword + ", protectedApps=" - + protectedApps + ", protectedAppsMap=" + protectedAppsMap - + ", passwordLastSetTime=" + passwordLastSetTime - + ", badPasswordCount=" + badPasswordCount + ", unLockTime=" - + unLockTime + ", isLocked=" + isLocked + ", lastLoginTime=" - + lastLoginTime + ", lastLoginIp=" + lastLoginIp - + ", lastLogoffTime=" + lastLogoffTime + ", passwordSetType=" - + passwordSetType + ", loginCount=" + loginCount + ", locale=" - + locale + ", timeZone=" + timeZone + ", preferredLanguage=" - + preferredLanguage + ", workCountry=" + workCountry - + ", workRegion=" + workRegion + ", workLocality=" - + workLocality + ", workStreetAddress=" + workStreetAddress - + ", workAddressFormatted=" + workAddressFormatted - + ", workEmail=" + workEmail + ", workPhoneNumber=" - + workPhoneNumber + ", workPostalCode=" + workPostalCode - + ", workFax=" + workFax + ", homeCountry=" + homeCountry - + ", homeRegion=" + homeRegion + ", homeLocality=" - + homeLocality + ", homeStreetAddress=" + homeStreetAddress - + ", homeAddressFormatted=" + homeAddressFormatted - + ", homeEmail=" + homeEmail + ", homePhoneNumber=" - + homePhoneNumber + ", homePostalCode=" + homePostalCode - + ", homeFax=" + homeFax + ", employeeNumber=" + employeeNumber - + ", costCenter=" + costCenter + ", organization=" - + organization + ", division=" + division + ", departmentId=" - + departmentId + ", department=" + department + ", jobTitle=" - + jobTitle + ", jobLevel=" + jobLevel + ", managerId=" - + managerId + ", manager=" + manager + ", assistantId=" - + assistantId + ", assistant=" + assistant + ", entryDate=" - + entryDate + ", quitDate=" + quitDate - + ", extraAttribute=" + extraAttribute - + ", extraAttributeName=" + extraAttributeName - + ", extraAttributeValue=" + extraAttributeValue - + ", extraAttributeMap=" + extraAttributeMap + ", online=" - + online + ", ldapDn=" + ldapDn + "]"; - } - - /** - * @return the createdBy - */ - public String getCreatedBy() { - return createdBy; - } - - /** - * @param createdBy the createdBy to set - */ - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - /** - * @return the createdDate - */ - public String getCreatedDate() { - return createdDate; - } - - /** - * @param createdDate the createdDate to set - */ - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - - /** - * @return the modifiedBy - */ - public String getModifiedBy() { - return modifiedBy; - } - - /** - * @param modifiedBy the modifiedBy to set - */ - public void setModifiedBy(String modifiedBy) { - this.modifiedBy = modifiedBy; - } - - /** - * @return the modifiedDate - */ - public String getModifiedDate() { - return modifiedDate; - } - - /** - * @param modifiedDate the modifiedDate to set - */ - public void setModifiedDate(String modifiedDate) { - this.modifiedDate = modifiedDate; - } + public void setEntryDate(String entryDate) { + this.entryDate = entryDate; + } + public String getQuitDate() { + return quitDate; + } + + public void setQuitDate(String quitDate) { + this.quitDate = quitDate; + } + + public String getExtraAttribute() { + return extraAttribute; + } + + public void setExtraAttribute(String extraAttribute) { + this.extraAttribute = extraAttribute; + } + + public String getExtraAttributeName() { + return extraAttributeName; + } + + public void setExtraAttributeName(String extraAttributeName) { + this.extraAttributeName = extraAttributeName; + } + + public String getExtraAttributeValue() { + return extraAttributeValue; + } + + public void setExtraAttributeValue(String extraAttributeValue) { + this.extraAttributeValue = extraAttributeValue; + } + + public HashMap getExtraAttributeMap() { + return extraAttributeMap; + } + + public void setExtraAttributeMap(HashMap extraAttributeMap) { + this.extraAttributeMap = extraAttributeMap; + } + + public int getOnline() { + return online; + } + + public void setOnline(int online) { + this.online = online; + } + + public String getLdapDn() { + return ldapDn; + } + + public void setLdapDn(String ldapDn) { + this.ldapDn = ldapDn; + } + + public void setPicture(byte[] picture) { + this.picture = picture; + } + + public void setProtectedAppsMap(HashMap protectedAppsMap) { + this.protectedAppsMap = protectedAppsMap; + } + + public String getLastLoginIp() { + return lastLoginIp; + } + + public void setLastLoginIp(String lastLoginIp) { + this.lastLoginIp = lastLoginIp; + } + + public Integer getLoginCount() { + return loginCount; + } + + public void setLoginCount(Integer loginCount) { + this.loginCount = loginCount; + } + + public int getGridList() { + return gridList; + } + + public void setGridList(int gridList) { + this.gridList = gridList; + } + + public String getDefineIm() { + return defineIm; + } + + public void setDefineIm(String defineIm) { + this.defineIm = defineIm; + } + + public int getWeixinFollow() { + return weixinFollow; + } + + public void setWeixinFollow(int weixinFollow) { + this.weixinFollow = weixinFollow; + } + + /** + * @return the status + */ + public int getStatus() { + return status; + } + + /** + * @param status the status to set + */ + public void setStatus(int status) { + this.status = status; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + @Override + public String toString() { + return "UserInfo [username=" + username + + ", password=" + password + ", decipherable=" + decipherable + + ", sharedSecret=" + sharedSecret + + ", sharedCounter=" + sharedCounter + ", userType=" + userType + + ", windowsAccount=" + windowsAccount + + ", displayName=" + displayName + ", nickName=" + nickName + + ", nameZHSpell=" + nameZhSpell + + ", nameZHShortSpell=" + nameZhShortSpell + + ", givenName=" + givenName + + ", middleName=" + middleName + ", familyName=" + familyName + + ", honorificPrefix=" + honorificPrefix + + ", honorificSuffix=" + honorificSuffix + + ", formattedName=" + formattedName + ", married=" + married + + ", gender=" + gender + ", birthDate=" + birthDate + + ", pictureFile=" + pictureFile + ", idType=" + + idType + ", idCardNo=" + idCardNo + ", webSite=" + webSite + + ", startWorkDate=" + startWorkDate + + ", authnType=" + authnType + ", email=" + email + + ", emailVerified=" + emailVerified + ", mobile=" + + mobile + ", mobileVerified=" + mobileVerified + + ", passwordQuestion=" + passwordQuestion + + ", passwordAnswer=" + passwordAnswer + ", appLoginAuthnType=" + appLoginAuthnType + + ", appLoginPassword=" + appLoginPassword + + ", protectedApps=" + protectedApps + ", protectedAppsMap=" + + protectedAppsMap + ", passwordLastSetTime=" + passwordLastSetTime + + ", badPasswordCount=" + + badPasswordCount + ", unLockTime=" + unLockTime + + ", isLocked=" + isLocked + ", lastLoginTime=" + + lastLoginTime + ", lastLoginIp=" + lastLoginIp + + ", lastLogoffTime=" + lastLogoffTime + + ", passwordSetType=" + passwordSetType + + ", loginCount=" + loginCount + ", locale=" + locale + + ", timeZone=" + timeZone + ", preferredLanguage=" + preferredLanguage + + ", workCountry=" + workCountry + + ", workRegion=" + workRegion + ", workLocality=" + workLocality + + ", workStreetAddress=" + + workStreetAddress + ", workAddressFormatted=" + workAddressFormatted + + ", workEmail=" + workEmail + + ", workPhoneNumber=" + workPhoneNumber + ", workPostalCode=" + workPostalCode + + ", workFax=" + workFax + + ", homeCountry=" + homeCountry + ", homeRegion=" + homeRegion + + ", homeLocality=" + homeLocality + + ", homeStreetAddress=" + homeStreetAddress + + ", homeAddressFormatted=" + homeAddressFormatted + + ", homeEmail=" + homeEmail + + ", homePhoneNumber=" + homePhoneNumber + ", homePostalCode=" + + homePostalCode + ", homeFax=" + homeFax + + ", employeeNumber=" + employeeNumber + ", costCenter=" + + costCenter + ", organization=" + organization + + ", division=" + division + ", departmentId=" + + departmentId + ", department=" + department + + ", jobTitle=" + jobTitle + ", jobLevel=" + jobLevel + + ", managerId=" + managerId + ", manager=" + manager + + ", assistantId=" + assistantId + ", assistant=" + + assistant + ", entryDate=" + entryDate + + ", quitDate=" + quitDate + ", extraAttribute=" + extraAttribute + + ", extraAttributeName=" + extraAttributeName + ", extraAttributeValue=" + + extraAttributeValue + ", extraAttributeMap=" + extraAttributeMap + + ", online=" + online + ", ldapDn=" + + ldapDn + "]"; + } + + /** + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * @param createdBy the createdBy to set + */ + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + /** + * @return the createdDate + */ + public String getCreatedDate() { + return createdDate; + } + + /** + * @param createdDate the createdDate to set + */ + public void setCreatedDate(String createdDate) { + this.createdDate = createdDate; + } + + /** + * @return the modifiedBy + */ + public String getModifiedBy() { + return modifiedBy; + } + + /** + * @param modifiedBy the modifiedBy to set + */ + public void setModifiedBy(String modifiedBy) { + this.modifiedBy = modifiedBy; + } + + /** + * @return the modifiedDate + */ + public String getModifiedDate() { + return modifiedDate; + } + + /** + * @param modifiedDate the modifiedDate to set + */ + public void setModifiedDate(String modifiedDate) { + this.modifiedDate = modifiedDate; + } } diff --git a/maxkey-core/src/main/java/org/maxkey/persistence/db/UserInfoRowMapper.java b/maxkey-core/src/main/java/org/maxkey/persistence/db/UserInfoRowMapper.java index fd217a72..81320afb 100644 --- a/maxkey-core/src/main/java/org/maxkey/persistence/db/UserInfoRowMapper.java +++ b/maxkey-core/src/main/java/org/maxkey/persistence/db/UserInfoRowMapper.java @@ -6,114 +6,113 @@ import java.sql.SQLException; import org.maxkey.domain.UserInfo; import org.springframework.jdbc.core.RowMapper; -public class UserInfoRowMapper implements RowMapper { +public class UserInfoRowMapper implements RowMapper { - @Override - public UserInfo mapRow(ResultSet rs, int rowNum)throws SQLException { - - UserInfo userInfo=new UserInfo(); - userInfo.setId(rs.getString("ID")); - userInfo.setUsername(rs.getString("USERNAME")); - userInfo.setPassword(rs.getString("PASSWORD")); - userInfo.setSharedSecret(rs.getString("SHAREDSECRET")); - userInfo.setSharedCounter(rs.getString("SHAREDCOUNTER")); - userInfo.setDecipherable(rs.getString("DECIPHERABLE")); - userInfo.setWindowsAccount(rs.getString("WINDOWSACCOUNT")); - userInfo.setUserType(rs.getString("USERTYPE")); - - userInfo.setDisplayName(rs.getString("DISPLAYNAME")); - userInfo.setNickName(rs.getString("NICKNAME")); - userInfo.setNameZHSpell(rs.getString("NAMEZHSPELL"));//nameZHSpell - userInfo.setNameZHShortSpell(rs.getString("NAMEZHSHORTSPELL"));//nameZHSpell - userInfo.setGivenName(rs.getString("GIVENNAME")); - userInfo.setMiddleName(rs.getString("MIDDLENAME")); - userInfo.setFamilyName(rs.getString("FAMILYNAME")); - userInfo.setHonorificPrefix(rs.getString("HONORIFICPREFIX")); - userInfo.setHonorificSuffix(rs.getString("HONORIFICSUFFIX")); - userInfo.setFormattedName(rs.getString("FORMATTEDNAME")); - - userInfo.setGender(rs.getInt("GENDER")); - userInfo.setBirthDate(rs.getString("BIRTHDATE")); - userInfo.setPicture(rs.getBytes("PICTURE")); - userInfo.setMarried(rs.getInt("MARRIED")); - userInfo.setIdType(rs.getInt("IDTYPE")); - userInfo.setIdCardNo(rs.getString("IDCARDNO")); - userInfo.setWebSite(rs.getString("WEBSITE")); - - userInfo.setAuthnType(rs.getInt("AUTHNTYPE")); - userInfo.setMobile(rs.getString("MOBILE")); - userInfo.setMobileVerified(rs.getInt("MOBILEVERIFIED")); - userInfo.setEmail(rs.getString("EMAIL")); - userInfo.setEmailVerified(rs.getInt("EMAILVERIFIED")); - userInfo.setPasswordQuestion(rs.getString("PASSWORDQUESTION")); - userInfo.setPasswordAnswer(rs.getString("PASSWORDANSWER")); - - userInfo.setAppLoginAuthnType(rs.getInt("APPLOGINAUTHNTYPE")); - userInfo.setAppLoginPassword(rs.getString("APPLOGINPASSWORD")); - userInfo.setProtectedApps(rs.getString("PROTECTEDAPPS")); - - userInfo.setPasswordLastSetTime(rs.getString("PASSWORDLASTSETTIME")); - userInfo.setPasswordSetType(rs.getInt("PASSWORDSETTYPE")); - userInfo.setBadPasswordCount(rs.getInt("BADPASSWORDCOUNT")); - userInfo.setUnLockTime(rs.getString("UNLOCKTIME")); - userInfo.setIsLocked(rs.getInt("ISLOCKED")); - userInfo.setLastLoginTime(rs.getString("LASTLOGINTIME")); - userInfo.setLastLoginIp(rs.getString("LASTLOGINIP")); - userInfo.setLastLogoffTime(rs.getString("LASTLOGOFFTIME")); - userInfo.setLoginCount(rs.getInt("LOGINCOUNT")); - - userInfo.setTimeZone(rs.getString("TIMEZONE")); - userInfo.setLocale(rs.getString("LOCALE")); - userInfo.setPreferredLanguage(rs.getString("PREFERREDLANGUAGE")); - + @Override + public UserInfo mapRow(ResultSet rs, int rowNum) throws SQLException { - userInfo.setWorkEmail(rs.getString("WORKEMAIL")); - userInfo.setWorkPhoneNumber(rs.getString("WORKPHONENUMBER")); - userInfo.setWorkCountry(rs.getString("WORKCOUNTRY")); - userInfo.setWorkRegion(rs.getString("WORKREGION")); - userInfo.setWorkLocality(rs.getString("WORKLOCALITY")); - userInfo.setWorkStreetAddress(rs.getString("WORKSTREETADDRESS")); - userInfo.setWorkAddressFormatted(rs.getString("WORKADDRESSFORMATTED")); - userInfo.setWorkPostalCode(rs.getString("WORKPOSTALCODE")); - userInfo.setWorkFax(rs.getString("WORKFAX")); - - userInfo.setHomeEmail(rs.getString("HOMEEMAIL")); - userInfo.setHomePhoneNumber(rs.getString("HOMEPHONENUMBER")); - userInfo.setHomeCountry(rs.getString("HOMECOUNTRY")); - userInfo.setHomeRegion(rs.getString("HOMEREGION")); - userInfo.setHomeLocality(rs.getString("HOMELOCALITY")); - userInfo.setHomeStreetAddress(rs.getString("HOMESTREETADDRESS")); - userInfo.setHomeAddressFormatted(rs.getString("HOMEADDRESSFORMATTED")); - userInfo.setHomePostalCode(rs.getString("HOMEPOSTALCODE")); - userInfo.setHomeFax(rs.getString("HOMEFAX")); - - userInfo.setEmployeeNumber(rs.getString("EMPLOYEENUMBER")); - userInfo.setDivision(rs.getString("DIVISION")); - userInfo.setCostCenter(rs.getString("COSTCENTER")); - userInfo.setOrganization(rs.getString("ORGANIZATION")); - userInfo.setDepartmentId(rs.getString("DEPARTMENTID")); - userInfo.setDepartment(rs.getString("DEPARTMENT")); - userInfo.setJobTitle(rs.getString("JOBTITLE")); - userInfo.setJobLevel(rs.getString("JOBLEVEL")); - userInfo.setManagerId(rs.getString("MANAGERID")); - userInfo.setManager(rs.getString("MANAGER")); - userInfo.setAssistantId(rs.getString("ASSISTANTID")); - userInfo.setAssistant(rs.getString("ASSISTANT")); - userInfo.setEntryDate(rs.getString("ENTRYDATE"));// - userInfo.setQuitDate(rs.getString("QUITDATE")); - userInfo.setStartWorkDate(rs.getString("STARTWORKDATE"));//STARTWORKDATE - - userInfo.setExtraAttribute(rs.getString("EXTRAATTRIBUTE")); - - userInfo.setCreatedBy(rs.getString("CREATEDBY")); - userInfo.setCreatedDate(rs.getString("CREATEDDATE")); - userInfo.setModifiedBy(rs.getString("MODIFIEDBY")); - userInfo.setModifiedDate(rs.getString("MODIFIEDDATE")); - - userInfo.setStatus(rs.getInt("STATUS")); - userInfo.setGridList(rs.getInt("GRIDLIST")); - userInfo.setDescription(rs.getString("DESCRIPTION")); - - return userInfo; - } + UserInfo userInfo = new UserInfo(); + userInfo.setId(rs.getString("ID")); + userInfo.setUsername(rs.getString("USERNAME")); + userInfo.setPassword(rs.getString("PASSWORD")); + userInfo.setSharedSecret(rs.getString("SHAREDSECRET")); + userInfo.setSharedCounter(rs.getString("SHAREDCOUNTER")); + userInfo.setDecipherable(rs.getString("DECIPHERABLE")); + userInfo.setWindowsAccount(rs.getString("WINDOWSACCOUNT")); + userInfo.setUserType(rs.getString("USERTYPE")); + + userInfo.setDisplayName(rs.getString("DISPLAYNAME")); + userInfo.setNickName(rs.getString("NICKNAME")); + userInfo.setNameZhSpell(rs.getString("NAMEZHSPELL"));// nameZHSpell + userInfo.setNameZhShortSpell(rs.getString("NAMEZHSHORTSPELL"));// nameZHSpell + userInfo.setGivenName(rs.getString("GIVENNAME")); + userInfo.setMiddleName(rs.getString("MIDDLENAME")); + userInfo.setFamilyName(rs.getString("FAMILYNAME")); + userInfo.setHonorificPrefix(rs.getString("HONORIFICPREFIX")); + userInfo.setHonorificSuffix(rs.getString("HONORIFICSUFFIX")); + userInfo.setFormattedName(rs.getString("FORMATTEDNAME")); + + userInfo.setGender(rs.getInt("GENDER")); + userInfo.setBirthDate(rs.getString("BIRTHDATE")); + userInfo.setPicture(rs.getBytes("PICTURE")); + userInfo.setMarried(rs.getInt("MARRIED")); + userInfo.setIdType(rs.getInt("IDTYPE")); + userInfo.setIdCardNo(rs.getString("IDCARDNO")); + userInfo.setWebSite(rs.getString("WEBSITE")); + + userInfo.setAuthnType(rs.getInt("AUTHNTYPE")); + userInfo.setMobile(rs.getString("MOBILE")); + userInfo.setMobileVerified(rs.getInt("MOBILEVERIFIED")); + userInfo.setEmail(rs.getString("EMAIL")); + userInfo.setEmailVerified(rs.getInt("EMAILVERIFIED")); + userInfo.setPasswordQuestion(rs.getString("PASSWORDQUESTION")); + userInfo.setPasswordAnswer(rs.getString("PASSWORDANSWER")); + + userInfo.setAppLoginAuthnType(rs.getInt("APPLOGINAUTHNTYPE")); + userInfo.setAppLoginPassword(rs.getString("APPLOGINPASSWORD")); + userInfo.setProtectedApps(rs.getString("PROTECTEDAPPS")); + + userInfo.setPasswordLastSetTime(rs.getString("PASSWORDLASTSETTIME")); + userInfo.setPasswordSetType(rs.getInt("PASSWORDSETTYPE")); + userInfo.setBadPasswordCount(rs.getInt("BADPASSWORDCOUNT")); + userInfo.setUnLockTime(rs.getString("UNLOCKTIME")); + userInfo.setIsLocked(rs.getInt("ISLOCKED")); + userInfo.setLastLoginTime(rs.getString("LASTLOGINTIME")); + userInfo.setLastLoginIp(rs.getString("LASTLOGINIP")); + userInfo.setLastLogoffTime(rs.getString("LASTLOGOFFTIME")); + userInfo.setLoginCount(rs.getInt("LOGINCOUNT")); + + userInfo.setTimeZone(rs.getString("TIMEZONE")); + userInfo.setLocale(rs.getString("LOCALE")); + userInfo.setPreferredLanguage(rs.getString("PREFERREDLANGUAGE")); + + userInfo.setWorkEmail(rs.getString("WORKEMAIL")); + userInfo.setWorkPhoneNumber(rs.getString("WORKPHONENUMBER")); + userInfo.setWorkCountry(rs.getString("WORKCOUNTRY")); + userInfo.setWorkRegion(rs.getString("WORKREGION")); + userInfo.setWorkLocality(rs.getString("WORKLOCALITY")); + userInfo.setWorkStreetAddress(rs.getString("WORKSTREETADDRESS")); + userInfo.setWorkAddressFormatted(rs.getString("WORKADDRESSFORMATTED")); + userInfo.setWorkPostalCode(rs.getString("WORKPOSTALCODE")); + userInfo.setWorkFax(rs.getString("WORKFAX")); + + userInfo.setHomeEmail(rs.getString("HOMEEMAIL")); + userInfo.setHomePhoneNumber(rs.getString("HOMEPHONENUMBER")); + userInfo.setHomeCountry(rs.getString("HOMECOUNTRY")); + userInfo.setHomeRegion(rs.getString("HOMEREGION")); + userInfo.setHomeLocality(rs.getString("HOMELOCALITY")); + userInfo.setHomeStreetAddress(rs.getString("HOMESTREETADDRESS")); + userInfo.setHomeAddressFormatted(rs.getString("HOMEADDRESSFORMATTED")); + userInfo.setHomePostalCode(rs.getString("HOMEPOSTALCODE")); + userInfo.setHomeFax(rs.getString("HOMEFAX")); + + userInfo.setEmployeeNumber(rs.getString("EMPLOYEENUMBER")); + userInfo.setDivision(rs.getString("DIVISION")); + userInfo.setCostCenter(rs.getString("COSTCENTER")); + userInfo.setOrganization(rs.getString("ORGANIZATION")); + userInfo.setDepartmentId(rs.getString("DEPARTMENTID")); + userInfo.setDepartment(rs.getString("DEPARTMENT")); + userInfo.setJobTitle(rs.getString("JOBTITLE")); + userInfo.setJobLevel(rs.getString("JOBLEVEL")); + userInfo.setManagerId(rs.getString("MANAGERID")); + userInfo.setManager(rs.getString("MANAGER")); + userInfo.setAssistantId(rs.getString("ASSISTANTID")); + userInfo.setAssistant(rs.getString("ASSISTANT")); + userInfo.setEntryDate(rs.getString("ENTRYDATE"));// + userInfo.setQuitDate(rs.getString("QUITDATE")); + userInfo.setStartWorkDate(rs.getString("STARTWORKDATE"));// STARTWORKDATE + + userInfo.setExtraAttribute(rs.getString("EXTRAATTRIBUTE")); + + userInfo.setCreatedBy(rs.getString("CREATEDBY")); + userInfo.setCreatedDate(rs.getString("CREATEDDATE")); + userInfo.setModifiedBy(rs.getString("MODIFIEDBY")); + userInfo.setModifiedDate(rs.getString("MODIFIEDDATE")); + + userInfo.setStatus(rs.getInt("STATUS")); + userInfo.setGridList(rs.getInt("GRIDLIST")); + userInfo.setDescription(rs.getString("DESCRIPTION")); + + return userInfo; + } } diff --git a/maxkey-core/src/main/java/org/maxkey/web/ImageEndpoint.java b/maxkey-core/src/main/java/org/maxkey/web/ImageEndpoint.java index b31c8cd3..d71090e7 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/ImageEndpoint.java +++ b/maxkey-core/src/main/java/org/maxkey/web/ImageEndpoint.java @@ -1,138 +1,174 @@ package org.maxkey.web; +import com.google.code.kaptcha.Producer; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; - import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.maxkey.web.WebConstants; +import org.maxkey.config.ApplicationConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import com.google.code.kaptcha.Producer; /** + * ImageEndpoint Producer Image and captcha. * @author Crystal.Sea * */ @Controller public class ImageEndpoint { - private static final Logger _logger = LoggerFactory.getLogger(ImageEndpoint.class); - - @Autowired - private Producer captchaProducer; + private static final Logger _logger = LoggerFactory.getLogger(ImageEndpoint.class); - /** - * captcha image Producer - * @param request - * @param response - */ - @RequestMapping(value = "/captcha") - public void captchaHandleRequest(HttpServletRequest request,HttpServletResponse response){ - try{ - // Set to expire far in the past. - response.setDateHeader("Expires", 0); - // Set standard HTTP/1.1 no-cache headers. - response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - // Set IE extended HTTP/1.1 no-cache headers (use addHeader). - response.addHeader("Cache-Control", "post-check=0, pre-check=0"); - // Set standard HTTP/1.0 no-cache header. - response.setHeader("Pragma", "no-cache"); - // return a jpeg - response.setContentType("image/jpeg"); - // create the text for the image - String capText = captchaProducer.createText(); - _logger.trace("Sesssion id " + request.getSession().getId() + " , Captcha Text is " + capText); - // store the text in the session - request.getSession().setAttribute(WebConstants.KAPTCHA_SESSION_KEY, capText); - // create the image with the text - BufferedImage bi = captchaProducer.createImage(capText); - ServletOutputStream out = response.getOutputStream(); - // write the data out - ImageIO.write(bi, "jpg", out); + @Autowired + private Producer captchaProducer; - out.flush(); - out.close(); - }catch(Exception e) { - _logger.error("captcha Producer Error " + e.getMessage()); + @Autowired + @Qualifier("applicationConfig") + ApplicationConfig applicationConfig; + + /** + * captcha image Producer. + * + * @param request HttpServletRequest + * @param response HttpServletResponse + */ + @RequestMapping(value = "/captcha") + public void captchaHandleRequest(HttpServletRequest request, HttpServletResponse response) { + try { + + String kaptchaText = captchaProducer.createText(); + if (applicationConfig.getLoginConfig().getCaptchaType() + .equalsIgnoreCase("Arithmetic")) { + Integer intParamA = Integer.valueOf(kaptchaText.substring(0, 1)); + Integer intParamB = Integer.valueOf(kaptchaText.substring(1, 2)); + Integer calculateValue = 0; + if ((intParamA > intParamB) && ((intParamA + intParamB) % 5 > 3)) { + calculateValue = intParamA - intParamB; + kaptchaText = intParamA + "-" + intParamB + "=?"; + } else { + calculateValue = intParamA + intParamB; + kaptchaText = intParamA + "+" + intParamB + "=?"; + } + _logger.trace("Sesssion id " + request.getSession().getId() + + " , Arithmetic calculate Value is " + calculateValue); + request.getSession().setAttribute( + WebConstants.KAPTCHA_SESSION_KEY, calculateValue + ""); + } else { + // store the text in the session + request.getSession().setAttribute(WebConstants.KAPTCHA_SESSION_KEY, kaptchaText); + } + _logger.trace("Sesssion id " + request.getSession().getId() + + " , Captcha Text is " + kaptchaText); + + // create the image with the text + BufferedImage bufferedImage = captchaProducer.createImage(kaptchaText); + producerImage(request,response,bufferedImage); + } catch (Exception e) { + _logger.error("captcha Producer Error " + e.getMessage()); } } - - /** - * image Producer - * @param request - * @param response - * @return - * @throws Exception - */ - @RequestMapping("/image/{id}") - public void imageHandleRequest(HttpServletRequest request,HttpServletResponse response,@PathVariable("id") String id) throws Exception { - // Set to expire far in the past. - response.setDateHeader("Expires", 0); - // Set standard HTTP/1.1 no-cache headers. - response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); - // Set IE extended HTTP/1.1 no-cache headers (use addHeader). - response.addHeader("Cache-Control", "post-check=0, pre-check=0"); - // Set standard HTTP/1.0 no-cache header. - response.setHeader("Pragma", "no-cache"); - // return a jpeg/gif - response.setContentType("image/gif"); - // create the text for the image - byte[]image=(byte[]) request.getSession().getAttribute(id); - //request.getSession().removeAttribute(id); - // create the image with the text - if(image!=null){ - ServletOutputStream out = response.getOutputStream(); - // write the data out - ImageIO.write(byte2BufferedImage(image), "gif", out); - try{ - out.flush(); - }finally{ - out.close(); - } - } + /** + * Session Image Producer. + * + * @param request HttpServletRequest + * @param response HttpServletResponse + */ + + @RequestMapping("/image/{id}") + public void imageHandleRequest(HttpServletRequest request, HttpServletResponse response, + @PathVariable("id") String id) { + try { + // get session image bytes + byte[] image = (byte[]) request.getSession().getAttribute(id); + producerImage(request,response,byte2BufferedImage(image)); + } catch (Exception e) { + _logger.error("captcha Producer Error " + e.getMessage()); + } } - - public static BufferedImage byte2BufferedImage(byte[]imageByte){ - try { - InputStream in = new ByteArrayInputStream(imageByte); - BufferedImage bufferedImage = ImageIO.read(in); - return bufferedImage; - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - public static byte[] bufferedImage2Byte(BufferedImage bufferedImage ){ - try { - ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(); - ImageIO.write(bufferedImage,"gif",byteArrayOutputStream); - return byteArrayOutputStream.toByteArray(); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - public Producer getCaptchaProducer() { - return captchaProducer; - } + /** + * producerImage. + * @param request HttpServletRequest + * @param response HttpServletResponse + * @param bufferedImage BufferedImage + * @throws IOException error + */ + public static void producerImage(HttpServletRequest request, + HttpServletResponse response, + BufferedImage bufferedImage) throws IOException { + // Set to expire far in the past. + response.setDateHeader("Expires", 0); + // Set standard HTTP/1.1 no-cache headers. + response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); + // Set IE extended HTTP/1.1 no-cache headers (use addHeader). + response.addHeader("Cache-Control", "post-check=0, pre-check=0"); + // Set standard HTTP/1.0 no-cache header. + response.setHeader("Pragma", "no-cache"); + // return a jpeg/gif + response.setContentType("image/gif"); + + // create the image + if (bufferedImage != null) { + ServletOutputStream out = response.getOutputStream(); + // write the data out + ImageIO.write(bufferedImage, "gif", out); + try { + out.flush(); + } finally { + out.close(); + } + } + } + + /** + * byte2BufferedImage. + * @param imageByte bytes + * @return + */ + public static BufferedImage byte2BufferedImage(byte[] imageByte) { + try { + InputStream in = new ByteArrayInputStream(imageByte); + BufferedImage bufferedImage = ImageIO.read(in); + return bufferedImage; + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * bufferedImage2Byte. + * @param bufferedImage BufferedImage + * @return + */ + public static byte[] bufferedImage2Byte(BufferedImage bufferedImage) { + try { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ImageIO.write(bufferedImage, "gif", byteArrayOutputStream); + return byteArrayOutputStream.toByteArray(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + public void setCaptchaProducer(Producer captchaProducer) { + this.captchaProducer = captchaProducer; + } + + public void setApplicationConfig(ApplicationConfig applicationConfig) { + this.applicationConfig = applicationConfig; + } - public void setCaptchaProducer(Producer captchaProducer) { - this.captchaProducer = captchaProducer; - } - - } diff --git a/maxkey-core/src/main/java/org/maxkey/web/message/Message.java b/maxkey-core/src/main/java/org/maxkey/web/message/Message.java index 84bad5c4..7feb5118 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/message/Message.java +++ b/maxkey-core/src/main/java/org/maxkey/web/message/Message.java @@ -15,211 +15,213 @@ import org.springframework.validation.FieldError; /** * message类定义 + * * @author Crystal.Sea * */ public class Message { - final static Logger _logger = LoggerFactory.getLogger(Message.class); - //服务名称 - private String serviceName; - //信息内容 - private String message; - //信息代码 - private String code; - //信息对象 - private Object messageObject; - //错误信息 - private ArrayList> errors; - //类型 - private MessageType messageType=MessageType.info; - //操作类型 - private OperateType operateType=OperateType.unknown; - //范围 - MessageScope messageScope=MessageScope.JSON; - - public Message() { - - } - - public Message(String message) { - this.message = message; - this.messageType = MessageType.info; - } - - - public Message(BindingResult result) { - setFieldErrors(result); - } + static final Logger _logger = LoggerFactory.getLogger(Message.class); + // 服务名称 + private String serviceName; + // 信息内容 + private String message; + // 信息代码 + private String code; + // 信息对象 + private Object messageObject; + // 错误信息 + private ArrayList> errors; + // 类型 + private MessageType messageType = MessageType.info; + // 操作类型 + private OperateType operateType = OperateType.unknown; + // 范围 + MessageScope messageScope = MessageScope.JSON; - public Message(String message, String code) { - this.message = message; - this.code = code; - this.messageType = MessageType.info; - } - - public Message(String message, MessageType messageType) { - this.message = message; - this.messageType = messageType; - } - - public Message(String message,BindingResult result) { - this.message = message; - setFieldErrors(result); - } - - public Message(String message, String code, MessageType messageType) { - this.message = message; - this.code = code; - this.messageType = messageType; - } - - public Message(String message,Object messageObject, MessageType messageType, - OperateType operateType) { - this.message = message; - this.messageType = messageType; - this.operateType = operateType; - this.messageObject = messageObject; - WebContext.setMessage(this); - } - - - public Message(String message,Object messageObject, MessageType messageType, - OperateType operateType,MessageScope messageScope) { - this.message = message; - this.messageObject = messageObject; - this.messageType = messageType; - this.operateType = operateType; - this.messageScope= messageScope; - WebContext.setMessage(this); - } - - public Message(String message,Object messageObject,BindingResult result, MessageType messageType, - OperateType operateType,MessageScope messageScope) { - this.message = message; - this.messageObject = messageObject; - this.operateType = operateType; - this.messageScope= messageScope; - setFieldErrors(result); - this.messageType = messageType; - WebContext.setMessage(this); - } - - public Message(String serviceName,String message,Object messageObject,BindingResult result, MessageType messageType, - OperateType operateType,MessageScope messageScope) { - this.serviceName = serviceName; - this.message = message; - this.messageObject = messageObject; - this.operateType = operateType; - this.messageScope= messageScope; - setFieldErrors(result); - this.messageType = messageType; - WebContext.setMessage(this); - } + public Message() { - public Message(String serviceName,String message,Object messageObject,BindingResult result, MessageType messageType, - OperateType operateType,MessageScope messageScope,String code) { - this(serviceName, message, messageObject, result, messageType, operateType, messageScope); - this.code = code; - } + } - /** - * 验证错误组装 - * @param result - */ - public void setFieldErrors(BindingResult result) { - if(result==null) - return; - this.messageType = MessageType.error; - this.errors=new ArrayList>(); - List listFieldError=result.getFieldErrors(); - - for(FieldError fieldError : listFieldError){ - HashMap error=new HashMap(); - error.put("field", fieldError.getField()); - error.put("type", fieldError.getCode()); - error.put("objectName", fieldError.getObjectName()); - String defaultMessageSourceResolvable=fieldError.getCodes()[0]; - String errorMessage=WebContext.getI18nValue(defaultMessageSourceResolvable); - if(errorMessage==null){ - error.put("message", /*fieldError.getField()+" "+*/fieldError.getDefaultMessage()); - }else{ - error.put("message", errorMessage); - } - _logger.debug(""+error); - this.errors.add(error); - } - _logger.debug(""+this.errors); - } - - public void setApplication(){ - WebContext.setMessage(this); - } - /** - * @return the code - */ - public String getCode() { - return code; - } + public Message(String message) { + this.message = message; + this.messageType = MessageType.info; + } - /** - * @param code the code to set - */ - public void setCode(String code) { - this.code = code; - } + public Message(BindingResult result) { + setFieldErrors(result); + } - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } + public Message(String message, String code) { + this.message = message; + this.code = code; + this.messageType = MessageType.info; + } - public MessageType getMessageType() { - return messageType; - } - public void setMessageType(MessageType messageType) { - this.messageType = messageType; - } + public Message(String message, MessageType messageType) { + this.message = message; + this.messageType = messageType; + } - public ArrayList> getErrors() { - return errors; - } + public Message(String message, BindingResult result) { + this.message = message; + setFieldErrors(result); + } - public void setErrors(ArrayList> errors) { - this.errors = errors; - } + public Message(String message, String code, MessageType messageType) { + this.message = message; + this.code = code; + this.messageType = messageType; + } - public OperateType getOperateType() { - return operateType; - } + public Message(String message, Object messageObject, MessageType messageType, OperateType operateType) { + this.message = message; + this.messageType = messageType; + this.operateType = operateType; + this.messageObject = messageObject; + WebContext.setMessage(this); + } - public void setOperateType(OperateType operateType) { - this.operateType = operateType; - } + public Message(String message, Object messageObject, MessageType messageType, OperateType operateType, + MessageScope messageScope) { + this.message = message; + this.messageObject = messageObject; + this.messageType = messageType; + this.operateType = operateType; + this.messageScope = messageScope; + WebContext.setMessage(this); + } - public Object getMessageObject() { - return messageObject; - } + public Message(String message, Object messageObject, BindingResult result, MessageType messageType, + OperateType operateType, MessageScope messageScope) { + this.message = message; + this.messageObject = messageObject; + this.operateType = operateType; + this.messageScope = messageScope; + setFieldErrors(result); + this.messageType = messageType; + WebContext.setMessage(this); + } - public void setMessageObject(Object messageObject) { - this.messageObject = messageObject; - } + public Message(String serviceName, String message, Object messageObject, BindingResult result, + MessageType messageType, OperateType operateType, MessageScope messageScope) { + this.serviceName = serviceName; + this.message = message; + this.messageObject = messageObject; + this.operateType = operateType; + this.messageScope = messageScope; + setFieldErrors(result); + this.messageType = messageType; + WebContext.setMessage(this); + } - public MessageScope getMessageScope() { - return messageScope; - } + public Message(String serviceName, String message, Object messageObject, BindingResult result, + MessageType messageType, OperateType operateType, MessageScope messageScope, String code) { + this(serviceName, message, messageObject, result, messageType, operateType, messageScope); + this.code = code; + } - public void setMessageScope(MessageScope messageScope) { - this.messageScope = messageScope; - } + /** + * 验证错误组装 + * + * @param result + */ + public void setFieldErrors(BindingResult result) { + if (result == null) + return; + this.messageType = MessageType.error; + this.errors = new ArrayList>(); + List listFieldError = result.getFieldErrors(); - public String getServiceName() { - return serviceName; - } + for (FieldError fieldError : listFieldError) { + HashMap error = new HashMap(); + error.put("field", fieldError.getField()); + error.put("type", fieldError.getCode()); + error.put("objectName", fieldError.getObjectName()); + String defaultMessageSourceResolvable = fieldError.getCodes()[0]; + String errorMessage = WebContext.getI18nValue(defaultMessageSourceResolvable); + if (errorMessage == null) { + error.put("message", /* fieldError.getField()+" "+ */fieldError.getDefaultMessage()); + } else { + error.put("message", errorMessage); + } + _logger.debug("" + error); + this.errors.add(error); + } + _logger.debug("" + this.errors); + } + + public void setApplication() { + WebContext.setMessage(this); + } + + /** + * @return the code + */ + public String getCode() { + return code; + } + + /** + * @param code the code to set + */ + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MessageType getMessageType() { + return messageType; + } + + public void setMessageType(MessageType messageType) { + this.messageType = messageType; + } + + public ArrayList> getErrors() { + return errors; + } + + public void setErrors(ArrayList> errors) { + this.errors = errors; + } + + public OperateType getOperateType() { + return operateType; + } + + public void setOperateType(OperateType operateType) { + this.operateType = operateType; + } + + public Object getMessageObject() { + return messageObject; + } + + public void setMessageObject(Object messageObject) { + this.messageObject = messageObject; + } + + public MessageScope getMessageScope() { + return messageScope; + } + + public void setMessageScope(MessageScope messageScope) { + this.messageScope = messageScope; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - } diff --git a/maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java b/maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java index c27d7a78..59ae7103 100644 --- a/maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java +++ b/maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java @@ -43,14 +43,15 @@ public class UserInfoService extends JpaBaseService { return (UserInfoMapper)super.getMapper(); } - public boolean insert(UserInfo userinfo) { - if(super.insert(userinfo)){ - - return true; - } - - return false; - } + public boolean insert(UserInfo userInfo) { + userInfo = passwordEncoder(userInfo); + if (super.insert(userInfo)) { + + return true; + } + + return false; + } public boolean update(UserInfo userinfo) { if(super.update(userinfo)){ @@ -102,20 +103,25 @@ public class UserInfoService extends JpaBaseService { e.printStackTrace(); } } - + + public UserInfo passwordEncoder(UserInfo userInfo) { + String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())); + userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()))); + _logger.debug("decipherable : "+userInfo.getDecipherable()); + userInfo.setPassword(password); + userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString()); + + userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString()); + + return userInfo; + } public boolean changePassword(UserInfo userInfo) { try { if(WebContext.getUserInfo() != null) { userInfo.setModifiedBy(WebContext.getUserInfo().getId()); } - String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())); - userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()))); - _logger.debug("decipherable : "+userInfo.getDecipherable()); - userInfo.setPassword(password); - userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString()); - - userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString()); + userInfo = passwordEncoder(userInfo); if(getMapper().changePassword(userInfo) > 0){ ChangePassword changePassword=new ChangePassword(); diff --git a/maxkey-lib/mybatis-jpa-extra-1.0.jar b/maxkey-lib/mybatis-jpa-extra-1.0.jar deleted file mode 100644 index 9d0a3867..00000000 Binary files a/maxkey-lib/mybatis-jpa-extra-1.0.jar and /dev/null differ diff --git a/maxkey-lib/mybatis-jpa-extra-2.0.jar b/maxkey-lib/mybatis-jpa-extra-2.0.jar new file mode 100644 index 00000000..e6f675e4 Binary files /dev/null and b/maxkey-lib/mybatis-jpa-extra-2.0.jar differ diff --git a/maxkey-lib/mybatis-jpa-extra-2.1-api-1.0.jar b/maxkey-lib/mybatis-jpa-extra-2.1-api-1.0.jar deleted file mode 100644 index 9bf91655..00000000 Binary files a/maxkey-lib/mybatis-jpa-extra-2.1-api-1.0.jar and /dev/null differ diff --git a/maxkey-lib/mybatis-jpa-extra-2.1-api-2.0.jar b/maxkey-lib/mybatis-jpa-extra-2.1-api-2.0.jar new file mode 100644 index 00000000..c7e3f78d Binary files /dev/null and b/maxkey-lib/mybatis-jpa-extra-2.1-api-2.0.jar differ diff --git a/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java b/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java index 43c59e67..8d05ee13 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java @@ -199,7 +199,7 @@ public class UserInfoController { * @return */ @ResponseBody - @RequestMapping(value="/delete",method=RequestMethod.DELETE) + @RequestMapping(value="/delete") public Message deleteUsersById(@RequestParam("id") String id) { _logger.debug(id); if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) { diff --git a/maxkey-web-manage/src/main/resources/config/applicationConfig.properties b/maxkey-web-manage/src/main/resources/config/applicationConfig.properties index 93accc6e..fa2fcec8 100644 --- a/maxkey-web-manage/src/main/resources/config/applicationConfig.properties +++ b/maxkey-web-manage/src/main/resources/config/applicationConfig.properties @@ -51,6 +51,8 @@ config.characterencoding.tocharset=UTF-8 ############################################################################ # Login config.login.captcha=false +#text or arithmetic +config.login.captcha.type=text config.login.socialAuth=true config.login.msad.kerberos=false # End Login diff --git a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-persistence.xml b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-persistence.xml index bb7fbf9c..e271d120 100644 --- a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-persistence.xml +++ b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-persistence.xml @@ -62,6 +62,8 @@ + + @@ -70,32 +72,13 @@ org.maxkey.domain, org.maxkey.domain.apps, " /> - - - - - - - - - - - - - - - - - - - - 70 - 25 - no - com.google.code.kaptcha.impl.ShadowGimpy - 23 - 0123456789 - 4 - com.google.code.kaptcha.impl.NoNoise - - - - - + + + + + 80 + 25 + no + com.google.code.kaptcha.impl.ShadowGimpy + 23 + 0123456789 + 4 + com.google.code.kaptcha.impl.NoNoise + + + + + diff --git a/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsAdd.ftl index c9bdd46f..23bd6124 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/orgs/orgsAdd.ftl @@ -51,11 +51,11 @@ $(function () { <@locale code="org.name" />: - + <@locale code="org.fullname" />: - + <@locale code="org.xpath" /> : diff --git a/maxkey-web-manage/src/main/resources/templates/views/userinfo/userAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/userinfo/userAdd.ftl index 9dabe675..07584cbc 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/userinfo/userAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/userinfo/userAdd.ftl @@ -51,11 +51,11 @@ <@locale code="userinfo.username" />: - + <@locale code="login.text.password" />: - + @@ -88,7 +88,7 @@ <@locale code="userinfo.displayName" />: - + <@locale code="userinfo.picture" />: diff --git a/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties b/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties index dc844e65..e3d21aa0 100644 --- a/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties +++ b/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties @@ -40,12 +40,12 @@ config.datasource.password.encrypt=false ############################################################################ # EMAIL configuration ############################################################################ -config.email.username=test@maxkey.org -config.email.password=3&8Ujbnm5hkjhFD -config.email.smtpHost=smtp.exmail.qq.com -config.email.port=25 -config.email.senderMail=test@maxkey.org -config.email.ssl=false +config.email.username=shimingxy@163.com +config.email.password=seamingxy99 +config.email.smtpHost=smtp.163.com +config.email.port=465 +config.email.senderMail=shimingxy@163.com +config.email.ssl=true ############################################################################ # CharacterEncoding configuration @@ -79,6 +79,8 @@ config.redis.pool.testonborrow=true # Login configuration #enable captcha config.login.captcha=true +#text or arithmetic +config.login.captcha.type=text #enable two factor,use one time password config.login.onetimepwd=true #enable social sign on diff --git a/maxkey-web-maxkey/src/main/resources/spring/maxkey-persistence.xml b/maxkey-web-maxkey/src/main/resources/spring/maxkey-persistence.xml index 92175846..b17e1305 100644 --- a/maxkey-web-maxkey/src/main/resources/spring/maxkey-persistence.xml +++ b/maxkey-web-maxkey/src/main/resources/spring/maxkey-persistence.xml @@ -60,6 +60,8 @@ + + @@ -68,27 +70,9 @@ org.maxkey.domain, org.maxkey.domain.apps, " /> - - - - - - - - - - - - - - diff --git a/maxkey-web-maxkey/src/main/resources/spring/maxkey-security.xml b/maxkey-web-maxkey/src/main/resources/spring/maxkey-security.xml index fb0f3af5..592e1266 100644 --- a/maxkey-web-maxkey/src/main/resources/spring/maxkey-security.xml +++ b/maxkey-web-maxkey/src/main/resources/spring/maxkey-security.xml @@ -127,26 +127,28 @@ + - - - - 70 - 25 - no - com.google.code.kaptcha.impl.ShadowGimpy - 23 - 0123456789 - 4 - com.google.code.kaptcha.impl.NoNoise - - - - - + + + + 80 + 25 + no + com.google.code.kaptcha.impl.ShadowGimpy + 23 + 0123456789 + 4 + com.google.code.kaptcha.impl.NoNoise + + + + +