Multiple installs sharing a user table don't create usermeta caps for all installs
|Reported by:||ringmaster||Owned by:|
Assume two instances of WordPress are installed to the same database for the purpose of sharing a user table. Registering a user on one instance (using db prefix "wp_") creates both the the wp_users data and the wp_usermeta data for that user. The wp_usermeta data contains the user capabilites.
Although the user login and password will be found by the second instance, there will be no default usermeta present for that login, and so the user does not have enough capabilities to log in.
A potential solution involves setting the (wp_)capabilities metadata to the default for new users when the WP_User class attempts to load caps for that user and finds nothing. If there are no elements in the caps array, it is safe to assume that the user did not properly have his caps created, since the WP_User::set_role() implies that all users must have at least one role, and roles are stored as caps. If a user has no caps, then the user has no role, and should then be assigned the default role.
Change History (9)
comment:2 markjaquith — 8 years ago
- Resolution set to invalid
- Status changed from new to closed
- Version changed from 1.2 to 2.0.1
comment:4 davidhouse — 8 years ago
- Keywords bg|has-patch added
- Resolution invalid deleted
- Status changed from closed to reopened