Examples of IChangePassword


Examples of com.narirelays.ems.security.IChangePassword

  public String changePassByUser()//用户修改自身的密码,需要输入旧密码
  {
    resultInfo = new OperResult();
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    String name = authentication.getName();
    IChangePassword iChangePassword = (IChangePassword)StorageService.ctx.getBean("jdbcUserService");//只能强制转为此接口,不知为何
//    CustomJdbcDaoImpl customJdbcDaoImpl = (CustomJdbcDaoImpl)StorageService.ctx.getBean("jdbcUserService");//cast exception??
    if(iChangePassword!=null)
    {
      String oldPass = request.getParameter("oldPass");
      String newPass = request.getParameter("newPass");
      try{
        iChangePassword.changePassword(name, oldPass, newPass);//pass能否为空?
        resultInfo.setSucceed();
      }
      catch(BadCredentialsException e)
      {
        e.printStackTrace();
View Full Code Here

Examples of com.narirelays.ems.security.IChangePassword

   * 但如果用户没有加任何权限,该接口会报异常
   * */
  public String changePassByAdmin()//管理员修改用户密码,无需用户旧密码,需用户id;
  {
    resultInfo = new OperResult();
    IChangePassword iChangePassword = (IChangePassword)StorageService.ctx.getBean("jdbcUserService");
    PrivilegeManagementService privilegeManagementService = (PrivilegeManagementService)StorageService.ctx.getBean("privilegeManagementService");
    if(iChangePassword!=null)
    {
      String userID = request.getParameter("id");
      String userName = null;
      if(privilegeManagementService!=null)
      {
        userName = privilegeManagementService.query4UserNameByID(userID);
      }
      String newPass = request.getParameter("newPass");
      try{
        iChangePassword.changePassword(userName,newPass);//pass能否为空?
        resultInfo.setSucceed();
      }
      catch(Exception e)
      {
        e.printStackTrace();
View Full Code Here

Examples of com.narirelays.ems.security.IChangePassword

    if(username==null){
      username = (String) request.getSession()
      .getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY);
    }
    if(username!=null){
      IChangePassword iChangePassword = (IChangePassword)StorageService.ctx.getBean("jdbcUserService");
      iChangePassword.changePassword(username, request.getParameter("password"));
    }
    resultInfo.setSucceed();
    return SUCCESS;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.