From: <abe...@us...> - 2014-03-20 19:40:57
|
Revision: 6473 http://sourceforge.net/p/astlinux/code/6473 Author: abelbeck Date: 2014-03-20 19:40:53 +0000 (Thu, 20 Mar 2014) Log Message: ----------- web interface, PhoneProv tab, sanity check MAC address from imported text file and make lower case Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/phoneprov.php Modified: branches/1.0/package/webinterface/altweb/admin/phoneprov.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/phoneprov.php 2014-03-19 19:30:30 UTC (rev 6472) +++ branches/1.0/package/webinterface/altweb/admin/phoneprov.php 2014-03-20 19:40:53 UTC (rev 6473) @@ -222,13 +222,15 @@ if ($line = trim(fgets($fp, 1024))) { if ($line[0] !== '#') { if (preg_match('/^([^ \t]+)[ \t]+([^ \t]+)[ \t]+([^ \t]+)[ \t]+([^ \t]+)(.*)$/', $line, $tokens)) { - $enabled = '1'; - $template = $tokens[1]; - $mac = $tokens[2]; - $ext_cid = $tokens[3]; - $password = $tokens[4]; - $account = trim($tokens[5]); - $result = addPHONEPROVmac($family, $mac, $enabled, $template, $ext_cid, $password, $account); + $mac = strtolower($tokens[2]); + if (preg_match('/^([0-9a-f]{2}:){5}([0-9a-f]{2})$/', $mac)) { + $enabled = '1'; + $template = $tokens[1]; + $ext_cid = $tokens[3]; + $password = $tokens[4]; + $account = trim($tokens[5]); + $result = addPHONEPROVmac($family, $mac, $enabled, $template, $ext_cid, $password, $account); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |