Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
9a799621
Commit
9a799621
authored
Jan 04, 2019
by
IKEDA Soji
Browse files
Small fix: Duplicate counts of update.
parent
bf7661f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Request/Handler/include.pm
View file @
9a799621
...
...
@@ -73,6 +73,7 @@ sub _get_data_sources {
}
@config
;
}
}
elsif
(
$role
eq
'
member
')
{
#FIXME: Use Sympa::Config.
my
@config_files
=
map
{
$list
->
_load_include_admin_user_file
(
$_
)
}
@
{
$list
->
{'
admin
'}{'
member_include
'}
||
[]
};
...
...
@@ -92,6 +93,7 @@ sub _get_data_sources {
}
}
else
{
my
$pname
=
(
$role
eq
'
owner
')
?
'
owner_include
'
:
'
editor_include
';
#FIXME: Use Sympa::Config.
my
@config_files
=
map
{
$list
->
_load_include_admin_user_file
(
$_
)
}
@
{
$list
->
{'
admin
'}{
$pname
}
||
[]
};
...
...
@@ -363,6 +365,17 @@ sub __update_user {
# 3. If user (has not been updated by the other data sources and) exists:
# UPDATE inclusion.
if
(
$is_external_ds
)
{
return
unless
$sth
=
$sdm
->
do_prepared_query
(
qq{UPDATE ${t}_table
SET inclusion_$t = ?, inclusion_ext_$t = ?
WHERE user_$t = ? AND list_$t = ? AND robot_$t = ?$r AND
inclusion_$t IS NOT NULL AND ? <= inclusion_$t}
,
$time
,
$time
,
$email
,
$list
->
{'
name
'},
$list
->
{'
domain
'},
$start_time
);
return
(
updated
=>
0
)
if
$sth
->
rows
;
return
unless
$sth
=
$sdm
->
do_prepared_query
(
qq{UPDATE ${t}_table
SET inclusion_$t = ?, inclusion_ext_$t = ?
...
...
@@ -370,6 +383,7 @@ sub __update_user {
$time
,
$time
,
$email
,
$list
->
{'
name
'},
$list
->
{'
domain
'}
);
return
(
updated
=>
1
)
if
$sth
->
rows
;
}
else
{
return
unless
$sth
=
$sdm
->
do_prepared_query
(
qq{UPDATE ${t}_table
...
...
@@ -378,8 +392,8 @@ sub __update_user {
$time
,
$email
,
$list
->
{'
name
'},
$list
->
{'
domain
'}
);
return
(
updated
=>
1
)
if
$sth
->
rows
;
}
return
(
updated
=>
1
)
if
$sth
->
rows
;
#FIXME: Duplicate counts
# 4. Otherwise, i.e. a new user:
# INSERT new user with:
...
...
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