From: Marcin Haba Date: Sun, 6 Aug 2017 07:05:20 +0000 (+0200) Subject: baculum: Fix bconsole test connection for new api host that works with new director X-Git-Tag: Release-9.0.3~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d36c61f46dc0cbcc3daed5fa82161bae49b9f05;p=bacula%2Fbacula baculum: Fix bconsole test connection for new api host that works with new director --- diff --git a/gui/baculum/protected/Common/Portlets/NewHost.php b/gui/baculum/protected/Common/Portlets/NewHost.php index 29f75bda4f..cb8c6004b9 100644 --- a/gui/baculum/protected/Common/Portlets/NewHost.php +++ b/gui/baculum/protected/Common/Portlets/NewHost.php @@ -78,7 +78,18 @@ class NewHost extends PortletTemplate { // Console test $api->setHostParams($host, $host_params); + $director = null; + if (array_key_exists('director', $_SESSION)) { + // Current director can't be passed to new remote host. + $director = $_SESSION['director']; + unset($_SESSION['director']); + } + $console = $api->set(array('console'), array('version'), $host, false); + if (!is_null($director)) { + // Revert director setting if any + $_SESSION['director'] = $director; + } // Config test $api->setHostParams($host, $host_params);