File tree Expand file tree Collapse file tree 13 files changed +190
-16
lines changed
Expand file tree Collapse file tree 13 files changed +190
-16
lines changed Original file line number Diff line number Diff line change 4949$ app ->load ('tform_actions ' );
5050
5151class page_action extends tform_actions {
52-
52+ function onBeforeUpdate () {
53+ global $ app , $ conf ;
54+
55+ //* Check if the server has been changed
56+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
57+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
58+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from firewall WHERE firewall_id = " .$ this ->id );
59+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
60+ //* Add a error message and switch back to old server
61+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
62+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
63+ }
64+ unset($ rec );
65+ }
66+ }
5367}
5468
5569$ page = new page_action ;
Original file line number Diff line number Diff line change 4646
4747// Loading classes
4848$ app ->uses ('tpl,tform,tform_actions ' );
49+ $ app ->load ('tform_actions ' );
4950
50- // let tform_actions handle the page
51- $ app ->tform_actions ->onLoad ();
51+ class page_action extends tform_actions {
52+
53+ function onBeforeUpdate () {
54+ global $ app , $ conf ;
55+
56+ //* Check if the server has been changed
57+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
58+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
59+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from server_ip WHERE server_ip_id = " .$ this ->id );
60+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
61+ //* Add a error message and switch back to old server
62+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
63+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
64+ }
65+ unset($ rec );
66+ }
67+ }
68+ }
69+
70+ $ page = new page_action ;
71+ $ page ->onLoad ();
5272
5373?>
Original file line number Diff line number Diff line change 4545$ app ->auth ->check_module_permissions ('admin ' );
4646
4747$ app ->uses ('listform_actions ' );
48+
49+ $ app ->listform_actions ->SQLOrderBy = "ORDER BY server_id, ip_address " ;
50+
4851$ app ->listform_actions ->onLoad ();
4952
5053
Original file line number Diff line number Diff line change 5959 'target ' => 'content ' ,
6060 'link ' => 'mail/spamfilter_policy_list.php ' );
6161
62- $ items [] = array ( 'title ' => 'Server Settings ' ,
63- 'target ' => 'content ' ,
64- 'link ' => 'mail/spamfilter_config_list.php ' );
62+ // $items[] = array( 'title' => 'Server Settings',
63+ // 'target' => 'content',
64+ // 'link' => 'mail/spamfilter_config_list.php');
6565}
6666
6767$ module ['nav ' ][] = array ( 'title ' => 'Spamfilter ' ,
Original file line number Diff line number Diff line change @@ -71,7 +71,24 @@ function onShowNew() {
7171
7272 parent ::onShowNew ();
7373 }
74-
74+
75+
76+ function onBeforeUpdate () {
77+ global $ app , $ conf ;
78+
79+ //* Check if the server has been changed
80+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
81+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
82+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from mail_access WHERE access_id = " .$ this ->id );
83+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
84+ //* Add a error message and switch back to old server
85+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
86+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
87+ }
88+ unset($ rec );
89+ }
90+ }
91+
7592 function onSubmit () {
7693 global $ app , $ conf ;
7794
Original file line number Diff line number Diff line change 5252$ app ->load ('tform_actions ' );
5353
5454class page_action extends tform_actions {
55-
55+ function onBeforeUpdate () {
56+ global $ app , $ conf ;
57+
58+ //* Check if the server has been changed
59+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
60+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
61+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from mail_content_filter WHERE content_filter_id = " .$ this ->id );
62+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
63+ //* Add a error message and switch back to old server
64+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
65+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
66+ }
67+ unset($ rec );
68+ }
69+ }
5670}
5771
5872$ page = new page_action ;
Original file line number Diff line number Diff line change @@ -110,7 +110,23 @@ function onShowEnd() {
110110
111111 parent ::onShowEnd ();
112112 }
113-
113+
114+ function onBeforeUpdate () {
115+ global $ app , $ conf ;
116+
117+ //* Check if the server has been changed
118+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
119+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
120+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from mail_transport WHERE transport_id = " .$ this ->id );
121+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
122+ //* Add a error message and switch back to old server
123+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
124+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
125+ }
126+ unset($ rec );
127+ }
128+ }
129+
114130 function onSubmit () {
115131 global $ app , $ conf ;
116132
Original file line number Diff line number Diff line change @@ -72,6 +72,22 @@ function onShowNew() {
7272 parent ::onShowNew ();
7373 }
7474
75+ function onBeforeUpdate () {
76+ global $ app , $ conf ;
77+
78+ //* Check if the server has been changed
79+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
80+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
81+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from mail_access WHERE access_id = " .$ this ->id );
82+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
83+ //* Add a error message and switch back to old server
84+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
85+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
86+ }
87+ unset($ rec );
88+ }
89+ }
90+
7591 function onSubmit () {
7692 global $ app , $ conf ;
7793
Original file line number Diff line number Diff line change @@ -71,7 +71,23 @@ function onShowNew() {
7171 parent ::onShowNew ();
7272 }
7373
74- function onSubmit () {
74+ function onBeforeUpdate () {
75+ global $ app , $ conf ;
76+
77+ //* Check if the server has been changed
78+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
79+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
80+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from spamfilter_wblist WHERE id = " .$ this ->id );
81+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
82+ //* Add a error message and switch back to old server
83+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
84+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
85+ }
86+ unset($ rec );
87+ }
88+ }
89+
90+ function onSubmit () {
7591 global $ app , $ conf ;
7692
7793 // Check the client limits, if user is not the admin
Original file line number Diff line number Diff line change @@ -71,7 +71,23 @@ function onShowNew() {
7171 parent ::onShowNew ();
7272 }
7373
74- function onSubmit () {
74+ function onBeforeUpdate () {
75+ global $ app , $ conf ;
76+
77+ //* Check if the server has been changed
78+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
79+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
80+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from spamfilter_users WHERE id = " .$ this ->id );
81+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
82+ //* Add a error message and switch back to old server
83+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
84+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
85+ }
86+ unset($ rec );
87+ }
88+ }
89+
90+ function onSubmit () {
7591 global $ app , $ conf ;
7692
7793 // Check the client limits, if user is not the admin
You can’t perform that action at this time.
0 commit comments