diff --git a/includes/functions.php b/includes/functions.php index 6d19d43..a341082 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -22,8 +22,6 @@ +-------------------------------------------------------------------------+ */ -//include_once(__DIR__ . '/arrays.php'); - function servcheck_show_tab($current_tab) { global $config, $servcheck_tabs; @@ -221,7 +219,7 @@ function servcheck_decrypt_credential ($cred_id) { $servcheck_iv = substr($encrypted, 0, $iv_length); $encrypted = substr($encrypted, $iv_length); - $decrypted=openssl_decrypt ($encrypted, SERVCHECK_CIPHER, $servcheck_key, OPENSSL_RAW_DATA, $servcheck_iv); + $decrypted = openssl_decrypt ($encrypted, SERVCHECK_CIPHER, $servcheck_key, OPENSSL_RAW_DATA, $servcheck_iv); return json_decode($decrypted, true); } diff --git a/servcheck_process.php b/servcheck_process.php index 1968a2e..5866016 100644 --- a/servcheck_process.php +++ b/servcheck_process.php @@ -331,7 +331,6 @@ } } - // checks only if test passed or some search string exists if ($results['result_search'] != 'not tested' && $results['result'] == 'ok') { if ($last_log['result_search'] != $results['result_search']) { diff --git a/servcheck_test.php b/servcheck_test.php index f9cbb8c..7513876 100644 --- a/servcheck_test.php +++ b/servcheck_test.php @@ -305,7 +305,6 @@ function form_save() { $save['external_id'] = get_nfilter_request_var('external_id'); - if (isset_request_var('type') && array_key_exists(get_nfilter_request_var('type'), $service_types)) { $save['type'] = get_nfilter_request_var('type'); list ($category, $service) = explode('_', get_nfilter_request_var('type')); @@ -429,7 +428,7 @@ function form_save() { $save['duration_trigger'] = is_numeric(get_nfilter_request_var('duration_trigger')) ? get_nfilter_request_var('duration_trigger') : 0; - $save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3); + $save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3); $save['search'] = get_nfilter_request_var('search'); $save['search_maint'] = get_nfilter_request_var('search_maint'); diff --git a/setup.php b/setup.php index 4f70dea..ff46499 100644 --- a/setup.php +++ b/setup.php @@ -75,6 +75,10 @@ function plugin_servcheck_upgrade() { db_add_column('plugin_servcheck_test', array('name' => 'ipaddress', 'type' => 'varchar(46)', 'NULL' => false, 'default' => '', 'after' => 'hostname')); } + if (!db_column_exists('plugin_servcheck_test', 'external_id')) { + db_add_column('plugin_servcheck_test', array('name' => 'external_id', 'type' => 'varchar(20)', 'NULL' => false, 'default' => '', 'after' => 'notes')); + } + // 0.3 contains a lot of changes. I tried to convert old data but for sure make a backup db_execute('DROP TABLE IF EXISTS plugin_servcheck_contacts');