Move validation of dyndns username to the only place it uses it, the GUI page. There it makes sense. While there add ':' character to allow NO-ip subaccounts.

This commit is contained in:
Ermal Lui 2009-05-07 17:24:28 +00:00
parent 21fcd99a62
commit ee2db55f73
2 changed files with 11 additions and 11 deletions

View File

@ -213,17 +213,6 @@ function is_domain($domain) {
return false;
}
/* returns true if $uname is a valid DynDNS username */
function is_dyndns_username($uname) {
if (!is_string($uname))
return false;
if (preg_match("/[^a-z0-9\-.@_]/i", $uname))
return false;
else
return true;
}
/* returns true if $macaddr is a valid MAC address */
function is_macaddr($macaddr) {
if (!is_string($macaddr))

View File

@ -34,6 +34,17 @@
##|-PRIV
/* returns true if $uname is a valid DynDNS username */
function is_dyndns_username($uname) {
if (!is_string($uname))
return false;
if (preg_match("/[^a-z0-9\-.@_:]/i", $uname))
return false;
else
return true;
}
require("guiconfig.inc");
if (!is_array($config['dyndnses']['dyndns'])) {