From 7a8587184c4717033b29acdb570b524239fdc828 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 15 Apr 2016 18:22:28 -0600 Subject: [PATCH] If the event socket information is not set then use the defaults. --- resources/classes/switch_settings.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/resources/classes/switch_settings.php b/resources/classes/switch_settings.php index 6fae05f386..c536d79422 100644 --- a/resources/classes/switch_settings.php +++ b/resources/classes/switch_settings.php @@ -43,13 +43,28 @@ if (!class_exists('switch_settings')) { //define the variables if (!isset($this->event_socket_ip_address)) { - $this->event_socket_ip_address = $_SESSION['event_socket_ip_address']; + if (strlen($_SESSION['event_socket_ip_address']) > 0) { + $this->event_socket_ip_address = $_SESSION['event_socket_ip_address']; + } + else { + $this->event_socket_ip_address = '127.0.0.1'; + } } if (!isset($this->event_socket_port)) { - $this->event_socket_port = $_SESSION['event_socket_port']; + if (strlen($_SESSION['event_socket_ip_address']) > 0) { + $this->event_socket_port = $_SESSION['event_socket_port']; + } + else { + $this->event_socket_port = '8021'; + } } if (!isset($this->event_socket_password)) { - $this->event_socket_password = $_SESSION['event_socket_password']; + if (strlen($_SESSION['event_socket_ip_address']) > 0) { + $this->event_socket_password = $_SESSION['event_socket_password']; + } + else { + $this->event_socket_password = 'ClueCon'; + } } //connect to event socket