From 71252ddbead2add8a853e8c508d2fef43ab3b753 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Mon, 20 Nov 2023 19:24:29 -0800 Subject: [PATCH] fix: state php version checking --- .../dynamix.my.servers/include/state.php | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php index 51e0eb720..7ee14f933 100644 --- a/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php +++ b/plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php @@ -98,7 +98,7 @@ class ServerState $this->registered = !empty($this->myservers['remote']['apikey']) && $this->connectPluginInstalled; // if we're on 6.12.6 or newer, get the case model as this version will include the cookie with the case model when it's reset - if (version_compare('6.12.6', $osVersion, '>=')) { + if (version_compare('6.12.6', $this->osVersion, '>=')) { $this->caseModel = $this->getServerCase(); } @@ -113,23 +113,23 @@ class ServerState } public function getServerCase() { - $caseModel = $_COOKIE['caseModel'] ?? false; + $caseModel = $_COOKIE['caseModel'] ?? ''; // if we don't have a cookie, check the file and set the cookie if we find one if (!$caseModel) { $caseModelFile = '/boot/config/plugins/dynamix/case-model.cfg'; - $caseModel = file_exists($caseModelFile) ? file_get_contents($caseModelFile) : false; - if ($caseModel) { - $cookieOptions = array ( - 'expires' => time() + (10 * 365 * 24 * 60 * 60), // overkill with 10 years - 'path' => '/', - 'secure' => false, - 'httponly' => false, - 'samesite' => 'Strict', - ); - setcookie('caseModel', $caseModel, $cookieOptions); - } else { - $caseModel = 'unknown'; - } + $caseModel = file_exists($caseModelFile) ? file_get_contents($caseModelFile) : ''; + // if ($caseModel) { + // $cookieOptions = array ( + // 'expires' => time() + (10 * 365 * 24 * 60 * 60), // overkill with 10 years + // 'path' => '/', + // 'secure' => false, + // 'httponly' => false, + // 'samesite' => 'Strict', + // ); + // setcookie('caseModel', $caseModel, $cookieOptions); + // } else { + // $caseModel = 'unknown'; + // } } return $caseModel; }