From 7637e85631a8c7f457f771626a1416d184162369 Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Mon, 20 Oct 2008 21:40:12 +0000 Subject: BIG CHANGE: migrate p_*_edit permissions to p_*_update permission naming convention, hasEditPermission is now hasUpdatePermission, many explicit perm checks have been cleaned up to hasUpdatePermission --- BitUser.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BitUser.php b/BitUser.php index 25cdd9f..e90be51 100644 --- a/BitUser.php +++ b/BitUser.php @@ -1,6 +1,6 @@ - * @version $Revision: 1.203 $ + * @version $Revision: 1.204 $ * @package users * @subpackage BitUser */ @@ -355,13 +355,14 @@ class BitUser extends LibertyMime { $errors = array(); } + // check for existing user first, so root@localhost doesn't get attempted to re-register + if( !empty( $this ) && is_object( $this ) && $this->userExists( array( 'email' => $pEmail ) ) ) { + $errors['email'] = 'The email address "'.$pEmail.'" has already been registered.'; // during install we have some @localhost as email address. we won't cause problems on those - if( $pEmail == 'root@localhost' || $pEmail == 'guest@localhost' ) { + } elseif( $pEmail == 'root@localhost' || $pEmail == 'guest@localhost' ) { // nothing to do } elseif( !validate_email_syntax( $pEmail ) ) { $errors['email'] = 'The email address "'.$pEmail.'" is invalid.'; - } elseif( !empty( $this ) && is_object( $this ) && $this->userExists( array( 'email' => $pEmail ) ) ) { - $errors['email'] = 'The email address "'.$pEmail.'" has already been registered.'; } elseif( $gBitSystem->isFeatureActive( 'users_validate_email' ) ) { if( !$this->verifyMX( $pEmail, $pValidate ) ) { $errors['email'] = 'Cannot find a valid MX host'; -- cgit v1.3