@@ -680,16 +680,11 @@ function onSubmit() {
680680 }
681681 }
682682
683- // Check if chosen server is in authorized servers for this client
684- $ serverChosenOk = is_array ($ client ['web_servers_ids ' ]) && in_array ($ this ->dataRecord ['server_id ' ], $ client ['web_servers_ids ' ]) || $ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' ;
685-
686683 // When the record is updated
687684 if ($ this ->id > 0 ) {
688685 // restore the server ID if the user is not admin and record is edited
689- $ tmp = $ app ->db ->queryOneRecord ("SELECT `cgi`, `ssi`, `perl`, `ruby`, `python`, `suexec`, `errordocs`, `subdomain`, `ssl` FROM web_domain WHERE domain_id = " .$ app ->functions ->intval ($ this ->id ));
690- if (!$ serverChosenOk ) {
691- $ app ->error ($ app ->tform ->wordbook ['server_chosen_not_ok ' ]);
692- }
686+ $ tmp = $ app ->db ->queryOneRecord ("SELECT server_id, `cgi`, `ssi`, `perl`, `ruby`, `python`, `suexec`, `errordocs`, `subdomain`, `ssl` FROM web_domain WHERE domain_id = " .$ app ->functions ->intval ($ this ->id ));
687+ $ this ->dataRecord ["server_id " ] = $ tmp ["server_id " ];
693688
694689 // set the settings to current if not provided (or cleared due to limits)
695690 if ($ this ->dataRecord ['cgi ' ] == '- ' ) $ this ->dataRecord ['cgi ' ] = $ tmp ['cgi ' ];
@@ -705,9 +700,8 @@ function onSubmit() {
705700 unset($ tmp );
706701 // When the record is inserted
707702 } else {
708- //* set the server ID to the default webserver of the client
709- if (!$ serverChosenOk ) {
710- // $this->dataRecord["server_id"] = $client["default_webserver"];
703+ //* display an error if chosen server is not allowed for this client
704+ if (!is_array ($ client ['web_servers_ids ' ]) || !in_array ($ this ->dataRecord ['server_id ' ], $ client ['web_servers_ids ' ])) {
711705 $ app ->error ($ app ->tform ->wordbook ['server_chosen_not_ok ' ]);
712706 }
713707
0 commit comments