X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuser.func.inc.php;h=45666bb157c443035c9c185045b5244094003015;hb=9833e186295906e81ff8c5ac4256f5cc941db0f8;hp=1080c263c329022887b41d746d97e3106082c51d;hpb=a7c29df3b9bf8f3c3b23fec0f1d2feb814cb61fe;p=platal.git diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 1080c26..45666bb 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -48,7 +48,7 @@ function user_clear_all_subs($user_id, $really_del=true) $tables_to_clear['contact'] = array('contacts'); XDB::execute("UPDATE auth_user_md5 SET date_ins = 0, promo_sortie = 0, nom_usage = '', password = '', perms = 'pending', - nationalite = '', cv = '', section = 0, date = 0, smtppass = '' + nationalite = '', cv = '', section = 0, date = 0, smtppass = '', mail_storage = '' WHERE user_id = {?}", $uid); XDB::execute("DELETE virtual.* FROM virtual INNER JOIN virtual_redirect AS r USING(vid) WHERE redirect = {?}", $alias.'@'.$globals->mail->domain); @@ -70,6 +70,15 @@ function user_clear_all_subs($user_id, $really_del=true) $mmlist = new MMList(S::v('uid'), S::v('password')); $mmlist->kill($alias, $really_del); + + // Deactivates, when available, the Google Apps account of the user. + if ($globals->mailstorage->googleapps_domain) { + require_once 'googleapps.inc.php'; + if (GoogleAppsAccount::account_status($uid)) { + $account = new GoogleAppsAccount($uid, $alias); + $account->suspend(); + } + } } // }}} @@ -390,7 +399,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private') s.text AS section, p.x, p.y, p.pub AS photo_pub, u.matricule_ax, m.expertise != '' AS is_referent, - COUNT(e.email) > 0 AS actif + (COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif FROM auth_user_md5 AS u INNER JOIN auth_user_quick AS q USING(user_id) INNER JOIN aliases AS a ON (u.user_id=a.id AND a.type='a_vie')