fix format
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import java.util.List;
|
||||
import org.maxkey.constants.OPERATEMESSAGE;
|
||||
import org.maxkey.constants.PROTOCOLS;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.constants.ConstantsProtocols;
|
||||
import org.maxkey.crypto.ReciprocalUtils;
|
||||
import org.maxkey.dao.service.AccountsService;
|
||||
import org.maxkey.dao.service.AppsService;
|
||||
@@ -171,10 +171,10 @@ public class AppListController {
|
||||
|
||||
userInfoService.updateProtectedApps(userInfo);
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR), MessageType.error);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR), MessageType.error);
|
||||
}
|
||||
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS), MessageType.success);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS), MessageType.success);
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/forward/appUserConfig/{protocol}/{credential}/{appId}" })
|
||||
@@ -187,12 +187,12 @@ public class AppListController {
|
||||
UserInfo userInfo = WebContext.getUserInfo();
|
||||
if (credential == Apps.CREDENTIALS.USER_DEFINED) {
|
||||
appUsers = appUsersService.load(new Accounts(userInfo.getId(), appId));
|
||||
if (protocol.equalsIgnoreCase(PROTOCOLS.DESKTOP) || protocol.equalsIgnoreCase(PROTOCOLS.FORMBASED)
|
||||
|| protocol.equalsIgnoreCase(PROTOCOLS.BASIC) || protocol.equalsIgnoreCase(PROTOCOLS.EXTEND_API)) {
|
||||
if (protocol.equalsIgnoreCase(ConstantsProtocols.DESKTOP) || protocol.equalsIgnoreCase(ConstantsProtocols.FORMBASED)
|
||||
|| protocol.equalsIgnoreCase(ConstantsProtocols.BASIC) || protocol.equalsIgnoreCase(ConstantsProtocols.EXTEND_API)) {
|
||||
|
||||
modelAndView.addObject("username", true);
|
||||
modelAndView.addObject("password", true);
|
||||
} else if (protocol.equalsIgnoreCase(PROTOCOLS.SAML20)) {
|
||||
} else if (protocol.equalsIgnoreCase(ConstantsProtocols.SAML20)) {
|
||||
modelAndView.addObject("username", true);
|
||||
modelAndView.addObject("password", false);
|
||||
} else {
|
||||
@@ -253,6 +253,6 @@ public class AppListController {
|
||||
}
|
||||
}
|
||||
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS), MessageType.success);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS), MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import org.maxkey.constants.OPERATEMESSAGE;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.dao.service.MyProfileService;
|
||||
import org.maxkey.dao.service.UserInfoService;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
@@ -71,12 +71,12 @@ public class ProfileController {
|
||||
|
||||
if (myProfileService.updateProfile(userInfo) > 0) {
|
||||
new Message(
|
||||
WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),
|
||||
WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),
|
||||
userInfo, MessageType.success,
|
||||
OperateType.add, MessageScope.DB);
|
||||
|
||||
} else {
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR), MessageType.error);
|
||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR), MessageType.error);
|
||||
}
|
||||
|
||||
return WebContext.forward("forwardMyProfile");
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apache.commons.mail.DefaultAuthenticator;
|
||||
import org.apache.commons.mail.EmailException;
|
||||
import org.apache.commons.mail.HtmlEmail;
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.maxkey.constants.STATUS;
|
||||
import org.maxkey.constants.ConstantsStatus;
|
||||
import org.maxkey.crypto.ReciprocalUtils;
|
||||
import org.maxkey.crypto.password.PasswordReciprocal;
|
||||
import org.maxkey.dao.service.RegistrationService;
|
||||
@@ -136,7 +136,7 @@ public class RegistrationController {
|
||||
|
||||
userInfo.setWorkPhoneNumber(registration.getWorkPhone());
|
||||
userInfo.setEmail(registration.getWorkEmail());
|
||||
userInfo.setStatus(STATUS.ACTIVE);
|
||||
userInfo.setStatus(ConstantsStatus.ACTIVE);
|
||||
String rawPassword=PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), password);
|
||||
userInfo.setDecipherable(ReciprocalUtils.encode(rawPassword));
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import org.maxkey.constants.OPERATEMESSAGE;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.crypto.ReciprocalUtils;
|
||||
import org.maxkey.crypto.password.PasswordReciprocal;
|
||||
import org.maxkey.dao.service.UserInfoService;
|
||||
@@ -47,9 +47,9 @@ public class SafeController {
|
||||
@RequestParam("confirmPassword") String confirmPassword) {
|
||||
|
||||
if(changeUserPassword(oldPassword,newPassword,confirmPassword)) {
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
|
||||
}else {
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class SafeController {
|
||||
}
|
||||
|
||||
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
|
||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class SafeController {
|
||||
//modelAndView.setViewName("index");
|
||||
}
|
||||
|
||||
new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
|
||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@@ -130,11 +130,11 @@ public class SafeController {
|
||||
userInfo.setAppLoginPassword(ReciprocalUtils.encode(newPassword));
|
||||
boolean change= userInfoService.changeAppLoginPassword(userInfo);
|
||||
_logger.debug(""+change);
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.prompt);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.prompt);
|
||||
}
|
||||
}
|
||||
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class SafeController {
|
||||
userInfo.setEmail(email);
|
||||
userInfoService.changeEmail(userInfo);
|
||||
|
||||
return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.maxkey.web.endpoint;
|
||||
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.maxkey.constants.PASSWORDSETTYPE;
|
||||
import org.maxkey.constants.ConstantsPasswordSetType;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.web.WebConstants;
|
||||
import org.maxkey.web.WebContext;
|
||||
@@ -31,7 +31,7 @@ public class IndexEndpoint {
|
||||
_logger.debug("IndexEndpoint /forwardindex.");
|
||||
ModelAndView modelAndView=new ModelAndView();
|
||||
Integer passwordSetType=(Integer)WebContext.getSession().getAttribute(WebConstants.CURRENT_LOGIN_USER_PASSWORD_SET_TYPE);
|
||||
if(passwordSetType==null || passwordSetType==PASSWORDSETTYPE.PASSWORD_NORMAL){
|
||||
if(passwordSetType==null || passwordSetType==ConstantsPasswordSetType.PASSWORD_NORMAL){
|
||||
if(applicationConfig.getLoginConfig().getDefaultUri()!=null&&
|
||||
!applicationConfig.getLoginConfig().getDefaultUri().equals("")){
|
||||
if(applicationConfig.getLoginConfig().getDefaultUri().startsWith("http")){
|
||||
@@ -45,11 +45,11 @@ public class IndexEndpoint {
|
||||
|
||||
UserInfo userInfo=WebContext.getUserInfo();
|
||||
modelAndView.addObject("model", userInfo);
|
||||
if(passwordSetType==PASSWORDSETTYPE.PASSWORD_EXPIRED){
|
||||
if(passwordSetType==ConstantsPasswordSetType.PASSWORD_EXPIRED){
|
||||
modelAndView.setViewName("passwordExpired");
|
||||
return modelAndView;
|
||||
}else if(passwordSetType==PASSWORDSETTYPE.INITIAL_PASSWORD||
|
||||
passwordSetType==PASSWORDSETTYPE.MANAGER_CHANGED_PASSWORD){
|
||||
}else if(passwordSetType==ConstantsPasswordSetType.INITIAL_PASSWORD||
|
||||
passwordSetType==ConstantsPasswordSetType.MANAGER_CHANGED_PASSWORD){
|
||||
modelAndView.setViewName("passwordInitial");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user