diff options
author | George Lebl <jirka@5z.com> | 2002-04-23 01:51:56 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2002-04-23 01:51:56 +0000 |
commit | f306580a6cd3642b641a193c367c6a8b3e7d62bb (patch) | |
tree | b20cee9c3caec81b5768b98777c155e0a1639a2b /daemon | |
parent | e68e80896722189854939c509e8ce2598beee47b (diff) | |
download | gdm-f306580a6cd3642b641a193c367c6a8b3e7d62bb.tar.gz |
support updating the timed login stuff
Mon Apr 22 19:00:14 2002 George Lebl <jirka@5z.com>
* daemon/gdm.[ch], daemon/slave.c: support updating the timed login
stuff
* gui/gdmsetup.(c|glade): implement updating of most things (at
least theoretically) except the greeter choosing.
* gui/greeter/greeter.c, gui/greeter/greeter_item_pam.c,
gui/greeter/greeter_session.c: fix warnings
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm.c | 39 | ||||
-rw-r--r-- | daemon/gdm.h | 5 | ||||
-rw-r--r-- | daemon/slave.c | 14 |
3 files changed, 58 insertions, 0 deletions
diff --git a/daemon/gdm.c b/daemon/gdm.c index 0b81da97..e579216d 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -2255,6 +2255,45 @@ update_config (const char *key) notify_displays_string (GDM_NOTIFY_REMOTEGREETER, val); goto update_config_ok; + } else if (is_key (key, GDM_KEY_TIMED_LOGIN) || + is_key (key, GDM_KEY_TIMED_LOGIN_ENABLE)) { + gboolean enable = gnome_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE); + char *val; + + /* if not enabled, we just don't care */ + if ( ! enable && ! GdmTimedLoginEnable) + goto update_config_ok; + + val = gnome_config_get_string (GDM_KEY_TIMED_LOGIN); + if (strcmp (ve_sure_string (val), + ve_sure_string (GdmTimedLogin)) == 0 && + ve_bool_equal (enable, GdmTimedLoginEnable)) { + g_free (val); + goto update_config_ok; + } + + GdmTimedLoginEnable = enable; + g_free (GdmTimedLogin); + if (GdmTimedLoginEnable) { + GdmTimedLogin = val; + } else { + g_free (val); + GdmTimedLogin = NULL; + } + + notify_displays_string (GDM_NOTIFY_TIMED_LOGIN, + ve_sure_string (GdmTimedLogin)); + + goto update_config_ok; + } else if (is_key (key, GDM_KEY_TIMED_LOGIN_DELAY)) { + int val = gnome_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY); + if (val == GdmTimedLoginDelay) + goto update_config_ok; + GdmTimedLoginDelay = val; + + notify_displays_int (GDM_NOTIFY_TIMED_LOGIN_DELAY, val); + + goto update_config_ok; } else if (is_key (key, GDM_KEY_XDMCP)) { gboolean val = gnome_config_get_bool (GDM_KEY_XDMCP); if (ve_bool_equal (val, GdmXdmcp)) diff --git a/daemon/gdm.h b/daemon/gdm.h index 89c554dc..ebb01272 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -425,6 +425,8 @@ GdmXServer * gdm_find_x_server (const char *id); #define GDM_NOTIFY_RETRYDELAY "RetryDelay" /* <seconds> */ #define GDM_NOTIFY_GREETER "Greeter" /* <greeter binary> */ #define GDM_NOTIFY_REMOTEGREETER "RemoteGreeter" /* <greeter binary> */ +#define GDM_NOTIFY_TIMED_LOGIN "TimedLogin" /* <login> */ +#define GDM_NOTIFY_TIMED_LOGIN_DELAY "TimedLoginDelay" /* <seconds> */ #define GDM_SUP_SOCKET "/tmp/.gdm_socket" @@ -547,6 +549,9 @@ GdmXServer * gdm_find_x_server (const char *id); * xdmcp/MaxPendingIndirect * xdmcp/MaxWaitIndirect * xdmcp/PingInterval (only affects new connections) + * xdmcp/TimedLogin (2.3.90.3) + * xdmcp/TimedLoginEnable (2.3.90.3) + * xdmcp/TimedLoginDelay (2.3.90.3) * Supported since: 2.3.90.2 * Arguments: <key> * <key> is just the base part of the key such as "security/AllowRemoteRoot" diff --git a/daemon/slave.c b/daemon/slave.c index 85377fdd..bd2e5297 100644 --- a/daemon/slave.c +++ b/daemon/slave.c @@ -3018,6 +3018,7 @@ gdm_slave_handle_notify (GdmConnection *conn, const char *msg, gpointer data) GdmRetryDelay = val; } else if (strncmp (msg, GDM_NOTIFY_GREETER " ", strlen (GDM_NOTIFY_GREETER) + 1) == 0) { + /* FIXME: this is fairly nasty, we should handle this nicer */ /* FIXME: can't handle flexi servers without going all cranky */ if (display->type == TYPE_LOCAL) { if ( ! display->logged_in) @@ -3027,6 +3028,7 @@ gdm_slave_handle_notify (GdmConnection *conn, const char *msg, gpointer data) } } else if (strncmp (msg, GDM_NOTIFY_REMOTEGREETER " ", strlen (GDM_NOTIFY_REMOTEGREETER) + 1) == 0) { + /* FIXME: this is fairly nasty, we should handle this nicer */ /* FIXME: can't handle flexi servers without going all cranky */ if (display->type == TYPE_XDMCP) { if ( ! display->logged_in) @@ -3034,6 +3036,18 @@ gdm_slave_handle_notify (GdmConnection *conn, const char *msg, gpointer data) else remanage_asap = TRUE; } + } else if (strncmp (msg, GDM_NOTIFY_TIMED_LOGIN " ", + strlen (GDM_NOTIFY_TIMED_LOGIN) + 1) == 0) { + /* FIXME: this is fairly nasty, we should handle this nicer */ + /* FIXME: can't handle flexi servers without going all cranky */ + if (display->type == TYPE_LOCAL) { + if ( ! display->logged_in) + _exit (DISPLAY_REMANAGE); + else + remanage_asap = TRUE; + } + } else if (sscanf (msg, GDM_NOTIFY_TIMED_LOGIN_DELAY " %d", &val) == 1) { + GdmTimedLoginDelay = val; } } |