diff --git a/code_igniter/application/controllers/admin_system.php b/code_igniter/application/controllers/admin_system.php index 662f73ce3..51b6391c9 100644 --- a/code_igniter/application/controllers/admin_system.php +++ b/code_igniter/application/controllers/admin_system.php @@ -653,7 +653,7 @@ public function add_systems() } } - # first test to see if we have a system_id - + # first test to see if we have a system.id - # if not, make a system key and find (or not) the device if (!isset($details->id) or $details->id == '') { diff --git a/code_igniter/application/controllers/ajax.php b/code_igniter/application/controllers/ajax.php index ae68fce2e..fb1ccf241 100644 --- a/code_igniter/application/controllers/ajax.php +++ b/code_igniter/application/controllers/ajax.php @@ -228,7 +228,7 @@ public function update_system_man() # 2 - additional_field_item.additional_field_id # 3 - additional_field.field_id - # TODO - should test if system_id is part of additional_field.group_id + # TODO - should test if system.id is part of additional_field.group_id # The code below assumes the view has done this (and it has), but it doesn't verify it. # Could call this directly using a URL and set a custom field on a device that is not supposed to have it diff --git a/code_igniter/application/controllers/discovery.php b/code_igniter/application/controllers/discovery.php index e43835257..9b9cf1706 100644 --- a/code_igniter/application/controllers/discovery.php +++ b/code_igniter/application/controllers/discovery.php @@ -69,7 +69,7 @@ public function index() public function discover_list($ids = '') { - // take a list of system_id's and run discovery on them + // take a list of system.id's and run discovery on them // do not wait for the return result, go back to the webpage ASAP // // ids should be a comma separated list of device id's (integers) - no spaces @@ -117,7 +117,7 @@ public function discover_list($ids = '') return; } - // spawn a discovery process for each system_id + // spawn a discovery process for each system.id foreach ($system_ids as $key => $value) { $timestamp = date('Y-m-d H:i:s'); $system_id = $value; @@ -1360,7 +1360,7 @@ public function process_subnet() $output = null; $return_var = null; } else { - $script_string = "$filepath\\" . $source_name . " strcomputer=".$details->ip." submit_online=y create_file=n struser=".$domain.$username." strpass=".$credentials_windows->credentials->password." url=".$url."index.php/system/add_system debugging=0 system_id=".$details->system_id; + $script_string = "$filepath\\" . $source_name . " strcomputer=".$details->ip." submit_online=y create_file=n struser=".$domain.$username." strpass=".$credentials_windows->credentials->password." url=".$url."index.php/system/add_system debugging=0 system_id=".$details->id; $command_string = "%comspec% /c start /b cscript //nologo ".$script_string." &"; pclose(popen($command_string, "r")); } diff --git a/code_igniter/application/controllers/main.php b/code_igniter/application/controllers/main.php index a35610c06..7608eef50 100644 --- a/code_igniter/application/controllers/main.php +++ b/code_igniter/application/controllers/main.php @@ -261,7 +261,7 @@ public function api_node_config() unset($document['sys_hw_network_card_ip']); } - $sql = "/* main::api_node_config */ SELECT id as net_id, system_id, mac as net_mac_address, manufacturer as net_manufacturer, model as net_model, description as net_description, alias as net_alias, ip_enabled as net_ip_enabled, net_index, dhcp_enabled as net_dhcp_enabled, dhcp_server as net_dhcp_server, dhcp_lease_obtained as net_dhcp_lease_obtained, dhcp_lease_expires as net_dhcp_lease_expires, dns_host_name as net_dns_host_name, dns_server as net_dns_server, dns_domain as net_dns_domain, dns_domain_reg_enabled as net_dns_domain_reg_enabled, type as net_adapter_type, connection as net_connection_id, connection_status as net_connection_status, speed as net_speed, slaves as net_slaves, ifadminstatus, iflastchange FROM network WHERE system_id = ? and current = 'y'"; + $sql = "/* main::api_node_config */ SELECT id as net_id, network.system_id, mac as net_mac_address, manufacturer as net_manufacturer, model as net_model, description as net_description, alias as net_alias, ip_enabled as net_ip_enabled, net_index, dhcp_enabled as net_dhcp_enabled, dhcp_server as net_dhcp_server, dhcp_lease_obtained as net_dhcp_lease_obtained, dhcp_lease_expires as net_dhcp_lease_expires, dns_host_name as net_dns_host_name, dns_server as net_dns_server, dns_domain as net_dns_domain, dns_domain_reg_enabled as net_dns_domain_reg_enabled, type as net_adapter_type, connection as net_connection_id, connection_status as net_connection_status, speed as net_speed, slaves as net_slaves, ifadminstatus, iflastchange FROM network WHERE system_id = ? and current = 'y'"; $data = array($system_id); $query = $this->db->query($sql, $data); $document['sys_hw_network_card'] = $query->result(); diff --git a/code_igniter/application/controllers/system.php b/code_igniter/application/controllers/system.php index 153d994f8..287bd3d8b 100644 --- a/code_igniter/application/controllers/system.php +++ b/code_igniter/application/controllers/system.php @@ -589,7 +589,7 @@ public function add_nmap() } if (isset($details->id) and !empty($details->id)) { - // we have a system_id and snmp details to update + // we have a system.id and snmp details to update $log_details = new stdClass(); $log_details->severity = 7; $log_details->file = 'system'; diff --git a/code_igniter/application/controllers/test.php b/code_igniter/application/controllers/test.php index 264fe9215..d3202a431 100644 --- a/code_igniter/application/controllers/test.php +++ b/code_igniter/application/controllers/test.php @@ -294,7 +294,7 @@ public function org_user() $instring = implode(',', $org_id_list) . "\n"; echo $instring . "\n"; - // $sql = "SELECT system_id, hostname, type, org_id, org_name FROM system LEFT JOIN oa_org ON system.org_id = oa_org.org_id WHERE org_id IN (" . $instring . ")"; + // $sql = "SELECT system.id, hostname, type, org_id, org_name FROM system LEFT JOIN oa_org ON system.org_id = oa_org.org_id WHERE org_id IN (" . $instring . ")"; // echo $sql . "\n"; // $query = $this->db->query($sql); // $result = $query->result(); @@ -552,7 +552,7 @@ public function delta() } - $sql = "SELECT first_seen FROM $table WHERE system_id = ? ORDER BY first_seen LIMIT 1"; + $sql = "SELECT first_seen FROM $table WHERE system.id = ? ORDER BY first_seen LIMIT 1"; $data = array($system_id); $query = $this->db->query($sql, $data); echo $this->db->last_query() . "\n"; @@ -563,11 +563,11 @@ public function delta() } if ($first_seen != '') { if ($type == 'delta') { - $sql = "SELECT $table.*, IF(($table.first_seen = ?), 'y', 'n') as original_install, IF($table.current = 'y', 'y', 'n') as current_install FROM $table WHERE system_id = ? and (current = 'y' or first_seen = ?)"; + $sql = "SELECT $table.*, IF(($table.first_seen = ?), 'y', 'n') as original_install, IF($table.current = 'y', 'y', 'n') as current_install FROM $table WHERE system.id = ? and (current = 'y' or first_seen = ?)"; $data = array("$first_seen", $system_id, "$first_seen"); } if ($type == 'full') { - $sql = "SELECT $table.*, IF(($table.first_seen = ?), 'y', 'n') as original_install, IF($table.current = 'y', 'y', 'n') as current_install FROM $table WHERE system_id = ?"; + $sql = "SELECT $table.*, IF(($table.first_seen = ?), 'y', 'n') as original_install, IF($table.current = 'y', 'y', 'n') as current_install FROM $table WHERE system.id = ?"; $data = array("$first_seen", $system_id); } $query = $this->db->query($sql, $data); @@ -575,7 +575,7 @@ public function delta() echo $this->db->last_query() . "\n"; print_r($result); } else { - # no data in this table for the system_id + # no data in this table for the system.id return; } } diff --git a/code_igniter/application/core/MY_Controller.php b/code_igniter/application/core/MY_Controller.php index dfe3ee0a0..e9328eb8a 100644 --- a/code_igniter/application/core/MY_Controller.php +++ b/code_igniter/application/core/MY_Controller.php @@ -765,7 +765,7 @@ public function make_url($col_link = '', $col_var_name_sec = '') if (strpos($col_link, '/') === 0) { $col_link = substr($col_link, 1); } - // NOTE - For most reports, $col_var_name_sec is normally system_id expressed as an int + // NOTE - For most reports, $col_var_name_sec is normally system.id expressed as an int // NOTE - Relative Index is normally like - /open-audit/index.php/ // NOTE - For an Enterprise report, $col_link is normally like - /omk/oae/device_details/ // NOTE - For a Community report, $col_link is normally like - /main/system_display/ diff --git a/code_igniter/application/helpers/input_helper.php b/code_igniter/application/helpers/input_helper.php index 6fa1d214c..9b28e187a 100644 --- a/code_igniter/application/helpers/input_helper.php +++ b/code_igniter/application/helpers/input_helper.php @@ -336,7 +336,7 @@ function inputRead() # get the action # valid values are typically - create, read, update, delete, list, execute - # TODO - request_method == post and body contains system_id, then update, not create + # TODO - request_method == post and body contains system.id, then update, not create if ($CI->input->get('action')) { $action = $CI->input->get('action'); $log->message = 'Set action to ' . $action . ', according to GET.'; diff --git a/code_igniter/application/models/m_additional_fields.php b/code_igniter/application/models/m_additional_fields.php index 39950bb35..5ce94312c 100644 --- a/code_igniter/application/models/m_additional_fields.php +++ b/code_igniter/application/models/m_additional_fields.php @@ -233,7 +233,7 @@ public function get_additional_fields_data($system_id) * * @access public * - * @param system_id + * @param group_id * * @return array */ diff --git a/code_igniter/application/models/m_attachment.php b/code_igniter/application/models/m_attachment.php index 9da71e746..4c5d84ece 100644 --- a/code_igniter/application/models/m_attachment.php +++ b/code_igniter/application/models/m_attachment.php @@ -42,7 +42,7 @@ public function __construct() public function create_system_attachment($system_id, $title, $name) { - $sql = "INSERT INTO attachment (id, system_id, user_id, title, filename, timestamp) VALUES (NULL, ?, ?, ?, ?, ?)"; + $sql = "INSERT INTO `attachment` (`id`, `system_id`, `user_id`, `title`, `filename`, `timestamp`) VALUES (NULL, ?, ?, ?, ?, ?)"; $sql = $this->clean_sql($sql); $data = array("$system_id", $this->session->userdata['user_id'], "$title", "$name", date('Y-m-d H:i:s')); $query = $this->db->query($sql, $data); @@ -52,7 +52,7 @@ public function create_system_attachment($system_id, $title, $name) public function get_system_attachment($system_id) { - $sql = "SELECT * FROM attachment WHERE system_id = ?"; + $sql = "SELECT * FROM `attachment` WHERE `attachment`.`system_id` = ?"; $sql = $this->clean_sql($sql); $data = array("$system_id"); $query = $this->db->query($sql, $data); diff --git a/code_igniter/application/models/m_audit_log.php b/code_igniter/application/models/m_audit_log.php index 73e65735b..6d17ab775 100644 --- a/code_igniter/application/models/m_audit_log.php +++ b/code_igniter/application/models/m_audit_log.php @@ -56,7 +56,7 @@ public function create($system_id, $username = '', $type = '', $ip = '', $debug if ($timestamp == '') { $timestamp = date('Y-m-d H:i:s'); } - $sql = "INSERT INTO audit_log (system_id, username, type, ip, debug, wmi_fails, `timestamp`) VALUES (?, ?, ?, ?, ?, ?, ?)"; + $sql = "INSERT INTO audit_log (`system_id`, `username`, `type`, `ip`, `debug`, `wmi_fails`, `timestamp`) VALUES (?, ?, ?, ?, ?, ?, ?)"; $sql = $this->clean_sql($sql); $data = array($system_id, "$username", "$type", "$ip", "$debug", "$wmi_fails", "$timestamp"); $query = $this->db->query($sql, $data); diff --git a/code_igniter/application/models/m_change_log.php b/code_igniter/application/models/m_change_log.php index d0412a68c..42b55cbc8 100644 --- a/code_igniter/application/models/m_change_log.php +++ b/code_igniter/application/models/m_change_log.php @@ -150,7 +150,7 @@ public function readDevice($id) */ public function create($system_id, $db_table, $db_row, $db_action, $details, $timestamp) { - $sql = "INSERT INTO change_log ( system_id, db_table, db_row, db_action, details, `timestamp` ) VALUES ( ?, ?, ?, ?, ?, ? )"; + $sql = "INSERT INTO change_log (`system_id`, `db_table`, `db_row`, `db_action`, `details`, `timestamp` ) VALUES ( ?, ?, ?, ?, ?, ? )"; $sql = $this->clean_sql($sql); $data = array("$system_id", "$db_table", "$db_row", "$db_action", "$details", "$timestamp"); $query = $this->db->query($sql, $data); diff --git a/code_igniter/application/models/m_oa_general.php b/code_igniter/application/models/m_oa_general.php index 6cbd47e05..a9ee4c8cb 100644 --- a/code_igniter/application/models/m_oa_general.php +++ b/code_igniter/application/models/m_oa_general.php @@ -64,7 +64,7 @@ public function get_system_document_api_new($table = '', $system_id = '') } $sql = ''; if ($table == 'system') { - $sql = 'SELECT system.* FROM system LEFT JOIN oa_location ON system.location_id = oa_location.id WHERE system_id = ?'; + $sql = 'SELECT system.* FROM system LEFT JOIN oa_location ON system.location_id = oa_location.id WHERE system.id = ?'; $sql = $this->clean_sql($sql); } if ($sql != '') { diff --git a/code_igniter/application/models/m_system.php b/code_igniter/application/models/m_system.php index 766b89594..fd0b3e590 100644 --- a/code_igniter/application/models/m_system.php +++ b/code_igniter/application/models/m_system.php @@ -798,7 +798,7 @@ public function insert_system($details, $display = 'n') $details = (object) $details; $details = (array) $details; $details = (object) $details; - # this is an insert - we do NOT want a system_id + # this is an insert - we do NOT want a system.id unset($details->id); // set a ip if not already 1.5.6 @@ -1021,7 +1021,7 @@ public function insert_system($details, $display = 'n') $temp_vm_id = $row->id; $details->vm_system_id = $row->vm_system_id; $details->vm_server_name = $row->vm_server_name; - $sql = "SELECT icon , 'vm' FROM system WHERE system_id = ?"; + $sql = "SELECT icon , 'vm' FROM system WHERE system.id = ?"; $sql = $this->clean_sql($sql); $data = array($details->id); $query = $this->db->query($sql, $data); @@ -1071,7 +1071,7 @@ public function insert_system($details, $display = 'n') public function update_system($details, $display = 'n') { if (!isset($details->id) or $details->id == '') { - # this is an update - we need a system_id + # this is an update - we need a system.id return; } @@ -1337,7 +1337,7 @@ public function update_system($details, $display = 'n') $temp_vm_id = $row->id; $details->vm_system_id = $row->vm_system_id; $details->vm_server_name = $row->vm_server_name; - $sql = "SELECT icon FROM system WHERE system_id = ?"; + $sql = "SELECT icon FROM system WHERE system.id = ?"; $sql = $this->clean_sql($sql); $data = array($details->id); $query = $this->db->query($sql, $data); diff --git a/code_igniter/application/views/theme-bootstrap/v_devices_collection.php b/code_igniter/application/views/theme-bootstrap/v_devices_collection.php index 065e060e9..1a3202cb8 100644 --- a/code_igniter/application/views/theme-bootstrap/v_devices_collection.php +++ b/code_igniter/application/views/theme-bootstrap/v_devices_collection.php @@ -136,7 +136,7 @@ # for every returned row foreach ($this->response->data as $item) { - # grab the system_id if it exists + # grab the system.id if it exists $system_id = ''; if (!empty($item->attributes->{'system.id'})) { $system_id = $item->attributes->{'system.id'};