From 5ca959fa688255a8de61f89fe2751eb4d24a6912 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Tue, 22 Mar 2016 09:22:07 -0400
Subject: [PATCH] fixed typo

---
 interface/web/admin/server_edit.php |   44 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/interface/web/admin/server_edit.php b/interface/web/admin/server_edit.php
index ea8dd89..c2e746d 100644
--- a/interface/web/admin/server_edit.php
+++ b/interface/web/admin/server_edit.php
@@ -38,16 +38,50 @@
 * End Form configuration
 ******************************************/
 
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
 
 //* Check permissions for module
 $app->auth->check_module_permissions('admin');
+$app->auth->check_security_permissions('admin_allow_server_services');
 
 // Loading classes
 $app->uses('tpl,tform,tform_actions');
+$app->load('tform_actions');
 
-// let tform_actions handle the page
-$app->tform_actions->onLoad();
+class page_action extends tform_actions {
 
-?>
\ No newline at end of file
+	function onShowEnd() {
+		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);
+		$mirror_server_select = '<option value="0">'.$app->tform->lng('- None -').'</option>';
+		if(is_array($mirror_servers)) {
+			foreach( $mirror_servers as $mirror_server) {
+				$selected = ($mirror_server["server_id"] == $this->dataRecord['mirror_server_id'])?'SELECTED':'';
+				$mirror_server_select .= "<option value='$mirror_server[server_id]' $selected>$mirror_server[server_name]</option>\r\n";
+			}
+		}
+		$app->tpl->setVar("mirror_server_id", $mirror_server_select);
+
+		parent::onShowEnd();
+	}
+
+	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;
+
+		parent::onSubmit();
+
+	}
+
+}
+
+$page = new page_action;
+$page->onLoad();
+
+?>

--
Gitblit v1.9.1