diff options
-rw-r--r-- | mate-session/gsm-manager.c | 16 | ||||
-rw-r--r-- | mate-session/gsm-manager.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c index 66ae3a6..a880fb3 100644 --- a/mate-session/gsm-manager.c +++ b/mate-session/gsm-manager.c @@ -215,6 +215,7 @@ gsm_manager_error_get_type (void) ENUM_ENTRY (GSM_MANAGER_ERROR_ALREADY_REGISTERED, "AlreadyRegistered"), ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_REGISTERED, "NotRegistered"), ENUM_ENTRY (GSM_MANAGER_ERROR_INVALID_OPTION, "InvalidOption"), + ENUM_ENTRY (GSM_MANAGER_ERROR_LOCKED_DOWN, "LockedDown"), { 0, 0, 0 } }; @@ -3303,6 +3304,13 @@ gsm_manager_request_reboot (GsmManager *manager, return TRUE; } +static gboolean +_log_out_is_locked_down (GsmManager *manager) +{ + return g_settings_get_boolean (manager->priv->settings_lockdown, + "disable-log-out"); +} + gboolean gsm_manager_shutdown (GsmManager *manager, GError **error) @@ -3386,6 +3394,14 @@ gsm_manager_logout (GsmManager *manager, return FALSE; } + if (_log_out_is_locked_down (manager)) { + g_set_error (error, + GSM_MANAGER_ERROR, + GSM_MANAGER_ERROR_LOCKED_DOWN, + "Logout has been locked down"); + return FALSE; + } + switch (logout_mode) { case GSM_MANAGER_LOGOUT_MODE_NORMAL: case GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION: diff --git a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h index c9170df..035d11b 100644 --- a/mate-session/gsm-manager.h +++ b/mate-session/gsm-manager.h @@ -96,6 +96,7 @@ typedef enum GSM_MANAGER_ERROR_ALREADY_REGISTERED, GSM_MANAGER_ERROR_NOT_REGISTERED, GSM_MANAGER_ERROR_INVALID_OPTION, + GSM_MANAGER_ERROR_LOCKED_DOWN, GSM_MANAGER_NUM_ERRORS } GsmManagerError; |