config to disable email validation
This commit is contained in:
@@ -607,6 +607,9 @@ function validate_url(&$url) {
|
||||
if(! function_exists('validate_email')) {
|
||||
function validate_email($addr) {
|
||||
|
||||
if(get_config('system','disable_email_validation'))
|
||||
return true;
|
||||
|
||||
if(! strpos($addr,'@'))
|
||||
return false;
|
||||
$h = substr($addr,strpos($addr,'@') + 1);
|
||||
|
||||
@@ -656,6 +656,10 @@ function search($s,$id='search-box',$url='/search',$save = false) {
|
||||
|
||||
if(! function_exists('valid_email')) {
|
||||
function valid_email($x){
|
||||
|
||||
if(get_config('system','disable_email_validation'))
|
||||
return true;
|
||||
|
||||
if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@@ -99,11 +99,11 @@ function create_user($arr) {
|
||||
|
||||
|
||||
if(! allowed_email($email))
|
||||
$result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL;
|
||||
$result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL;
|
||||
|
||||
if((! valid_email($email)) || (! validate_email($email)))
|
||||
$result['message'] .= t('Not a valid email address.') . EOL;
|
||||
|
||||
|
||||
// Disallow somebody creating an account using openid that uses the admin email address,
|
||||
// since openid bypasses email verification. We'll allow it if there is not yet an admin account.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user