On Tue, Sep 30, 2008 at 6:23 PM, Lane, Ryan
<Ryan.Lane(a)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.
But I had a clause in the code that bypassed the updateUser. That was
breaking things. I'm wondering why it was in there in the first place.
Anyway it seems like the user info in the nav is updating now.
Note that I don't think the bug you cited actually applies to me
because SPNEGO occurs with every request. Meaning we don't really need
to know if the user has already authenticated.
Overall I have to say I'm a little worried about all the magical
things that need to occur to get non-username/password authentication
working. It's fine once you get it working but the extensions are a
little fragile in the face of changes like the UserLoadFromSession
one. I get the feeling non-username/password based authentication is
not a principal design feature. That's a shame.
Mike
PS: I see now that SVN has a much more current version of your LDAP
extension. I'll make sure to look at SVN from now on.
--
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/