Examples of UserProfile


Examples of org.exoplatform.services.organization.UserProfile

        lang = userProfile == null ? null : userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
        return (lang != null) ? LocaleContextInfo.getLocale(lang) : null;
    }

    private UserProfile loadUserProfile(ExoContainer container, PortalRequestContext context) {
        UserProfile userProfile = null;
        OrganizationService svc = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);

        String user = context.getRemoteUser();
        if (user != null) {
            try {
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfile

        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService svc = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);

        // Don't rely on UserProfileLifecycle loaded UserProfile when doing
        // an update to avoid a potential overwrite of other changes
        UserProfile userProfile = loadUserProfile(container, context);
        if (userProfile != null) {
            userProfile.getUserInfoMap().put(Constants.USER_LANGUAGE, LocaleContextInfo.getLocaleAsString(loc));
            try {
                svc.getUserProfileHandler().saveUserProfile(userProfile, false);
            } catch (Exception ignored) {
                log.error("IGNORED: Failed to save profile for user: " + user, ignored);
                userProfile = null;
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfile

        if (preferencesPortletContext == null) {
            return null;
        }

        // get the user profile cached in the prc during the start of the request
        UserProfile userProfile = (UserProfile) prc.getAttribute(UserProfileLifecycle.USER_PROFILE_ATTRIBUTE_NAME);

        // client context
        AbstractClientContext clientContext;
        Cookie[] cookies = servletRequest.getCookies();
        if (cookies != null) {
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfile

            String remoteUser = rContext.getRemoteUser();

            // Save the skin selection to the User Profile
            OrganizationService orgService = event.getSource().getApplicationComponent(OrganizationService.class);
            if (remoteUser != null) {
                UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
                userProfile.getUserInfoMap().put(Constants.USER_SKIN, skin);
                UserProfileHandler hanlder = orgService.getUserProfileHandler();
                hanlder.saveUserProfile(userProfile, true);
            }
        }
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfile

        this.portalLocale = Locale.ENGLISH;
        return portalLocale;
    }

    private Locale getUserProfileLocale(ExoContainer container, String user) {
        UserProfile userProfile = null;
        OrganizationService svc = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);

        if (user != null) {
            try {
                beginContext(svc);
                userProfile = svc.getUserProfileHandler().findUserProfileByName(user);
            } catch (Exception ignored) {
                log.error("IGNORED: Failed to load UserProfile for username: " + user, ignored);
            } finally {
                try {
                    endContext(svc);
                } catch (Exception ignored) {
                    // we don't care
                }
            }

            if (userProfile == null && log.isWarnEnabled())
                log.warn("Could not load user profile for " + user);
        }

        String lang = userProfile == null ? null : userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
        return (lang != null) ? LocaleContextInfo.getLocale(lang) : null;
    }
View Full Code Here

Examples of org.exoplatform.services.organization.UserProfile

        String user = context.getRemoteUser();
        String portalSkin = null;
        OrganizationService orgService = getApplicationComponent(OrganizationService.class);

        if (user != null) {
            UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(user);
            if (userProfile != null) {
                portalSkin = userProfile.getUserInfoMap().get(Constants.USER_SKIN);
            } else {
                if (log.isWarnEnabled())
                    log.warn("Could not load user profile for " + user + ". Using default portal locale.");
            }
        }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

   * @param password
   * @return
   */
  public UserProfile authenticate( String username, String password )
  {
    UserProfile profile = getUser(username);
    if( profile != null)
    {
      if( profile.authenticate( password ) )
        return profile;
    }
    return null;
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

  protected void doLoad( InputStream in )
  {
    XMLDecoder decoder = new XMLDecoder( in );
    UserManagerConfig managerConfig = (UserManagerConfig)decoder.readObject();
    for (Iterator iter = managerConfig.getUsers().iterator(); iter.hasNext();) {
      UserProfile user = (UserProfile) iter.next();
      usersMap.put(user.getUsername().toLowerCase(), user);
    }
    System.out.println("UserManager: registered " + usersMap.size() + " users");
    decoder.close();
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

          while( true ) {
            // TODO: might want to put this in another thread so the port doesnt block while the user logs in
           
            //System.out.println("TelnetUI: starting login" );
           
            UserProfile profile = login( socket.getInputStream(), socket.getOutputStream() );
           
            //System.out.println("TelnetUI: login profile obtained" );
           
            if( profile != null ) {
             
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    ps.print("Username: ");
    String username = br.readLine();
    ps.print("Password: ");
    String password = br.readLine();
    UserProfile userProfile = userManager.authenticate(username, password);
    if( userProfile != null )
    {
      ps.println("Login successful");
      return userProfile;
    }
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.