diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3087dbcf8..3c466fc1b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,5 +1,8 @@ # Release Notes +### 4.1.1 (UNRELEASED) +* Use the current logged-in users' settings for the Admin Portal. This suppresses the Twilio error for Zonal Yap Servers for service bodies. [#614] + ### 4.1.0 (August 6, 2022) * Added date picker for reports. [#574] * Added support for downloading the list of volunteers for a given service body. [#595] diff --git a/legacy/_includes/functions.php b/legacy/_includes/functions.php index 5cbbd1afc..f997f35d8 100644 --- a/legacy/_includes/functions.php +++ b/legacy/_includes/functions.php @@ -18,7 +18,7 @@ require_once 'migrations.php'; require_once 'queries.php'; require_once 'logging.php'; -$GLOBALS['version'] = "4.1.0"; +$GLOBALS['version'] = "4.1.1"; $GLOBALS['settings_allowlist'] = [ 'announce_servicebody_volunteer_routing' => [ 'description' => '' , 'default' => false, 'overridable' => true, 'hidden' => false], 'blocklist' => [ 'description' => 'Allows for blocking a specific list of phone numbers https://github.com/bmlt-enabled/yap/wiki/Blocklist' , 'default' => '', 'overridable' => true, 'hidden' => false], diff --git a/legacy/_includes/session.php b/legacy/_includes/session.php index 28b235e58..1e21f05d5 100644 --- a/legacy/_includes/session.php +++ b/legacy/_includes/session.php @@ -1,39 +1,44 @@ - 0) { + $service_body_config = getServiceBodyConfig($service_body_id); - if ($service_body_id > 0) { - $service_body_config = getServiceBodyConfig($service_body_id); + if (isset($service_body_config)) { + foreach ($service_body_config as $item => $value) { + if (($item == "twilio_account_sid" || $item == "twilio_auth_token") && isset($_SESSION['call_state'])) { + continue; + } + $_SESSION["override_" . $item] = $value; + } + } + } + } - if (isset($service_body_config)) { - foreach ($service_body_config as $item => $value) { - if (($item == "twilio_account_sid" || $item == "twilio_auth_token") && isset($_SESSION['call_state'])) { - continue; - } - $_SESSION["override_" . $item] = $value; - } - } - } -} + if (!isset($_SESSION['override_service_body_id'])) { + $service_body_id = 0; + if (isset($_REQUEST["service_body_id"]) || isset($_REQUEST["override_service_body_id"])) { + $service_body_id = isset($_REQUEST["service_body_id"]) ? $_REQUEST["service_body_id"] : $_REQUEST["override_service_body_id"]; + } elseif (isset($_REQUEST["override_service_body_config_id"])) { + $service_body_id = $_REQUEST["override_service_body_config_id"]; + } -if (!isset($_SESSION['call_state'])) { - $_SESSION['call_state'] = "STARTED"; -} + setConfigForService($service_body_id); + } -if (!isset($_SESSION['initial_webhook'])) { - $webhook_array = explode("/", $_SERVER['REQUEST_URI']); - $_SESSION['initial_webhook'] = str_replace("&", "&", $webhook_array[count($webhook_array) - 1]); -} + if (!isset($_SESSION['call_state'])) { + $_SESSION['call_state'] = "STARTED"; + } -if (isset($_REQUEST)) { - foreach ($_REQUEST as $key => $value) { - if (str_exists($key, "override_")) { - $_SESSION[$key] = $value; - } - } -} + if (!isset($_SESSION['initial_webhook'])) { + $webhook_array = explode("/", $_SERVER['REQUEST_URI']); + $_SESSION['initial_webhook'] = str_replace("&", "&", $webhook_array[count($webhook_array) - 1]); + } + + if (isset($_REQUEST)) { + foreach ($_REQUEST as $key => $value) { + if (str_exists($key, "override_")) { + $_SESSION[$key] = $value; + } + } + } diff --git a/legacy/admin/auth_login.php b/legacy/admin/auth_login.php index 86640d122..c03b19a7e 100644 --- a/legacy/admin/auth_login.php +++ b/legacy/admin/auth_login.php @@ -1,6 +1,6 @@