@@ -192,12 +192,20 @@ function onShowEnd() {
192192
193193 // Check wether per domain relaying is enabled or not
194194 $ global_config = $ app ->getconf ->get_global_config ('mail ' );
195- if ($ global_config ['show_per_domain_relay_options ' ] == 'n ' ) {
195+ if ($ global_config ['show_per_domain_relay_options ' ] == 'y ' ) {
196196 $ app ->tpl ->setVar ("show_per_domain_relay_options " , 1 );
197197 } else {
198198 $ app ->tpl ->setVar ("show_per_domain_relay_options " , 0 );
199199 }
200200
201+ // Get the limits of the client
202+ $ client_group_id = $ app ->functions ->intval ($ _SESSION ["s " ]["user " ]["default_group " ]);
203+ $ client = $ app ->db ->queryOneRecord ("SELECT limit_relayhost FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ? " , $ client_group_id );
204+ if ($ client ["limit_relayhost " ] == 'y ' || $ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' ) {
205+ $ app ->tpl ->setVar ("limit_relayhost " , 1 );
206+ } else {
207+ $ app ->tpl ->setVar ("limit_relayhost " , 0 );
208+ }
201209
202210 // Get the spamfilter policys for the user
203211 $ tmp_user = $ app ->db ->queryOneRecord ("SELECT policy_id FROM spamfilter_users WHERE email = ? " , '@ ' . $ this ->dataRecord ["domain " ]);
@@ -273,7 +281,7 @@ function onSubmit() {
273281 if ($ _SESSION ["s " ]["user " ]["typ " ] != 'admin ' ) {
274282 // Get the limits of the client
275283 $ client_group_id = $ app ->functions ->intval ($ _SESSION ["s " ]["user " ]["default_group " ]);
276- $ client = $ app ->db ->queryOneRecord ("SELECT client.mail_servers, limit_maildomain, default_mailserver, limit_relayhost FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ? " , $ client_group_id );
284+ $ client = $ app ->db ->queryOneRecord ("SELECT client.mail_servers, limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ? " , $ client_group_id );
277285 // When the record is updated
278286 if ($ this ->id > 0 ) {
279287 // restore the server ID if the user is not admin and record is edited
0 commit comments