]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Send config to api server as json
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Nov 2017 15:58:55 +0000 (16:58 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Nov 2017 16:04:31 +0000 (17:04 +0100)
gui/baculum/protected/API/Pages/API/Config.php
gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php

index bec7f40b464981f427793a828d15b23edb46ecc8..0ecdb0c842a330899f489ce633707aa37a401dd0 100644 (file)
@@ -36,7 +36,7 @@ class Config extends BaculumAPIServer {
        public function set($id, $params) {
                $config = (array)$params;
                if (array_key_exists('config', $config)) {
-                       $config = unserialize($config['config']);
+                       $config = json_decode($config['config'], true);
                } else {
                        $config = array();
                }
index 02fc3ec7321d704d4c7309d7f2837abc136019cf..32654259aa8138566a0609894df6aad69ff04415 100644 (file)
@@ -303,7 +303,7 @@ class BaculaConfigDirectives extends DirectiveListTemplate {
                        $resource_type,
                        $resource_name
                );
-               $result = $this->Application->getModule('api')->set($params, array('config' => serialize($directives)), $host, false);
+               $result = $this->Application->getModule('api')->set($params, array('config' => json_encode($directives)), $host, false);
                if ($result->error === 0) {
                        $this->SaveDirectiveOk->Display = 'Dynamic';
                        $this->SaveDirectiveError->Display = 'None';