Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
63368e9e
Commit
63368e9e
authored
Jul 15, 2021
by
Jesse Norell
Browse files
remove spamfilter_wblist entries when removing spamfilter_users
parent
36cdb858
Pipeline
#9062
passed with stage
in 8 minutes and 16 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
interface/web/mail/mail_user_del.php
View file @
63368e9e
...
...
@@ -55,6 +55,14 @@ class page_action extends tform_actions {
global
$app
;
$conf
;
$tmp_user
=
$app
->
db
->
queryOneRecord
(
"SELECT id FROM spamfilter_users WHERE email = ?"
,
$this
->
dataRecord
[
"email"
]);
if
(
is_array
(
$tmp_user
)
&&
isset
(
$tmp_user
[
'id'
]))
{
$tmp_wblists
=
$app
->
db
->
queryAllRecords
(
"SELECT wblist_id FROM spamfilter_wblist WHERE rid = ?"
,
$tmp_user
[
'id'
]);
if
(
is_array
(
$tmp_wblists
))
{
foreach
(
$tmp_wblists
as
$tmp
)
{
$app
->
db
->
datalogDelete
(
'spamfilter_wblist'
,
'wblist_id'
,
$tmp
[
'wblist_id'
]);
}
}
}
$app
->
db
->
datalogDelete
(
'spamfilter_users'
,
'id'
,
$tmp_user
[
"id"
]);
$tmp_filters
=
$app
->
db
->
queryAllRecords
(
"SELECT filter_id FROM mail_user_filter WHERE mailuser_id = ?"
,
$this
->
id
);
...
...
@@ -71,4 +79,3 @@ class page_action extends tform_actions {
$page
=
new
page_action
;
$page
->
onDelete
();
?>
interface/web/mail/spamfilter_users_del.php
View file @
63368e9e
...
...
@@ -45,7 +45,24 @@ require_once '../../lib/app.inc.php';
//* Check permissions for module
$app
->
auth
->
check_module_permissions
(
'mail'
);
$app
->
uses
(
"tform_actions"
);
$app
->
tform_actions
->
onDelete
();
$app
->
uses
(
'tform_actions'
);
$app
->
load
(
'tform_actions'
);
class
page_action
extends
tform_actions
{
function
onBeforeDelete
()
{
global
$app
;
$conf
;
$tmp_wblists
=
$app
->
db
->
queryAllRecords
(
"SELECT wblist_id FROM spamfilter_wblist WHERE rid = ?"
,
$this
->
id
);
if
(
is_array
(
$tmp_wblists
))
{
foreach
(
$tmp_wblists
as
$tmp
)
{
$app
->
db
->
datalogDelete
(
'spamfilter_wblist'
,
'wblist_id'
,
$tmp
[
'wblist_id'
]);
}
}
}
}
$page
=
new
page_action
;
$page
->
onDelete
();
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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