[wp-hackers] CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE broken

Eric Marden wp at xentek.net
Sun Mar 2 18:57:38 GMT 2008


I found that if you get the first one installed, when you start to  
install the others, it will tell you that the admin user was  
recognized... This is how you know it was successful.

However, the constants weren't recognized when they lived in wp- 
config.php ... I had to actually put them in wp-settings.php. I can't  
understand why the constants couldn't work there, since this is one  
of the first files included (as far as I could tell). Also, I didn't  
need the changes in capabilities.php.

Also, I had to re-install the first one, so that it could hook into  
the shared users table, and have it's own prefix. A better way would  
be to install a 'base' blog, then throw away its other tables (and  
files) after the others are hooked in. Just leave the two user tables  
from it.

Sorry these are from memory (did this 4 months ago for the first  
time). I'll see if I can't come up with a better process, and  
document it somewhere.

Its still wonky, but it does work. I agree that this should be  
improved upon, but it can be made to work, even if you have to  
'jiggle the handle' a bit before it gets going.

Also, I recommend doing this on fresh installs... it will help  
eliminate other possible issues when trouble shooting.

Hope this helps you out some.

-e



On Mar 2, 2008, at 7:38 AM, DD32 wrote:

> On Sun, 02 Mar 2008 22:45:28 +1100, Jeremy Visser  
> <jeremy.visser at gmail.com> wrote:
>
>> I've put the following in wp-config.php to share my user tables among
>> multiple WP installs:
>>
>>         define ('CUSTOM_USER_TABLE', 'wp_users');
>>         define ('CUSTOM_USER_META_TABLE', 'wp_usermeta');
>>
>> However, I'm getting the infamous "You do not have sufficient
>> permissions to access this page" error, and I'm not the first:
>>
>> <http://www.google.com/search?q=custom_user_table+"You+do+not+have 
>> +sufficient+permissions+to+access+this+page.">
>>
>> No solutions I've seen worked. My blog prefix is "wp_jv_", so I tried
>> renaming the meta_keys "wp_capabilities" and "wp_user_level" in
>> wp_usermeta to "wp_jv_capabilities" and "wp_jv_user_level", but no  
>> dice.
>>
>> Someone also suggested editing the following in
>> wp-includes/capabilities.php:
>>
>>         $this->cap_key = $wpdb->prefix . 'capabilities';
>>
>> to this:
>>
>>         $this->cap_key = 'wp_capabilities';
>
> That worked for me, Dont have any caches enabled?
>
> However, Since WP has the Custom meta table define, Maybe it needs  
> one so as to respect the meta table prefixes?
>
> eg, In  your case, It attempts to load "wp_jv_capabilities" from  
> the table "wp_usermeta", while "wp_usermeta" contains a  
> "wp_capabilities" hey instead...
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list