Package com.adito.properties.impl.userattributes

Examples of com.adito.properties.impl.userattributes.UserAttributeKey


        request.getSession().setAttribute(Constants.SELECTED_PROFILE, profile);
        String originalRequest = (String) request.getSession().getAttribute(Constants.ORIGINAL_REQUEST);

        // Optionally set the users default property profile
        if (profileSelectionForm.getMakeDefault()) {
            Property.setProperty(new UserAttributeKey(user, User.USER_STARTUP_PROFILE), String.valueOf(profile.getResourceId()), getSessionInfo(request));
        }

        // Reset the navigation and timeouts, they may be different in this new
        // profile
        CoreUtil.resetMainNavigation(request.getSession());
View Full Code Here


        List propertyProfiles = null;
        int selectedPropertyProfile = 0;
        User user = LogonControllerFactory.getInstance().getUser(request);
        if (user != null) {
            propertyProfiles = (List)request.getSession().getAttribute(Constants.PROFILES);
            String selectedProfile = Property.getProperty(new UserAttributeKey(user, User.USER_STARTUP_PROFILE));
            if(selectedProfile.equals(ProfilesListDataSource.SELECT_ON_LOGIN)) {
              selectedPropertyProfile = 0;
            }
            else {
              try {
View Full Code Here

            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid user attribute '" + key + "'");
                return null;
            } else {
                String val = Property.getProperty(new UserAttributeKey(username, key, realm));
                if(val.equals("")) {
                  val = def.getDefaultValue();
                }
                return val;
            }
View Full Code Here

              .getPropertyProfiles(user.getPrincipalName(), true, user.getRealm().getResourceId()), true);
      session.setAttribute(Constants.PROFILES, profiles);
      if (profiles.size() == 0) {
        throw new UserDatabaseException("You do not have permission to use any profiles.");
      }
      String startupProfile = Property.getProperty(new UserAttributeKey(user, User.USER_STARTUP_PROFILE));
      if (profiles.size() < 2) {
        profile = (PropertyProfile) profiles.get(0);
      } else if (!startupProfile.equals(ProfilesListDataSource.SELECT_ON_LOGIN)) {
        int profileId = Integer.parseInt(startupProfile);
        profile = null;
View Full Code Here

            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid user attribute '" + key + "'");
                return null;
            } else {
                return Property.getProperty(new UserAttributeKey(sessionInfo.getUser(), key));
            }
        } else if (type.equalsIgnoreCase("ticket")) {
            if (sessionInfo == null) {
                return null;
            }
View Full Code Here

     * @param user user to test
     * @return disabled
     * @throws Exception
     */
    public static boolean isEnabled(User user) throws Exception {
        return Property.getPropertyBoolean(new UserAttributeKey(user, User.USER_ATTR_ENABLED));
    }
View Full Code Here

     */
    public static void setEnabled(User user, boolean enabled, AccountLock lock, SessionInfo session) throws Exception {
        CoreServlet servlet = CoreServlet.getServlet();
        try {
            servlet.fireCoreEvent(new CoreEvent(servlet, CoreEventConstants.ACCOUNT_LOCKED, lock, session));
            Property.setProperty(new UserAttributeKey(user, User.USER_ATTR_ENABLED), enabled, session);
            servlet.fireCoreEvent(new CoreEvent(CoreServlet.getServlet(), enabled ? CoreEventConstants.GRANT_ACCESS
                            : CoreEventConstants.REVOKE_ACCESS, null, session, CoreEvent.STATE_SUCCESSFUL).addAttribute(
                CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
        } catch (Exception e) {
            servlet.fireCoreEvent(new CoreEvent(servlet, enabled ? CoreEventConstants.GRANT_ACCESS
View Full Code Here

            AttributeDefinition def = (AttributeDefinition) d;
            if (!def.isHidden()) {
                if (def.getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                    String value = def.getDefaultValue();
                    if (user != null) {
                        value = Property.getProperty(new UserAttributeKey(user, def.getName()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value);
                    userAttributeValueItems.add(item);
                }
            }
View Full Code Here

            if(def.isHidden())
              continue;
            if(def.getVisibility() == AttributeDefinition.USER_OVERRIDABLE_ATTRIBUTE ||
                            def.getVisibility() == AttributeDefinition.USER_VIEWABLE_ATTRIBUTE
                            || def.getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                a.add(new AttributeValueItem(def, request, Property.getProperty(new UserAttributeKey(sessionInfo.getUser(), def.getName()))));
            }
        }
        Collections.sort(a);
        ((UserAttributesForm)form).initialize(a);
        ((UserAttributesForm)form).setReferer(CoreUtil.getReferer(request));
View Full Code Here

        User u = sessionInfo.getUser();
        for(Iterator i = l.iterator(); i.hasNext(); ) {
            AttributeValueItem item = (AttributeValueItem)i.next();
            if(item.getDefinition().getVisibility() == AttributeDefinition.USER_OVERRIDABLE_ATTRIBUTE ||
                            item.getDefinition().getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                Property.setProperty(new UserAttributeKey(u.getPrincipalName(), item.getDefinition().getName(), u.getRealm()
                                .getResourceId()), item.getDefinition().formatAttributeValue(item.getValue()), sessionInfo);
            }
        } 
        sessionInfo.setUser(u);
        return cleanUpAndReturnToReferer(mapping, form, request, response);
View Full Code Here

TOP

Related Classes of com.adito.properties.impl.userattributes.UserAttributeKey

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.