diff options
Diffstat (limited to 'daemon/gdm-simple-slave.c')
-rw-r--r-- | daemon/gdm-simple-slave.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c index 5af1ba79..3c65b261 100644 --- a/daemon/gdm-simple-slave.c +++ b/daemon/gdm-simple-slave.c @@ -362,17 +362,50 @@ on_session_secret_info_query (GdmSession *session, gdm_greeter_server_secret_info_query (slave->priv->greeter_server, text); } +static gboolean +get_timed_login_details (GdmSimpleSlave *slave, + char **username, + int *delay) +{ + gboolean enabled; + gboolean res; + + enabled = FALSE; + res = gdm_settings_client_get_boolean (GDM_KEY_TIMED_LOGIN_ENABLE, &enabled); + if (! enabled) { + return FALSE; + } + + *username = NULL; + res = gdm_settings_client_get_string (GDM_KEY_TIMED_LOGIN_USER, username); + + if (username == NULL) { + return FALSE; + } + + res = gdm_settings_client_get_int (GDM_KEY_TIMED_LOGIN_DELAY, delay); + + return TRUE; +} + static void on_session_opened (GdmSession *session, GdmSimpleSlave *slave) { gboolean res; + char *username; + int delay; g_debug ("GdmSimpleSlave: session opened"); res = gdm_greeter_server_ready (slave->priv->greeter_server); if (! res) { g_warning ("Unable to send ready"); } + + if (get_timed_login_details (slave, &username, &delay)) { + gdm_greeter_server_request_timed_login (slave->priv->greeter_server, username, delay); + g_free (username); + } } static void |