From eec634c1b06d87fa2190fb8984b2fee999916fd4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 30 Mar 2020 10:10:06 -0400 Subject: [PATCH] Add Source() support for VNC type --- web/includes/Monitor.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index 8c45c0d27..de9bcf7c4 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -441,14 +441,17 @@ class Monitor extends ZM_Object { $source = ''; if ( $this->{'Type'} == 'Local' ) { $source = $this->{'Device'}.' ('.$this->{'Channel'}.')'; - } elseif ( $this->{'Type'} == 'Remote' ) { + } else if ( $this->{'Type'} == 'Remote' ) { $source = preg_replace( '/^.*@/', '', $this->{'Host'} ); if ( $this->{'Port'} != '80' and $this->{'Port'} != '554' ) { $source .= ':'.$this->{'Port'}; } - } elseif ( $this->{'Type'} == 'File' || $this->{'Type'} == 'cURL' ) { - $source = preg_replace( '/^.*\//', '', $this->{'Path'} ); - } elseif ( $this->{'Type'} == 'Ffmpeg' || $this->{'Type'} == 'Libvlc' || $this->{'Type'} == 'WebSite' ) { + } else if ( $this->{'Type'} == 'VNC' ) { + $source = preg_replace( '/^.*@/', '', $this->{'Host'} ); + if ( $this->{'Port'} != '5900' ) { + $source .= ':'.$this->{'Port'}; + } + } else if ( $this->{'Type'} == 'Ffmpeg' || $this->{'Type'} == 'Libvlc' || $this->{'Type'} == 'WebSite' ) { $url_parts = parse_url( $this->{'Path'} ); if ( ZM_WEB_FILTER_SOURCE == 'Hostname' ) { # Filter out everything but the hostname @@ -457,7 +460,7 @@ class Monitor extends ZM_Object { } else { $source = $this->{'Path'}; } - } elseif ( ZM_WEB_FILTER_SOURCE == 'NoCredentials' ) { + } else if ( ZM_WEB_FILTER_SOURCE == 'NoCredentials' ) { # Filter out sensitive and common items unset($url_parts['user']); unset($url_parts['pass']);