Advertisement:
NameCheap

Author Topic: SMF MediaWiki integration released  (Read 221221 times)

Offline Shadra

  • Newbie
  • *
  • Posts: 3
Re: SMF MediaWiki integration released
« Reply #200 on: July 31, 2015, 05:15:49 AM »
You are right, the SMF doesn't know something about the wiki, I add a new Tab and it's okay.

I tested the thing with subdomain cookies and I can login at my SMF without any error. But the MW give me new warnings: "session_name() [function.session-name.php]: session.name cannot be numeric or empty " in /home/restofthepath/folder/wiki/extensions/Auth_SMF.php on line 333" and "session_destroy () [function.session-destroy.php]: Trying to destroy uninitialized session in /home/restofthepath/folder/wiki/extensions/Auth_SMF.php on line 334"

This is the function
Code: [Select]
function UserLogoutSMF (&$user)
{
global $wgCookiePrefix, $wgSessionName;

// Log them out of wiki first.
$user->doLogout();

// Destory their session.
$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
$old_session = session_name(isset($wgSessionName) ? $wgSessionName : $wgCookiePrefix . '_session');
session_destroy();

// Destroy the cookie!
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000, $params['path'], $params['domain'], $params['secure'], $params['httponly']);

// Back to whatever we had (we hope mediawiki).
session_name($old_session);

// Now SMFs turn.
smf_sessionSetup();

// This means we have no SMF session data or unable to find it.
if (empty($_SESSION['session_var']))
return true;

smf_redirectWrapper('logout_url', 'logout;' . $_SESSION['session_var'] . '=' . $_SESSION['session_value']);
}

Line 333 and 334 are
   $old_session = session_name(isset($wgSessionName) ? $wgSessionName : $wgCookiePrefix . '_session');
   session_destroy();


I changed in the localsettings.php the domain cookie from ".mydomain.com" to "mydomain.com" and after reload the wiki I got only the first warning with line 333.

Offline Shadra

  • Newbie
  • *
  • Posts: 3
Re: SMF MediaWiki integration released
« Reply #201 on: August 03, 2015, 07:12:51 AM »
Sorry for double post, but I tried some other things and they work. Actually I've the same problem like ekynox a few months earlier.

...cut from shadra...

Used another smf account (not admin), it still do not redirect back to wiki, but I'm logged with that account inside mediawiki.

So ... why my main smf admin account is not accepted ?
...cut from shadra...

So all members of my board can now start spaming the wiki, without me as admin/sysop.
I uncommented in the localsettings.php this two values:
$wgSMFGroupID = array(2);
$wgSMFAdminGroupID = array(1, 3);

But nothing works, my latin is at the end :(
But one thing is now clear: it's no longer a cookie problem, but something else is wrong or so.