I should add more information.
$wgIP is set to the login name of the user. So what I am doing here is
checking if that login name is already a vaild user if so load it, else
create a new account with that name.
All that works well, as I said before only problem I have been able to find
is saving the preferences. Can't seem to get that token set right. I think
it is some sort of session issue since my code executes on each load, but I
am not sure.
Any help would be appreciated,
Thanks
Chris McIntosh
On 11/16/05, Chris McIntosh <cmcintosh(a)gmail.com> wrote:
I am modifying the source code to allow our internal Intranet users to
automatically log in to the wiki based on their username applied by apache.
I do this by using mod_ntlm to get their NTLM credentials and then want to
seemlessly log them in.
The problem I am having is setting up the user variable (wgUser) properly.
I have tried the following.
For now I have it near the bottom of Setup.php just to test around line
300.
if ( $wgUseRemoteUser)
{
if ($userid = $wgUser->idFromName($wgIP))
{
$wgUser->setId($userid);
$wgUser->loadFromDatabase();
}
else
{
$wgUser = $wgUser->newFromName($wgIP);
$wgUser->setId($wgUser->getMaxId());
$wgUser->addToDatabase();
}
$wgUser->setToken() ;
$wgUser->setCookies();
}
The problem with this approach is I can't change any preferences for this
user. Everything else seems fine but if I try and change a setting like
Underline links, the preference page won't save. I have tracked that down to
the edit token not being set properly, but I am not sure how to set it. If I
remove the check in SpecialPreferences where it calls matchEditToken then
everything works fine.
Any advice?
Thanks
Chris McIntosh