[wp-trac] [WordPress Trac] #29594: Basic Cookie Authentication from External Database
WordPress Trac
noreply at wordpress.org
Tue Oct 7 04:53:08 UTC 2014
#29594: Basic Cookie Authentication from External Database
-----------------------------+------------------------------
Reporter: LPH2005 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 4.0
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by dd32):
I can't duplicate this either.
This code in a mu-plugin works for me, and allows me to edit existing
posts, create new posts, nonces pass, etc.
{{{
// http://example.com/wordpress/?login=admin
add_action( 'init', function() {
if ( isset( $_GET['login'] ) ) {
$user = get_user_by( 'login', $_GET['login'] );
wp_set_current_user( $user->ID );
wp_set_auth_cookie( $user->ID , 1 );
}
} );
}}}
@kburkhardt: I notice you're using this: {{{get_user_by('uid',
$uidHeader);}}} which won't work, WordPress has no 'uid' field, it's 'id'
that you want there.
> For example, XenWord bridges XenForo and WordPress.
[http://www.tuxreports.com/community/threads/wordpress-4-0-and-
xenword.519547/ Appears that theres a new release of XenWord in beta
testing with 4.0 compatibility] - It seems it was calling
{{{wp_update_user()}}} after login which was invalidating the sessions, I
don't have access to the code so I can't determine how it was failing, or
if it was a WordPress issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29594#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list