Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Purpose
To authenticate DokuWiki users against your UBB.threads database.

Demo
As can be seen on my site, the VFDCwiki is integrated with the VFDC Forums.

Background
From the DokuWiki website:

DokuWiki is a standards compliant, simple to use Wiki, mainly aimed at creating documentation of any kind. It is targeted at developer teams, workgroups and small companies. It has a simple but powerful syntax which makes sure the datafiles remain readable outside the Wiki and eases the creation of structured texts. All data is stored in plain text files – no database is required.

DokuWiki can use a variety of authentication backends for logging users in and out. Since it supports a MySQL backend, you can use your UBB.threads database to authenticate your Wiki users.

Changes to conf/local.php
Changes are required to the DokuWiki configuration which can be done by either manually editing the conf/local.php file, or by using the Admin panel of your installation. For each step I will be showing the change required within conf/local.php.

1. Enable ACL (Access Control Lists) for your Wiki installation.

PHP Code
$conf['useacl'] = 1; 
2. Enable MySQL as your desired authentication type.

PHP Code
$conf['authtype'] = "mysql"; 
3. Require the configuration file for your MySQL authentication.

PHP Code
require_once ("mysql.conf.php"); 
By default, you may only have a conf/mysql.conf.php.example file. Just copy it to conf/mysql.conf.php since we'll be modifying it in the steps ahead.

4. If you want all of your UBB.t Administrators to be "superuser" in your Wiki, then add the following:
PHP Code
$conf['superuser'] = '@Administrators'; 
5. DokuWiki can allow users to register, resend their password, and manage their own profile. I disable all of these actions, forcing my users to go through the forums for that functionality. You can disable these actions as follows:
PHP Code
$conf['disableactions'] = 'register,resendpwd,profile'; 
The only user-level actions that are allowed are login and logout, which is the bare minimum required to track users in the system.

Changes to conf/mysql.conf.php
This file contains all configuration settings required by the MySQL backend. If you copied this file from the default example file, then just change the settings mentioned below. Otherwise, just include the below in the abovementioned file.

Note: If you use a different UBB.t table prefix to "ubbt_" then just replace as required.

1. Populate the main database settings below. The server, user, password and (name of) database should be the same as your UBB.threads configuration.
PHP Code
$conf['auth']['mysql']['server']   = 'localhost';
$conf['auth']['mysql']['user'] = 'your_user';
$conf['auth']['mysql']['password'] = 'your_password';
$conf['auth']['mysql']['database'] = 'your_database';

$conf['auth']['mysql']['forwardClearPass'] = 0;

$conf['auth']['mysql']['TablesToLock']= array("ubbt_USERS", "ubbt_USERS AS u","ubbt_GROUPS", "ubbt_GROUPS AS g", "ubbt_USER_GROUPS", "ubbt_USER_GROUPS AS ug");

2. The settings below are for the MySQL user authentication.
PHP Code
$conf['auth']['mysql']['checkPass'] =
"SELECT USER_PASSWORD AS pass
FROM ubbt_USERS
WHERE USER_LOGIN_NAME='%{user}'"
;

$conf['auth']['mysql']['getUserInfo'] =
"SELECT USER_PASSWORD AS pass,
USER_DISPLAY_NAME AS name,
USER_REGISTRATION_EMAIL AS mail
FROM ubbt_USERS
WHERE USER_LOGIN_NAME='%{user}'"
;

$conf['auth']['mysql']['getGroups'] =
"SELECT GROUP_NAME AS `group`
FROM ubbt_GROUPS g, ubbt_USERS u, ubbt_USER_GROUPS ug
WHERE u.USER_ID = ug.USER_ID
AND g.GROUP_ID = ug.GROUP_ID
AND u.USER_LOGIN_NAME='%{user}'"
;

and that about does it! If you've done everything correctly, and more importantly, if I haven't forgotten anything smile then you should be able to login to your wiki using your forum username and password!

But, you won't be able to edit anything yet (unless you're the admin) until you setup the ACL based on your Forum users or groups. See the next section!

Changes to conf/acl.auth.php
DokuWiki's ACL allows you to grant all sorts of access levels to users and/or groups down to the namespace or page. You may decide that you want your wiki editable by all your users, or just your moderators, or only members from a custom group you created in your forums.

I defined access levels for my forum Moderators and Users groups. I also have a custom group called Authors.

My conf/acl.auth.php looks like this:

Code
*               @ALL          1
* @user 8
* @admin 255
vf5:* @Authors 16
vf5:* @Moderators 8
vf5:* @Users 1
The first three lines in the above ACL are most likely your default settings. The admin group can do everything, (local) users can edit, create and upload, and everyone else (ALL) gets read-only. You could probably delete or comment the @user and @admin lines since you'll no longer be using the default local authentication.

The last three lines, however, use the group names from your forums. In the example above, my forum groups have only been given access to the namespace called "vf5". In this namespace, it gives all my forum Users read-only access, Moderators can read, edit, create, and upload, and Authors can do everything Moderators can with the addition of delete.

I use the Authors group mainly for forum users who aren't Moderators but are willing to contribute to the Wiki.

In case you're wondering why the @Administrators group doesn't appear in my ACL, it's because I've already defined this group to be a "superuser" (see step 4 in Changes to conf/local.php).

Please refer to DokuWiki ACL documentation for a more detailed information.

Of course, my Wiki is not as "open" as others, and I pretty much control which forum users can edit it. So, the above just serves as an example of how to control access levels using groups from your UBB.t forums, and not a suggestion of how you should run your Wiki! smile

If anyone is brave enough to try this out, let me know how it goes for you!

Last edited by Myke; 09/13/2007 5:50 AM.
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Thanks for providing this, it looks like it'll be really useful for those UBB's that use a wiki smile


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thank you Myke! thumbsup


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
If we want the wiki to be private, with no access unless you are a member, is that pretty easy?


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Read the acl docs, not too bad. smile


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
i really think we should have a ubbthreads api, where more than just user_auth is gleaned from.

i had to fool around with auto login / user creation of a threads user, based upon a foreign system and it just screamed for such an api.

i know Rick mentioned it to me at some point, but i'd love to see it.

possible cookie sharing, stylesheet sharing and on and on.

makes integration easier and even more tight in the end.

Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Offline
Joined: Sep 2005
Posts: 136
Sir Dude want to play around with my site to see if you can get my board hooked into my mediawiki?

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
:points: she's cheating on me with an older man! :snicker:™


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
:flex:™

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
wink

Originally Posted by sirdude
i really think we should have a ubbthreads api, where more than just user_auth is gleaned from.

i had to fool around with auto login / user creation of a threads user, based upon a foreign system and it just screamed for such an api.

i know Rick mentioned it to me at some point, but i'd love to see it.

possible cookie sharing, stylesheet sharing and on and on.

makes integration easier and even more tight in the end.


and header/footer/headerinsert smile

yes please smile


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
hehe.. i don't know if you are stalking me tonite or it's the other way around, but i seem to be posting either just before or just after you laugh

Joined: Sep 2005
Posts: 136
Journeyman
Journeyman
Offline
Joined: Sep 2005
Posts: 136
He appreciates my breasts

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Originally Posted by sirdude
hehe.. i don't know if you are stalking me tonite or it's the other way around, but i seem to be posting either just before or just after you laugh


smile

I need to integrate another script into threads (my tng genealogy software) - someone integrated some other forum with the app using the api from them, a ubbt api may make it possible for me to get it done too smile


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Originally Posted by sirdude
:flex:™
! thats my :flex:&trade!!

Originally Posted by AllenAyres
I need to integrate another script into threads (my tng genealogy software) - someone integrated some other forum with the app using the api from them, a ubbt api may make it possible for me to get it done too smile
That'd be nice, I wouldn't necessarily have to fork it off to do any sort of auth against its db... Though to add features and styles how i want them it's going to have to anyway :x...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
dokuwiki is probably all I need - the feature comparison with the others is close enough, UNLESS I end up needing a mysql backend smile

tng - not written the best (could really use some sort of template system to start) but appears to be the best of its kind out there right now.


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
yeh, TNG is much better than TUFAT; but definately needs some work...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
Originally Posted by AshtarRose
Sir Dude want to play around with my site to see if you can get my board hooked into my mediawiki?


i've actually looked deeper into it and find that mediawiki has tons of features and all that, but for a ubbthreads board, it's overkill.

dokuwiki and pmwiki would be the two choices i'd go with.

and the more i look @ dokuwiki, the better i like it. i much prefer their ACL and just the coding style in general.

the only issue is hooking in the styles in a more automatic way, but any wiki you choose would have that problem.

Joined: Jul 2004
Posts: 132
Likes: 1
Journeyman
Journeyman
Offline
Joined: Jul 2004
Posts: 132
Likes: 1
Originally Posted by Myke
If anyone is brave enough to try this out, let me know how it goes for you!


Hi Myke,
Just wanted to let you know that this works well and couldn't have come at a better time for me smile

Thanks a lot laugh

Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Cheers, and glad to hear that it worked! smile

Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Just confirming that this still works with UBB.threads 7.5.3.

Joined: Aug 2017
Posts: 4
Lurker
Lurker
Offline
Joined: Aug 2017
Posts: 4
Does this work still with UBB.threads Version7.6.1


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)