Package com.agiletec.aps.system.services.user

Examples of com.agiletec.aps.system.services.user.UserDetails


*
* */
public class CasAuthProviderManager extends AuthenticationProviderManager {
 
  public UserDetails getUser(String username) throws ApsSystemException {
    UserDetails user = null;
    try {
      user = this.getUserManager().getUser(username);
      if (null == user || (null != user && user.isDisabled())) return null;
      if (!user.getUsername().equals(SystemConstants.ADMIN_USER_NAME)) {
        if (!user.isAccountNotExpired()) {
          ApsSystemUtils.getLogger().info("User '" + user.getUsername() + "' expired");
          return user;
        }
      }
      this.getUserManager().updateLastAccess(user);
      if (!user.isCredentialsNotExpired()) {
        ApsSystemUtils.getLogger().info("User '" + user.getUsername() + "' credential expired");
        return user;
      }
      this.addUserAuthorizations(user);
    } catch (Throwable t) {
      throw new ApsSystemException("Error in user authentication " + username, t);
View Full Code Here


  public void deleteUser(Object key) {
    String username = null;
    if (key instanceof String) {
      username = key.toString();
    } else if (key instanceof UserDetails) {
      UserDetails userDetails = (UserDetails) key;
      username = userDetails.getUsername();
    }
    if (username != null) {
      try {
        this.getUserRegDAO().clearTokenByUsername(username);
      } catch (Throwable t) {
View Full Code Here

* */
public class UserRecoverFromEmailAction extends BaseAction implements IUserRecoverFromEmailAction {
 
  @Override
  public String initRecover() {
    UserDetails userDetails = this.getCurrentUser();
    if (null != userDetails && !userDetails.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
      return "loggedUser";
    }
    return SUCCESS;
  }
View Full Code Here

* */
public class UserRecoverFromUsernameAction extends BaseAction implements IUserRecoverFromUsernameAction {
 
  @Override
  public String initRecover() {
    UserDetails userDetails = this.getCurrentUser();
    if (null != userDetails && !userDetails.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
      return "loggedUser";
    }
    return SUCCESS;
  }
View Full Code Here

    Lang lang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    Page page = (Page) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
    statsRecord.setIp(reqCtx.getRequest().getRemoteAddr());
    statsRecord.setReferer(reqCtx.getRequest().getHeader("Referer"));
    statsRecord.setSessionId(session.getId());
    UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
    StringBuffer rolesBuffer = new StringBuffer();
    boolean isFirstRole = true;
    IApsAuthority[] auths = currentUser.getAuthorities();
    for (int i=0; i<auths.length; i++) {
      if (auths[i] instanceof Role) {
        Role role = (Role) auths[i];
        if (!isFirstRole) rolesBuffer.append(" - ");
        rolesBuffer.append(role.getName());
View Full Code Here

      this._notifierHelper.deleteContentEvents();
    }
  }
 
  protected UserDetails getCurrentUser() {
    UserDetails currentUser = (UserDetails) this.getRequest().getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
    return currentUser;
  }
View Full Code Here

      if (null ==  resourceId || resourceId.length() == 0) {
        return null;
      }
      ResourceInterface resource = this.getTrashedResourceManager().loadTrashedResource(resourceId);
      String mainGroup = resource.getMainGroup();
      UserDetails currentUser = this.getCurrentUser();
      if (!this.getAuthManager().isAuthOnGroup(currentUser, mainGroup)) {
        return null;
      }
      int size = Integer.parseInt(this.getSize());
      ResourceInstance instance = null;
View Full Code Here

public class GuestWonderInterceptor extends AbstractInterceptor {
 
  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    HttpSession session = ServletActionContext.getRequest().getSession();
    UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
    if (null == currentUser || currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
      return "guestUserNotAllowed";
    }
     return invocation.invoke();
  }
View Full Code Here

  protected List<String> getLdapUsernames() throws ApsSystemException {
    List<UserDetails> users = ((ILdapUserManager) this.getUserManager()).searchUsers(this.getUsername(), true);
    List<String> usernames = new ArrayList<String>();
    if (null != users) {
      for (int i = 0; i < users.size(); i++) {
        UserDetails user = users.get(i);
        usernames.add(user.getUsername());
      }
    }
    return usernames;
  }
View Full Code Here

    this.setStrutsAction(ApsAdminSystemConstants.EDIT);
    try {
      String result = this.checkUserForEdit();
      if (null != result) return result;
      String username = this.getUsername();
      UserDetails user = this.getUserManager().getUser(username);
      if (!user.isEntandoUser() && !this.isWriteUserEnable()) {
        this.addActionError(this.getText("error.user.notLocal"));
        return "userList";
      }
      this.setRemoteUser(!user.isEntandoUser());
      this.setActive(!user.isDisabled());
      this.setUser(user);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "edit");
      return FAILURE;
    }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.user.UserDetails

Copyright © 2018 www.massapicom. 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.