- #451: vCard are RFC compliant -FRU
- #502: Use 'alias' instead of 'aka' to specify the nickname -FRU
+ * Xnet:
+ - #511: Migrate ML subscription when changing email of a non-X -FRU
+
* Xnet/Events:
- #490: Events can be opened to non-members -FRU
- #514: Improve visibility of open events -FRU
# owners procedures [ admin.php ]
#
+def replace_email(userdesc, perms, vhost, listname, from_email, to_email):
+ try:
+ mlist = MailList.MailList(vhost+VHOST_SEP+listname.lower(), lock=0)
+ except:
+ return 0
+ try:
+ if not is_admin_on(userdesc, perms, mlist):
+ return 0
+
+ mlist.Lock()
+ mlist.ApprovedChangeMemberAddress(from_email, to_email, 0)
+ mlist.Save()
+ mlist.Unlock()
+ return 1
+ except:
+ return 0
+
def mass_subscribe(userdesc, perms, vhost, listname, users):
try:
mlist = MailList.MailList(vhost+VHOST_SEP+listname.lower(), lock=0)
server.register_function(get_members_limit)
server.register_function(get_owners)
# admin.php
+server.register_function(replace_email)
server.register_function(mass_subscribe)
server.register_function(mass_unsubscribe)
server.register_function(add_owner)
$globals->asso('mail_domain'));
if (Post::has('change')) {
+ $email_changed = ($user['origine'] != 'X' && $user['email'] != Post::v('email'));
+ $from_email = $user['email'];
if ($user['origine'] != 'X') {
XDB::query('UPDATE groupex.membres
SET prenom={?}, nom={?}, email={?}, sexe={?}
foreach (Env::v('ml1', array()) as $ml => $state) {
$ask = empty($_REQUEST['ml2'][$ml]) ? 0 : 2;
- if ($ask == $state) continue;
+ if ($ask == $state) {
+ if ($state) {
+ $mmlist->replace_email($ml, $from_email, $user['email2']);
+ $page->trig("L'abonnement de {$user['prenom']} {$user['nom']} à $ml@ a été mis à jour");
+ }
+ continue;
+ }
if ($state == '1') {
$page->trig("{$user['prenom']} {$user['nom']} a "
."actuellement une demande d'inscription en "
$mmlist->mass_subscribe($ml, Array($user['email2']));
$page->trig("{$user['prenom']} {$user['nom']} a été abonné à $ml@");
} else {
- $mmlist->mass_unsubscribe($ml, Array($user['email2']));
+ if ($email_changed) {
+ $mmlist->mass_unsubscribe($ml, Array($from_email));
+ } else {
+ $mmlist->mass_unsubscribe($ml, Array($user['email2']));
+ }
$page->trig("{$user['prenom']} {$user['nom']} a été désabonné de $ml@");
}
}