landlord
as I said before, since smf_api is out-dated, plus nobody can confirm where is the latest version(the one in SMF tool section is as old as the internet) I don't see smf.class.php getting an update in near future. smfauth doesn't depends on smf_api, it's pretty much like using default mysql.class.php, just a few workaround.
All I can confirm is that my smfauth works on fresh install(Dokuwiki 2008-05-05 + SMF 1.1.5), but it's far from perfect.
If you're really desperate, try it out, no coding required(except filling in absolute path to Settings.php). ;-)
mrzexion
Well... I tried it today and it kinda worked but not so much;
1. I made sure my SMF forum was 1.1.5 (
http://mainmedia.negative0.net/forum/) and Wiki was 5-5-2008 (
http://mainmedia.negative0.net/wiki/) and were both working right.
2. I downloaded the attachment, renamed/converted it as a .php file. And added the full correct path to my forum's Settings.php
3. I uploaded it (to the correct directory) then made sure everything that was supposed to be CHMOD 777, was set right, double checked everything, then
4. I went into my DokuWiki admin changed the auth type to "smfauth". Logged out, then logged back in again (I use the same username and password for both my DokuWiki and SMF forum admin accounts).
So I logged in with my normal DokuWiki/SMF forum account name and password THEN: it worked (finally!!)! BUT: It won't let me go into Admin OR Edit Pages. I also tried logging out and logging in with a forum Test Account, but still the SAME thing!
Why is it not working? Did I do something wrong? I went back and double checked everything? Did I mess up with the ACL settings??
Thanks in advance,
MrZexion
landlord
first, take a deep breath. ;-)
make sure your superuser group(in local.php) setting matches your SMF install.
as default install it should be @Administrator.
normal user, ie. "Newbie", should be setup via ACL
PS: If you're using utf-8 multibit characters as groupname in SMF,
add $conf['auth']['mysql']['charset'] = "utf8"; in local.php, should helps.
mrzexion
I changed it to "@Admin" and made SURE I put $conf['auth']['mysql']['charset'] = "utf8"; in local.php...and It WORKS! :D
However I do not know whether or not these problems are coming from my server or the script but there's a few bugs like when I logged out it said "Connect to Negative0.net through ftp" I clicked "Cancel" and it said "Autheration required". This could possibly be someone doing work on the server perhaps. Anyways I'll test it out and if I encounter any problems I'll be sure to keep you updated. :)
Also, thanks for taking interest in and creating this module...because the other one on WebThreads is WAY out of date.
Edit: I've looked through the script and y'know this is actaully really clever. Except for the few bugs. Good work :D
Edit2: Well when I login ONLY I can edit, and go into admin, I tried using my Test account and it SHOULD be able to Edit the page, right? Well it can't =(
Em...Did I do something wrong? >_>
Edit 3: Erm....I changed ALL the users "groups" except "Admins" to "user" And it gave them all permissions to edit pages but now my forum is slightly messed up. You see by default the users "groups" field seems to be blank.....why if its blank they have no permissions? Isn't there someway I could set the DokuWiki permissions so that anyone who logs in can edit pages? Instead of only users in the "user" group? And how do I get people in the "Global Mod" field to be able to edit pages and have special permissions set for them?
landlord
initial release rely on ID_GROUP only, which was a bad idea, I will incorporate additionalGroups in v0.2
updated: I have updated the version to v0.2
it should solve your problem, be sure to read the comment in the file to understand what's going on.
it's now v0.21, silly mistake in getGroups/getUsers :-/ matching pattern can't distinguish 11 and 1
mrzexion
Well I JUST uploaded it. I made sure it uploaded right, permissions set good, path good, everything in local.php right, I even read all the commentary in the file and it seems I'm still having the same problem. I have 3 member groups on my forum (four if you count the ranking system), which are:
Admin(s)
Global Mod(s)
Moderator(s) [Should just be an extension of the ranking system for a select board or boards)
And of course normal users; The ranking system. Where 10 posts you get to Rank 2, and 25, rank 3, 60, rank 4 and ect.
My problem stays the same: No matter what I do ONLY Admin(s) can edit pages. Even on this new, 0.21 version, Global Mod(s) can't edit.
landlord
please read comments in the script.
since v0.2 I changed a few things.
I. new sign-up(the ones after you update this script) are now using 0 as ID_GROUP, it includes all "register members that doesn't have a special primary group."
II. additionally, upon sign-up it will inset default user group in dokuwiki as additionalGroups, unless you set default user group to blank.
III. in ACL you should match your group name to either ID_GROUP or additionalGroups (special groups), not ID_POST_GROUP (groups that associate with user posts count)
IV. if unsure what groupname you're using, go check user management in dokuwiki.
V. if step 4 gives you weird result, check database, particularly smf_members/membergroups, check if column ID_GROUP / additionalGroups matches your desired groupid.
VI. if step 5 makes you uncomfortable, hit forum admin, and try editing each user's primary / additional group, check against dokuwiki user management's lists. (user ranking is unrelated in v0.2, I might make use of it in future, but not now)
That's as far as I can think of, use another clean install if necessary, have fun debugging :-)
PS: if anyone wish to continue improving this auth please do(lots of room for improvement), I will be away for now.
DF
mrzexion
I did read the comments in the script and I'll try those, thanks. :)
junior76
Hi evberybody,
I tri to use your bridge, but I have a problem.
I can't loggin after install The bridge with Dokuwiki 0./05/2008 and SMF 1.1.6.
Dokuwiki say : "User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin."
I don't understand why, someone could help me ?
Regards
Junior76
NB : Sorry for my bad english, I'm french.
junior76
My conf\local.php file
<?php
/*
This is an example of how a local.php coul look like.
Simply copy the options you want to change from dokuwiki.php
to this file and change them
*/
$conf['lang'] = 'en'; //your language
$conf['title'] = 'JFland WIKI'; //what to show in the title
$conf['start'] = 'Sommaire';
$conf['openregister']= 0;
$conf['useacl'] = 1; //Use Access Control Lists to restrict access?
$conf['superuser'] = 'jfland';
$conf['allowdebug'] = 1;
/* The following options are usefull, if you use a MySQL
* database as autentication backend. Have a look into
* mysql.conf.php too and adjust the options to match
* your database installation.
*/
$conf['authtype'] = 'smfauth';
?>
junior76
More information, I add the line in my conf/local.php :
$conf['auth']['mysql']['debug'] = 1;
The debug say :
MySQL err: insufficient configuration. [mysql.class.php:51]
Someone ?
Regards
junior76
Always is sorting out my solution !!! ;-)
The line 51 of mysql.class.php =
// set capabilities based upon config strings set
if (empty($this->cnf['server']) || empty($this->cnf['user']) ||
empty($this->cnf['password']) || empty($this->cnf['database'])){
if ($this->cnf['debug'])
msg("MySQL err: insufficient configuration.",-1,__LINE__,__FILE__);
$this->success = false;
return;
}
I check in the file setting.php of SMF, the 4 filed aren't empty.
I don't understand why I have this mistake.
I hope somebody could explain this me.
Regards
nathan42100
I know I am bumping a REALLY old topic, but if you want to get this to work with SMF 2.0 (tested with RC1.1), go into smfauth.class.php and make the following changes:
find all instances of memberName and change to member_name
find all instances of realName and change to real_name
find all instances of emailAddress and change to email_address
find all instances of groupName and change to group_name
find all instances of additionalGroups and change to additional_groups
find all instances of dateRegistered and change to date_registered
find all instances of posterEmail and change to poster_email
find all instances of ID_GROUP and change to id_group <--NECESSARY
find all instances of ID_MEMBER and change to id_member <-- not sure if it's necessary
Hope that is helpful!
landlord
Thanks everyone for the inputs so far!
I have uploaded a updated version, which you can download from this reply.
BTW:
http://blog.ticktag.org/addons/smfauth.class.zip always have the latest version.
tomg
Hi,
I have been trying out this module. I found that smf users don't have any group If they are not assigned one by the smf admins.
Of course they all have a post count group.
I made a small change to smfauth.class.php to include the post based groups.
# diff /tmp/smfauth.class.php smfauth.class.php
78c78
< AND (concat(',',u.additionalGroups,',') LIKE concat('%,',g.ID_GROUP,',%') OR u.ID_GROUP = g.ID_GROUP)";
---
> AND (concat(',',u.additionalGroups,',') LIKE concat('%,',g.ID_GROUP,',%') OR u.ID_GROUP = g.ID_GROUP OR u.ID_POST_GROUP = g.ID_GROUP)";
regards,
Tom.
shadowmaster
Thank you so much for this, and also big thanks to nathan42100 for providing the info needed to make this working with SMF 2.0
gwrtheyrn
thanks a lot for your help. i made a summary of the changes necessary to make it work with SMF 2.0 RC1.2. i hope i may link your file directly?
http://blog.ich-wars-nicht.ch/2009/09/integrate-dokuwiki-with-smf/
cheers
tcp
There should be an additional check to see if the account has been activated. For SMF 2.0 the SQL could look like this.
$conf['auth']['mysql']['checkPass'] = "SELECT passwd
FROM ${db_prefix}members
WHERE member_name = '%{user}'
AND is_activated = 1
AND passwd = SHA1(concat(LOWER('%{user}'), '%{pass}'))";
Below is the updated code for 2.0 with this additional check. Works so far. :)
leukosaima
tcp:1260958752 wrote
Below is the updated code for 2.0 with this additional check. Works so far. :)
AWwwww yeah, this is working for me!!!
I'm using SMF 2.0 RC2
and
Dokuwiki 2009-12-25c “Lemming”
Thanks for your updated file! I just used that, changed the absolute path, then modified dokuwiki's conf/local.php to my needs.
anticulas
I had issues with absolute and relative paths, especially when editing the ACL after the bridge was enabled.
After a day of being tired with testing different things, i simply left the settings.php for smf in the same location as before, but also
moved it to the root of the wiki.
This allowed it to resolve just the same using the same relative path, so I guess this would be considered a cheap workaround, lol.
SMF v1.1.11
DokuWiki v2009-12-25c
I hope this might help someone having issues with some of the things.
ACL crafting took a bit of time, but in the end, it wasn't quite so bad.