* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2016 Kern Sibbald
+ * Copyright (C) 2013-2017 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
public function set($id, $params) {
$config = (array)$params;
if (array_key_exists('config', $config)) {
- $config = json_decode($config['config'], true);
+ if ($this->getClientVersion() <= 0.2) {
+ // old way sending config as serialized array
+ $config = unserialize($config['config']);
+ } else {
+ $config = json_decode($config['config'], true);
+ }
} else {
$config = array();
}
} else if ($result['is_valid'] === false) {
$this->output = BaculaConfigError::MSG_ERROR_CONFIG_VALIDATION_ERROR . print_r($result['result'], true);
$this->error = BaculaConfigError::ERROR_CONFIG_VALIDATION_ERROR;
-
} else {
$this->output = BaculaConfigError::MSG_ERROR_WRITE_TO_CONFIG_ERROR . print_r($result['result'], true);
$this->error = BaculaConfigError::ERROR_WRITE_TO_CONFIG_ERROR;