|
|
@@ -974,7 +974,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
|
|
|
// Server module functions
|
|
|
/// \brief Adds remote server to database.
|
|
|
- public function addRemoteServer($rhost_ip,$rhost_name,$rhost_user_name,$rhost_port,$rhost_ftp_ip,$rhost_ftp_port,$encryption_key,$rhost_timeout,$use_nat)
|
|
|
+ public function addRemoteServer($rhost_ip,$rhost_name,$rhost_user_name,$rhost_port,$rhost_ftp_ip,$rhost_ftp_port,$encryption_key,$rhost_timeout,$use_nat,$display_public_ip)
|
|
|
{
|
|
|
$rhost_ip = trim($rhost_ip);
|
|
|
$rhost_port = trim($rhost_port);
|
|
|
@@ -984,6 +984,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
$encryption_key = trim($encryption_key);
|
|
|
$rhost_timeout = trim($rhost_timeout);
|
|
|
$use_nat = trim($use_nat);
|
|
|
+ $display_public_up = trim($display_public_ip);
|
|
|
|
|
|
if ( empty($rhost_ip) )
|
|
|
return false;
|
|
|
@@ -993,8 +994,8 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
return false;
|
|
|
|
|
|
$rhost_name = trim($rhost_name);
|
|
|
- $query = sprintf("INSERT INTO `%sremote_servers` (`agent_ip`,remote_server_name,ogp_user,agent_port,ftp_ip,ftp_port,`encryption_key`,timeout,use_nat)
|
|
|
- VALUES('%s','%s','%s','%d','%s','%s','%s','%s','%s');",
|
|
|
+ $query = sprintf("INSERT INTO `%sremote_servers` (`agent_ip`,remote_server_name,ogp_user,agent_port,ftp_ip,ftp_port,`encryption_key`,timeout,use_nat,display_public_ip)
|
|
|
+ VALUES('%s','%s','%s','%d','%s','%s','%s','%s','%s','%s');",
|
|
|
$this->table_prefix,
|
|
|
mysqli_real_escape_string($this->link,$rhost_ip),
|
|
|
mysqli_real_escape_string($this->link,$rhost_name),
|
|
|
@@ -1004,7 +1005,8 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
mysqli_real_escape_string($this->link,$rhost_ftp_port),
|
|
|
mysqli_real_escape_string($this->link,$encryption_key),
|
|
|
mysqli_real_escape_string($this->link,$rhost_timeout),
|
|
|
- mysqli_real_escape_string($this->link,$use_nat));
|
|
|
+ mysqli_real_escape_string($this->link,$use_nat),
|
|
|
+ mysqli_real_escape_string($this->link,$display_public_ip));
|
|
|
++$this->queries_;
|
|
|
mysqli_query($this->link,$query);
|
|
|
|
|
|
@@ -1148,7 +1150,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
}
|
|
|
|
|
|
public function changeRemoteServerSettings($server_id,
|
|
|
- $agent_ip,$agent_port,$remote_server_name,$remote_server_user_name,$remote_host_ftp_ip,$remote_host_ftp_port,$encryption_key,$remote_timeout,$use_nat)
|
|
|
+ $agent_ip,$agent_port,$remote_server_name,$remote_server_user_name,$remote_host_ftp_ip,$remote_host_ftp_port,$encryption_key,$remote_timeout,$use_nat,$display_public_ip)
|
|
|
{
|
|
|
$query = sprintf("UPDATE %sremote_servers SET agent_ip='%s',
|
|
|
agent_port='%s', encryption_key='%s',
|
|
|
@@ -1157,7 +1159,8 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
ftp_ip='%s',
|
|
|
ftp_port='%s',
|
|
|
timeout='%s',
|
|
|
- use_nat='%s'
|
|
|
+ use_nat='%s',
|
|
|
+ display_public_ip='%s'
|
|
|
WHERE remote_server_id = %d;",
|
|
|
$this->table_prefix,
|
|
|
mysqli_real_escape_string($this->link,$agent_ip),
|
|
|
@@ -1169,6 +1172,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|
|
mysqli_real_escape_string($this->link,$remote_host_ftp_port),
|
|
|
mysqli_real_escape_string($this->link,$remote_timeout),
|
|
|
mysqli_real_escape_string($this->link,$use_nat),
|
|
|
+ mysqli_real_escape_string($this->link,$display_public_ip),
|
|
|
mysqli_real_escape_string($this->link,$server_id));
|
|
|
++$this->queries_;
|
|
|
if ( mysqli_query($this->link,$query) === FALSE )
|