]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Fix bconsole test connection for new api host that works with new director
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 6 Aug 2017 07:05:20 +0000 (09:05 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 6 Aug 2017 08:40:33 +0000 (10:40 +0200)
gui/baculum/protected/Common/Portlets/NewHost.php

index 29f75bda4fd029d282ce7745225fadbcfb7d9b68..cb8c6004b9e8b22f516b4d19c3f94258385e0abf 100644 (file)
@@ -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);