src/main/java/edu/kit/informatik/pcc/webinterface/datamanagement/AccountDataManager.java
/**
     * This method sends the given parameters to ServerProxy to authenticate.
     *
     * @param mail mail address
     * @param password password
     * @return true on success false else
     */
This method sends the given parameters to ServerProxy to authenticate.
@param mail mail address
@param password password
@return true on success false else
This method sends the given parameters to ServerProxy to authenticate . @param mail mail address @param password password @return true on success false else
public static boolean authenticateAccount(String mail, String password, VaadinSession session) {
        Account account = new Account(mail, password);
        String ret = ServerProxy.authenticateUser(account);
        switch (ret) {
            case NOTEXISTING:
                MessageBox.createInfo()
                        .withMessage(errors.getString("noSuchAccount"))
                        .open();
                break;
            case WRONGPASSWORD:
                MessageBox.createInfo()
                        .withMessage(errors.getString("wrongPassword"))
                        .open();
                break;
            case NOTVERIFIED:
                MessageBox.createInfo()
                        .withMessage(errors.getString("notVerified"))
                        .open();
                break;
            case SUCCESS:
                session.setAttribute("account", account);
                return true;
            default:
                System.out.println(ret);
                MessageBox.createInfo()
                        .withMessage(errors.getString("authenticateFail"))
                        .open();
                break;
        }
        return false;
    }
public static boolean authenticateAccount ( String mail , String password , VaadinSession session ) { Account account = new Account ( mail , password ) ; String ret = ServerProxy . authenticateUser ( account ) ; switch ( ret ) { case NOTEXISTING : MessageBox . createInfo ( ) . withMessage ( errors . getString ( "noSuchAccount" ) ) . open ( ) ; break ; case WRONGPASSWORD : MessageBox . createInfo ( ) . withMessage ( errors . getString ( "wrongPassword" ) ) . open ( ) ; break ; case NOTVERIFIED : MessageBox . createInfo ( ) . withMessage ( errors . getString ( "notVerified" ) ) . open ( ) ; break ; case SUCCESS : session . setAttribute ( "account" , account ) ; return true ; default : System . out . println ( ret ) ; MessageBox . createInfo ( ) . withMessage ( errors . getString ( "authenticateFail" ) ) . open ( ) ; break ; } return false ; }
This method sends the given parameters to ServerProxy to authenticate.
This method sends the given parameters to ServerProxy to authenticate .