Stop using UserUtil::isAvailableEmail()
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Dec 2021 10:45:51 +0000 (11:45 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Dec 2021 10:45:51 +0000 (11:45 +0100)
wcfsetup/install/files/lib/acp/form/UserAddForm.class.php
wcfsetup/install/files/lib/data/user/UserRegistrationAction.class.php
wcfsetup/install/files/lib/form/AccountManagementForm.class.php
wcfsetup/install/files/lib/form/EmailActivationForm.class.php
wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php

index b8ff713d5bba55fa0ab3683593b8a42252f4622f..e93fbc11297270bd4a56d562afc7d78cf97c5921 100644 (file)
@@ -366,7 +366,7 @@ class UserAddForm extends UserOptionListForm
         }
 
         // Check if email exists already.
-        if (!UserUtil::isAvailableEmail($email)) {
+        if (User::getUserByEmail($email)->userID) {
             throw new UserInputException('email', 'notUnique');
         }
 
index 755c5224dde8fbf7d484b9a35ec5ece2b99a34b0..003d17600eda403dacb565c12d0cd4a78d795826 100644 (file)
@@ -3,7 +3,6 @@
 namespace wcf\data\user;
 
 use wcf\util\UserRegistrationUtil;
-use wcf\util\UserUtil;
 
 /**
  * Executes user registration-related actions.
@@ -86,7 +85,7 @@ class UserRegistrationAction extends UserAction
             ];
         }
 
-        if (!UserUtil::isAvailableEmail($this->parameters['email'])) {
+        if (User::getUserByEmail($this->parameters['email'])->userID) {
             return [
                 'isValid' => false,
                 'error' => 'notUnique',
index f8bc090570b8080d471dcde42acc59a43618fa8e..cb442d657c6351fe64c3ad81c6d822161e109850 100644 (file)
@@ -16,7 +16,6 @@ use wcf\system\WCF;
 use wcf\util\JSON;
 use wcf\util\StringUtil;
 use wcf\util\UserRegistrationUtil;
-use wcf\util\UserUtil;
 
 /**
  * Shows the account management form.
@@ -293,7 +292,7 @@ class AccountManagementForm extends AbstractForm
                 }
 
                 // checks if email already exists.
-                if (!UserUtil::isAvailableEmail($this->email)) {
+                if (User::getUserByEmail($this->email)->userID) {
                     throw new UserInputException('email', 'notUnique');
                 }
             }
index 68ee1fff130929d8e07286613cd362c49cd95b27..cc42a6f2a649a10902552ed7a301e40f54431f18 100644 (file)
@@ -11,7 +11,6 @@ use wcf\system\exception\UserInputException;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\HeaderUtil;
-use wcf\util\UserUtil;
 
 /**
  * Shows the email activation form.
@@ -90,7 +89,7 @@ class EmailActivationForm extends AbstractForm
         }
 
         // check whether the new email isn't unique anymore
-        if (!UserUtil::isAvailableEmail($this->user->newEmail)) {
+        if (User::getUserByEmail($this->user->newEmail)->userID) {
             throw new NamedUserException(WCF::getLanguage()->get('wcf.user.email.error.notUnique'));
         }
 
index e76e725f2da51b0c6d5e9198abebbd36560a03bf..ca226c3895b76318382f7570f2b45a998870658f 100644 (file)
@@ -16,7 +16,6 @@ use wcf\system\WCF;
 use wcf\util\HeaderUtil;
 use wcf\util\StringUtil;
 use wcf\util\UserRegistrationUtil;
-use wcf\util\UserUtil;
 
 /**
  * Shows the new activation code form.
@@ -148,7 +147,7 @@ class RegisterNewActivationCodeForm extends AbstractForm
                 }
 
                 // Check if email exists already.
-                if (!UserUtil::isAvailableEmail($this->email)) {
+                if (User::getUserByEmail($this->email)->userID) {
                     throw new UserInputException('email', 'notUnique');
                 }
             } else {