From ebe19f2109cca4e226a890e1b08d6b3719a73db5 Mon Sep 17 00:00:00 2001
From: florian030 <florian@schaal-24.de>
Date: Fri, 6 Jul 2018 08:09:25 +0200
Subject: [PATCH] Show server hostname under system > server config (#5063)

---
 interface/web/admin/server_config_edit.php                | 8 ++++++++
 interface/web/admin/templates/server_config_cron_edit.htm | 4 ++--
 interface/web/admin/templates/server_config_dns_edit.htm  | 2 +-
 .../web/admin/templates/server_config_fastcgi_edit.htm    | 4 ++--
 .../web/admin/templates/server_config_getmail_edit.htm    | 4 ++--
 .../web/admin/templates/server_config_jailkit_edit.htm    | 4 ++--
 interface/web/admin/templates/server_config_mail_edit.htm | 2 +-
 .../web/admin/templates/server_config_rescue_edit.htm     | 2 +-
 .../web/admin/templates/server_config_server_edit.htm     | 2 +-
 interface/web/admin/templates/server_config_ufw_edit.htm  | 4 ++--
 .../web/admin/templates/server_config_vlogger_edit.htm    | 4 ++--
 interface/web/admin/templates/server_config_web_edit.htm  | 2 +-
 interface/web/admin/templates/server_config_xmpp_edit.htm | 2 +-
 13 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/interface/web/admin/server_config_edit.php b/interface/web/admin/server_config_edit.php
index 4c03e7ee43..b4868e8fd9 100644
--- a/interface/web/admin/server_config_edit.php
+++ b/interface/web/admin/server_config_edit.php
@@ -72,6 +72,14 @@ class page_action extends tform_actions {
 		$app->tpl->setVar($record);
 	}
 
+	function onShowEnd() {
+		global $app;
+
+		$app->tpl->setVar('server_name', $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ? AND ((SELECT COUNT(*) FROM server) > 1)", $this->id)['server_name']);
+
+		parent::onShowEnd();
+	}
+
 	function onUpdateSave($sql) {
 		global $app, $conf;
 
diff --git a/interface/web/admin/templates/server_config_cron_edit.htm b/interface/web/admin/templates/server_config_cron_edit.htm
index 908e6246b2..62e6efea76 100644
--- a/interface/web/admin/templates/server_config_cron_edit.htm
+++ b/interface/web/admin/templates/server_config_cron_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -21,4 +21,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_dns_edit.htm b/interface/web/admin/templates/server_config_dns_edit.htm
index b2b7966574..a4f7a26ade 100644
--- a/interface/web/admin/templates/server_config_dns_edit.htm
+++ b/interface/web/admin/templates/server_config_dns_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
diff --git a/interface/web/admin/templates/server_config_fastcgi_edit.htm b/interface/web/admin/templates/server_config_fastcgi_edit.htm
index b4c5cac19e..c36b482e72 100644
--- a/interface/web/admin/templates/server_config_fastcgi_edit.htm
+++ b/interface/web/admin/templates/server_config_fastcgi_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -39,4 +39,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_getmail_edit.htm b/interface/web/admin/templates/server_config_getmail_edit.htm
index 406dff412d..84ca1ec73f 100644
--- a/interface/web/admin/templates/server_config_getmail_edit.htm
+++ b/interface/web/admin/templates/server_config_getmail_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -15,4 +15,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_jailkit_edit.htm b/interface/web/admin/templates/server_config_jailkit_edit.htm
index 3371fd8a30..b7a7491476 100644
--- a/interface/web/admin/templates/server_config_jailkit_edit.htm
+++ b/interface/web/admin/templates/server_config_jailkit_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -24,4 +24,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_mail_edit.htm b/interface/web/admin/templates/server_config_mail_edit.htm
index 926be8e62c..c1531c654a 100644
--- a/interface/web/admin/templates/server_config_mail_edit.htm
+++ b/interface/web/admin/templates/server_config_mail_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
diff --git a/interface/web/admin/templates/server_config_rescue_edit.htm b/interface/web/admin/templates/server_config_rescue_edit.htm
index 435449bf24..df8aa97c07 100644
--- a/interface/web/admin/templates/server_config_rescue_edit.htm
+++ b/interface/web/admin/templates/server_config_rescue_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
diff --git a/interface/web/admin/templates/server_config_server_edit.htm b/interface/web/admin/templates/server_config_server_edit.htm
index be44a85551..66ead08996 100644
--- a/interface/web/admin/templates/server_config_server_edit.htm
+++ b/interface/web/admin/templates/server_config_server_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
diff --git a/interface/web/admin/templates/server_config_ufw_edit.htm b/interface/web/admin/templates/server_config_ufw_edit.htm
index e84260bc7a..85e9c78297 100644
--- a/interface/web/admin/templates/server_config_ufw_edit.htm
+++ b/interface/web/admin/templates/server_config_ufw_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -60,4 +60,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_vlogger_edit.htm b/interface/web/admin/templates/server_config_vlogger_edit.htm
index edcbaeda84..a53ab76676 100644
--- a/interface/web/admin/templates/server_config_vlogger_edit.htm
+++ b/interface/web/admin/templates/server_config_vlogger_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
@@ -15,4 +15,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_config_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_config_list.php">{tmpl_var name='btn_cancel_txt'}</button>
-        </div></div>
\ No newline at end of file
+        </div></div>
diff --git a/interface/web/admin/templates/server_config_web_edit.htm b/interface/web/admin/templates/server_config_web_edit.htm
index c1bae44c06..c0f148271c 100644
--- a/interface/web/admin/templates/server_config_web_edit.htm
+++ b/interface/web/admin/templates/server_config_web_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
diff --git a/interface/web/admin/templates/server_config_xmpp_edit.htm b/interface/web/admin/templates/server_config_xmpp_edit.htm
index acf019b9ff..4e6eaf0018 100644
--- a/interface/web/admin/templates/server_config_xmpp_edit.htm
+++ b/interface/web/admin/templates/server_config_xmpp_edit.htm
@@ -1,5 +1,5 @@
 <div class='page-header'>
-	<h1><tmpl_var name="list_head_txt"></h1>
+	<h1><tmpl_var name="list_head_txt"> {tmpl_var name='server_name'}</h1>
 </div>
 <p><tmpl_var name="list_desc_txt"></p>
 
-- 
GitLab