summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author段冬梅 <[email protected]>2018-12-14 09:47:00 +0800
committer段冬梅 <[email protected]>2018-12-14 09:47:00 +0800
commit8781cfd7935ea2cde6ecc7c1148a0ff66547fda0 (patch)
treed0dfb49c3ce20a3309d56b9d0449fa6731e491fe /src
parentbd95ce5387c9198e363f533b5ab4c9c18c2e3b1f (diff)
恢复UserController上次提交
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/nis/web/controller/sys/UserController.java42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/main/java/com/nis/web/controller/sys/UserController.java b/src/main/java/com/nis/web/controller/sys/UserController.java
index 43399a2..27e4a68 100644
--- a/src/main/java/com/nis/web/controller/sys/UserController.java
+++ b/src/main/java/com/nis/web/controller/sys/UserController.java
@@ -11,6 +11,7 @@ import org.apache.commons.beanutils.BeanUtils;
import org.apache.derby.tools.sysinfo;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.mgt.RealmSecurityManager;
@@ -292,44 +293,6 @@ public class UserController extends BaseController{
if (StringUtils.validatePassword(oldPassword, user.getPassword())){
userService.updatePasswordById(user.getId(), user.getLoginId(), newPassword);
- systemService.deleteSession(UserUtils.getSession());
- RealmSecurityManager securityManager =
- (RealmSecurityManager) SecurityUtils.getSecurityManager();
- Collection<Realm> realm=securityManager.getRealms();
- for (Realm realm2 : realm) {
- SystemAuthorizingRealm userRealm = (SystemAuthorizingRealm) realm2;
- userRealm.clearCachedAuthorizationInfo(UserUtils.getPrincipal());
- userRealm.clearCachedAuthenticationInfo(UserUtils.getPrincipal());
-
- /* new UsernamePasswordToken(UserUtils.getUser(), UserUtils.getUser().getpas.toCharArray(), rememberMe, host, captcha, mobile);*/
-
- Cache<Object, AuthenticationInfo> cache= userRealm.getAuthenticationCache();
- for (AuthenticationInfo auth : cache.values()) {
- /*auth.getPrincipals().getPrimaryPrincipal()*/
- userRealm.getAuthenticationCache().remove(auth.getPrincipals().getPrimaryPrincipal());
- }
- }
- /*userRealm.clearCachedAuthorizationInfoC(SecurityUtils.getSubject().getPreviousPrincipals());*/
-
-
-
- /*Cache<Object, AuthenticationInfo> cache=SecurityUtils.getSecurityManager() getAvailableAuthenticationCache();;
- Object cacheKey="";
- for (Object cacheKey1 : cache.keys()) {
- cacheKey=cacheKey1;
- System.out.println(cacheKey);
- System.out.println(userRealm.getAuthenticationCache().get(cacheKey));
- AuthenticationInfo auth=cache.get(cacheKey);
- userRealm.clearCachedAuthorizationInfoC(auth.getPrincipals());
- }*/
- /*userRealm.getAuthenticationCache().remove(cacheKey);
- userRealm.getAuthenticationCache().remove(cacheKey);
- for (AuthenticationInfo auth : cache.values()) {
- //userRealm.clearCachedAuthorizationInfoC(auth.getPrincipals());
- userRealm.getAuthenticationCache().remove(auth.getPrincipals());
- }
- Cache<Object, AuthenticationInfo> cache2=userRealm.getAuthenticationCache();*/
- /*UserUtils.getSubject().logout();*/
model.addAttribute("message", "update_success");
}else{
model.addAttribute("message", "update_failed");
@@ -338,8 +301,7 @@ public class UserController extends BaseController{
model.addAttribute("user", user);
return "/sys/userModifyPwd";
}
-
-
+
}