X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuser.func.inc.php;h=b903654a1bd08ba87ee43df4a29f731c5bab45ed;hb=a7d35093a40837b3a17d7fbac0259995f084812c;hp=05da262beb45b790c25bf933eb0d75b94af7dc33;hpb=ebd515f95f03f8a87f9b846d65e179b39a535222;p=platal.git diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 05da262..b903654 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); @@ -74,8 +74,10 @@ function user_clear_all_subs($user_id, $really_del=true) // Deactivates, when available, the Google Apps account of the user. if ($globals->mailstorage->googleapps_domain) { require_once 'googleapps.inc.php'; - $account = new GoogleAppsAccount($uid, $alias); - $account->suspend(); + if (GoogleAppsAccount::account_status($uid)) { + $account = new GoogleAppsAccount($uid, $alias); + $account->suspend(); + } } } @@ -86,7 +88,7 @@ function user_clear_all_subs($user_id, $really_del=true) function _default_user_callback($login) { global $page; - $page->trig("Il n'y a pas d'utilisateur avec l'identifiant : $login"); + $page->trigError("Il n'y a pas d'utilisateur avec l'identifiant : $login"); return; } @@ -169,7 +171,7 @@ function get_user_login($data, $get_forlife = false, $callback = '_default_user_ default: if (S::has_perms()) { $aliases = $res->fetchColumn(); - $page->trig("Il y a $i utilisateurs avec cette adresse mail : ".join(', ', $aliases)); + $page->trigError("Il y a $i utilisateurs avec cette adresse mail : ".join(', ', $aliases)); } else { $res->free(); } @@ -397,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')