예제 #1
0
                        $response .= implode(PHP_EOL, $whois_parts);
                        //print_vars($request['data']['records']);
                    }
                }
            }
            if ($response) {
                $_SESSION['cache']['response_' . $vars['entity_type'] . '_' . $ip] = '<pre class="small">' . $response . '</pre>';
                echo $_SESSION['cache']['response_' . $vars['entity_type'] . '_' . $ip];
            } else {
                echo 'Not Found';
            }
        } else {
            echo 'Not correct IP address';
        }
        exit;
        break;
    default:
        if (is_array($config['entities'][$vars['entity_type']])) {
            if (is_numeric($vars['entity_id']) && is_entity_permitted($vars['entity_id'], $vars['entity_type'])) {
                $entity = get_entity_by_id_cache($vars['entity_type'], $vars['entity_id']);
                echo generate_entity_popup($entity, $vars);
            } else {
                print_warning("You are not permitted to view this entity.");
            }
        } else {
            print_error("Unknown entity type.");
        }
        exit;
        break;
}
// EOF
     } else {
         print_warning("您未被授权查看该端口.");
     }
     exit;
     break;
 case "netscaler_svc":
 case "netscaler_vsvr":
 case "bgp_peer":
 case "storage":
 case "sensor":
 case "status":
 case "mempool":
 case "processor":
     if (is_numeric($vars['entity_id']) && is_entity_permitted($vars['entity_id'], 'processor')) {
         $entity = get_entity_by_id_cache($vars['entity_type'], $vars['entity_id']);
         echo generate_entity_popup($entity, $vars['entity_type']);
     } else {
         print_warning("You are not permitted to view this entity.");
     }
     exit;
     break;
 case "mac":
     if (Net_MAC::check($vars['entity_id'])) {
         // Other way by using Pear::Net_MAC, see here: http://pear.php.net/manual/en/package.networking.net-mac.importvendors.php
         $url = 'http://api.macvendors.com/' . urlencode($vars['entity_id']);
         $response = get_http_request($url);
         if ($response) {
             echo 'MAC vendor: ' . $response;
         } else {
             echo '未找到';
         }