librenms-librenms/html/ajax/list_interfaces.php
2010-02-27 14:44:38 +00:00

18 lines
580 B
PHP
Executable File

<?php
include("../../includes/defaults.inc.php");
include("../../config.php");
include("../../includes/functions.php");
include("../includes/authenticate.inc.php");
if(!$_SESSION['authenticated']) { echo("unauthenticated"); exit; }
if(isset($_GET['device_id'])){
$ports = mysql_query("SELECT * FROM ports WHERE device_id = '".$_GET['device_id']."'");
while($interface = mysql_fetch_array($ports)) {
echo "obj.options[obj.options.length] = new Option('".$interface['ifDescr']." - ".$interface['ifAlias']."','".$interface['interface_id']."');\n";
}
}
?>