Method

MalcontentSessionLimitscheck_time_remaining

unstable since: 0.14.0

Declaration [src]

gboolean
mct_session_limits_check_time_remaining (
  MctSessionLimits* limits,
  GDateTime* now_dt,
  uint64_t active_session_time_today_secs,
  guint64* time_remaining_secs_out,
  gboolean* time_limit_enabled_out
)

Description [src]

Check whether the user has time remaining in which they are allowed to use the computer.

This assumes that now_dt is the current time and active_session_time_today_secs is the total amount of time the user has spent in an active session up to that point today, and applies the session limit policy from limits to them.

This will return whether the user is allowed to use the computer now; further information about the policy and remaining time is provided in time_remaining_secs_out and time_limit_enabled_out.

Available since: 0.14.0

Parameters

now_dt

Type: GDateTime

Current time in the user’s timezone, typically queried using g_date_time_new_now_local().

The data is owned by the caller of the method.
active_session_time_today_secs

Type: uint64_t

Total time the user has spent in an active session so far today, in seconds.

time_remaining_secs_out

Type: guint64*

Return location for the number of seconds remaining before the user’s session has to end, if limits are in force.

The argument will be set by the function.
The argument can be NULL.
time_limit_enabled_out

Type: gboolean*

Return location for whether time limits are enabled for this user.

The argument will be set by the function.
The argument can be NULL.

Return value

Type: gboolean

True if the user this limits corresponds to is allowed to be in an active session at the given time; false otherwise.