Membershipworks
-
I have been pulling my hair out (and I don’t have much to lose) over PowerPress’ inability to authenticate against Membershipworks. The reason is that Membershipworks does not use the person’s email address for the ID of the account. After messing around for a long time, I made these changes and they appear to work. Posting this in case others need it (file is powerpress-feed-auth.php):
// old code
// $userObj = wp_authenticate($user, $password);// if( !is_wp_error($userObj) )
// {
// Check capability…
// if( $userObj->has_cap( $FeedSettings[‘premium’] ) )
// return; // Nice, let us continue…
// powerpress_feed_auth_basic( $FeedSettings[‘title’], __(‘Access Denied’, ‘powerpress’) );
// exit;
// }// new code
$userObjID = get_user_by( ’email’, $user );
if( !is_wp_error($userIDObj) )
{
$userObj = wp_authenticate($userObjID->user_login, $password);
if( !is_wp_error($userObj) )
{
// Check capability…
if( $userObj->has_cap( $FeedSettings[‘premium’] ) )
return; // Nice, let us continue…
powerpress_feed_auth_basic( $FeedSettings[‘title’], __(‘Access Denied’, ‘powerpress’) );
exit;
}
} else {
powerpress_feed_auth_basic( $FeedSettings[‘title’], __(‘Access Denied’, ‘powerpress’) );
exit;
}
- The topic ‘Membershipworks’ is closed to new replies.