From 7e1ec631082817fc46fd593d82faf4ed2c4f8c8e Mon Sep 17 00:00:00 2001 From: Victor Boctor Date: Sat, 7 Mar 2015 21:16:31 -0800 Subject: [PATCH] Allow Admins to bypass blank email check Fixes #19475 --- core/email_api.php | 4 +++- docbook/Admin_Guide/en-US/config/email.xml | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/email_api.php b/core/email_api.php index b3030fd1c6..ee42cf601a 100644 --- a/core/email_api.php +++ b/core/email_api.php @@ -111,9 +111,11 @@ function email_regex_simple() { */ function email_is_valid( $p_email ) { # if we don't validate then just accept + # If blank email is allowed or current user is admin, then accept blank emails which are useful for + # accounts that should never receive email notifications (e.g. anonymous account) if( OFF == config_get( 'validate_email' ) || ON == config_get( 'use_ldap_email' ) || - ( is_blank( $p_email ) && ON == config_get( 'allow_blank_email' ) ) + ( is_blank( $p_email ) && ( ON == config_get( 'allow_blank_email' ) || current_user_is_administrator() ) ) ) { return true; } diff --git a/docbook/Admin_Guide/en-US/config/email.xml b/docbook/Admin_Guide/en-US/config/email.xml index ea393db4d8..aa6d8c4af5 100644 --- a/docbook/Admin_Guide/en-US/config/email.xml +++ b/docbook/Admin_Guide/en-US/config/email.xml @@ -155,6 +155,11 @@ an email at that point, no matter what the value of this option is. Otherwise they wouldn't get their passwords. + + Administrators are able to bypass this check to enable them to create + special accounts like anonymous access and other service accounts that + don't need notifications. +