File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,14 @@ function onBeforeDelete() {
5555 global $ app ; $ conf ;
5656
5757 $ tmp_user = $ app ->db ->queryOneRecord ("SELECT id FROM spamfilter_users WHERE email = ? " , $ this ->dataRecord ["email " ]);
58+ if (is_array ($ tmp_user ) && isset ($ tmp_user ['id ' ])) {
59+ $ tmp_wblists = $ app ->db ->queryAllRecords ("SELECT wblist_id FROM spamfilter_wblist WHERE rid = ? " , $ tmp_user ['id ' ]);
60+ if (is_array ($ tmp_wblists )) {
61+ foreach ($ tmp_wblists as $ tmp ) {
62+ $ app ->db ->datalogDelete ('spamfilter_wblist ' , 'wblist_id ' , $ tmp ['wblist_id ' ]);
63+ }
64+ }
65+ }
5866 $ app ->db ->datalogDelete ('spamfilter_users ' , 'id ' , $ tmp_user ["id " ]);
5967
6068 $ tmp_filters = $ app ->db ->queryAllRecords ("SELECT filter_id FROM mail_user_filter WHERE mailuser_id = ? " , $ this ->id );
@@ -71,4 +79,3 @@ function onBeforeDelete() {
7179$ page = new page_action ;
7280$ page ->onDelete ();
7381
74- ?>
Original file line number Diff line number Diff line change 4545//* Check permissions for module
4646$ app ->auth ->check_module_permissions ('mail ' );
4747
48- $ app ->uses ("tform_actions " );
49- $ app ->tform_actions ->onDelete ();
48+ $ app ->uses ('tform_actions ' );
49+ $ app ->load ('tform_actions ' );
50+
51+ class page_action extends tform_actions {
52+
53+ function onBeforeDelete () {
54+ global $ app ; $ conf ;
55+
56+ $ tmp_wblists = $ app ->db ->queryAllRecords ("SELECT wblist_id FROM spamfilter_wblist WHERE rid = ? " , $ this ->id );
57+ if (is_array ($ tmp_wblists )) {
58+ foreach ($ tmp_wblists as $ tmp ) {
59+ $ app ->db ->datalogDelete ('spamfilter_wblist ' , 'wblist_id ' , $ tmp ['wblist_id ' ]);
60+ }
61+ }
62+ }
63+
64+ }
65+
66+ $ page = new page_action ;
67+ $ page ->onDelete ();
5068
51- ?>
You can’t perform that action at this time.
0 commit comments