Commit cf4d7912 authored by Marius Burkard's avatar Marius Burkard

Merge branch 'stable-3.1' into 'stable-3.1'

Prevent master from being a mirror (Fixs #4854)

See merge request ispconfig/ispconfig3!678
parents 44b3dc96 f5655fde
......@@ -55,8 +55,8 @@ class page_action extends tform_actions {
global $app, $conf;
// Getting Servers
$sql = "SELECT server_id,server_name FROM server WHERE server_id != ? ORDER BY server_name";
$mirror_servers = $app->db->queryAllRecords($sql, $this->id);
$sql = "SELECT server_id,server_name FROM server WHERE server_id != ? AND mirror_server_id != ? ORDER BY server_name";
$mirror_servers = $app->db->queryAllRecords($sql, $this->id, $this->id);
$mirror_server_select = '<option value="0">'.$app->tform->lng('- None -').'</option>';
if(is_array($mirror_servers)) {
foreach( $mirror_servers as $mirror_server) {
......@@ -72,8 +72,8 @@ class page_action extends tform_actions {
function onSubmit() {
global $app;
//* We do not want to mirror the the server itself
if($this->id == $this->dataRecord['mirror_server_id']) $this->dataRecord['mirror_server_id'] = 0;
//* We do not want to mirror the the server itself and the master can not be a mirror
if($this->id == $this->dataRecord['mirror_server_id'] || $this->id == 1) $this->dataRecord['mirror_server_id'] = 0;
parent::onSubmit();
......
......@@ -50,12 +50,14 @@
{tmpl_var name='xmpp_server'}
</div>
</div>
<div class="form-group">
<label for="mirror_server_id" class="col-sm-3 control-label">{tmpl_var name='mirror_server_id_txt'}</label>
<div class="col-sm-9"><select name="mirror_server_id" id="server_id" class="form-control">
{tmpl_var name='mirror_server_id'}
</select></div>
</div>
<tmpl_if name="id" op="!=" value="1">
<div class="form-group">
<label for="mirror_server_id" class="col-sm-3 control-label">{tmpl_var name='mirror_server_id_txt'}</label>
<div class="col-sm-9"><select name="mirror_server_id" id="server_id" class="form-control">
{tmpl_var name='mirror_server_id'}
</select></div>
</div>
</tmpl_if>
<div class="form-group">
<label for="active" class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
<div class="col-sm-9"><select name="active" id="active" class="form-control">
......@@ -69,4 +71,4 @@
<div class="clear"><div class="right">
<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>
<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>
</div></div>
\ No newline at end of file
</div></div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment