Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.User


        {
            JSUser _user = (JSUser) _itUsers.next();
            JSPrincipalRules jsRules = _user.getRules();
            try
            {
              User user = userManager.getUser(_user.getName());
              Principal principal = getUserPrincipal(user);
              if (jsRules != null)
              {
                Iterator _itRoles = jsRules.iterator();
                  while (_itRoles.hasNext())
View Full Code Here


        while (list.hasNext())
        {

            try
            {
                User _user = (User) list.next();
                JSUser _tempUser = createJSUser(_user);
                userMap.put(_tempUser.getName(), _tempUser);
                ((JSSeedData)getSnapshot()).getUsers().add(_tempUser);
            } catch (Exception e)
            {
View Full Code Here

            Principal principal = requestContext.getUserPrincipal();           
                resultMap.put(USERNAME, principal.getName());
                resultMap.put(TYPE, principal.getClass().getName());
               
                // Loading the userinfo
                User user = userManager.getUser(principal.getName());
                if(user != null)
                {
                  Preferences prefs = user.getUserAttributes();
                  String[] prefKeys = prefs.keys();
                  Map prefsSet = new HashMap();
                  for(int i = 0; i<prefKeys.length; i++)
                  {
                    prefsSet.put(prefKeys[i], prefs.get(prefKeys[i], "No value"));                   
View Full Code Here

        }
       
        String userName = (String)PortletMessaging.receive(request,
                                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);

        User user = null;
        if (userName != null)
        {
            user = lookupUser(request, userName);
        }
       
View Full Code Here

    public void removeUser(ActionRequest actionRequest, ActionResponse actionResponse)
    throws PortletException
    {
        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);       
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            try
            {
                Preferences attributes = user.getUserAttributes();
                String subsite = attributes.get(User.USER_INFO_SUBSITE, null);               
                userManager.removeUser(userName);
                PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_REFRESH, "true");
                if (subsite == null)
                {
View Full Code Here

    {
        ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jetspeed.portlets.security.resources.UsersResources",actionRequest.getLocale());

        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            try
            {
                String password = actionRequest.getParameter("user_cred_value");
View Full Code Here

   
    private void editUser(ActionRequest actionRequest, ActionResponse actionResponse)
    {
        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            Iterator attrIter = paUserAttributes.iterator();
            UserAttribute attr;
            String value;
            while( attrIter.hasNext() )
            {
                attr = (UserAttribute)attrIter.next();
                value = actionRequest.getParameter("attr_"+attr.getName());
                if (value != null)
                {
                    user.getUserAttributes().put(attr.getName(), value);
                    audit.logAdminAttributeActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_ADD_ATTRIBUTE, attr.getName(), value, value, USER_ADMINISTRATION);                               
                }
            }
        }
        if ( "true".equals(actionRequest.getPreferences().getValue("showPasswordOnUserTab", "false")))
View Full Code Here

   
    private void updateUserAttribute(ActionRequest actionRequest, ActionResponse actionResponse)
    {
        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            String[] userAttrNames = actionRequest.getParameterValues("user_attr_id");
            if(userAttrNames != null)
            {               
                for (int i=0; i<userAttrNames.length; i++)
                {
                    String userAttrName = userAttrNames[i];
                    String value = actionRequest.getParameter(userAttrName + ":value");
                    String before = user.getUserAttributes().get(userAttrName, "");
                    user.getUserAttributes().put(userAttrName, value);
                    audit.logAdminAttributeActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_UPDATE_ATTRIBUTE, userAttrName, before, value, USER_ADMINISTRATION);                                                   
                }               
            }       
        }
    }
View Full Code Here

   
    private void addUserAttribute(ActionRequest actionRequest, ActionResponse actionResponse)
    {
        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);       
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            String userAttrName = actionRequest.getParameter("user_attr_name");
            String userAttrValue = actionRequest.getParameter("user_attr_value");
            if (userAttrName != null && userAttrName.trim().length() > 0)
            {
                Preferences attributes = user.getUserAttributes();
                attributes.put(userAttrName, userAttrValue);
                audit.logAdminAttributeActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_ADD_ATTRIBUTE, userAttrName, "", userAttrValue, USER_ADMINISTRATION);                                               
            }
        }
    }
View Full Code Here

    private void removeUserAttributes(ActionRequest actionRequest, ActionResponse actionResponse)
    {
        String userName = (String)PortletMessaging.receive(actionRequest,
                SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);       
       
        User user = lookupUser(actionRequest, userName);
        if (user != null)
        {
            String[] userAttrNames = actionRequest.getParameterValues("user_attr_id");

            if(userAttrNames != null)
            {
                Preferences attributes = user.getUserAttributes();
                for(int ix = 0; ix < userAttrNames.length; ix++)
                {
                    try
                    {
                        String before = attributes.get(userAttrNames[ix], "");                       
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.User

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.