Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sympa
sympa
Commits
ee43b3c3
Unverified
Commit
ee43b3c3
authored
Aug 18, 2018
by
IKEDA Soji
Committed by
GitHub
Aug 18, 2018
Browse files
Merge pull request #395 from ikedas/issue-389 by ikedas
sympa.pl --change_user_email no longer working with 6.2.34 #389
parents
d54dc27b
502b7e17
Changes
2
Hide whitespace changes
Inline
Side-by-side
default/mail_tt2/report.tt2
View file @
ee43b3c3
...
...
@@ -791,8 +791,26 @@ Warning: this message may already have been sent by one of the list's moderators
[%~ ELSIF report_entry == 'change_member_email_failed_deleting' ~%]
[%|loc(report_param.email,report_param.listname)%]Failed to delete member email '%1' in list '%2'.[%END%]
[%~ ELSIF report_entry == 'change_admin_email_failed' ~%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.email,report_param.listname)%]Failed to update owner email '%1' in list '%2'.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.email,report_param.listname)%]Failed to update moderator email '%1' in list '%2'.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'change_admin_email_failed_included' ~%]
[%|loc(report_param.listname)%]Failed to update admin email in list '%1', list owner has been notified.[%END%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.listname)%]Failed to update owner email in list '%1', listmaster has been notified.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.listname)%]Failed to update moderator email in list '%1', listmaster has been notified.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'change_admin_email_failed_deleting' ~%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.email,report_param.listname)%]Failed to delete owner email '%1' in list '%2'.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.email,report_param.listname)%]Failed to delete moderator email '%1' in list '%2'.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'no_email_changed' ~%]
[%|loc%]Address was not changed.[%END%]
...
...
src/lib/Sympa/Request/Handler/move_user.pm
View file @
ee43b3c3
...
...
@@ -149,23 +149,27 @@ sub _twist {
Sympa::List::
get_which
(
$current_email
,
$robot_id
,
$role
))
{
# Check if admin is included via an external datasource.
my
(
$admin_user
)
=
@
{
$list
->
get_admins
(
$role
,
filter
=>
[
email
=>
$current_email
])
};
grep
{
$_
->
{
role
}
eq
$role
and
$_
->
{
email
}
eq
$current_email
}
@
{
$list
->
get_current_admins
||
[]
};
if
(
$admin_user
and
$admin_user
->
{'
included
'})
{
# Notify listmaster.
Sympa::
send_notify_to_listmaster
(
$list
,
'
failed_to_change_included_admin
',
{
'
current_email
'
=>
$current_email
,
'
new_email
'
=>
$email
,
'
datasource
'
=>
{
current_email
=>
$current_email
,
new_email
=>
$email
,
role
=>
$role
,
datasource
=>
$list
->
get_datasource_name
(
$admin_user
->
{'
id
'})
}
);
$self
->
add_stash
(
$request
,
'
user
',
'
change_admin_email_failed_included
',
{
email
=>
$current_email
,
listname
=>
$list
->
{'
name
'}}
{
email
=>
$current_email
,
listname
=>
$list
->
{'
name
'},
role
=>
$role
}
);
$log
->
syslog
(
'
err
',
...
...
@@ -178,19 +182,46 @@ sub _twist {
next
;
}
# Go through owners/editors of the list.
foreach
my
$admin
(
@
{
$list
->
{'
admin
'}{
$role
}})
{
next
unless
lc
$admin
->
{'
email
'}
eq
lc
$current_email
;
# Update entry with new email address.
$admin
->
{'
email
'}
=
$email
;
$updated_lists
{
$list
->
{'
name
'}}
++
;
# Check if user is already user of the list with their new address
# then we just need to remove the old address.
if
(
grep
{
$_
->
{
role
}
eq
$role
and
$_
->
{
email
}
eq
$email
}
@
{
$list
->
get_current_admins
||
[]
})
{
unless
(
$list
->
delete_list_admin
(
$role
,
$current_email
))
{
$self
->
add_stash
(
$request
,
'
user
',
'
change_admin_email_failed_deleting
',
{
email
=>
$current_email
,
listname
=>
$list
->
{'
name
'},
role
=>
$role
}
);
$log
->
syslog
('
info
',
'
Could not remove email %s from list %s
',
$current_email
,
$list
);
next
;
}
}
else
{
unless
(
$list
->
update_list_admin
(
$current_email
,
$role
,
{
email
=>
$email
,
update_date
=>
time
}
)
)
{
$self
->
add_stash
(
$request
,
'
user
',
'
change_admin_email_failed
',
{
email
=>
$current_email
,
listname
=>
$list
->
{'
name
'},
role
=>
$role
}
);
$log
->
syslog
('
err
',
'
Could not change email %s for list %s to %s
',
$current_email
,
$list
,
$email
);
next
;
}
}
# Update database cache for the list.
$list
->
sync_include_admin
();
$list
->
save_config
();
$updated_lists
{
$list
->
{'
name
'}}
=
1
;
}
}
# Notify listmasters that list owners/moderators email have changed.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment