From f7d43ed53508bacc955e4964af2b4071ac906c6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 28 Jun 2011 22:49:50 +0200 Subject: [PATCH] Fixes users merge. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/user.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/user.php b/classes/user.php index 7ede56b..f24a8dc 100644 --- a/classes/user.php +++ b/classes/user.php @@ -782,6 +782,8 @@ class User extends PlUser // Change email used in mailing lists. if ($this->forlifeEmail() != $newuser->forlifeEmail()) { + // The super user is the user who has the right to do the modification. + $super_user = S::user(); // group mailing lists $group_domains = XDB::fetchColumn('SELECT g.mail_domain FROM groups AS g @@ -789,11 +791,11 @@ class User extends PlUser WHERE g.mail_domain != \'\' AND gm.uid = {?}', $this->id()); foreach ($group_domains as $mail_domain) { - $mmlist = new MMList($this, $mail_domain); + $mmlist = new MMList($super_user, $mail_domain); $mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail()); } // main domain lists - $mmlist = new MMList($this); + $mmlist = new MMList($super_user); $mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail()); } } -- 2.1.4