0) { $len = is_array($_POST['poe_on']) ? count($_POST['poe_on']) : 0; for ($i = 0; $i < $len; $i++) { $port_index = intval($_POST['poe_on'][$i]); $sSQL = "SELECT port from device_ports WHERE device_id=" . $id . " and snmp_index=" . $port_index; $port = get_record_sql($db_link, $sSQL); LOG_DEBUG($db_link, "Device id: " . $id . " enable poe at port " . $port['port'] . " snmp index " . $port_index); set_port_poe_state($device['vendor_id'], $port['port'], $port_index, $device['ip'], $snmp, 1); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } if (isset($_POST['poe_off']) and $device['snmp_version'] > 0) { $len = is_array($_POST['poe_off']) ? count($_POST['poe_off']) : 0; for ($i = 0; $i < $len; $i++) { $port_index = intval($_POST['poe_off'][$i]); $sSQL = "SELECT port from device_ports WHERE device_id=" . $id . " and snmp_index=" . $port_index; $port = get_record_sql($db_link, $sSQL); LOG_DEBUG($db_link, "Device id: " . $id . " disable poe at port " . $port['port'] . " snmp index " . $port_index); set_port_poe_state($device['vendor_id'], $port['port'], $port_index, $device['ip'], $snmp, 0); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } if (isset($_POST['port_on']) and $device['snmp_version'] > 0) { $len = is_array($_POST['port_on']) ? count($_POST['port_on']) : 0; for ($i = 0; $i < $len; $i++) { $port_index = intval($_POST['port_on'][$i]); LOG_DEBUG($db_link, "Device id: $id enable port with snmp index $port_index"); set_port_state($device['vendor_id'], $port_index, $device['ip'], $snmp, 1); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } if (isset($_POST['port_off']) and $device['snmp_version'] > 0) { $len = is_array($_POST['port_off']) ? count($_POST['port_off']) : 0; for ($i = 0; $i < $len; $i++) { $port_index = intval($_POST['port_off'][$i]); LOG_DEBUG($db_link, "Device id: $id disable port with snmp index $port_index"); set_port_state($device['vendor_id'], $port_index, $device['ip'], $snmp, 0); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } unset($_POST); if (!apply_device_lock($db_link, $id)) { header("Location: /admin/devices/editdevice.php?id=" . $id . "&status=locked"); exit; } $user_info = get_record_sql($db_link, "SELECT * FROM User_list WHERE id=" . $device['user_id']); require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php"); print_device_submenu($page_url); print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['login']); ?>