Skip to content
Snippets Groups Projects
Commit cf4d7912 authored by Marius Burkard's avatar Marius Burkard
Browse files

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