+
+ // If GoogleApps is enabled, the user did choose to use synchronized passwords,
+ // and the password was changed, updates the Google Apps password as well.
+ if ($globals->mailstorage->googleapps_domain && Env::v('newpass_clair') != "********") {
+ require_once 'googleapps.inc.php';
+ $account = new GoogleAppsAccount($mr['user_id'], $mr['forlife']);
+ if ($account->active() && $account->sync_password) {
+ $account->set_password($pass_encrypted);
+ }
+ }
+
+ // If GoogleApps is enabled, and the user is now disabled, disables the Google Apps account as well.
+ if ($globals->mailstorage->googleapps_domain &&
+ $new_fields['perms'] == 'disabled' &&
+ $new_fields['perms'] != $old_fields['perms']) {
+ require_once 'googleapps.inc.php';
+ $account = new GoogleAppsAccount($mr['user_id'], $mr['forlife']);
+ $account->suspend();
+ }