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