3 // Returns node ID of requestor
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2006 The Trustees of Princeton University
11 // Get admin API handle
12 require_once 'plc_api.php';
15 if (!empty($_REQUEST['mac_addr'])) {
16 $mac_lower = strtolower(trim($_REQUEST['mac_addr']));
17 $mac_upper = strtoupper(trim($_REQUEST['mac_addr']));
18 $interfaces = $adm->GetInterfaces(array('mac' => array($mac_lower, $mac_upper)));
20 $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
23 if (!empty($interfaces)) {
24 print $interfaces[0]['node_id'];