2 namespace wcf\data\user
;
3 use wcf\util\UserRegistrationUtil
;
7 * Executes user registration-related actions.
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\Data\User
14 class UserRegistrationAction
extends UserAction
{
18 protected $allowGuestAccess = ['validateEmailAddress', 'validatePassword', 'validateUsername'];
21 * Validates the validate username function.
23 public function validateValidateUsername() {
24 $this->readString('username');
28 * Validates the validate email address function.
30 public function validateValidateEmailAddress() {
31 $this->readString('email');
35 * Validates the validate password function.
37 public function validateValidatePassword() {
38 $this->readString('password');
42 * Validates the given username.
46 public function validateUsername() {
47 if (!UserRegistrationUtil
::isValidUsername($this->parameters
['username'])) {
54 if (!UserUtil
::isAvailableUsername($this->parameters
['username'])) {
57 'error' => 'notUnique'
67 * Validates given email address.
71 public function validateEmailAddress() {
72 if (!UserRegistrationUtil
::isValidEmail($this->parameters
['email'])) {
79 if (!UserUtil
::isAvailableEmail($this->parameters
['email'])) {
82 'error' => 'notUnique'
92 * Validates given password.
96 public function validatePassword() {
97 if (!UserRegistrationUtil
::isSecurePassword($this->parameters
['password'])) {
100 'error' => 'notSecure'