Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#2817 closed defect (bug) (fixed)

Admin password change problem

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

Reported by Owen Gray on wp-testers

After new install, while logged in as admin if I change admin's password
the meta_value for admin's wp_capabilities has been changed to "a:0:{}"
and the response to any attempt to view the admin area is: "You do not
have sufficient permissions to access this page."

I'm going to tackle this since it was my patch that caused this -- Mark

Attachments (1)

role_fix.diff (430 bytes) - added by markjaquith 18 years ago.
fix for trunk

Download all attachments as: .zip

Change History (3)

@markjaquith
18 years ago

fix for trunk

#1 @markjaquith
18 years ago

  • Keywords has-patch commit added
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

Got it. Just need to make sure $role is set before updating it. When you edit your profile, $role won't be set, so it passes. Tested the uploaded patch and it works.

If anyone was bitten by this bug, do this:

UPDATE your_wp_usermeta SET meta_value = 'a:1:{s:13:"administrator";b:1;}' WHERE meta_key = 'your_wp_capabilities' AND user_id = '1';

Obviously, replace your_wp_usermeta with your usermeta table name, and "1" with the user ID affected. Then rm -rf your /wp-content/cache/ directory.

Thanks Owen Gray for the nice report!

#2 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3865]) Make sure role is set when updating. Props Mark Jaquith. fixes #2817

Note: See TracTickets for help on using tickets.