diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-04-18 20:32:08 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-04-18 20:32:08 +0000 |
commit | f183b092ef8fcf09eff16884a8fdb9b403d9ddb3 (patch) | |
tree | 9bcb45d30b8d36ea38bb54473a4fd2aa60a4506c /usr | |
parent | 1e694beecf622f2100f639179b484f60d5e1f41f (diff) | |
download | pfsense-f183b092ef8fcf09eff16884a8fdb9b403d9ddb3.zip pfsense-f183b092ef8fcf09eff16884a8fdb9b403d9ddb3.tar.gz |
Add "Copy my MAC address" feature which copies the mac address of the person surfing into pfSense.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/services_dhcp_edit.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 1d8b934..ef66c29 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -144,7 +144,13 @@ if ($_POST) { <tr> <td width="22%" valign="top" class="vncellreq">MAC address</td> <td width="78%" class="vtable"> - <input name="mac" type="text" class="formfld" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>"> + <input name="mac" type="text" class="formfld" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>"> + <?php + $ip = getenv('REMOTE_ADDR'); + $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`; + $mac = str_replace("\n","",$mac); + ?> + <a OnClick="document.forms[0].mac.value='<?=$mac?>';" href="#">Copy my MAC address</a> <br> <span class="vexpl">Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx</span></td> |