PasswordResetModel::validateResetPassword PHP Method

validateResetPassword() public static method

Validate the password submission
public static validateResetPassword ( $user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat ) : boolean
$user_name
$user_password_reset_hash
$user_password_new
$user_password_repeat
return boolean
    public static function validateResetPassword($user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat)
    {
        if (empty($user_name)) {
            Session::add('feedback_negative', Text::get('FEEDBACK_USERNAME_FIELD_EMPTY'));
            return false;
        } else {
            if (empty($user_password_reset_hash)) {
                Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_RESET_TOKEN_MISSING'));
                return false;
            } else {
                if (empty($user_password_new) || empty($user_password_repeat)) {
                    Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_FIELD_EMPTY'));
                    return false;
                } else {
                    if ($user_password_new !== $user_password_repeat) {
                        Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_REPEAT_WRONG'));
                        return false;
                    } else {
                        if (strlen($user_password_new) < 6) {
                            Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_TOO_SHORT'));
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }