Package org.apache.cocoon.auth

Examples of org.apache.cocoon.auth.User


        Map map = null;

        final Map loginContext = new HashMap();
        loginContext.put(ApplicationManager.LOGIN_CONTEXT_PARAMETERS_KEY, par);
        final User user =
                  this.applicationManager.login( applicationName, loginContext );

        if ( user != null) {
            // success
            map = new HashMap();
            map.put("ID", user.getId());
            Iterator i = user.getAttributeNames();
            while ( i.hasNext() ) {
                final String key = (String)i.next();
                map.put(key, user.getAttribute(key));
            }
        }

        if (this.getLogger().isDebugEnabled() ) {
            this.getLogger().debug("END act map="+map);
View Full Code Here


        final String applicationName = par.getParameter("application");
        final String roleName = par.getParameter("role", null);

        final boolean negate = par.getParameterAsBoolean("negate-result", false);
        if ( this.applicationManager.isLoggedIn(applicationName) ) {
            final User user = ApplicationUtil.getUser(objectModel);
            if ( roleName == null || user.isUserInRole(roleName) ) {
                if ( !negate ) {
                    map = new HashMap();
                    map.put("ID", user.getId());
                    Iterator i = user.getAttributeNames();
                    while ( i.hasNext() ) {
                        final String key = (String)i.next();
                        map.put(key, user.getAttribute(key));
                    }
                }
            }
        } else {
            if ( negate ) {
View Full Code Here

            // if the user is logged in, we set the current application, data and user
            if ( appData != null ) {
                try {
                    final Application application = this.getApplication(appName);
                    final User user = (User)session.getAttribute(USER + '-' + appName);
                    final Application oldApp = (Application)objectModel.get(ApplicationManager.APPLICATION);
                    objectModel.put(ApplicationManager.APPLICATION, application);
                    objectModel.put(ApplicationManager.APPLICATION_DATA, appData);
                    objectModel.put(ApplicationManager.USER, user);
                    // notify application
View Full Code Here

    /**
     * @see org.apache.cocoon.auth.ApplicationManager#login(java.lang.String, java.util.Map)
     */
    public User login(final String appName, final Map loginContext) throws Exception {
        User user = null;

        final Map objectModel = ContextHelper.getObjectModel( this.context );

        // first check, if we are already logged in
        if ( this.isLoggedIn(appName) ) {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.auth.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.