diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 0ceb381374..7042b0d15b 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -460,8 +460,14 @@ foreach ($fields as $field) { $custom_value = ''; } - $data[1] = html_print_textarea ('customvalue_'.$field['id_field'], - 2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true); + if ($field['is_password_type']) { + $data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '', + 30, 100, $view_mode, '', '', true, true); + } + else { + $data[1] = html_print_textarea ('customvalue_'.$field['id_field'], + 2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true); + } array_push ($table->data, $data); } diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php index 85cce95437..d1d1044377 100755 --- a/pandora_console/godmode/agentes/configure_field.php +++ b/pandora_console/godmode/agentes/configure_field.php @@ -27,12 +27,14 @@ if (! check_acl ($config['id_user'], 0, "PM")) { $id_field = (int) get_parameter ('id_field', 0); $name = (string) get_parameter ('name', ''); $display_on_front = (bool) get_parameter ('display_on_front', 0); +$is_password_type = (bool) get_parameter ('is_password_type', 0); // Header if ($id_field) { $field = db_get_row_filter('tagent_custom_fields',array('id_field' => $id_field)); $name = $field['name']; $display_on_front = $field['display_on_front']; + $is_password_type = $field['is_password_type']; ui_print_page_header (__("Update agent custom field"), "images/custom_field.png", false, "", true, ""); } else { @@ -48,8 +50,11 @@ $table->data = array (); $table->data[0][0] = __('Name'); $table->data[0][1] = html_print_input_text ('name', $name, '', 35, 100, true); -$table->data[0][2] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true); -$table->data[0][3] = html_print_checkbox ('display_on_front', 1, $display_on_front, true); +$table->data[0][2] = __('Pass type').ui_print_help_tip (__('The fields with pass type enabled will be displayed like html input type pass in html'), true); +$table->data[0][3] = html_print_checkbox ('is_password_type', 1, $is_password_type, true); + +$table->data[0][4] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true); +$table->data[0][5] = html_print_checkbox ('display_on_front', 1, $display_on_front, true); echo '
'; html_print_table ($table); diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 6491c0f9f9..042aa82e31 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -36,6 +36,7 @@ $delete_field = (bool) get_parameter ('delete_field'); $id_field = (int) get_parameter ('id_field', 0); $name = (string) get_parameter ('name', ''); $display_on_front = (int) get_parameter ('display_on_front', 0); +$is_password_type = (int) get_parameter ('is_password_type', 0); /* Create field */ if ($create_field) { @@ -48,7 +49,8 @@ if ($create_field) { } else { $result = db_process_sql_insert('tagent_custom_fields', - array('name' => $name, 'display_on_front' => $display_on_front)); + array('name' => $name, 'display_on_front' => $display_on_front, + 'is_password_type' => $is_password_type)); ui_print_success_message(__('Field successfully created')); } } @@ -57,7 +59,7 @@ if ($create_field) { if ($update_field) { /*Check if name field is empty*/ if ( $name != "") { - $values = array('name' => $name, 'display_on_front' => $display_on_front); + $values = array('name' => $name, 'display_on_front' => $display_on_front, 'is_password_type' => $is_password_type); $result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field)); } diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 26942b9c4a..fb39f731b8 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -456,7 +456,13 @@ foreach ($fields as $field) { $custom_value = ''; } - $data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true); + if ($field['is_password_type']) { + $data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '', + 30, 100, $view_mode, '', '', true, true); + } + else { + $data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true); + } array_push ($table->data, $data); } diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 03cc57036e..6ddd8cf1f9 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1382,9 +1382,20 @@ function api_set_create_custom_field($t1, $t2, $other, $returnType) { returnError('error_parameter', 'Custom field display flag required'); return; } + + $is_password_type = 0; + + if ($other['data'][2] != '') { + $is_password_type = $other['data'][2]; + } + else { + returnError('error_parameter', 'Custom field is password type required'); + return; + } $result = db_process_sql_insert('tagent_custom_fields', - array('name' => $name, 'display_on_front' => $display_front)); + array('name' => $name, 'display_on_front' => $display_front, + 'is_password_type' => $is_password_type)); $data['type'] = "string"; $data["data"] = $result;