X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuser.func.inc.php;h=45666bb157c443035c9c185045b5244094003015;hb=14870e883e3fbfb866998d6640c0e5fb8047d04b;hp=aca62cdc64b136e01cd128f1c2c72a91fb2a103f;hpb=be6ab042d1dc34d9e42557281b48dd8da400231b;p=platal.git
diff --git a/include/user.func.inc.php b/include/user.func.inc.php
index aca62cd..45666bb 100644
--- a/include/user.func.inc.php
+++ b/include/user.func.inc.php
@@ -1,6 +1,6 @@
mail->domain);
@@ -71,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();
+ }
+ }
}
// }}}
@@ -391,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')
@@ -448,14 +456,18 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
$user['binets'] = $res->fetchColumn();
$user['binets_join'] = join(', ', $user['binets']);
- $res = XDB::iterRow("SELECT text, url
- FROM groupesx_ins
- LEFT JOIN groupesx_def ON groupesx_ins.gid = groupesx_def.id
- WHERE guid = {?}", $uid);
+ $res = XDB::iterRow("SELECT a.diminutif, a.nom, a.site
+ FROM groupex.asso AS a
+ LEFT JOIN groupex.membres AS m ON (m.asso_id = a.id)
+ WHERE m.uid = {?} AND (a.cat = 'GroupesX' OR a.cat = 'Institutions')
+ AND pub = 'public'", $uid);
$user['gpxs'] = Array();
$user['gpxs_name'] = Array();
- while (list($gxt, $gxu) = $res->next()) {
- $user['gpxs'][] = $gxu ? "$gxt" : $gxt;
+ while (list($gxd, $gxt, $gxu) = $res->next()) {
+ if (!$gxu) {
+ $gxu = 'http://www.polytechnique.net/' . $gxd;
+ }
+ $user['gpxs'][] = '$gxd";
$user['gpxs_name'][] = $gxt;
}
$user['gpxs_join'] = join(', ', $user['gpxs']);