v1.3.1 FIX

1、验证增强,增加算术验证码支持
2、修复新增用户时报错
3、修复操作日志报错
4、mybatis-jpa-extra升级到v2.0
上级 20497c4a
......@@ -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() {
......
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;
String startDate;
String endDate;
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 getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
}
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;
}
/**
*
*/
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();
}
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 getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
}
/**
* @return the username
*/
public String getUsername() {
return username;
}
/**
* @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 void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
}
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<String, String> 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<String, String> 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<String, String> getProtectedAppsMap() {
if (protectedAppsMap == null) {
protectedAppsMap = new HashMap<String, String>();
}
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;
}
/**
*
*/
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<String,String> 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<String,String> 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<String, String> getProtectedAppsMap() {
if(protectedAppsMap==null){
protectedAppsMap=new HashMap<String,String>();
}
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 String getMiddleName() {
return middleName;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getFamilyName() {
return familyName;
}
public String getFamilyName() {
return familyName;
}
public void setFamilyName(String familyName) {
this.familyName = familyName;
}
public void setFamilyName(String familyName) {
this.familyName = familyName;
}
public String getHonorificPrefix() {
return honorificPrefix;
}
public String getHonorificPrefix() {
return honorificPrefix;
}
public void setHonorificPrefix(String honorificPrefix) {
this.honorificPrefix = honorificPrefix;
}
public void setHonorificPrefix(String honorificPrefix) {
this.honorificPrefix = honorificPrefix;
}
public String getHonorificSuffix() {
return honorificSuffix;
}
public String getHonorificSuffix() {
return honorificSuffix;
}
public void setHonorificSuffix(String honorificSuffix) {
this.honorificSuffix = honorificSuffix;
}
public void setHonorificSuffix(String honorificSuffix) {
this.honorificSuffix = honorificSuffix;
}
public String getFormattedName() {
return formattedName;
}
public String getFormattedName() {
return formattedName;
}
public void setFormattedName(String formattedName) {
this.formattedName = formattedName;
}
public void setFormattedName(String formattedName) {
this.formattedName = formattedName;
}
public int getMarried() {
return married;
}
public int getMarried() {
return married;
}
public void setMarried(int married) {
this.married = married;
}
public void setMarried(int married) {
this.married = married;
}
public int getGender() {
return gender;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public String getBirthDate() {
return birthDate;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public MultipartFile getPictureFile() {
return pictureFile;
}
public MultipartFile getPictureFile() {
return pictureFile;
}
public void setPictureFile(MultipartFile pictureFile) {
this.pictureFile = pictureFile;
}
public void setPictureFile(MultipartFile pictureFile) {
this.pictureFile = pictureFile;
}
public int getIdType() {
return idType;
}
public int getIdType() {
return idType;
}
public void setIdType(int idType) {
this.idType = idType;
}
public void setIdType(int idType) {
this.idType = idType;
}
public String getIdCardNo() {
return idCardNo;
}
public String getIdCardNo() {
return idCardNo;
}
public void setIdCardNo(String idCardNo) {
this.idCardNo = idCardNo;
}
public void setIdCardNo(String idCardNo) {
this.idCardNo = idCardNo;
}
public String getWebSite() {
return webSite;
}
public String getWebSite() {
return webSite;
}
public void setWebSite(String webSite) {
this.webSite = webSite;
}
public void setWebSite(String webSite) {
this.webSite = webSite;
}
public String getStartWorkDate() {
return startWorkDate;
}
public String getStartWorkDate() {
return startWorkDate;
}
public void setStartWorkDate(String startWorkDate) {
this.startWorkDate = startWorkDate;
}
public void setStartWorkDate(String startWorkDate) {
this.startWorkDate = startWorkDate;
}
public int getAuthnType() {
return authnType;
}
public int getAuthnType() {
return authnType;
}
public void setAuthnType(int authnType) {
this.authnType = authnType;
}
public void setAuthnType(int authnType) {
this.authnType = authnType;
}
public String getEmail() {
return email;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public void setEmail(String email) {
this.email = email;
}
public int getEmailVerified() {
return emailVerified;
}
public int getEmailVerified() {
return emailVerified;
}
public void setEmailVerified(int emailVerified) {
this.emailVerified = emailVerified;
}
public void setEmailVerified(int emailVerified) {
this.emailVerified = emailVerified;
}
public String getMobile() {
return mobile;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public int getMobileVerified() {
return mobileVerified;
}
public int getMobileVerified() {
return mobileVerified;
}
public void setMobileVerified(int mobileVerified) {
this.mobileVerified = mobileVerified;
}
public void setMobileVerified(int mobileVerified) {
this.mobileVerified = mobileVerified;
}
public String getPasswordQuestion() {
return passwordQuestion;
}
public String getPasswordQuestion() {
return passwordQuestion;
}
public void setPasswordQuestion(String passwordQuestion) {
this.passwordQuestion = passwordQuestion;
}
public void setPasswordQuestion(String passwordQuestion) {
this.passwordQuestion = passwordQuestion;
}
public String getPasswordAnswer() {
return passwordAnswer;
}
public String getPasswordAnswer() {
return passwordAnswer;
}
public void setPasswordAnswer(String passwordAnswer) {
this.passwordAnswer = passwordAnswer;
}
public void setPasswordAnswer(String passwordAnswer) {
this.passwordAnswer = passwordAnswer;
}
public int getAppLoginAuthnType() {
return appLoginAuthnType;
}
public int getAppLoginAuthnType() {
return appLoginAuthnType;
}
public void setAppLoginAuthnType(int appLoginAuthnType) {
this.appLoginAuthnType = appLoginAuthnType;
}
public void setAppLoginAuthnType(int appLoginAuthnType) {
this.appLoginAuthnType = appLoginAuthnType;
}
public String getAppLoginPassword() {
return appLoginPassword;
}
public String getAppLoginPassword() {
return appLoginPassword;
}
public void setAppLoginPassword(String appLoginPassword) {
this.appLoginPassword = appLoginPassword;
}
public void setAppLoginPassword(String appLoginPassword) {
this.appLoginPassword = appLoginPassword;
}
public String getProtectedApps() {
return protectedApps;
}
public String getProtectedApps() {
return protectedApps;
}
public void setProtectedApps(String protectedApps) {
this.protectedApps = protectedApps;
}
public void setProtectedApps(String protectedApps) {
this.protectedApps = protectedApps;
}
public String getPasswordLastSetTime() {
return passwordLastSetTime;
}
public String getPasswordLastSetTime() {
return passwordLastSetTime;
}
public void setPasswordLastSetTime(String passwordLastSetTime) {
this.passwordLastSetTime = passwordLastSetTime;
}
public void setPasswordLastSetTime(String passwordLastSetTime) {
this.passwordLastSetTime = passwordLastSetTime;
}
public int getBadPasswordCount() {
return badPasswordCount;
}
public int getBadPasswordCount() {
return badPasswordCount;
}
public void setBadPasswordCount(int badPasswordCount) {
this.badPasswordCount = badPasswordCount;
}
public void setBadPasswordCount(int badPasswordCount) {
this.badPasswordCount = badPasswordCount;
}
public String getUnLockTime() {
return unLockTime;
}
public String getUnLockTime() {
return unLockTime;
}
public void setUnLockTime(String unLockTime) {
this.unLockTime = unLockTime;
}
public void setUnLockTime(String unLockTime) {
this.unLockTime = unLockTime;
}
public int getIsLocked() {
return isLocked;
}
public int getIsLocked() {
return isLocked;
}
public void setIsLocked(int isLocked) {
this.isLocked = isLocked;
}
public void setIsLocked(int isLocked) {
this.isLocked = isLocked;
}
public String getLastLoginTime() {
return lastLoginTime;
}
public String getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getLastLogoffTime() {
return lastLogoffTime;
}
public String getLastLogoffTime() {
return lastLogoffTime;
}
public void setLastLogoffTime(String lastLogoffTime) {
this.lastLogoffTime = lastLogoffTime;
}
public void setLastLogoffTime(String lastLogoffTime) {
this.lastLogoffTime = lastLogoffTime;
}
public int getPasswordSetType() {
return passwordSetType;
}
public int getPasswordSetType() {
return passwordSetType;
}
public void setPasswordSetType(int passwordSetType) {
this.passwordSetType = passwordSetType;
}
public void setPasswordSetType(int passwordSetType) {
this.passwordSetType = passwordSetType;
}
public String getLocale() {
return locale;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public String getTimeZone() {
return timeZone;
}
public String getTimeZone() {
return timeZone;
}
public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}
public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}
public String getPreferredLanguage() {
return preferredLanguage;
}
public String getPreferredLanguage() {
return preferredLanguage;
}
public void setPreferredLanguage(String preferredLanguage) {
this.preferredLanguage = preferredLanguage;
}
public void setPreferredLanguage(String preferredLanguage) {
this.preferredLanguage = preferredLanguage;
}
public String getWorkCountry() {
return workCountry;
}
public String getWorkCountry() {
return workCountry;
}
public void setWorkCountry(String workCountry) {
this.workCountry = workCountry;
}
public void setWorkCountry(String workCountry) {
this.workCountry = workCountry;
}
public String getWorkRegion() {
return workRegion;
}
public String getWorkRegion() {
return workRegion;
}
public void setWorkRegion(String workRegion) {
this.workRegion = workRegion;
}
public void setWorkRegion(String workRegion) {
this.workRegion = workRegion;
}
public String getWorkLocality() {
return workLocality;
}
public String getWorkLocality() {
return workLocality;
}
public void setWorkLocality(String workLocality) {
this.workLocality = workLocality;
}
public void setWorkLocality(String workLocality) {
this.workLocality = workLocality;
}
public String getWorkStreetAddress() {
return workStreetAddress;
}
public String getWorkStreetAddress() {
return workStreetAddress;
}
public void setWorkStreetAddress(String workStreetAddress) {
this.workStreetAddress = workStreetAddress;
}
public void setWorkStreetAddress(String workStreetAddress) {
this.workStreetAddress = workStreetAddress;
}
public String getWorkAddressFormatted() {
return workAddressFormatted;
}
public String getWorkAddressFormatted() {
return workAddressFormatted;
}
public void setWorkAddressFormatted(String workAddressFormatted) {
this.workAddressFormatted = workAddressFormatted;
}
public void setWorkAddressFormatted(String workAddressFormatted) {
this.workAddressFormatted = workAddressFormatted;
}
public String getWorkEmail() {
return workEmail;
}
public String getWorkEmail() {
return workEmail;
}
public void setWorkEmail(String workEmail) {
this.workEmail = workEmail;
}
public void setWorkEmail(String workEmail) {
this.workEmail = workEmail;
}
public String getWorkPhoneNumber() {
return workPhoneNumber;
}
public String getWorkPhoneNumber() {
return workPhoneNumber;
}
public void setWorkPhoneNumber(String workPhoneNumber) {
this.workPhoneNumber = workPhoneNumber;
}
public void setWorkPhoneNumber(String workPhoneNumber) {
this.workPhoneNumber = workPhoneNumber;
}
public String getWorkPostalCode() {
return workPostalCode;
}
public String getWorkPostalCode() {
return workPostalCode;
}
public void setWorkPostalCode(String workPostalCode) {
this.workPostalCode = workPostalCode;
}
public void setWorkPostalCode(String workPostalCode) {
this.workPostalCode = workPostalCode;
}
public String getWorkFax() {
return workFax;
}
public String getWorkFax() {
return workFax;
}
public void setWorkFax(String workFax) {
this.workFax = workFax;
}
public void setWorkFax(String workFax) {
this.workFax = workFax;
}
public String getHomeCountry() {
return homeCountry;
}
public String getHomeCountry() {
return homeCountry;
}
public void setHomeCountry(String homeCountry) {
this.homeCountry = homeCountry;
}
public void setHomeCountry(String homeCountry) {
this.homeCountry = homeCountry;
}
public String getHomeRegion() {
return homeRegion;
}
public String getHomeRegion() {
return homeRegion;
}
public void setHomeRegion(String homeRegion) {
this.homeRegion = homeRegion;
}
public void setHomeRegion(String homeRegion) {
this.homeRegion = homeRegion;
}
public String getHomeLocality() {
return homeLocality;
}
public String getHomeLocality() {
return homeLocality;
}
public void setHomeLocality(String homeLocality) {
this.homeLocality = homeLocality;
}
public void setHomeLocality(String homeLocality) {
this.homeLocality = homeLocality;
}
public String getHomeStreetAddress() {
return homeStreetAddress;
}
public String getHomeStreetAddress() {
return homeStreetAddress;
}
public void setHomeStreetAddress(String homeStreetAddress) {
this.homeStreetAddress = homeStreetAddress;
}
public void setHomeStreetAddress(String homeStreetAddress) {
this.homeStreetAddress = homeStreetAddress;
}
public String getHomeAddressFormatted() {
return homeAddressFormatted;
}
public String getHomeAddressFormatted() {
return homeAddressFormatted;
}
public void setHomeAddressFormatted(String homeAddressFormatted) {
this.homeAddressFormatted = homeAddressFormatted;
}
public void setHomeAddressFormatted(String homeAddressFormatted) {
this.homeAddressFormatted = homeAddressFormatted;
}
public String getHomeEmail() {
return homeEmail;
}
public String getHomeEmail() {
return homeEmail;
}
public void setHomeEmail(String homeEmail) {
this.homeEmail = homeEmail;
}
public void setHomeEmail(String homeEmail) {
this.homeEmail = homeEmail;
}
public String getHomePhoneNumber() {
return homePhoneNumber;
}
public String getHomePhoneNumber() {
return homePhoneNumber;
}
public void setHomePhoneNumber(String homePhoneNumber) {
this.homePhoneNumber = homePhoneNumber;
}
public void setHomePhoneNumber(String homePhoneNumber) {
this.homePhoneNumber = homePhoneNumber;
}
public String getHomePostalCode() {
return homePostalCode;
}
public String getHomePostalCode() {
return homePostalCode;
}
public void setHomePostalCode(String homePostalCode) {
this.homePostalCode = homePostalCode;
}
public void setHomePostalCode(String homePostalCode) {
this.homePostalCode = homePostalCode;
}
public String getHomeFax() {
return homeFax;
}
public String getHomeFax() {
return homeFax;
}
public void setHomeFax(String homeFax) {
this.homeFax = homeFax;
}
public void setHomeFax(String homeFax) {
this.homeFax = homeFax;
}
public String getEmployeeNumber() {
return employeeNumber;
}
public String getEmployeeNumber() {
return employeeNumber;
}
public void setEmployeeNumber(String employeeNumber) {
this.employeeNumber = employeeNumber;
}
public void setEmployeeNumber(String employeeNumber) {
this.employeeNumber = employeeNumber;
}
public String getCostCenter() {
return costCenter;
}
public String getCostCenter() {
return costCenter;
}
public void setCostCenter(String costCenter) {
this.costCenter = costCenter;
}
public void setCostCenter(String costCenter) {
this.costCenter = costCenter;
}
public String getOrganization() {
return organization;
}
public String getOrganization() {
return organization;
}
public void setOrganization(String organization) {
this.organization = organization;
}
public void setOrganization(String organization) {
this.organization = organization;
}
public String getDivision() {
return division;
}
public String getDivision() {
return division;
}
public void setDivision(String division) {
this.division = division;
}
public void setDivision(String division) {
this.division = division;
}
public String getDepartmentId() {
return departmentId;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartment() {
return department;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getJobTitle() {
return jobTitle;
}
public String getJobTitle() {
return jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
public String getJobLevel() {
return jobLevel;
}
public String getJobLevel() {
return jobLevel;
}
public void setJobLevel(String jobLevel) {
this.jobLevel = jobLevel;
}
public void setJobLevel(String jobLevel) {
this.jobLevel = jobLevel;
}
public String getManagerId() {
return managerId;
}
public String getManagerId() {
return managerId;
}
public void setManagerId(String managerId) {
this.managerId = managerId;
}
public void setManagerId(String managerId) {
this.managerId = managerId;
}
public String getManager() {
return manager;
}
public String getManager() {
return manager;
}
public void setManager(String manager) {
this.manager = manager;
}
public void setManager(String manager) {
this.manager = manager;
}
public String getAssistantId() {
return assistantId;
}
public String getAssistantId() {
return assistantId;
}
public void setAssistantId(String assistantId) {
this.assistantId = assistantId;
}
public void setAssistantId(String assistantId) {
this.assistantId = assistantId;
}
public String getAssistant() {
return assistant;
}
public String getAssistant() {
return assistant;
}
public void setAssistant(String assistant) {
this.assistant = assistant;
}
public void setAssistant(String assistant) {
this.assistant = assistant;
}
public String getEntryDate() {
return entryDate;
}
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 void setEntryDate(String entryDate) {
this.entryDate = entryDate;
}
public void setExtraAttribute(String extraAttribute) {
this.extraAttribute = extraAttribute;
}
public String getQuitDate() {
return quitDate;
}
public String getExtraAttributeName() {
return extraAttributeName;
}
public void setQuitDate(String quitDate) {
this.quitDate = quitDate;
}
public void setExtraAttributeName(String extraAttributeName) {
this.extraAttributeName = extraAttributeName;
}
public String getExtraAttributeValue() {
return extraAttributeValue;
}
public void setExtraAttributeValue(String extraAttributeValue) {
this.extraAttributeValue = extraAttributeValue;
}
public HashMap<String, String> getExtraAttributeMap() {
return extraAttributeMap;
}
public void setExtraAttributeMap(HashMap<String, String> 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<String, String> 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 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<String, String> getExtraAttributeMap() {
return extraAttributeMap;
}
public void setExtraAttributeMap(HashMap<String, String> 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<String, String> 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;
}
}
......@@ -6,114 +6,113 @@ import java.sql.SQLException;
import org.maxkey.domain.UserInfo;
import org.springframework.jdbc.core.RowMapper;
public class UserInfoRowMapper implements RowMapper<UserInfo> {
@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"));
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;
}
public class UserInfoRowMapper implements RowMapper<UserInfo> {
@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"));
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;
}
}
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());
}
}
/**
* 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();
}
}
}
public static BufferedImage byte2BufferedImage(byte[]imageByte){
/**
* 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;
}
public static byte[] bufferedImage2Byte(BufferedImage bufferedImage ){
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;
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "gif", byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public Producer getCaptchaProducer() {
return captchaProducer;
}
public void setCaptchaProducer(Producer captchaProducer) {
this.captchaProducer = captchaProducer;
}
public void setApplicationConfig(ApplicationConfig applicationConfig) {
this.applicationConfig = applicationConfig;
}
public void setCaptchaProducer(Producer captchaProducer) {
this.captchaProducer = captchaProducer;
}
}
......@@ -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<HashMap<String,Object>> 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);
}
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(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<HashMap<String,Object>>();
List<FieldError> listFieldError=result.getFieldErrors();
for(FieldError fieldError : listFieldError){
HashMap<String,Object> error=new HashMap<String,Object>();
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<HashMap<String, Object>> getErrors() {
return errors;
}
public void setErrors(ArrayList<HashMap<String, Object>> 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;
}
static final Logger _logger = LoggerFactory.getLogger(Message.class);
// 服务名称
private String serviceName;
// 信息内容
private String message;
// 信息代码
private String code;
// 信息对象
private Object messageObject;
// 错误信息
private ArrayList<HashMap<String, Object>> 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);
}
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(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<HashMap<String, Object>>();
List<FieldError> listFieldError = result.getFieldErrors();
for (FieldError fieldError : listFieldError) {
HashMap<String, Object> error = new HashMap<String, Object>();
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<HashMap<String, Object>> getErrors() {
return errors;
}
public void setErrors(ArrayList<HashMap<String, Object>> 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;
}
}
......@@ -43,14 +43,15 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
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<UserInfo> {
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();
......
......@@ -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, ","))) {
......
......@@ -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
......
......@@ -62,6 +62,8 @@
<!--<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">-->
<bean id="sqlSessionFactory" class="org.apache.mybatis.jpa.MyBatisSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="dialect" value="mysql" />
<property name="timeout" value="30" />
<property name="transactionFactory">
<bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" />
</property>
......@@ -70,32 +72,13 @@
org.maxkey.domain,
org.maxkey.domain.apps,
" />
<property name="timeout" value="30" />
<property name="mapperLocations" value="classpath*:org/maxkey/dao/persistence/xml/#{dataSoruceConfig.database}/*.xml" />
<property name="interceptors">
<list>
<ref bean="StatementHandlerInterceptor"/>
</list>
</property>
</bean>
<bean id="StatementHandlerInterceptor" class="org.apache.mybatis.jpa.StatementHandlerInterceptor">
<!-- dialect need bean dialect
<property name="dialect">
<bean id="dialect" class="org.apache.mybatis.jpa.dialect.MySQLDialect"/>
</property>
-->
<!-- from database type -->
<property name="dialectString" value="#{dataSoruceConfig.dialect}"/>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<!-- scan for mappers and let them be autowired -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage"
......
......@@ -117,24 +117,23 @@
<!-- Captcha Producer Config -->
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
<property name="config">
<bean class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">70</prop>
<prop key="kaptcha.image.height">25</prop>
<prop key="kaptcha.border">no</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.textproducer.font.size">23</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- <prop key="kaptcha.noise.color">white</prop>
-->
</props>
</constructor-arg>
</bean>
</property>
<property name="config" >
<bean id="kaptchaConfig" class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">80</prop>
<prop key="kaptcha.image.height">25</prop>
<prop key="kaptcha.border">no</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.textproducer.font.size">23</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- <prop key="kaptcha.noise.color">white</prop> -->
</props>
</constructor-arg>
</bean>
</property>
</bean>
<bean id="savedRequestSuccessHandler" class="org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler"> </bean>
......
......@@ -51,11 +51,11 @@ $(function () {
</tr>
<tr>
<td > <@locale code="org.name" /></td>
<td><input type="text" id="name" name="name" class="form-control"/></td>
<td><input type="text" id="name" name="name" required="" class="form-control"/></td>
</tr>
<tr>
<td > <@locale code="org.fullname" /></td>
<td><input type="text" id="fullName" name="fullName" class="form-control"/></td>
<td><input type="text" id="fullName" name="fullName" required="" class="form-control"/></td>
</tr>
<tr >
<td > <@locale code="org.xpath" />
......
......@@ -51,11 +51,11 @@
<td style="width:15%;"><@locale code="userinfo.username" /></td>
<td style="width:35%;">
<input type="hidden" id="id" name="id" value=""/>
<input class="form-control" type="text" id="username" name="username" title="" value=""/>
<input class="form-control" type="text" required="" id="username" name="username" title="" value=""/>
</td>
<td style="width:15%;"><@locale code="login.text.password" /></td>
<td style="width:35%;">
<input class="form-control" type="password" id="password" name="password" title="" value=""/>
<input class="form-control" type="password" required="" id="password" name="password" title="" value=""/>
</td>
</tr>
<tr>
......@@ -88,7 +88,7 @@
<tr>
<td><@locale code="userinfo.displayName" /></td>
<td>
<input class="form-control" type="text" id="displayName" name="displayName" title="" value=""/>
<input class="form-control" type="text" required="" id="displayName" name="displayName" title="" value=""/>
</td>
<td rowspan="4"><@locale code="userinfo.picture" /></td>
<td rowspan="4">
......
......@@ -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
......
......@@ -60,6 +60,8 @@
<!--<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">-->
<bean id="sqlSessionFactory" class="org.apache.mybatis.jpa.MyBatisSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="dialect" value="mysql" />
<property name="timeout" value="30" />
<property name="transactionFactory">
<bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" />
</property>
......@@ -68,27 +70,9 @@
org.maxkey.domain,
org.maxkey.domain.apps,
" />
<property name="timeout" value="30" />
<property name="mapperLocations" value="classpath*:/org/maxkey/dao/persistence/xml/#{dataSoruceConfig.database}/*.xml" />
<property name="interceptors">
<list>
<ref bean="StatementHandlerInterceptor"/>
</list>
</property>
</bean>
<bean id="StatementHandlerInterceptor" class="org.apache.mybatis.jpa.StatementHandlerInterceptor">
<!-- dialect need bean dialect
<property name="dialect">
<bean id="dialect" class="org.apache.mybatis.jpa.dialect.MySQLDialect"/>
</property>
-->
<!-- from database type -->
<property name="dialectString" value="#{dataSoruceConfig.dialect}"/>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
......
......@@ -127,26 +127,28 @@
</property>
</bean>
<!-- Captcha Producer Config -->
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
<property name="config">
<bean class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">70</prop>
<prop key="kaptcha.image.height">25</prop>
<prop key="kaptcha.border">no</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.textproducer.font.size">23</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- <prop key="kaptcha.noise.color">white</prop>
-->
</props>
</constructor-arg>
</bean>
</property>
<bean id="kaptchaConfig" class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">80</prop>
<prop key="kaptcha.image.height">25</prop>
<prop key="kaptcha.border">no</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.textproducer.font.size">23</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- 干扰线
<prop key="kaptcha.noise.color">white</prop>
-->
</props>
</constructor-arg>
</bean>
</property>
</bean>
<bean id="savedRequestSuccessHandler" class="org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler"> </bean>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册