Package org.apache.jetspeed.services.security

Examples of org.apache.jetspeed.services.security.UserException


        {
            throw new UnknownUserException(Localization.getString("UPDATEACCOUNT_NOUSER"));
        }
        if(!user.getPassword().equals(encrypted))
        {
            throw new UserException(Localization.getString("UPDATEACCOUNT_BADOLDPASSWORD"));
        }
        user.setPassword(JetspeedSecurity.encryptPassword(newPassword));

        // Set the last password change date
        user.setPasswordChanged(new Date());
View Full Code Here


        {
            users = TurbineUserPeer.doSelect(criteria);
        }
        catch(Exception e)
        {
            throw new UserException(
                "Failed to check account's presence", e);
        }
        if (users.size() < 1)
        {
            return false;
        }
        TurbineUser retrieved = (TurbineUser)users.get(0);
        int key = retrieved.getUserId();
        String keyId = String.valueOf(key);
        if (checkUniqueId && !keyId.equals(id))
        {
            throw new UserException("User exists but under a different unique ID");
        }
        return true;
    }
View Full Code Here

            userurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=users"),
                       "(&(uid="+principal.getName()+")(objectclass=jetspeeduser))", ATTRS, true);
        }
        catch (Exception e)
        {
            throw new UserException("Failed to retrieve user '" + principal.getName() + "'", e);
        }
        
        if (userurls.size() == 1)
        {
            user = new LDAPUser((LDAPURL) ((Vector)userurls.elementAt(0)).firstElement());
            return user;
        }
        else if(userurls.size() > 1)
        {
            throw new UserException("Multiple Users with same username '" + principal.getName() + "'");
        }
        else
        {
            throw new UnknownUserException("Unknown user '" + principal.getName() + "'");
        }
View Full Code Here

            JetspeedLDAP.getService().checkAndCloseContext(ctx);
        }
        catch ( Exception e )
        {
            throw new UserException( "Failed to retrieve user with filter:" + filter, e );
        }

        return ( resultList.iterator() );
    }
View Full Code Here

        {
            ((LDAPUser)user).update(false);
        }
        catch(Exception e)
        {
            throw new UserException("Failed to save user object ", e);
        }
    }
View Full Code Here

            }
        }
        catch (Exception e)
        {
            removeUser(new UserNamePrincipal(user.getUserName()));
            throw new UserException("Failed to create profile for new user ", e);
        }
    }
View Full Code Here

            JetspeedLDAP.deleteEntry(user.getldapurl());
            PsmlManager.removeUserDocuments(user);
        }
        catch(Exception e)
        {
            throw new UserException("Failed to remove account '" +
                user.getUserName() + "'", e);
        }

    }
View Full Code Here

            throw new UnknownUserException("The account '" +
                user.getUserName() + "' does not exist");
        }
        else if (!passwordsMatch(user, oldPassword))
        {
            throw new UserException(
               "The supplied old password for '" + user.getUserName() +
                "' was incorrect");
        }

        String encrypted = JetspeedSecurity.encryptPassword( newPassword );
View Full Code Here

                userClassName = serviceConf.getString(CONFIG_USER_CLASSNAME);                                                            
                userClass = Class.forName(userClassName);
            }
            catch(Exception e)
            {
                throw new UserException(
                    "JetspeedUserFactory: Failed to create a Class object for User implementation: " + e.toString());
            }
        }

        try
        {
            user = (JetspeedUser)userClass.newInstance();
            if (user instanceof BaseJetspeedUser)
            {
                ((BaseJetspeedUser)user).setNew(isNew);
            }           
        }
        catch(Exception e)
        {
            throw new UserException("Failed instantiate an User implementation object: " + e.toString());
        }

        return user;
    }
View Full Code Here

   
        if (create)
        {
            ldapurl = JetspeedLDAP.buildURL("uid=" + (String)getPerm(User.USERNAME) + ",ou=users");
            setutil(ATTR_UID, (String)getPerm(User.USERNAME));
            if (JetspeedLDAP.addEntry(ldapurl, myAttrs) == false) throw new UserException("Could not insert user data to LDAP!");
        }
        else if (JetspeedLDAP.exists(ldapurl))
        {
            JetspeedLDAP.deleteAttrs(ldapurl, rmAttrs);
            if (JetspeedLDAP.updateEntry(ldapurl, myAttrs) == false) throw new UserException("Could not update user data to LDAP!");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.services.security.UserException

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.