} else {
$page->trigWarning('Tu as été désinscrit du groupe, mais des erreurs se sont produites lors des désinscriptions des alias et des listes de diffusion.');
}
- if ($user->type == 'xnet' && $hasSingleGroup && Post::has('accountDeletion')) {
- XDB::execute('DELETE FROM acounts
- WHERE uid = {?}',
- $user->id());
- $page->trigSuccess('Ton compte a bien été supprimé.');
+
+ // If user is of type xnet account and this was her last group, disable the account.
+ if ($user->type == 'xnet' && $hasSingleGroup) {
+ $user->clear(true);
}
$page->assign('is_member', is_member(true));
}
$page->trigWarning("{$user->fullName()} a été désinscrit du groupe, mais des erreurs subsistent !");
}
- // Either deletes or notifies site administrators if it was the last group
- // of a xnet account.
+ // If user is of type xnet account and this was her last group, disable the account.
if ($user->type == 'xnet' && $hasSingleGroup) {
- if ($user->state == 'pending') {
- // If the user has never logged in the site, we delete her account.
- XDB::execute('DELETE FROM acounts
- WHERE uid = {?}',
- $user->id());
- } else {
- // It the user has already logged in the site, we notify site
- // administrators that there is a new xnet account without any
- // group.
- $mailer = new PlMailer('xnetgrp/unsubscription.mail.tpl');
- $mailer->assign('user', $user);
- $mailer->assign('groupId', $globals->asso('id'));
- $mailer->assign('groupName', $globals->asso('nom'));
- $mailer->send();
- }
+ $user->clear(true);
}
}
{if $self}
Êtes-vous sûr de vouloir vous désinscrire du groupe {$asso->nom} et de toutes
les listes de diffusion associées ?
- {if $user->type eq 'xnet' && $user->groupCount() eq 1}
- <br />C'est le seul groupe auquel tu es actuellement inscrit sur polytechnique.net.
- Si, malgré cela, tu souhaites garder ton accès à Polytechnique.net, décoche la case
- ci-dessous.<br />
- <label><input type="checkbox" name="accountDeletion" checked="checked" />Supprimer mon compte.</label>
- {/if}
{else}
Êtes-vous sûr de vouloir supprimer {$user->fullName()} du groupe,
lui retirer tous les droits associés à son statut de membre