--- /dev/null
+<?php
+
+namespace wcf\system\user\event;
+
+use wcf\system\event\IInterruptableEvent;
+use wcf\system\event\TInterruptableEvent;
+
+/**
+ * Indicates that a username is currently validated. If this event
+ * is interrupted, the username is considered to be invalid.
+ *
+ * This event will not be fired for usernames changed by an administrator.
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+final class UsernameValidating implements IInterruptableEvent
+{
+ use TInterruptableEvent;
+
+ public function __construct(
+ public readonly string $username
+ ) {
+ }
+}
namespace wcf\util;
use Spoofchecker;
+use wcf\system\event\EventHandler;
+use wcf\system\user\event\UsernameValidating;
/**
* Contains user registration related functions.
return false;
}
+ $event = new UsernameValidating($name);
+ EventHandler::getInstance()->fire($event);
+ if ($event->defaultPrevented()) {
+ return false;
+ }
+
switch (REGISTER_USERNAME_FORCE_ASCII) {
case 0:
break;