News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

DokuWiki and SMF integration

Started by shinji257, December 29, 2005, 10:31:09 AM

Previous topic - Next topic

erenfro

Quote from: eldʌkaː on September 16, 2006, 10:44:19 PM

I'd prefer to use SSI.php so that I can use the features it gives, and also so I can get my themes to be integrated.


I agree. The use of the SSI.php over the foreign smf_api.php, would be better. And I think I myself, will start re-coding this script to use it.

Quote from: quake101 on February 23, 2007, 10:00:26 AM

After upgrading to 1.1.2 DokuWiki no longer lets my smf users login

is there anything I should change?


I just threw together an SMF 1.1.2 and current version of DokuWiki, using the auth plugin from the auth mentioned here in this thread, I forget the website, but it's over there. :)

It works, but has a couple flaws.

Login works, on Doku, IF you logged into Doku, if you just did the forum, Doku won't recognize the login.
Logout works the same. If you're logged in through Doku, but logout from the forum, Doku still shows you logged in, and in fact, has a bug and serious security hole, that it will actually RE-LOG you back in after you logout, in some cases. Repeatedly. I logged out 10 times in a row, and went back to the main_page link, and appeared as if I were logged in still.

I, myself, am just trying to build my own mini-CMS, based on Doku as the site handler, and SMF as the forum. I'd like it to be perfectly seemless as possible.

Eric

Quote

PS.: Why are there shortcuts using alt+s and alt+p, claimed to be usable to save and preview this post? I tried it, but alt+s just brings up my History menu in FF. heh And alt+p ... Not sure how to describe it, it just selects some word. heh


Dannii

I'd like to be able to use SMF's BBCode parser in DokuWiki too, all the more reason to use SSI.php ;)

If you use FF2.0, the keys got changed cause the firefox people are silly. Try Ctrl+Alt+S.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

ms_ukyankee

#62
I've updated the auth module to work with the most recent versions of SMF and Dokuwiki, if anyone wants to try it. Also added how to add users viewing the wiki to SMF Who's Online.

http://www.web-threads.com/downloads/dokuwiki-smf.php

Apologies for not seeing responses, my notifications seem to go on the blink now and then here. :-[
SMF since 2004 <3

Giasher


BigRandalo

#64
hi there :) wanted to ask if this will work with smf 1.1.4 too. if not is there any chance for an update?

working fine, sry :P

regards kHaN

Grayside

Quote from: Valodim on February 13, 2007, 11:07:09 AM
logout is also broken. replace

smf_setLoginCookie(time()-600000, $smf_user_info['id']);

with

smf_setLoginCookie(-3600, 0);

the login cookie time is relative to the current time, and time()+time()-600000 is a positive integer, plus after logout you're a guest so the userid is zero. the logout does work, but only for the dokuwiki, smf will stay logged in if you log out like this (assuming you use the same cookie)

\\ edit

okay for SOME weird reason, smf_setLoginCookie breaks if userid = 0. it works with smf_setLoginCookie(-3600, 1); but that's rather inconsistent... >_>
I found I couldn't log off on SMF or DK, only switch users, until I saw this.  I changed
it to
smf_setLoginCookie(-3600, $smf_user_info['id']);
And it seems to work now.

Thelenius

Hi! I need integration between SMF 1.1.4 and DokuWiki, but I don't know where to start. This topic is filled with old discussion and fixes (or suggestions for fixes), and I don't know which are relevant and which are not. Are there noob-friendly instructions somewhere? Latest files for getting this to work on current versions? I'm confused!

Grayside

Check out leah's code.  The readme is very self-explanatory, and aside from that last bug everything seems fairly smooth to me.

Remember that DokuWiki uses the smf board id number, not the board title, for its internal ACL groups.

Thelenius

Thanks for the link! We'll see how I'll manage. At least now I have all the bits and pieces. The instructions in the readme seem straightforward enough, but still a bit daunting if you don't know what an API is, for example. (How exactly will that API file affect my forums, by the way?)

The "last bug" you mentioned is the one for which you posted a fix two posts up, I suppose?

Grayside

Yes... well, the fix I refined anyway.  I don't know why the earlier poster was trying to use a 0 or 1...
The API won't affect your forums.  Once its sitting there, any script/site sitting on your webhost with access could include it, and use its functions to call on specific bits of your SMF install.


Thelenius

Well... I did everything exactly as in the instructions, but when I got to stage 6 ("Vist (sic) your wiki and try to edit or login with your SMF username/pass"), my wiki had stopped working. All I got was a blank window. The wiki is completely dead.

Might this somehow be caused by the fact that I'm testing on a local system, on an Apache server running on a Mac with hxxp:www.mamp.info/ [nonactive]?

Maybe I should take this to the DokuWiki forum, since the issue is with DokuWiki?

Grayside

It sounds like you have a typo in one of the files you added to DokuWiki.  A missing semicolon, a missing quotation mark, an extra quotation mark... such little typos as that can cause DokuWiki to go to white.  That is part of how PHP works.

I suggest you look over all the changes you made, and see if there's any typos like that.

Thelenius

Yeah, it was just a typo, even though I was so sure I made no mistakes. Is my face red or what.

Now it works, BUT it has (a part of) the bug mentioned in a previous post: logging out in SMF doesn't log me out in DokuWiki. Login works just fine.

iGate


Grayside

My dokuwiki logout is re-broken.

I'm coming to the conclusion that the most bulletproof part of this mechanism is DokuWiki's awareness of SMF.  There should be a fairly simple way to redirect DokuWiki's login/logout routines to the forum.

ms_ukyankee

I have been very busy with life/work etc sorry, I'll take time to revisit this next week.
SMF since 2004 <3

ms_ukyankee

I've spent considerable time over the last few days going over this and testing the api outside of dokuwiki and realised after a search here that the api is buggy and not setting the cookie on the same path specified in SMF settings, hence the inability to logout and kill the cookies. (This explains why the Drupal-SMF developer released his own version of the api for his integration, I may have to do the same to get this to work properly.)
SMF since 2004 <3

jesselif

I downloaded the file from hxxp:www.web-threads.com/downloads/dokuwiki-smf.php [nonactive] and followed the README.txt.

It seems working, though not fully. When I login to SMF and then switch to Dokuwiki, I'm expecting it the wiki shows me already logged in but thats not the case.

I can manually login to Dokuwiki upon my SMF id, but how can I get the auto login work?

thanks.

daenney

#78
Hm, it might be useful if on the SMF tools download page the API for SMF1.1 would be included too, that was the problem I was having, I assumed that download there would be up to date.
After getting the other api file from the forum thread everything works like a charm and I can't be happier.

Thanks a zillion!
Now time to wait for JFusion to have SMF signle-singon and user-syncing and I'm done :D

Hmm, actually little problem here, the Logout issue.
I changed the smf_setLoginCookie to

smf_setLoginCookie(-3600, $smf_user_info['id']);

But still when I logout from SMF the wiki keeps me logged in and whenever I logout the wiki and then go back to the wiki start page I am logged in again.
As strange, if I change it to:

smf_setLoginCookie(-3600, 0);

I still can't logout from DokuWiki
Is there something else I need to change for SMF1.4 logout?

FYI:
SMF: 1.1.4
DokuWiki: 2007-06-26b

Advertisement: