[Mediawiki-l] autoAuthenticate to UserLoadFromSession issues

Michael B Allen ioplex at gmail.com
Wed Oct 1 01:48:48 UTC 2008


On Tue, Sep 30, 2008 at 6:40 PM, Michael B Allen <ioplex at gmail.com> wrote:
> On Tue, Sep 30, 2008 at 6:23 PM, Lane, Ryan
> <Ryan.Lane at ocean.navo.navy.mil> wrote:
>>> Sorry, I meant to say $wgAuth->updateUser is what I'm doing in
>>> UserLoadFromSession.
>>>
>>> The user info on the main page isn't updating.
>>>
>>
>> Are you calling:
>>
>>        $user->saveSettings();
>>
>> at the end of the function?
>
> Everything works pretty well with UserLoadFromSession if I do the following:
>
>  global $wgUser;
>  ...
>  $user = User::newFromName($mwCanonName);
>  if (!$user)
>      throw new Exception("Invalid username: $mwCanonName");
>  $wgUser = &$user;
>
>  if ($user->getID() == 0) {
>      if (!class_exists('LoginForm'))
>          require_once 'SpecialUserlogin.php';
>      global $wgRequest;
>
>      $wgUser->setName($mwCanonName);
>      $loginForm = new LoginForm($wgRequest);
>
>      $loginForm->initUser($wgUser, true);
>  } else {
>      $wgAuth->updateUser($wgUser);
>  }
>
>  $wgUser->setCookies();
>  $wgUser->setupSession();
>
> So actually no, I don't do saveSettings.

Actually I take it back, I *do* call saveSettings (in updateUser).

Anyway, the same package is working now with both 1.13 and 1.11 at least.

Thanks for your help as usual,
Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/



More information about the MediaWiki-l mailing list