@Override
    public boolean isValid() {

        try {
            // If access window enforcement is disabled for active sessions,
            // skip validity checks entirely
            if (!environment.enforceAccessWindowsForActiveSessions())
                return true;
        }

        catch (GuacamoleException e) {

            logger.warn(
                    "Unable to determine if access window enforcement is"
                    + " enabled for active sessions; enforcing by default: {}"
                    , e.getMessage());
            logger.debug("Unable to determine access window enforcement policy.", e);

        }

        // A user context is valid if the associated user's account is valid
        // for the current date, and the user is within an access time window
        ModeledUser user = getCurrentUser().getUser();
        return user.isAccountValid() && user.isAccountAccessible();

    }
Records that the user associated with this UserContext has logged in,
creating a partial activity record. The resulting activity record will
contain a start date only, with the end date being automatically
populated when this UserContext is invalidated. If this function is
invoked more than once for the same UserContext, only the first
invocation has any effect. If this function is never invoked, no
activity record will be recorded, including when this UserContext is
invalidated.

@throws GuacamoleException
    If an error occurs retrieving configuration information from the
    environment.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUserContext.java