File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,24 @@ function onAfterInsert() {
176176 } // endif spamfilter policy
177177 }
178178
179+ function onBeforeUpdate () {
180+ global $ app , $ conf ;
181+
182+ //* Check if the server has been changed
183+ // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
184+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' || $ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
185+ $ rec = $ app ->db ->queryOneRecord ("SELECT server_id from mail_domain WHERE domain_id = " .$ this ->id );
186+ if ($ rec ['server_id ' ] != $ this ->dataRecord ["server_id " ]) {
187+ //* Add a error message and switch back to old server
188+ $ app ->tform ->errorMessage .= $ app ->lng ('The Server can not be changed. ' );
189+ $ this ->dataRecord ["server_id " ] = $ rec ['server_id ' ];
190+ }
191+ unset($ rec );
192+ }
193+ }
194+
195+
196+
179197 function onAfterUpdate () {
180198 global $ app , $ conf ;
181199
You can’t perform that action at this time.
0 commit comments