summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2008-02-13 23:49:38 +0000
committerjeff <jeff>2008-02-13 23:49:38 +0000
commite0f170ed96e65e693debb06dd1d56a912d06fe39 (patch)
treee04cc7e96a98a33801673339cbb78718ca23a5ca
parentba5deb42e573673383c8e9dac0dfe3e4296c4b6d (diff)
svc_broadband MAC searches RT#2985
-rwxr-xr-xFS/FS/svc_broadband.pm4
-rw-r--r--httemplate/elements/header.html4
2 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 473cd5705..68e7496d1 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -114,6 +114,10 @@ sub search_sql {
my( $class, $string ) = @_;
if ( $string =~ /^(\d{1,3}\.){3}\d{1,3}$/ ) {
$class->search_sql_field('ip_addr', $string );
+ }elsif ( $string =~ /^([a-fA-F0-9]{12})$/ ) {
+ $class->search_sql_field('mac_addr', uc($string));
+ }elsif ( $string =~ /^(([a-fA-F0-9]{1,2}:){5}([a-fA-F0-9]{1,2}))$/ ) {
+ $class->search_sql_field('mac_addr', uc("$2$3$4$5$6$7") );
} else {
'1 = 0'; #false
}
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html
index dfe6b6829..a1813405c 100644
--- a/httemplate/elements/header.html
+++ b/httemplate/elements/header.html
@@ -30,7 +30,7 @@
}
function clearhint_search_svc (what) {
- if ( what.value == '(user, user@domain or domain)' )
+ if ( what.value == '(user, email, ip, mac, or domain)' )
what.value = '';
}
@@ -190,7 +190,7 @@ input.fsblackbuttonselected {
<TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
<FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
- <INPUT NAME="search_svc" TYPE="text" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
+ <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
<A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
<INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
</FORM>