Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Integrate or bridge with MediaWiki
HolisticEarth
Join Date: Apr 2006
Posts: 14

Winnipeg, MB, CAN
by HolisticEarth HolisticEarth is offline 14 Apr 2006

Do you want to use vBulletin's user database with your MediaWiki? You might like this.

I have taken Kai Backman's MediaWiki authentication plugin idea, fixed coding errors, and expanded greatly on it.

Working on:
vBulletin 3.5.4 and MediaWiki 1.6.3

Features:
  • Allows you to run MediaWiki with your vBulletin user database
  • Disallows users with invalid username characters
  • Disallows users who are not part of specified usergroups
  • Sets users to sysop status in MediaWiki if they are part of a specified admin usergroup
  • Removes users from sysop status in MediaWiki if they no longer are a part of a specified admin usergroup
  • For same-database setups, allows easy installation

Possible Future Features:
These are possible features for inclusion in the how-to in the future. They have not been investigated for their feasibility, but are here to let you know they have been requested and I am thinking about them. If you know how to add the features, please let us know.
  • No-login required (automatic) integration
  • Option: User profile field points to, or has option to link to vBulletin profile
  • To register, link the user to vBulletin's registration script on the login pages

How to:
  1. Install Reynaldovb's Restrict usernames to alphanumeric and underscore plugin, and disallow both spaces and underscores
  2. Optional: On boards that already have existing users, somehow have their usernames changed so that they are only alphanumeric. This is required if you wish your users to be able to login and edit the wiki using their vBulletin username. The reason you have to do this is because MediaWiki has some Restrictions on what can go in a page title, and as usernames have to be passed as page titles, they also have to adhere to the same restrictions. If you do not change the usernames, I have included a check to not allow users to login if their username contains non-alphanumeric characters.
  3. Open your wiki/LocalSettings.php file
  4. Insert the following code at the end of the file, before the ?>:

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    If you are running vBulletin and MediaWiki in the same database, then it already uses the connection information.
    If you are not running vBulletin and MediaWiki in the same database, please change the strings to reflect your vBulletin database information.
    In either case, the last value is whatever your vBulletin table prefix is.
  5. Insert this code below the require_once( "includes/DefaultSettings.php" ); at the top of the LocalSettings.php file:

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    This prevents people from registering new accounts on the wiki, requiring people to register on vBulletin. It also prevents anonymous edits. This code may only work on MediaWiki 1.5.x and above, but I am unsure.
  6. Download the AuthPlugin_vBulletin.php file and put it in your main wiki directory, ie: /wiki/AuthPlugin_vBulletin.php

Please let me know if this was helpful, or if you can expand on this code.
Attached Files
File Type: php AuthPlugin_vBulletin.php (7.4 KB, 491 views)
Views: 60326
Reply With Quote
Comments
  #2  
Old 14 Apr 2006, 08:00
pipin's Avatar
pipin pipin is offline
 
Join Date: Feb 2005
Thanx HolisticEarth,

maybe you should add $wgCapitalLinks = false; too, so the usernames will be exactly the same and not changed at the first letter.
__________________
mfg
pipin

Planet 3DNow!
Reply With Quote
  #3  
Old 14 Apr 2006, 23:21
machtzu machtzu is offline
 
Join Date: Sep 2004
Talking

Probably one of the best little snippets of code here! Well done HolisticEarth, its awesome! :banana:
Reply With Quote
  #4  
Old 16 Apr 2006, 13:22
Jon_Simmonds Jon_Simmonds is offline
 
Join Date: Nov 2005
Ive been using the original method for a while, ill take a look at the code and see if I can merge it in to mine(done so many edits since then, which ive not made notes on..)

Also if you like to use subdomains on yoru sites, ill find the code so you can have something like http://wiki.site.com/PAGETITLE (eg http://wiki.exceem.co.uk/Help:Contents)
Reply With Quote
  #5  
Old 16 Apr 2006, 15:18
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Real name: Daniel Gravenor
Originally Posted by Jon_Simmonds
Ive been using the original method for a while, ill take a look at the code and see if I can merge it in to mine(done so many edits since then, which ive not made notes on..)

Also if you like to use subdomains on yoru sites, ill find the code so you can have something like http://wiki.site.com/PAGETITLE (eg http://wiki.exceem.co.uk/Help:Contents)
The article on making a really short url for MediaWiki is here:
http://meta.wikimedia.org/wiki/Using_a_very_short_URL

However I am not a hardcore techie to konw which (if any) of the methods listed are foolproof. I have heard now and again that some of those methods do not work perfectly, as in they will not display URLs that contain periods properly.

Also, the script I came up should work great with the other script... the only difference is the extra function call in your LocalSettings.php file for your vB table prefix. If you simply add that information to the LocalSettings.php, then all you need to do is replace the original file with my file and you will be good to go, no worse than before, but have more functionality.
__________________
HolisticEarth.org
Reply With Quote
  #6  
Old 17 Apr 2006, 08:30
rockaffe rockaffe is offline
 
Join Date: Dec 2005
I've followed the instructions but it don't work...
When i open my wiki page it remain to an error page.

http://tutorialweb.org/wiki/

here is the link.

Bye!
Reply With Quote
  #7  
Old 17 Apr 2006, 13:45
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Real name: Daniel Gravenor
Originally Posted by rockaffe
I've followed the instructions but it don't work...
When i open my wiki page it remain to an error page.

http://tutorialweb.org/wiki/
Did you try logging in using your vb information?

You might want to try changing

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

if you want anonymous users to be able to read the wiki.
__________________
HolisticEarth.org
Reply With Quote
  #8  
Old 17 Apr 2006, 15:13
rockaffe rockaffe is offline
 
Join Date: Dec 2005
I'll be happy if I can use my info to login but in the wiki page no login box appear, and if I click on "login" it remain on the same page.

However when I visit that page, I'm already logged in on my vbulletin.
Reply With Quote
  #9  
Old 18 Apr 2006, 02:09
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Real name: Daniel Gravenor
Originally Posted by rockaffe
I'll be happy if I can use my info to login but in the wiki page no login box appear, and if I click on "login" it remain on the same page.

However when I visit that page, I'm already logged in on my vbulletin.
I can't provide technical support for it. You dont have to login to the forums, you just have to have an account there. Then you have to login with that same information on the wiki, and your login information must have only alpha-numeric characters.
__________________
HolisticEarth.org
Reply With Quote
  #10  
Old 18 Apr 2006, 02:18
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
Intresting, say I already have a wiki setup and working, how will this work then?
__________________
Looking for ImpEx?
Reply With Quote
  #11  
Old 18 Apr 2006, 12:36
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Real name: Daniel Gravenor
Originally Posted by Zachery
Intresting, say I already have a wiki setup and working, how will this work then?
It wont erase anything from the database. It is like other plugins - you just install it and it starts using the vb database for login info. There might be conflicts if users have the same info but different passwords, or if another user has a different username that exists for someone else, but I dont know ... i started this from a fresh wiki. A sure way to fix it would be to erase all the users but wikisysop and start with a fresh users db.
__________________
HolisticEarth.org
Reply With Quote
  #12  
Old 20 Apr 2006, 00:26
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Real name: Brent Hegnauer
Thanks for this, installed and working.
Reply With Quote
  #13  
Old 24 Apr 2006, 22:42
TheFinney TheFinney is offline
 
Join Date: Dec 2005
Hi, I'm not that great at PHP. For the changing of the values, do I replace everything after the $, or after the $wgDBserver, or something else?

Thanks!
Reply With Quote
  #14  
Old 26 Apr 2006, 22:23
Cyburbia's Avatar
Cyburbia Cyburbia is offline
 
Join Date: Feb 2002
Thanks for making this!

I'd use it if it weren't for the "no alphanumeric characters" restriction. It would be terrific id there was a way around it.
__________________
Cyburbia | urban planning community
http://www.cyburbia.org/forums
Reply With Quote
  #15  
Old 27 Apr 2006, 12:45
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Real name: Daniel Gravenor
Originally Posted by Cyburbia
Thanks for making this!

I'd use it if it weren't for the "no alphanumeric characters" restriction. It would be terrific id there was a way around it.
Yeah, I have a forum with a moderate amount of people (~3000), and there are many non-alphanumeric characters as well.

I like your website btw, I found a bit of information on it for a paper or two I have done at University.

Originally Posted by TheFinney
Hi, I'm not that great at PHP. For the changing of the values, do I replace everything after the $, or after the $wgDBserver, or something else?

Thanks!
For the values, and php in general, $something is a variable, and if it is a string, you can thing of it as "somevalue". So if you were to hard-code something like the server name, you would replace $servername with "servername".
__________________
HolisticEarth.org

Last edited by HolisticEarth; 27 Apr 2006 at 12:46. Reason: Automerged Doublepost
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 10:15.

Layout Options | Width: Wide Color: