Package com.ecyrd.jspwiki.auth

Examples of com.ecyrd.jspwiki.auth.WikiSecurityException


                    return;
                }
            }

            log.debug("Failed JSON permission check: "+instance);
            throw new WikiSecurityException("No permission to access this AJAX method!");
        }
View Full Code Here


            log.debug( acl.toString() );
        }
        catch( NoSuchElementException nsee )
        {
            log.warn( "Invalid access rule: " + ruleLine + " - defaults will be used." );
            throw new WikiSecurityException( "Invalid access rule: " + ruleLine, nsee );
        }
        catch( IllegalArgumentException iae )
        {
            throw new WikiSecurityException( "Invalid permission type: " + ruleLine, iae );
        }

        return acl;
    }
View Full Code Here

        {
            pageManager.putPageText( page, newText );
        }
        catch ( ProviderException e )
        {
            throw new WikiSecurityException( "Could not set Acl. Reason: ProviderExcpetion " + e.getMessage(), e );
        }
    }
View Full Code Here

                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

            }
            ps.close();
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

                {
                    ps.setString( 8, Serializer.serializeToBase64( profile.getAttributes() ) );
                }
                catch ( IOException e )
                {
                    throw new WikiSecurityException( "Could not save user profile attribute. Reason: " + e.getMessage(), e );
                }
                ps.setTimestamp( 9, ts );
                ps.execute();
                ps.close();

                // Insert new role record
                ps = conn.prepareStatement( m_findRoles );
                ps.setString( 1, profile.getLoginName() );
                ResultSet rs = ps.executeQuery();
                int roles = 0;
                while ( rs.next() )
                {
                    roles++;
                }
                ps.close();
                if( roles == 0 )
                {
                    ps = conn.prepareStatement( m_insertRole );
                    ps.setString( 1, profile.getLoginName() );
                    ps.setString( 2, m_initialRole );
                    ps.execute();
                    ps.close();
                }

                // Set the profile creation time
                profile.setCreated( modDate );
            }
            else
            {
                // User exists: modify existing record
                ps = conn.prepareStatement( m_updateProfile );
                ps.setString( 1, profile.getUid() );
                ps.setString( 2, profile.getEmail() );
                ps.setString( 3, profile.getFullname() );
                ps.setString( 4, password );
                ps.setString( 5, profile.getWikiName() );
                ps.setTimestamp( 6, ts );
                ps.setString( 7, profile.getLoginName() );
                try
                {
                    ps.setString( 8, Serializer.serializeToBase64( profile.getAttributes() ) );
                }
                catch ( IOException e )
                {
                    throw new WikiSecurityException( "Could not save user profile attribute. Reason: " + e.getMessage(), e );
                }
                ps.setDate( 9, lockExpiry );
                ps.setString( 10, profile.getLoginName() );
                ps.execute();
                ps.close();
            }
            // Set the profile mod time
            profile.setLastModified( modDate );

            // Commit and close connection
            if( m_supportsCommits )
            {
                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

     */
    public synchronized void deleteByLoginName( String loginName ) throws NoSuchPrincipalException, WikiSecurityException
    {
        if ( c_dom == null )
        {
            throw new WikiSecurityException( "FATAL: database does not exist" );
        }
           
        NodeList users = c_dom.getDocumentElement().getElementsByTagName( USER_TAG );
        for( int i = 0; i < users.getLength(); i++ )
        {
View Full Code Here

            io.write("</users>");
            io.close();
        }
        catch ( IOException e )
        {
            throw new WikiSecurityException( e.getLocalizedMessage(), e );
        }

        // Copy new file over old version
        File backup = new File( c_file.getAbsolutePath() + ".old" );
        if ( backup.exists() )
View Full Code Here

                Text value = c_dom.createTextNode( encodedAttributes );
                attributes.appendChild( value );
            }
            catch ( IOException e )
            {
                throw new WikiSecurityException( "Could not save user profile attribute. Reason: " + e.getMessage(), e );
            }
        }

        // Set the profile timestamps
        if ( isNew )
View Full Code Here

TOP

Related Classes of com.ecyrd.jspwiki.auth.WikiSecurityException

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.