Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
SMF Auth Module! V0.3 (Updated 2009-07-17)
let's improve it.
Page:  1  2  next 
Avatar
landlord #1
Member since May 2008 · 9 posts
Group memberships: Members
Show profile · Link to this post
Subject: SMF Auth Module! V0.3 (Updated 2009-07-17)
I need an auth module that:
 1. use SMF as user database
 2. doesn't jeopardize Dokuwiki's basic function (register/user management)

After spending some time searching for a dokuwiki/SMF integration solution,
I realized there isn't a working one,

http://www.web-threads.com/downloads/dokuwiki-smf.php
is broken for now, mostly smf_api's fault.

http://wiki.splitbrain.org/wiki:auth:mysql_smf
basically throw away all dokuwiki user management.

So I decided to step up and utilize my terrible coding skill.

And the attachement is my initial result.

(Update: guest can't download attachment ? external link: http://blog.ticktag.org/addons/smfauth.class.zip  :-)  )

Installation:

0. set your SMF membergroups according to Dokuwiki's ACL, or vice versa.
1. download attachment, extract as smfauth.class.php, put it in your inc/auth/ directory.
2. edit the line require_once('your-forum-path/Settings.php');, point to your SMF's Settings.php.
3. enable authtype "smfauth", either in Dokuwiki admin or local.php
4. Dokuwiki should start using SMF database for authentication, it will throw you out if you haven't set ACL corretly.

more comment in the file itself.

NOTE: This works for Dokuwiki 2009-02-14 + SMF 1.1.10, see nathan42100's reply for working with SMF 2.0

Any improvement/feedback on this is HIGHLY appreciated, but I probably won't be actively maintaining it...

Best Wishes,
DF
This post was edited 6 times, last on 2009-07-17, 08:08 by landlord.
Edit reason: upload correct version
Avatar
MrZexion #2
Member since May 2008 · 20 posts
Group memberships: Members
Show profile · Link to this post
Thank GOD! Someone is finally taking interest in this. I've been needing this extremely bad for my website but it doesn't work. The best I can do is get it to say "Wrong username or password" message.

If you check the recent posts on the webthreads forum I've been spamming 'em trying to get them to make a new module for SMF Auth integration. (...Just kidding) :P

In all seriousness though, COULD this actaully work? You should contact try contacting "webmaster" on the webthreads forum. She seems to know a good bit on SMF/DokuWiki Auth Integration and good give you some constructive advice. Hope this helped and I might be trying this method for SMF soon (I'm desperate and only have about 2 weeks left to figure out how to integrate Authing between SMF and DokuWiki) I'm just too lazy to learn complicated coding and code it myself :P



MrZexion
Avatar
landlord #3
Member since May 2008 · 9 posts
Group memberships: Members
Show profile · Link to this post
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). ;-)
This post was edited on 2008-05-29, 04:51 by landlord.
Avatar
MrZexion #4
Member since May 2008 · 20 posts
Group memberships: Members
Show profile · Link to this post
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
Avatar
landlord #5
Member since May 2008 · 9 posts
Group memberships: Members
Show profile · Link to this post
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.
This post was edited on 2008-05-29, 16:41 by landlord.
Avatar
MrZexion #6
Member since May 2008 · 20 posts
Group memberships: Members
Show profile · Link to this post
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?
This post was edited 3 times, last on 2008-05-29, 22:28 by MrZexion.
Avatar
landlord #7
Member since May 2008 · 9 posts
Group memberships: Members
Show profile · Link to this post
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
This post was edited 2 times, last on 2008-06-01, 15:05 by landlord.
Avatar
MrZexion #8
Member since May 2008 · 20 posts
Group memberships: Members
Show profile · Link to this post
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.
Avatar
landlord #9
Member since May 2008 · 9 posts
Group memberships: Members
Show profile · Link to this post
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
Avatar
MrZexion #10
Member since May 2008 · 20 posts
Group memberships: Members
Show profile · Link to this post
I did read the comments in the script and I'll try those, thanks. :)
This post was edited on 2008-06-01, 21:47 by MrZexion.
Avatar
junior76 #11
Member since May 2008 · 14 posts · Location: Selestat
Group memberships: Members
Show profile · Link to this post
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.
Avatar
junior76 #12
Member since May 2008 · 14 posts · Location: Selestat
Group memberships: Members
Show profile · Link to this post
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';

?>
Avatar
junior76 #13
Member since May 2008 · 14 posts · Location: Selestat
Group memberships: Members
Show profile · Link to this post
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
Avatar
junior76 #14
Member since May 2008 · 14 posts · Location: Selestat
Group memberships: Members
Show profile · Link to this post
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
Avatar
nathan42100 #15
Member since Jul 2009 · 1 post
Group memberships: Members
Show profile · Link to this post
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!
This post was edited on 2009-07-13, 02:57 by nathan42100.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-16, 22:46:47 (UTC +02:00)