Package org.apache.struts.apps.mailreader.dao

Examples of org.apache.struts.apps.mailreader.dao.User


                !"EDIT".equals(state.getMode())) {
            return;
        }

        // The first time in, prepopulate our input field values
        User user = state.getUser();
        org.apache.struts.apps.mailreader.dao.Subscription subscription =
                user.findSubscription(state.getHost());
        if (!isPostBack()) {
            setHost(subscription.getHost());
            setUsername(subscription.getUsername());
            setPassword(subscription.getPassword());
            setType(subscription.getType());
View Full Code Here


        // FIXME: Stupid testing hack to compensate for inadequate DAO layer
        if (Constants.EXPIRED_PASSWORD_EXCEPTION.equals(username)) {
            throw new ExpiredPasswordException(Constants.EXPIRED_PASSWORD_EXCEPTION);
        }

        User user = getDatabase().findUser(username);
        if ((user != null) && !user.getPassword().equals(password)) {
            user = null;
        }
        if (user == null) {
            this.addFieldError(Constants.PASSWORD_MISMATCH_FIELD,
                    getText("error.password.mismatch"));
View Full Code Here

            throw new Exception(message, e);
        }
    }

    public void createInputUser() {
        User user = new MemoryUser(null, null);
        setUser(user);
    }
View Full Code Here

     *         Errors if create fails
     */
    public User createUser(String username, String password) {

        UserDatabase database = getDatabase();
        User user;

        try {
            user = database.findUser(username);
         }

View Full Code Here

     *
     * @param _username User username
     * @param _password User password
     */
    public void copyUser(String _username, String _password) {
        User input = getUser();
        input.setPassword(_password);
        User user = createUser(_username, _password);
        if (null != user) {
            copyUser(input,user);
            setUser(user);
        }
    }
View Full Code Here

     * <p>Double check that there is not a valid User login. </p>
     *
     * @return True if there is not a valid User login
     */
    private boolean isCreating() {
        User user = getUser();
        return (null == user) || (null == user.getDatabase());
    }
View Full Code Here

        boolean creating = Constants.CREATE.equals(getTask());
        creating = creating && isCreating(); // trust but verify

        if (creating) {

            User user = findUser(getUsername(), getPassword());
            boolean haveUser = (user != null);

            if (haveUser) {
                addActionError(getText("error.username.unique"));
                return INPUT;
View Full Code Here

    public String intercept(ActionInvocation actionInvocation) throws Exception {

        Map session = actionInvocation.getInvocationContext().getSession();

        User user = (User) session.get(Constants.USER_KEY);

        boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());

        if (!isAuthenticated) {
            return Action.LOGIN;           
        }
        else {
View Full Code Here

*/
public final class Login extends MailreaderSupport {

    public String execute() throws ExpiredPasswordException  {

        User user = findUser(getUsername(), getPassword());

        if (user != null) {
            setUser(user);
        }

View Full Code Here

        // FIXME: Stupid testing hack to compensate for inadequate DAO layer
        if (Constants.EXPIRED_PASSWORD_EXCEPTION.equals(username)) {
            throw new ExpiredPasswordException(Constants.EXPIRED_PASSWORD_EXCEPTION);
        }

        User user = getDatabase().findUser(username);
        if ((user != null) && !user.getPassword().equals(password)) {
            user = null;
        }
        if (user == null) {
            this.addFieldError(Constants.PASSWORD_MISMATCH_FIELD,
                    getText("error.password.mismatch"));
View Full Code Here

TOP

Related Classes of org.apache.struts.apps.mailreader.dao.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.