Skip to content

Commit cf4d791

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1' into 'stable-3.1'
Prevent master from being a mirror (Fixs #4854) See merge request ispconfig/ispconfig3!678
2 parents 44b3dc9 + f5655fd commit cf4d791

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

interface/web/admin/server_edit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ function onShowEnd() {
5555
global $app, $conf;
5656

5757
// Getting Servers
58-
$sql = "SELECT server_id,server_name FROM server WHERE server_id != ? ORDER BY server_name";
59-
$mirror_servers = $app->db->queryAllRecords($sql, $this->id);
58+
$sql = "SELECT server_id,server_name FROM server WHERE server_id != ? AND mirror_server_id != ? ORDER BY server_name";
59+
$mirror_servers = $app->db->queryAllRecords($sql, $this->id, $this->id);
6060
$mirror_server_select = '<option value="0">'.$app->tform->lng('- None -').'</option>';
6161
if(is_array($mirror_servers)) {
6262
foreach( $mirror_servers as $mirror_server) {
@@ -72,8 +72,8 @@ function onShowEnd() {
7272
function onSubmit() {
7373
global $app;
7474

75-
//* We do not want to mirror the the server itself
76-
if($this->id == $this->dataRecord['mirror_server_id']) $this->dataRecord['mirror_server_id'] = 0;
75+
//* We do not want to mirror the the server itself and the master can not be a mirror
76+
if($this->id == $this->dataRecord['mirror_server_id'] || $this->id == 1) $this->dataRecord['mirror_server_id'] = 0;
7777

7878
parent::onSubmit();
7979

interface/web/admin/templates/server_edit_services.htm

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ <h1><tmpl_var name="list_head_txt"></h1>
5050
{tmpl_var name='xmpp_server'}
5151
</div>
5252
</div>
53-
<div class="form-group">
54-
<label for="mirror_server_id" class="col-sm-3 control-label">{tmpl_var name='mirror_server_id_txt'}</label>
55-
<div class="col-sm-9"><select name="mirror_server_id" id="server_id" class="form-control">
56-
{tmpl_var name='mirror_server_id'}
57-
</select></div>
58-
</div>
53+
<tmpl_if name="id" op="!=" value="1">
54+
<div class="form-group">
55+
<label for="mirror_server_id" class="col-sm-3 control-label">{tmpl_var name='mirror_server_id_txt'}</label>
56+
<div class="col-sm-9"><select name="mirror_server_id" id="server_id" class="form-control">
57+
{tmpl_var name='mirror_server_id'}
58+
</select></div>
59+
</div>
60+
</tmpl_if>
5961
<div class="form-group">
6062
<label for="active" class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
6163
<div class="col-sm-9"><select name="active" id="active" class="form-control">
@@ -69,4 +71,4 @@ <h1><tmpl_var name="list_head_txt"></h1>
6971
<div class="clear"><div class="right">
7072
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/server_edit.php">{tmpl_var name='btn_save_txt'}</button>
7173
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_list.php">{tmpl_var name='btn_cancel_txt'}</button>
72-
</div></div>
74+
</div></div>

0 commit comments

Comments
 (0)