Package org.apache.wiki.auth

Examples of org.apache.wiki.auth.UserManager$SaveUserProfileTask


        m_prop = null;
    }

    public final int doWikiStartTag() throws IOException, WikiSecurityException
    {
        UserManager manager = m_wikiContext.getEngine().getUserManager();
        UserProfile profile = manager.getUserProfile( m_wikiContext.getWikiSession() );
        String result = null;

        if ( EXISTS.equals( m_prop ) || NOT_NEW.equals( m_prop ) )
        {
            return profile.isNew() ? SKIP_BODY : EVAL_BODY_INCLUDE;
View Full Code Here


        {
            // See if admin users exists
            boolean adminExists = false;
            try
            {
                UserManager userMgr = m_engine.getUserManager();
                UserDatabase userDb = userMgr.getUserDatabase();
                userDb.findByLoginName( Installer.ADMIN_ID );
                adminExists = true;
            }
            catch ( NoSuchPrincipalException e )
            {
View Full Code Here

    public String doPost(WikiContext context)
    {
        HttpServletRequest request = context.getHttpRequest();
        WikiSession session = context.getWikiSession();
        UserManager mgr = context.getEngine().getUserManager();

        String loginid   = request.getParameter("loginid");
        String loginname = request.getParameter("loginname");
        String fullname  = request.getParameter("fullname");
        String password  = request.getParameter("password");
        String password2 = request.getParameter("password2");
        String email     = request.getParameter("email");


        if( request.getParameter("action").equalsIgnoreCase("remove") )
        {
            try
            {
                mgr.getUserDatabase().deleteByLoginName(loginid);
                session.addMessage("User profile "+loginid+" ("+fullname+") has been deleted");
            }
            catch (NoSuchPrincipalException e)
            {
                session.addMessage("User profile has already been removed");
            }
            catch (WikiSecurityException e)
            {
                session.addMessage("Security problem: "+e);
            }
            return "";
        }


        if( password != null && password.length() > 0 && !password.equals(password2) )
        {
            session.addMessage("Passwords do not match!");
            return "";
        }

        UserProfile p;

        if( loginid.equals("--New--") )
        {
            // Create new user

            p = mgr.getUserDatabase().newProfile();
            p.setCreated( new Date() );
        }
        else
        {
            try
            {
                p = mgr.getUserDatabase().findByLoginName( loginid );
            }
            catch (NoSuchPrincipalException e)
            {
                session.addMessage("I could not find user profile "+loginid);
                return "";
            }
        }

        p.setEmail(email);
        p.setFullname(fullname);
        if( password != null && password.length() > 0 ) p.setPassword(password);
        p.setLoginName(loginname);

        try
        {
            mgr.getUserDatabase().save( p );
        }
        catch( WikiSecurityException e )
        {
            session.addMessage("Unable to save "+e.getMessage());
        }
View Full Code Here

        {
            // See if admin users exists
            boolean adminExists = false;
            try
            {
                UserManager userMgr = m_engine.getUserManager();
                UserDatabase userDb = userMgr.getUserDatabase();
                userDb.findByLoginName( Installer.ADMIN_ID );
                adminExists = true;
            }
            catch ( NoSuchPrincipalException e )
            {
View Full Code Here

        m_prop = null;
    }

    public final int doWikiStartTag() throws IOException, WikiSecurityException
    {
        UserManager manager = m_wikiContext.getEngine().getUserManager();
        UserProfile profile = manager.getUserProfile( m_wikiContext.getWikiSession() );
        String result = null;

        if ( EXISTS.equals( m_prop ) || NOT_NEW.equals( m_prop ) )
        {
            return profile.isNew() ? SKIP_BODY : EVAL_BODY_INCLUDE;
View Full Code Here

TOP

Related Classes of org.apache.wiki.auth.UserManager$SaveUserProfileTask

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.