The prefix parameter is overridden in the logout - meaning that the wiki cookies are not properly unset and the user sees both the logout and logged in links
<?
function StaticUserLogout($prefix = null, $path = null, $domain = null) {
...
if ( $GLOBALS['wgDBprefix'] ) {
$prefix = $GLOBALS['wgDBname'] . '_' . $GLOBALS['wgDBprefix'];
}
elseif ( $GLOBALS['wgSharedDB'] ) {
// This is not supported yet--haven't researched it--Maarten.
// XXX should throw an error into watchdog log?
$prefix = $GLOBALS['wgSharedDB'];
} else {
$prefix = $GLOBALS['wgDBname']; // <-- $prefix overridden here - ignoring function parameter
}
?>
I notice that there is a different version of AuthDrupalEncode.php distributed with the AUthDrupal media wiki extension..
The attached patch is a minimal change to the current file which checks to see if $prefix is already set before attempting to fall back to $GLOBAL settings
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 932590-dbprefix.patch | 749 bytes | drzraf |
| AuthDrupalEncode_prefix.patch | 899 bytes | seanburlington |
Comments
Comment #1
anarcat commentedPatch looks good, but please fix intentation so that the final commit looks right.
Comment #2
seanburlington commentedI've committed the patch as I want to move things forward.
But still seeing trouble on logout - possibly a local config issue
Comment #3
seanburlington commentedThe problem I had was just a configuration error
This is now working fine.
Comment #4
thinkling commentedCurrent code in mediawikiauth breaks logout for my install where the mediawiki side is based on my latest AuthDrupal code on mediawiki.org. Code there takes the dbprefix out of the settings array, so that it will work for multiple wikis, whereas the old code used here relies on there being a single wiki set up in $GLOBALS.
Can I suggest updating StaticUSerLogout() to the latest version from AuthDrupalEncode.php on mediawiki.org?
Comment #5
drzraf commentedI would add that the attached patch is needed to get loggout working properly (lost quite some time on this one)
I also have an important note:
1) variable_get does not seem to set a default value for serialized empty strings (at least for the Drupal 7-x I use)
2) when you setcookie() with an empty value for $wgCookiePath, the login will succeed
3) when you setcookie() with an empty value for $wgCookiePath, the logout will fail ! (= the cookie will not be removed (firefox 7.0.1))
I think that empty $wgCookiePath values should be really given a default '/' value when empty (not relying on variable_get() in this case).