summaryrefslogtreecommitdiff
path: root/mate-session/gsm-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'mate-session/gsm-manager.c')
-rw-r--r--mate-session/gsm-manager.c16
1 files changed, 16 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: