Closed jnoir closed 12 years ago
Interesting development. When using $smf_member_id = $user->getOption('smf_member_id'); , groups are pulled properly from the arrays etc and permissions assigned accordingly during login, but the autoauth doesnt work so your session fails immediately (I think) so you just see "Log in". Seems it sees the user, does everything to the point of the session, and then fails.
However When using $smf_member_id = $user_settings['id_member'];, groups are not pulled from the arrays at all, but the session works. Maybe this info will help? I hope so. Im dying to get this working
More stuff I commented out the following
if (empty($smf_member_id) || $smf_member_id != $ID_MEMBER)
{
// TODO: Log errors if the ids don't match?
if ($user->isLoggedIn())
$user->logout();
return true;
}
And it now works :D so something to do with that section :)
$smf_member_id is pulling 0. EDIT: Nah I can't see where it pulls from. Gone as far as I can with my limited knowledge. Hopefully you guys will be able to find out whats going on :)
I used this script on a test suit I have in my computer that replicates a live SMF and mediawiki and noticed a few things, one of them is that it would fail to login because of the code:
if (empty($smf_member_id))
$smf_member_id = $user->getOption('smf_member_id');
would always return 0 even if the option is set to another value. This happens because MediaWiki always returns the Default (0 in this case) if the option is set to hidden.
$wgHiddenPrefs[] = 'smf_member_id';
$wgHiddenPrefs[] = 'smf_last_update';
There are two options, change getOption parameters in order to force the retrieval of data even if hidden or simply no longer mark the two Options as hidden. I did the latest.
Jnoir,
I dropped the two references about issues with the authentication. You are correct and I shouldn't of been using the $wgHiddenPrefs and this appears to of been causing those issues since it caused the id to always be 0.
Updated README to clarify installation instructions; added brief background, pre-requisites and FAQ