Skip to content

Commit

Permalink
Allow Admins to bypass blank email check
Browse files Browse the repository at this point in the history
Fixes #19475
  • Loading branch information
vboctor committed Mar 10, 2015
1 parent 0298961 commit 7e1ec63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/email_api.php
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions docbook/Admin_Guide/en-US/config/email.xml
Expand Up @@ -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.
</para>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
Expand Down

0 comments on commit 7e1ec63

Please sign in to comment.