+ $page->trigSuccess("{$user['prenom']} {$user['nom']} a été désabonné du groupe !");
+ } else {
+ $page->trigWarning("{$user['prenom']} {$user['nom']} a été désabonné du groupe, mais des erreurs subsistent !");
+ }
+ }
+
+ private function changeLogin(PlatalPage &$page, array &$user, MMList &$mmlist, $login)
+ {
+ require_once 'user.func.inc.php';
+ // Search the uid of the user...
+ $res = XDB::query("SELECT f.id, f.alias
+ FROM aliases AS a
+ INNER JOIN aliases AS f ON (f.id = a.id AND f.type = 'a_vie')
+ WHERE a.alias = {?}",
+ $login);
+ if ($res->numRows() == 0) {
+ $x = get_not_registered_user($login);
+ if (!$x) {
+ $page->trigError("Le login $login ne correspond à aucun X.");
+ return false;
+ } else if (count($x) > 1) {
+ $page->trigError("Le login $login correspond a plusieurs camarades.");
+ return false;
+ }
+ $uid = $x[0]['user_id'];
+ $sub = false;
+ } else {
+ list($uid, $login) = $res->fetchOneRow();
+ $sub = true;
+ }
+
+ // Check if the user is already in the group
+ global $globals;
+ $res = XDB::query("SELECT uid, email
+ FROM groupex.membres
+ WHERE uid = {?} AND asso_id = {?}",
+ $uid, $globals->asso('id'));
+ if ($res->numRows()) {
+ list($uid, $email) = $res->fetchOneRow();
+ XDB::execute("DELETE FROM groupex.membres
+ WHERE uid = {?}",
+ $user['uid']);