From 1f84e0aca375a425c2fb58be57e24867727f3559 Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Mon, 23 Mar 2009 14:47:28 +0100 Subject: [PATCH] Avoids disabling the Google Apps account when a user account is disabled. This matches the behavior of email forwarding (requested by Gadz.org). Also adds a reminder to the admin, so that she doesn't forget to properly remove the forwardings when needed. Signed-off-by: Vincent Zanotti --- modules/admin.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/admin.php b/modules/admin.php index d9b00c8..40df9da 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -552,6 +552,10 @@ class AdminModule extends PLModule // however suits our needs. if ($perms == 'disabled' && $old_fields['perms'] != 'disabled') { kill_sessions(); + + // Also serve a reminder to the admin: disabling an account + // does not deactivate email forwarding. + $page->trigWarning("N'oubliez pas, le cas échéant, de désactiver les redirections et le compte GoogleApps de l'utilisateur."); } // Updates the user profile with the new values. @@ -603,14 +607,6 @@ class AdminModule extends PLModule $account->set_password($pass_encrypted); } } - - // If the update did disable the user account, disables - // the Google Apps account as well. - if ($new_fields['perms'] == 'disabled' && $new_fields['perms'] != $old_fields['perms']) { - require_once 'googleapps.inc.php'; - $account = new GoogleAppsAccount($user); - $account->suspend(); - } } -- 2.1.4