From: Stéphane Jacob Date: Fri, 6 Aug 2010 14:46:51 +0000 (+0200) Subject: Warns animator about password modification when user has more than one group. X-Git-Tag: xorg/1.1.0~26^2~39 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4257b11a6048df5b2ff148edfce0f319c9092226;p=platal.git Warns animator about password modification when user has more than one group. Signed-off-by: Stéphane Jacob --- diff --git a/classes/user.php b/classes/user.php index 1c22fef..b521048 100644 --- a/classes/user.php +++ b/classes/user.php @@ -586,6 +586,15 @@ class User extends PlUser $this->id()); } + public function hasSingleGroup() + { + $groupNb = XDB::fetchOneCell('SELECT COUNT(DISTINCT(asso_id)) + FROM group_members + WHERE uid = {?}', + $this->id()); + return ($groupNb == 1); + } + /** * Clears a user. * *always deletes in: account_lost_passwords, register_marketing, diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 7c7afc3..068ad86 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -988,6 +988,7 @@ class XnetGrpModule extends PLModule } $page->addJsLink('password.js'); + $page->assign('onlyGroup', $user->hasSingleGroup()); $page->assign('user', $user); $page->assign('listes', $mmlist->get_lists($user->forlifeEmail())); $page->assign('alias', $user->emailAliases($globals->asso('mail_domain'), 'user', true)); diff --git a/templates/xnetgrp/membres-edit.tpl b/templates/xnetgrp/membres-edit.tpl index 6a4192a..e73d521 100644 --- a/templates/xnetgrp/membres-edit.tpl +++ b/templates/xnetgrp/membres-edit.tpl @@ -144,6 +144,13 @@
{checkpasswd prompt="new_plain_password" submit="dummy_none"}
+ {if !$onlyGroup} +
+ + Attention, cet utilisateur est inscrit à d'autres groupes, changer son mot de passe modifiera aussi ses accès aux autres groupes. + +
+ {/if}