2012-06-08 Junichi Satoh <junichi@rworks.jp>

* include/functions_config.php, godmode/setup/setup.php: Fixed that
	ACL with API access cannot be removed after once configured. (Merged
	from 4.0.2)
	Fixed multiple recording of list_ACL_IPs_for_API.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6451 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-06-08 07:57:53 +00:00
parent 26aa9f5400
commit e899a68a77
3 changed files with 30 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2012-06-08 Junichi Satoh <junichi@rworks.jp>
* include/functions_config.php, godmode/setup/setup.php: Fixed that
ACL with API access cannot be removed after once configured. (Merged
from 4.0.2)
Fixed multiple recording of list_ACL_IPs_for_API.
2012-06-07 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,

View File

@ -120,7 +120,12 @@ $table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory
$table->data[14][1] = html_print_input_text ('attachment_store', $config["attachment_store"], '', 50, 255, true);
$table->data[15][0] = __('IP list with API access') . ui_print_help_icon ("ip_api_list", true);
$list_ACL_IPs_for_API = get_parameter('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
if (isset($_POST["list_ACL_IPs_for_API"])) {
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
}
else {
$list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
}
$table->data[15][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
$table->data[16][0] = __('API password') .

View File

@ -44,27 +44,23 @@ function config_create_value ($token, $value) {
function config_update_value ($token, $value) {
global $config;
switch ($token) {
case 'list_ACL_IPs_for_API':
return (bool) config_create_value ($token, $value);
break;
default:
if (!isset ($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value ($token, $value);
}
/* If it has not changed */
if ($config[$token] == $value)
return true;
$config[$token] = $value;
return (bool) db_process_sql_update ('tconfig',
array ('value' => $value),
array ('token' => $token));
break;
if ($token == 'list_ACL_IPs_for_API')
$value = str_replace(array("\r\n", "\r", "\n"), ";", io_safe_output($value));
if (!isset ($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value ($token, $value);
}
/* If it has not changed */
if ($config[$token] == $value)
return true;
$config[$token] = $value;
return (bool) db_process_sql_update ('tconfig',
array ('value' => $value),
array ('token' => $token));
}
/**
@ -128,7 +124,7 @@ function config_update_config () {
config_update_value ('agentaccess', (int) get_parameter ('agentaccess', $config['agentaccess']));
config_update_value ('flash_charts', (bool) get_parameter ('flash_charts', $config["flash_charts"]));
config_update_value ('attachment_store', (string) get_parameter ('attachment_store', $config["attachment_store"]));
config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API'])));
config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'));
config_update_value ('custom_logo', (string) get_parameter ('custom_logo', $config["custom_logo"]));
config_update_value ('history_db_enabled', (bool) get_parameter ('history_db_enabled', $config['history_db_enabled']));