MediaWiki 1.18.1 Integration Problems using PHP 5.3.8

Started by danielwmoore, January 18, 2012, 01:52:40 PM

Previous topic - Next topic

danielwmoore

I'm posting this hoping it will give someone else a bit of insight when they go to searching for a solution to their problem. 

I'm using the SMF Auth Integration bridge to allow my MediaWiki to use the SMF members on a site. 

At first, I thought maybe the bridge just didn't work with 1.18.1, but it's the PHP version that causes the error.  I get the error:
Deprecated: Call-time pass-by-reference has been deprecated in \path\to\mediawiki\installation\extensions\Auth_SMF.php on line 265
Hacking attempt on SMF...


Partial Solution:
Looking it over, PHP has deprecated the pass-by-reference from within the function call.  Function definition alone is enough to correctly pass the argument by reference.

Changing line 265 from:
$wgAuth->isGroupAllowed($user_settings['member_name'], &$user);
to:
$wgAuth->isGroupAllowed($user_settings['member_name'], $user);

fixes the issue with the Deprecated message. 

However, the bridge still throws the "Hacking attempt on SMF..." error message when used with MediaWiki 1.18.1.

If anyone knows how to fix this issue I would be very grateful!

SA™

is that bridge the same as this one?

https://github.com/SimpleMachines/smf-mw-auth

not too sure about the error tho doe it leave any error messages in your server error logs?

oh i see that error comes from this line
if (!defined('SMF_IN_WIKI'))
   exit('Hacking attempt on SMF...');
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

danielwmoore

After doing a file compare, then yes, it is the same file.  It needs the above fix to work with PHP 5.3.8. 

I figured out that Hacking attempt message finally.  Fixed it, as I forgot to define it in LocalSettings.php, however, now that the bridge is properly "running" and LocalSettings.php is now set up according to the bridge instructions, it isn't working. That is, you are never shown as logged in.  Always a guest. 

Is the bridge just not compatible with MediaWiki 1.18.1 and SMF 2.0.2?  Does anyone know what else I should try?  What settings on my end do you need to help me troubleshoot this?

I notice there is a note on GitHub that setupSession() was deprecated in MediaWiki 1.18

SA™

im not realy sure not familyer with this bridge realy
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

danielwmoore

Found the topic I need to get the help from.  http://www.simplemachines.org/community/index.php?topic=461612.0

I'll post there, and could a moderator please lock this topic?  Thanks.

Illori

you would actually be best to keep to this topic, as that thread is not really for support. also we dont lock threads unless there is great reason to do so.

danielwmoore

Very well then.

Here's my actual problem now, if someone can help.

I've set up the LocalSettings.php per the instructions, removed the '&' from line 265 which fixed compatibility with my PHP 5.3.8, and the Wiki loads fine, however, I can't log in.  It redirects to an SMF login page, but I never get logged in.  I'm always a guest. 


If I use
$wgSMFLogin = false;
Then I get "password error" message every time I attempt to log in from MediaWiki (the password is correct.)

If I use
$wgSMFLogin = false;
then I have the problem of not being able to log in at all, with no error message given.

I'm using MediaWiki 1.18.1 and SMF 2.0.2.

I have set $wgCookieDomain correctly I am sure. 

Andre N

But that script looks like it is for SMF 1.13
You are using 2.02
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

ajbaldwin

I'm also running into this issue - I've configured the bridge per the instructions, but am continuously getting a "No such user exists" error (when I'm certain that the account does exist and the password is correct). It's as if there's no actual bridge to my SF auth store happening at all. I'd certainly appreciate any help that folks could give us.

I've got no entries in my error log that I can show people, sadly. I'm running the same setup that Daniel is (MW 1.18.1, SMF 2.0.2) and the bridging code available at hxxp:github.com/SimpleMachines/smf-mw-auth [nonactive]

Couple of small things that I noted (which probably aren't related, but I figured that I'd mention them):

- The README file for the bridge code mentions "If you encouter an issue be sure to read the known issues below", but there's only one thing below that entry that it could be actually referencing (page caching issues). Is that intended?

- One entry mentions: "NOTE: Make sure to configure the wgCookeDomain below" - the correct variable is wgCookieDomain (just a typo), but I wasn't sure if I was supposed to be referencing the same cookie name for both my SMF forum and the MediaWiki installation? Doing so seemed to clobber both sessions (which made sense), so right now that cookies are named independently of each other.

danielwmoore

Quote from: ajbaldwin on January 19, 2012, 07:51:17 PM
- The README file for the bridge code mentions "If you encouter an issue be sure to read the known issues below", but there's only one thing below that entry that it could be actually referencing (page caching issues). Is that intended?

I've tried that both ways myself, to no avail.

Quote from: ajbaldwin on January 19, 2012, 07:51:17 PM
- One entry mentions: "NOTE: Make sure to configure the wgCookeDomain below" - the correct variable is wgCookieDomain (just a typo), but I wasn't sure if I was supposed to be referencing the same cookie name for both my SMF forum and the MediaWiki installation? Doing so seemed to clobber both sessions (which made sense), so right now that cookies are named independently of each other.
The wgCookieDomain is the domain name that the cookie is stored under.  The browser will store the cookie by domain name, then under the cookie name in the domain name.  Give the correct domain here, and the Auth is supposed to get the cookie name from SMF's Settings.php, then read the cookie.

I have put test code within the SMF_Auth.php script, and verified I am reading the cookie correctly.  I have been unable to determine where it fails.


Quote from: andre nickatina on January 19, 2012, 04:29:53 PM
But that script looks like it is for SMF 1.13
You are using 2.02

No, that script is for 2.0 only, and is not backwards compatible with 1.13.  The version of the Auth script is 1.13, it is not a reference to the SMF version whatsoever.

ajbaldwin

I think I just realized is the date on this bridge code is mid-December while a security patch (2.0.2) was released just after the New Year. Perhaps the fix changed something that the bridge code relies on? Still strange that I don't receive any error messages (save the "Incorrect Password) at all (I'm running PHP 5.3.8 and didn't run into that reference error, for example).

SleePy

ajbaldwin,

The Auth file has been updated on the repository and should support working with MW 1.18.  The auth worked with my MW 1.18 install I created and tested with.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: