Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
Don't allow any site admin email address to be used for registration.…
Browse files Browse the repository at this point in the history
… See #24
  • Loading branch information
boonebgorges committed May 22, 2013
1 parent 26f2217 commit 7d325b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions thatcamp-registrations-public-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ function display_registration() {
$alerts['user_email'] = __('You must add an email address.', 'thatcamp-registrations');
}

if ( $_POST['user_email'] == get_option( 'admin_email' ) ) {
$alerts['user_email'] = __( 'You cannot register using this site\'s admin email address.', 'thatcamp-registrations' );
$email = $_POST['user_email'];
$the_user = get_user_by( 'email', $email );
$is_an_admin = is_a( $the_user, 'WP_User' ) && user_can( $the_user, 'manage_options' );
if ( $is_an_admin ) {
$alerts['user_email'] = __( 'You cannot register the email address of a site administrator.', 'thatcamp-registrations' );
}

if ( empty( $_POST['description'] ) ) {
Expand Down

0 comments on commit 7d325b5

Please sign in to comment.