<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$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);
$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();
+ }
+ }
}
// }}}
// Defaut callback to call when a login is not found
function _default_user_callback($login)
{
- global $page;
- $page->trig("Il n'y a pas d'utilisateur avec l'identifiant : $login");
+ Platal::page()->trigError("Il n'y a pas d'utilisateur avec l'identifiant : $login");
return;
}
function get_user_login($data, $get_forlife = false, $callback = '_default_user_callback')
{
- global $globals, $page;
+ global $globals;
if (is_numeric($data)) {
$res = XDB::query("SELECT alias FROM aliases WHERE type='a_vie' AND id={?}", $data);
default:
if (S::has_perms()) {
$aliases = $res->fetchColumn();
- $page->trig("Il y a $i utilisateurs avec cette adresse mail : ".join(', ', $aliases));
+ Platal::page()->trigError("Il y a $i utilisateurs avec cette adresse mail : ".join(', ', $aliases));
} else {
$res->free();
}
if (strlen(trim($members)) == 0) {
return null;
}
- $members = explode(' ', $members);
+ $members = split("[; ,\r\n\|]+", $members);
}
if ($members) {
$list = array();
foreach ($members as $i => $alias) {
+ $alias = trim($alias);
+ if (empty($alias)) {
+ continue;
+ }
if (($login = get_user_forlife($alias, $callback)) !== false) {
$list[$i] = $login;
- } else if(!$strict) {
+ } else if (!$strict) {
$list[$i] = $alias;
+ } else {
+ global $globals;
+ if (strpos($alias, '@') !== false) {
+ list($user, $dom) = explode('@', $alias);
+ if ($dom != $globals->mail->domain && $dom != $globals->mail->domain2) {
+ $list[$i] = $alias;
+ }
+ }
}
}
return $list;
}
$sql = "SELECT user_id, nom, prenom, promo
FROM auth_user_md5
- WHERE $where
+ WHERE $where AND perms = 'pending'
ORDER BY promo, nom, prenom";
if ($iterator) {
return XDB::iterator($sql, $nom, $prenom, $promo);
gp.pays AS countrytxt,a.region, a.regiontxt,
FIND_IN_SET('active', a.statut) AS active, a.adrid,
FIND_IN_SET('res-secondaire', a.statut) AS secondaire,
+ FIND_IN_SET('courrier', a.statut) AS courier,
a.pub, gp.display
FROM adresses AS a
LEFT JOIN geoloc_pays AS gp ON (gp.a2=a.country)
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')