Jump to content

Extension talk:SMF Auth Integration

Add topic
From mediawiki.org
Latest comment: 13 years ago by Gossamer in topic Problems in 1.16

Is there a plan to update for 1.13? Or does anyone have solution for the error:

Notice: Undefined variable: result in ...wiki/includes/Title.php on line 1158

which occurs 5 times in a row when SMF_Auth is enabled?

Problems in 1.19

[edit]

Many Users from my forum have this error. With my Account it works perfectly, I testet with a Account from a friend and became this error

Backtrace:

  1. 0 /homepages/7/d242867666/htdocs/wiki/includes/specials/SpecialUserlogin.php(440): User->setPassword('*******')
  2. 1 /homepages/7/d242867666/htdocs/wiki/includes/specials/SpecialUserlogin.php(709): LoginForm->initUser(Object(User), true)
  3. 2 /homepages/7/d242867666/htdocs/wiki/includes/specials/SpecialUserlogin.php(530): LoginForm->attemptAutoCreate(Object(User))
  4. 3 /homepages/7/d242867666/htdocs/wiki/includes/specials/SpecialUserlogin.php(716): LoginForm->authenticateUserData()
  5. 4 /homepages/7/d242867666/htdocs/wiki/includes/specials/SpecialUserlogin.php(170): LoginForm->processLogin()
  6. 5 /homepages/7/d242867666/htdocs/wiki/includes/SpecialPageFactory.php(476): LoginForm->execute(NULL)
  7. 6 /homepages/7/d242867666/htdocs/wiki/includes/Wiki.php(263): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
  8. 7 /homepages/7/d242867666/htdocs/wiki/includes/Wiki.php(593): MediaWiki->performRequest()
  9. 8 /homepages/7/d242867666/htdocs/wiki/includes/Wiki.php(503): MediaWiki->main()
  10. 9 /homepages/7/d242867666/htdocs/wiki/index.php(58): MediaWiki->run()
  11. 10 {main}

Problems in 1.16

[edit]

Different SubDomains Integration

[edit]

I have www.forum.maindomain.com SMF forum and www.wiki.maindomain.com MediaWiki what should i insert into $wgSMFPath =?

forum files stores in startfolder/subdomains/testforum/httpdocs/forum wiki files stores in startfolder/subdomains/wiki/httpdocs

when i write $wgSMFPath =../subdomains/testforum/httpdocs/forum wiki says that its wrong



If auth sharing is disabled, strange errors appear

[edit]

I set the setting that users must relogin in the wiki, worked fine for admins but "normal" users wich are in the defined group can't login due to a strange error. I use the latest MediaWiki version (1.15.2).


Problems in 1.14

[edit]

Note: I don't know yet if this is my fault or the software's.

  • Using AutoAuthentication, logging in works fine, but on logging out, I'm being redirected to SMF which tells me
"An Error Has Occured: Session verification failed. Please try logging out and back in again, and then try again. "
Logging out in the SMF works.

Anyone having the same problems, or, better yet, a solution?

I've the same problem in 1.14 and also in 1.15.1! Please help me!!! --151.50.5.139 21:16, 3 August 2009 (UTC)Reply

Solution

[edit]

Change on the function UserLogoutSMF the line:

smf_redirectWrapper('logout_url', 'logout;sesc=' . $_SESSION['rand_code']);

To:

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

There is still the problem of the cookies, which must be deleted in order to skip autologin in the wiki.

Questions

[edit]
  • If I comment out the part about $wgSMFLogin = true;, the whole extension seems to seize working. What is it meant to do in that case? I thought it would use the wiki login, but somehow hook into the SMF user table to see if there's a match (instead of using the wiki users), but this doesn't seem to be the case.
  • Using $wgHooks['UserLoadFromSession'][] or $wgHooks['AutoAuthenticate'][] doesn't seem to make a difference when not using $wgSMFLogin = true;. When using it, only $wgHooks['UserLoadFromSession'][] works.

Problems in 1.12

[edit]

Are you planning to update this for 1.12? Currently logging in and out doesnt function when $wgSMFLogin is enabled. The download link is broken.

Same Problem

[edit]

get an Parse error: syntax error, unexpected '=' in /../../LocalSettings.php on line 153 where wgSMFLogin = true; is located

Problem still exists with version 1.13

Another bug

[edit]
# Load up the extension
require_once "$IP/extensions/Auth_SMF.php";

seems not work, it should be

# Load up the extension
require_once "./extensions/Auth_SMF.php";

like in Ver 1.12

Version 1.13.0 Hiccups

[edit]

I was having some problems with the 1.13.0 beta in regards to this extension. I found out that the AutoAuthenticate hook doesn't exist anymore in 1.13+ and the suggestion is to use the UserLoadFromSession hook instead. I found that I was having login issues which may, or may not have been related. Now I'm not a serious coder but I did some tweaking of the Auth_SMF.php which are documented below and the issue seems to have been fixed though I am sure its couldn't have been as simple as that to fix.


Line 138:

function AutoAuthenticateSMF(&$user) {

Was changed into:

function AutoAuthenticateSMF(&$user, &$result) {


Line 468:

$wgHooks['AutoAuthenticate'][] = 'AutoAuthenticateSMF';

Was changed into:

$wgHooks['UserLoadFromSession'][] = 'AutoAuthenticateSMF';

I would appreciate it if someone more knowledgeable would look the issue over and hopefully update the code. Cheers for the extension!

Works in 1.12

[edit]

I just installed this extension to MediaWiki v1.12 and it is working great. Though I had a problem with logout. If I used the automatic wiki login/logout ($wgSMFLogin = true;), every browser just hanged when clicking the logout link (they kept requesting the same blank page over and over again). The problem was solved by modifying the Auth_SMF.php: Line 469:

$wgHooks['UserLogout'][] = 'UserLogoutSMF';

Was changed into:

$wgHooks['UserLogoutComplete'][] = 'UserLogoutSMF';

Underscore workaround suggestion

[edit]

There are lots of characters besides underscore that are valid SMF usernames but invalid for the MediaWiki software. So, instead, why don't create a regexp that checks and removes these characters and, if at least one character has been removed, append the user's id, so we avoid any colission?

I will try to do it myself and put here the resulting code if anyone wants it.

MW1.17

[edit]

Does anybody have this working for SMF 1.115 and MW1.17?

The MW links point to SMF logon, but it doesn't log the user into the wiki also...

Thanks 219.89.97.73

Error when changing line 468

[edit]

$wgHooks['AutoAuthenticate'][] = 'AutoAuthenticateSMF';

to 

$wgHooks['UserLoadFromSession'][] = 'AutoAuthenticateSMF';

it says:

[8e2f687f] /geo/index.php?title=Main_Page Exception from line 222 of /mypath/geo/includes/Hooks.php: Detected bug in an extension! Hook AutoAuthenticateSMF has invalid call signature; Parameter 1 to AutoAuthenticateSMF() expected to be a reference, value given

Backtrace:

#0 /mypath/geo/includes/GlobalFunctions.php(4004): Hooks::run(string, array, NULL)
#1 /mypath/geo/includes/User.php(1042): wfRunHooks(string, array)
#2 /mypath/geo/includes/User.php(300): User->loadFromSession()
#3 /mypath/geo/includes/User.php(1863): User->load()
#4 /mypath/geo/includes/User.php(2986): User->getId()
#5 /mypath/geo/includes/Wiki.php(530): User->isLoggedIn()
#6 /mypath/geo/includes/Wiki.php(447): MediaWiki->main()
#7 /mypath/geo/index.php(46): MediaWiki->run()
#8 {main}