Examples of loadUserById()


Examples of com.dotmarketing.business.UserAPI.loadUserById()

      Logger.error(this, e.getMessage(), e);
      throw new DotSecurityException(e.getMessage(),e);
    }
    UserAPI userAPI=APILocator.getUserAPI();
    if (comp.getAuthType().equals(Company.AUTH_TYPE_ID)) {
      _user = userAPI.loadUserById(username,userAPI.getSystemUser(),false);
    } else {
      _user = userAPI.loadByUserByEmail(username, userAPI.getSystemUser(), false);
    }
    if (PublicEncryptionFactory.digestString(passwd).equals(_user.getPassword())) {
      return _user;
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);

    for(String userId : userIds) {
      User user = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      roleAPI.removeRoleFromUser(role, user);
    }
  }

  public Map<String, Object> addUserToRole(String userId, String roleId) throws DotDataException, DotRuntimeException, PortalException, SystemException, DotSecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);
    User user = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));

    User modUser = getUser();
    String date = DateUtil.getCurrentDate();
    ActivityLogger.logInfo(getClass(), "Adding Role: " +role.getName() + " to User: " + user.getUserId() , "Date: " + date + "; "+ "User:" + modUser.getUserId());
    AdminLogger.log(getClass(), "Adding Role: " +role.getName() + " to User: " + user.getUserId() , "Date: " + date + "; "+ "User:" + modUser.getUserId());
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    Map<String, Object> toReturn = new HashMap<String, Object>();

    if(UtilMethods.isSet(userId)){
      UserAPI userAPI = APILocator.getUserAPI();
      User userForRole = userAPI.loadUserById(userId);
      RoleAPI roleAPI = APILocator.getRoleAPI();
      toReturn = roleAPI.getUserRole(userForRole).toMap();
    }
    return toReturn;
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

          try {
            userToDelete = iterUsersToDelete.next();
            if (comp.getAuthType().equals(Company.AUTH_TYPE_EA)) {
                    user = uAPI.loadByUserByEmail(userToDelete.getUserId(), sysUser, false);
                  } else {
                    user = uAPI.loadUserById(userToDelete.getUserId(), sysUser, false);
                  }
           
            user.setActive(false);
            uAPI.save(user, sysUser, false);
               
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    UserAPI uAPI = APILocator.getUserAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();
    try {

      User user = uAPI.loadUserById(userId,uWebAPI.getLoggedInUser(request),false);

      UserProxyAPI uProxyAPI = APILocator.getUserProxyAPI();
      User u = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      UserProxy up = uProxyAPI.getUserProxy(u, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    try {

      User user = uAPI.loadUserById(userId,uWebAPI.getLoggedInUser(request),false);

      UserProxyAPI uProxyAPI = APILocator.getUserProxyAPI();
      User u = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      UserProxy up = uProxyAPI.getUserProxy(u, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));


      if(!active && u.getUserId().equals(uWebAPI.getLoggedInUser(request).getUserId())){
        throw new DotRuntimeException(LanguageUtil.get(uWebAPI.getLoggedInUser(request),"deactivate-your-own-user-error"));
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

    UserAPI userAPI = APILocator.getUserAPI();

    User user = uWebAPI.getLoggedInUser(request);
    boolean respectFrontend = uWebAPI.isLoggedToBackend(request);

    User toUpdate = userAPI.loadUserById(userId, user, respectFrontend);
    toUpdate.setTimeZoneId(timeZoneId);
    toUpdate.setLanguageId(languageId);
    userAPI.save(toUpdate, user, respectFrontend);

  }
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

          if(loggedInUser==null || !APILocator.getPortletAPI().hasUserAdminRights(loggedInUser)) {
              SecurityLogger.logInfo(UserAjax.class, "unauthorized attempt to call getUserById by user "+loggedInUser!=null?loggedInUser.getUserId():"[not logged in]");
              throw new DotSecurityException("not authorized");
          }

      user = uAPI.loadUserById(userId,uWebAPI.getSystemUser(), !uWebAPI.isLoggedToBackend(request));

      Map<String, Object> aRecord = user.toMap();
      aRecord.put("id", user.getUserId());
      aRecord.put("type", USER_TYPE_VALUE);
      aRecord.put("name", user.getFullName());
View Full Code Here

Examples of com.dotmarketing.business.UserAPI.loadUserById()

      UserProxyAPI upAPI = APILocator.getUserProxyAPI();
      User userToSave;
      User loggedInUser = uWebAPI.getLoggedInUser(request);

      try {
        userToSave = (User)uAPI.loadUserById(userId,uAPI.getSystemUser(),false).clone();
        userToSave.setModified(false);
      } catch (Exception e) {
        Logger.error(this, e.getMessage(), e);
        return null;
      }
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.