Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.User


   
    private void removeUserRoles(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[] roleNames = actionRequest.getParameterValues("user_role_id");

            if(roleNames != null)
View Full Code Here


   
    private void addUserRole(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 roleName = actionRequest.getParameter("role_name");
            if (roleName != null && roleName.trim().length() > 0)
            {
View Full Code Here

   
    private void removeUserGroups(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[] groupNames = actionRequest.getParameterValues("user_group_id");

            if(groupNames != null)
View Full Code Here

   
    private void addUserGroup(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 groupName = actionRequest.getParameter("group_name");
            if (groupName != null && groupName.trim().length() > 0)
            {
View Full Code Here

        return getCredential(lookupUser(request, userName));
    }
   
    private User lookupUser(PortletRequest request, String userName)
    {
        User user = null;
        try
        {
            user = userManager.getUser(userName);
        }
        catch (Exception e)
View Full Code Here

    private void addUserProfile(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 locatorName = actionRequest.getParameter("locator_name");
            if (locatorName != null && locatorName.trim().length() > 0)
            {
                try
                {
                    Principal userPrincipal = createPrincipal(user.getSubject(), UserPrincipal.class);                         
                    String ruleName = actionRequest.getParameter("select_rule");
                    profiler.setRuleForPrincipal(userPrincipal,
                            profiler.getRule(ruleName),
                            locatorName);             
                    audit.logAdminAuthorizationActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_ADD_PROFILE, ruleName + "-" + locatorName, USER_ADMINISTRATION);                                                                                                                                           
View Full Code Here

   
    private void removeUserProfile(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[] locatorNames = actionRequest.getParameterValues("user_profile_id");

            if(locatorNames != null)
            {
                Principal userPrincipal = createPrincipal(user.getSubject(), UserPrincipal.class);                                             
                Collection rules = profiler.getRulesForPrincipal(userPrincipal);
                for (int ix = 0; ix < locatorNames.length; ix++)
                {
                    try
                    {
View Full Code Here

                audit.logAdminUserActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_CREATE, USER_ADMINISTRATION);           
               
                PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_REFRESH, "true");
                PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED, userName);
                                               
                User user = userManager.getUser(userName);
               
                PasswordCredential credential = getCredential(user);
                if ( credential != null )
                {
                    String updateRequiredStr = actionRequest.getParameter("user_cred_updreq");
                    if (updateRequiredStr != null)
                    {
                        boolean updateRequired = Boolean.valueOf(updateRequiredStr).booleanValue();
                        if (updateRequired != credential.isUpdateRequired())
                        {
                            userManager.setPasswordUpdateRequired(userName,updateRequired);
                        }
                    }                   
                }
               
                String requiredRole = actionRequest.getPreferences().getValue("requiredRole", "");
                if (!requiredRole.equals("") && user != null)
                {
                    roleManager.addRoleToUser(userName, requiredRole);
                }

                String role = actionRequest.getParameter(ROLES_CONTROL);
                if (!SecurityUtil.isEmpty(role) && user != null)
                {
                    roleManager.addRoleToUser(userName, role);
                }
               
                String templateFolder = actionRequest.getPreferences().getValue("newUserTemplateDirectory", "/_user/template/");
                String subsite = actionRequest.getParameter(SUBSITES_CONTROL);
                if (SecurityUtil.isEmpty(subsite))
                {
                    subsite = Folder.USER_FOLDER + userName;
                }
                else
                {
                    subsite  = subsite + Folder.USER_FOLDER +  userName;
                    Preferences attributes = user.getUserAttributes();
                    attributes.put(User.USER_INFO_SUBSITE, subsite);                   
                }
               
                // copy the entire dir tree from the template folder
                Folder source = pageManager.getFolder(templateFolder);               
                pageManager.deepCopyFolder(source, subsite, userName);
               
                // TODO: send message that site tree portlet invalidated
               
                String rule = actionRequest.getParameter(RULES_CONTROL);
                if (!SecurityUtil.isEmpty(rule) && user != null)
                {
                    Principal principal = SecurityUtil.getPrincipal(user.getSubject(), UserPrincipal.class);                        
                    profiler.setRuleForPrincipal(principal, profiler.getRule(rule), "page");
                }               
                               
            }
            catch (SecurityException sex)
View Full Code Here

                return;
            }
            if (optionForceEmailsToBeSystemUnique)
            {
                boolean emailExistsFlag = true;
                User user = null;
                try
                {
                    user = admin.lookupUserFromEmail((String) userInfo
                            .get(USER_ATTRIBUTE_EMAIL));
                } catch (AdministrationEmailException e1)
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

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.