bcc-code / bcc-wp

[BCC IT] Custom Wordpress themes and plugins which can be used in any BCC application (currently includes the BCC Login plugin)
Apache License 2.0
0 stars 7 forks source link

Creating manually a user with PMO ID is not possible #165

Open ice1e0 opened 3 months ago

ice1e0 commented 3 months ago

Hi, I switched to the new plugin and users are now not anymore automatically created. I tried now to create a user manually, but a user name must include at least one letter when I want to create the user via the Wordpress admin page. How can I now with the new plugin create a user to assign e.g. role admin when he/she log in via BCC Login?

ice1e0 commented 3 months ago

Note: I figured out that the Wordpress validation rule in wp-includes/ms-functions.php creates this issue:

// All numeric?
if ( preg_match( '/^[0-9]*$/', $user_name ) ) {
    $errors->add( 'user_name', __( 'Sorry, usernames must have letters too!' ) );
}

One option is to manually disable this logic but I guess it is there for a reason. The Wordpress plugin should work here differently to link the PMO ID to the user by another field than the username.

cs1m0n commented 3 months ago

The user can be linked to the BCC member also by the email address, totally independent of what username you are setting to the account.

ice1e0 commented 3 months ago

@cs1m0n This is great to hear! But I think this would not work anymore when someone changes the email address, right? Then one would be locked out of Wordpress right?