Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserved usernames #785 #846

Open
wants to merge 1 commit into
base: 10.next-cake4
Choose a base branch
from

Conversation

rafaelqueiroz
Copy link
Contributor

No description provided.

@@ -63,6 +63,7 @@ public function register($user, $data, $options)
//@todo move updateActive to afterSave?
$user = $this->_updateActive($user, $validateEmail, $tokenExpiration);
$this->_table->isValidateEmail = $validateEmail;
$this->_table->usernameBlackList = Configure::read('Users.Username.blackList', []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can read the configuration from inside the UsersTable:203 callback and leave this trait unchanged

@@ -192,6 +197,16 @@ public function buildRules(RulesChecker $rules)
]);
}

if ($this->usernameBlackList) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract it into a behavior, allow to configure a callback to check the username blacklist (lines 202-204) so we will be able to configure an external method and read the blacklist from the database.

Please change name and configuration from usernameBlacklist to forbiddenUsernames.

Thanks,

@steinkel steinkel added this to the 9.1.0 milestone Aug 11, 2020
@steinkel steinkel modified the milestones: 9.1.0, 10.0.0 Aug 24, 2020
@steinkel steinkel changed the base branch from develop to 10.next-cake4 September 29, 2021 17:51
@steinkel steinkel removed this from the 10.0.0 milestone Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants