PDA

View Full Version : MediWiki Integration


leitel
07-27-2005, 08:51 PM
I have posted the stub of an article that will outline modifications needed to integrate vB users with MediaWiki. This will result in wiki users being able to login through vB. Please go to: VBulletin/Users_Integration (http://meta.wikimedia.org/wiki/VBulletin/Users_Integration) The reason for posting this information there is because this is more of a MediaWiki hack than vB.

If anyone has or is pursuing this, please share your insights there. Thank you!

ricker
07-27-2005, 10:14 PM
I have posted the stub of an article that will outline modifications needed to integrate vB users with MediaWiki. This will result in wiki users being able to login through vB. Please go to: VBulletin/Users_Integration (http://meta.wikimedia.org/wiki/VBulletin/Users_Integration) The reason for posting this information there is because this is more of a MediaWiki hack than vB.

If anyone has or is pursuing this, please share your insights there. Thank you!

I will be checking this out.

nogerorob
07-28-2005, 03:53 PM
Holy smoke. This is recent interest for me. How incredibly timely.

Thank you.

rob

Darax The Good
07-29-2005, 07:46 PM
This would be a reasonable project to put some effort into. I'll contribute what I can. The single intergration thing is interesting and something which I would leverage-but it would need to be complete, and the issues at the bottom of your post show how this could be challenging.

I've been running my wiki for a week now (yeah yeah) and I've had a few bad eggs-one person even blanked around 50 articles before we blocked him and rolled everything back. It only took a few minutes to undo damage that took the attacker more than 30 minutes to create.

What I really want to do is have the 'discussion' tab turn into a vB thread discussing the article. What I'm working on doing in the meantime is making a simple script which will automatically make and/or redirect to the thread in my 'articles' discussion forum. This, I think, will be something that is absolutely necessary for an integration.

Darax The Good
07-31-2005, 04:24 AM
btw, I have a media wiki template and some php code that will cause a thread to get autogenerated if it doesn't exist for an article and link to the thread if it does. I can't update the wiki with all the code, unfortuantely because of vB rules...
This is crude-and a bit hacked together. The RSS Bot guys saved me a lot of time.

<?php


//get started
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'WikiThread');
$phrasegroups = array();
$specialtemplates = array();
$actiontemplates = array();
$auto=0;

require_once('./global.php');
require_once('./includes/functions.php');
require_once('./includes/functions_bigthree.php');
require_once('./includes/functions_forumlist.php');
require_once('./includes/functions_newpost.php');


//See if it is an existing thread
$threads = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "thread
WHERE title = 'Discussion: ".$_REQUEST['t']. "'
AND forumid='46'
");
//if it is, go there
while($thread=$DB_site->fetch_array($threads)){

echo($thread['forumid']);
$url = "http://www.hitchhikernet.com/forum/showthread.php?t=".$thread['threadid'];
eval(standard_redirect('',$url));
}
//the thread doesn't exist, better make sure this is a real wiki article
//or haxxors will get you. You need to put your wiki db info in here.

$title = $_REQUEST['t'];
if($title == ''){die("No article specified");}
$wdbserver =
$wdbusername=
$wdbpassword =
$wdbdbname =
$dbconn = mysql_connect($wdbserver,$wdbusername,$wdbpassword );

$dbacc = mysql_select_db($wdbdbname,$dbconn);
if(!$dbacc){
die("Error getting to the db...");
}

$res = mysql_query("
SELECT * FROM cur
WHERE cur_title = '".$title."'",$dbconn);

if(mysql_num_rows( $res ) < 1){
die("Invalid Article Requested");
}
//it is a real article, add the 'default thread'
//You need to do a lot of editing here.

$threadtitle = "Discussion: ".$title;
$wikibotpost = "This is an automatically generated introductory discussion post for the article at http://www.hitchhikernet.com/index.php/".$title."";
$wikibotname = "WikiBot";
$wikibotid = 220;
$wikiforumid=46;

$foruminfo = fetch_foruminfo($wikiforumid);
$bbuserinfo = fetch_userinfo($wikibotid);

$post['signature'] = true;
$post['emailupdate'] = 9999;
$post['title'] = $threadtitle;
$post['message'] = $wikibotpost;
$post['poststarttime'] = TIMENOW;
$post['rss_date'] = TIMENOW;
$post['posthash'] = md5($post['poststarttime'] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
build_new_post('thread', $foruminfo, array(), 0, $post, $errors, $wikibotid);

$url = "http://www.hitchhikernet.com/forum/wikithread.php?t=".$title;
eval(standard_redirect('',$url));


?>


and then I made a template on my wiki called fd (forum discussion)


<h3>
[http://www.hitchhikernet.com/forum/wikithread.php?t={{PAGENAMEE}} comments/discussion]
</h3>


my sig has a link to where this is currently working.

nogerorob
07-31-2005, 04:30 PM
Darax, would you consider adding this information to the wiki Leitel's started?

r

Darax The Good
08-01-2005, 03:23 AM
I can't because the first bit of code references vB code at the beginning and end... The best I could do is link back to here.

leitel
08-01-2005, 11:35 AM
Darax, you are welcome to add your comments/code to the article I started. Notice how nogerorob did this.

The focus of this article is Users integration. Your hack addresses thread integration with the discussion tab (if got that right). QUESTION: Should my article be renamed to cover vB integration in general OR should someone start a NEW article perhaps entitled: VBulletin/Thread_Integration?

leitel
08-04-2005, 04:23 PM
I am starting to dive into this again. It sure would be helpful to collaborate with any others on this. :) If you are interested, please reply here or email me. Thanks! :)

Kai Backman
08-04-2005, 05:05 PM
I'm sorry to be late to the thread, but I've actually been running an integrated vBulletin/MediaWiki system for quite some time. I just today got another request from someone wanting to have the code, and realized it might be easier to just post it .. :)

MediaWiki has a facility for creating Authentication plugins that let you do the integration pretty easily. They were non-documented when I started with the hack, but once you find the correct template everything was smooth sailing. There are a few comments about the code

- People still need to log on to MediaWiki once, after that they are cookied.
- MediaWiki has a smaller namespace for usernames than vBulletin, on a large board you might have clashes. I'm assuming it's not a security problem, but it might be an inconvenience.
- You need to clean up the user properties pages of things like changing names and stuff (they aren't automatically dropped).
- The Wiki will create only those users who actually log on
- The $usergroupid clauses determine who can create an account, you need to change these clauses to suit your own board.

Have fun! :D

Add this snippet to you LocalSettings.php. Insert your vBulletin DB information:

require_once("AuthPlugin_vBulletin.php");

$wgAuth = new AuthPlugin_vBulletin(<hostname>, <vb_username>, <vb_password>, <vb_dbName);


And then AuthPlugin_vBulletin.php itself:

<?php


/**
* Authentication plugin interface. Instantiate a subclass of AuthPlugin
* and set $wgAuth to it to authenticate against some external tool.
*
* The default behavior is not to do anything, and use the local user
* database for all authentication. A subclass can require that all
* accounts authenticate externally, or use it only as a fallback; also
* you can transparently create internal wiki accounts the first time
* someone logs in who can be authenticated externally.
*
* This interface is new, and might change a bit before 1.4.0 final is
* done...
*
* @package MediaWiki
*/
require_once("includes/AuthPlugin.php");

class AuthPlugin_vBulletin extends AuthPlugin {

// Persistent DB connection
var $vb_database;

function AuthPlugin_vBulletin($host, $username, $password, $dbname)
{
$this->vb_database = mysql_pconnect($host, $username, $password);
mysql_select_db($dbname, $this->vb_database);
}


/**
* Check whether there exists a user account with the given name.
* The name will be normalized to MediaWiki's requirements, so
* you might need to munge it (for instance, for lowercase initial
* letters).
*
* @param string $username
* @return bool
* @access public
*/
function userExists( $username ) {
$username = addslashes($username);
$vb_find_user_query = "SELECT usergroupid FROM user WHERE LOWER(username)=LOWER('" . $username . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$usergroupid = $vb_user_info['usergroupid'];
// Only registered and admins. Banned and unregistered don't belong here.
if($usergroupid == "2" || $usergroupid == "5" || $usergroupid == "6" || $usergroupid == "7")
return true;
}
else
return false;
}

/**
* Check if a username+password pair is a valid login.
* The name will be normalized to MediaWiki's requirements, so
* you might need to munge it (for instance, for lowercase initial
* letters).
*
* @param string $username
* @param string $password
* @return bool
* @access public
*/
function authenticate( $username, $password ) {
$username = addslashes($username);
$vb_find_user_query = "SELECT password, salt, usergroupid FROM user WHERE LOWER(username)=LOWER('" . $username . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$usergroupid = $vb_user_info['usergroupid'];

// Only registered and admins. Banned and unregistered don't belong here.
if($usergroupid == "2" || $usergroupid == "5" || $usergroupid == "6" || $usergroupid == "7")
if(md5(md5($password) . $vb_user_info['salt']) == $vb_user_info['password'])
return true;
}
return false;
}

/**
* Return true if the wiki should create a new local account automatically
* when asked to login a user who doesn't exist locally but does in the
* external auth database.
*
* If you don't automatically create accounts, you must still create
* accounts in some way. It's not possible to authenticate without
* a local account.
*
* This is just a question, and shouldn't perform any actions.
*
* @return bool
* @access public
*/
function autoCreate() {
return true;
}

/**
* Return true to prevent logins that don't authenticate here from being
* checked against the local database's password fields.
*
* This is just a question, and shouldn't perform any actions.
*
* @return bool
* @access public
*/
function strict() {
return true;
}

/**
* When creating a user account, optionally fill in preferences and such.
* For instance, you might pull the email address or real name from the
* external user database.
*
* The User object is passed by reference so it can be modified; don't
* forget the & on your function declaration.
*
* @param User $user
* @access public
*/
function initUser( &$user ) {
$vb_find_user_query = "SELECT password, salt FROM user WHERE LOWER(username)=LOWER('" . addslashes($user->mName) . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$user->mEmail = $vb_user_info['email'];
}
else {
// ERROR?
}
}
}


?>

leitel
08-04-2005, 05:11 PM
Thank you so much for sharing this. I will look it over. I saw that stub class and wondered if it could be used. At this point, I am in the analyzing mode. Input from others like yourself will produce the maximum results. Of course, whatever I/we come up with will be shared.

Thanks! :)

ndahiya
08-12-2005, 07:36 PM
Hi

A couple of small doubts... Does the user have to register for Media Wiki ? I already have a user DB, and getting the ones who want to register again might be cumbersome... If yes, is there some way to "transfer" the userDB?

Just thinking aloud:

IS this a valid (though less elegant) solution: on the edit page of the wiki, check to see if the user is logged onto vbulletin (using the cookie). if not, bump them to the login page... ???



MediaWiki has a facility for creating Authentication plugins that let you do the integration pretty easily. They were non-documented when I started with the hack, but once you find the correct template everything was smooth sailing. There are a few comments about the code

- People still need to log on to MediaWiki once, after that they are cookied.
- MediaWiki has a smaller namespace for usernames than vBulletin, on a large board you might have clashes. I'm assuming it's not a security problem, but it might be an inconvenience.
- You need to clean up the user properties pages of things like changing names and stuff (they aren't automatically dropped).
- The Wiki will create only those users who actually log on
- The $usergroupid clauses determine who can create an account, you need to change these clauses to suit your own board.

Have fun! :D

leitel
08-12-2005, 08:20 PM
That is exactly what I am going to do. I have it already working with our OSCommerce site. If there is a cookie, they don't even know that they have been automatically logged into vB. The Wiki is a bit more tricky. Please see article where I have outlined some details.

Kai Backman
08-12-2005, 08:55 PM
They don't need to register, MediaWiki creates an account automatically for them the first time they log in. However, the AuthPlugin still requires MediaWiki to have separate user information, even if it's just the name. The comments give more information on how it works.

leitel
08-12-2005, 09:39 PM
You're right. What happens in the scenario I mentioned previously is when a user goes to the wiki, it will check vB to see if there is a cookie. If not, they will be taken to vB to login or create an account. The process of creating an account ALSO creates an account in the wiki for them. There a number of preferences, etc that are best maintained in the wiki.

There is still a need to maintain 'connections' to vB and back. For example, see this page (http://www.noblood.org/wiki/index.php/Patricia_A_Ford_MD) as an example to link to vB profile from the wiki.

Hopefully, we will begin coding this next week.

Mek
08-18-2005, 10:56 AM
Hi folks, I just tired out Kai Backman's integration authplugin; I was wondering if there is a way to make registering a user on the wiki create a coresponding vbulletin account. Or would I simply turn off the new user creation to force registration on the vbulletin end?

Viktor Kraft
08-22-2005, 02:08 AM
Hi folks, I just tired out Kai Backman's integration authplugin; I was wondering if there is a way to make registering a user on the wiki create a coresponding vbulletin account. Or would I simply turn off the new user creation to force registration on the vbulletin end?
At least, you can do the second one easily :)

On your LocalSettings.php find

require_once( "includes/DefaultSettings.php" );


Add below

# Only sysops can register new users
$wgWhitelistAccount = array ( "sysop" => 1, "developer" => 1 );

Burgy
09-01-2005, 10:46 PM
Allthough the user integration through MW Authplugin and automatic acount creation in MW if not existant seems to be the most professional solution. There is a miner drowback of how to handle change of preferences and logout situations.

some thoughts about unsolved problems

Preferences such as email do exist and are stored twice the vB and MW and should be changed in vB by user and then be updated in MW automaticly
Logout should be made global which means that logout manualy in either vB or MW should log out both automaticly to be secure
or even better the login in MW should just use the db of vB but not the login procedure then there could serveral MW installations eg german and english been run together useing the centralised vB User Data


The above thougts are not critic but merely helpless nonprogrammer effort to contribute on the grounds of checking possible cases.

shortes way by logic with smalles chance of interference
I do hope that in the end there can be achived a working bridge that does as little as possible except checking user data in the vB Database and producing doubles in MW in order to make things independent. The Preferences which exist twise should be changed in vB because of code copyright bull++++ and then updated in MW automaticaly where only Preferences should be changeble which are nonexistant in vB.


I hope my thoughts might trigger some genius programmers efforts to solve the problem with minimum effort.

Sincerely yours
Burgy Zapp with greatings from Hagenheim

ndahiya
09-03-2005, 03:17 PM
hi

i get the following error


Fatal error: Call to a member function on a non-object in /home/jatland/public_html/wiki/includes/SpecialUserlogin.php on line 314


maybe it is coz of the version i am using ? (1.5RC4).. Would really appreciate help on this.. TIA.



also,


some thoughts about unsolved problems

Preferences such as email do exist and are stored twice the vB and MW and should be changed in vB by user and then be updated in MW automaticly
Logout should be made global which means that logout manualy in either vB or MW should log out both automaticly to be secure
or even better the login in MW should just use the db of vB but not the login procedure then there could serveral MW installations eg german and english been run together useing the centralised vB User Data



this would be excellent to have... anyone made any progress on this ?

Yorixz
09-11-2005, 11:24 AM
I'm wondering; does anyone have this running with vB3.5 and secondly; is it possible to run MediaWiki on windows?

Gary King
09-12-2005, 01:44 AM
I'm wondering; does anyone have this running with vB3.5 and secondly; is it possible to run MediaWiki on windows?

I am also curious about if this works with vBulletin 3.5

Also, yes, MediaWiki will run on Windows, just like any other PHP/MySQL script.

Yorixz
09-12-2005, 06:03 AM
I am also curious about if this works with vBulletin 3.5

Also, yes, MediaWiki will run on Windows, just like any other PHP/MySQL script.

Last time I tried it (like a year ago) it only worked on Linux because the difference in parsing of PHP on Linux/Win back then (something with quotes or so was it)

Thanks for your reply :)

Gary King
09-13-2005, 08:00 PM
Last time I tried it (like a year ago) it only worked on Linux because the difference in parsing of PHP on Linux/Win back then (something with quotes or so was it)

Thanks for your reply :)

Magic quotes? That's just an option.

sub_ubi
09-15-2005, 05:30 PM
This thread, or parts of it, should be moved to hacks. It's good stuff.

ndahiya
10-04-2005, 12:14 PM
bump.

just checking if there is a update to this ? i am still getting the error is post #19 (even with the older mediawiki version. the user needs to refresh the error page for it to work correctly)...

would be super if a "tight" integration could be achieved!

Reeve of shinra
10-04-2005, 02:19 PM
[tagging thread for myself] -- I'm curious about how well this is working now with 3.5 gold.

Reeve of shinra
10-14-2005, 12:33 AM
*bump*

ndahiya
10-16-2005, 01:56 AM
*bump*

/me hopes for the best.

pipin
10-16-2005, 06:42 PM
i tested the whole thing with a local test forum 3.5.0 and mediawiki 1.5.0 and it works, only a minor glitch that vb user names which begins with a lower-case character are transformed into a wiki user name beginning with an upper-case character. :surprised:

Yorixz
10-16-2005, 06:50 PM
I'm glad to hear that it works, I guess I'll start trying it out on a localhost aswell later.

weeno
10-23-2005, 08:56 PM
Can someone explain how the namespaces on vbulletin and mediawiki usernames are different? What would cause a collision?

arn

GrendelKhan{TSU
10-24-2005, 04:31 AM
bump!

* GrendelKhan{TSU hopes there is still interest in this. :)

weeno
10-26-2005, 06:02 AM
I've been trying to use this code to integrate a wiki and vbulletin.

There's a mistake in the initUser function... note the database query isn't correct. I fixed it here:


function initUser( &$user ) {
$vb_find_user_query = "SELECT email FROM user WHERE LOWER(username)=LOWER('" .
addslashes($user->mName) . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$user->mEmail = $vb_user_info['email'];
}
else {
// ERROR?
}
}


is no one else working on this/ interested in this?

So, it seems the "_" underscore is the one of the forbidden chars in mediawiki.... so might cause some collision issues with vb's user database.

still working on this to see how to best resolve these issues.

arn

GrendelKhan{TSU
10-27-2005, 11:13 AM
I've been trying to use this code to integrate a wiki and vbulletin.

There's a mistake in the initUser function... note the database query isn't correct. I fixed it here:


function initUser( &$user ) {
$vb_find_user_query = "SELECT email FROM user WHERE LOWER(username)=LOWER('" .
addslashes($user->mName) . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$user->mEmail = $vb_user_info['email'];
}
else {
// ERROR?
}
}


is no one else working on this/ interested in this?

So, it seems the "_" underscore is the one of the forbidden chars in mediawiki.... so might cause some collision issues with vb's user database.

still working on this to see how to best resolve these issues.

arn

well I'm glad someone is working on it. Sorry I can't contribute on that end. but just wanted to say I think this would be a KILLER hack if ya got it work. :)

<<< keeps fingers crossed. :)

eva01_
10-27-2005, 05:30 PM
I have been trying to work this out for 3.5 as well, i will post any of my results here.

ndahiya
10-28-2005, 01:42 AM
Ya, the namespace is a problem... One way around it is to limit the vb name space... you want to make sure there are no spaces etc... i just do it in the vbulletin register.php file in vb...

---
Another point:

Not sure what the error was in the original code, BUT even after using the code by weeno, i get this error the FIRST time a user logs in (with the correct password)


Fatal error: Call to a member function on a non-object in /home/sitename/public_html/wiki/includes/SpecialUserlogin.php on line 314



the user is actually created, but this error still comes up... not sure why... the user can then login.. i am isung mediawiki 1.5 and vb 3.5...

Thx.



I've been trying to use this code to integrate a wiki and vbulletin.

There's a mistake in the initUser function... note the database query isn't correct. I fixed it here:


function initUser( &$user ) {
$vb_find_user_query = "SELECT email FROM user WHERE LOWER(username)=LOWER('" .
addslashes($user->mName) . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$user->mEmail = $vb_user_info['email'];
}
else {
// ERROR?
}
}


is no one else working on this/ interested in this?

So, it seems the "_" underscore is the one of the forbidden chars in mediawiki.... so might cause some collision issues with vb's user database.

still working on this to see how to best resolve these issues.

arn

exceem
10-28-2005, 06:48 PM
im goign to give this a go over the weekend on a test setup, hopefulyl it will work ok

weeno
11-01-2005, 01:28 PM
we went live:
http://www.macrumors.com/pages/2005/10/20051030152853.shtml

arn

d4v3r5
11-02-2005, 01:23 AM
we went live:
http://www.macrumors.com/pages/2005/10/20051030152853.shtml

arn

saweet!
howzit workin so far?
you gonna release a hack for the rest of us? :)

GrendelKhan{TSU
11-02-2005, 02:29 AM
saweet!
howzit workin so far?
you gonna release a hack for the rest of us? :)

what he said!!

or you just teasin us? :(. lol looks good though!! (mouth waters) :p

pushing my luck: if you do release it....is it going to phrased? that is a huge point for many (me!) :)

exceem
11-02-2005, 08:47 AM
how much code did you have to change in the end?

ndahiya
11-02-2005, 11:53 AM
Hi

This thread actually has 2 separate topics (the first few posts refer to other stuff)... Can we clean it up and move it to the vb 3.5 forum? should gather more interest ??

Btw, I went live with it as well. Works well, despite that error logging in for the first time....

Nd.

weeno
11-02-2005, 01:03 PM
The integration alone is pretty much the code posted in the first page of this thread. I did some very minor changes, will post what I'm actually using when I get home later.

Other things you need to do is figure out how many of your users are affected by the illegal characters not allowed in MediaWiki. Mine turned out to be not that many in the grand schemes. I make these users change their username to be able to log in. I have to do this manually.

I now prohibit the use of these characters in new registrations on vbulletin. this is a simple an option in the vbulletin control panel. This is really the only change needed in vbulletin to get the user access integration working.

Unfortauntely the two accounts aren't linked once someone logs into the mediawiki. Password changes aren't carried over. logout/logins are cookied seperately too.

I am working on more integration with the forums itself which requires some vbulletin template mods.

arn

GrendelKhan{TSU
11-02-2005, 04:25 PM
still sounds great so far!

can't wait for a public release and full integration :)

btw...is this phrased?

pirotess
11-02-2005, 07:08 PM
still sounds great so far!

can't wait for a public release and full integration :)

btw...is this phrased?

Very nice. I've been looking all over for a wiki package for vBulletin. This is closer than anything I have seen but I was hoping to find something as tightly integrated as say vb CMPS eventually. Hopefully this will evolve into that.

exceem
11-02-2005, 07:15 PM
yeah i got the code working from that post just fine, i plan to change the email when a update to a pm via the forums, as well as adding whos online tracking, if i do figure it out ill post what i did, as well as integrating the profiles into one profile based on the forums one

weeno do you want to start a thread in the 3.5.x section, since you have probably done the most work towards this hack? it may well encourage other people to all help out?

sammyman
11-03-2005, 05:21 AM
When should we get an unofficial, or even better, official release? That code looks sweet!

weeno
11-03-2005, 09:56 PM
Ok, first read this post by Kai Backman who did most of the coding:

https://vborg.vbsupport.ru/showpost.php?p=749311&postcount=10

Then, here's my modifications to the code, with my comments I just added now.

AuthPlugin_vBulletin.php file:


<?php

/**
* Authentication plugin interface. Instantiate a subclass of AuthPlugin
* and set $wgAuth to it to authenticate against some external tool.
*
* The default behavior is not to do anything, and use the local user
* database for all authentication. A subclass can require that all
* accounts authenticate externally, or use it only as a fallback; also
* you can transparently create internal wiki accounts the first time
* someone logs in who can be authenticated externally.
*
* This interface is new, and might change a bit before 1.4.0 final is
* done...
*
* @package MediaWiki
*/
require_once("includes/AuthPlugin.php");

class AuthPlugin_vBulletin extends AuthPlugin {

// Persistent DB connection
var $vb_database;

function AuthPlugin_vBulletin($host, $username, $password, $dbname)
{
$this->vb_database = mysql_pconnect($host, $username, $password);
mysql_select_db($dbname, $this->vb_database);
}


/**
* Check whether there exists a user account with the given name.
* The name will be normalized to MediaWiki's requirements, so
* you might need to munge it (for instance, for lowercase initial
* letters).
*
* @param string $username
* @return bool
* @access public
*/
function userExists( $username ) {
$username = addslashes($username);

$vb_find_user_query = "SELECT membergroupids FROM user WHERE LOWER(username)=LOWER('" . $username . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);
$membergroupids = $vb_user_info['membergroupids'];
$membergrouparray = explode(",",$membergroupids);

/* weeno comment
This version checks to see if a user is in a special secondary group. In
my case, this is group 17. I only allow users who are promoted to this
group (I call it Wiki Editor), to be authorized. Mine has a post count of 20
minimum */

/* weeno comment
Below is some very ugly code to exclude illegal mediawiki chars. These
chars are simply denied. People have to change their username by asking
to log in. Could be done in some sorta automatic way perhaps, but then
you risk collisions. Come to think of it, this will fail if the illegal char is
the first and only character in the username. Can someone fix this? */

if ( !strpos($username,"#") and
!strpos($username,"+") and
!strpos($username,"<") and
!strpos($username,">") and
!strpos($username,"[") and
!strpos($username,"]") and
!strpos($username,"|") and
!strpos($username,"{") and
!strpos($username,"}") )
{
if(in_array("17",$membergrouparray))
return true;
else
return false;
}

}

return false;
}

/**
* Check if a username+password pair is a valid login.
* The name will be normalized to MediaWiki's requirements, so
* you might need to munge it (for instance, for lowercase initial
* letters).
*
* @param string $username
* @param string $password
* @return bool
* @access public
*/
function authenticate( $username, $password )
{
$username = addslashes($username);
$vb_find_user_query = "SELECT password, salt, membergroupids FROM user WHERE LOWER(username)=LOWER('" .
$username . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1)
{

$vb_user_info = mysql_fetch_array($vb_find_result);
$membergroupids = $vb_user_info['membergroupids'];
$membergrouparray = explode(",",$membergroupids);

/* same check. A function would perhaps be cleaner */
if ( !strpos($username,"#") and
!strpos($username,"+") and
!strpos($username,"<") and
!strpos($username,">") and
!strpos($username,"[") and
!strpos($username,"]") and
!strpos($username,"|") and
!strpos($username,"{") and
!strpos($username,"}") )
{
if(in_array("17",$membergrouparray))
if(md5(md5($password) . $vb_user_info['salt']) == $vb_user_info['password'])
return true;
}

}
return false;
}

/**
* Return true if the wiki should create a new local account automatically
* when asked to login a user who doesn't exist locally but does in the
* external auth database.
*
* If you don't automatically create accounts, you must still create
* accounts in some way. It's not possible to authenticate without
* a local account.
*
* This is just a question, and shouldn't perform any actions.
*
* @return bool
* @access public
*/
function autoCreate() {
return true;
}

/**
* Return true to prevent logins that don't authenticate here from being
* checked against the local database's password fields.
*
* This is just a question, and shouldn't perform any actions.
*
* @return bool
* @access public
*/
function strict() {
return false;
}

/**
* When creating a user account, optionally fill in preferences and such.
* For instance, you might pull the email address or real name from the
* external user database.
*
* The User object is passed by reference so it can be modified; don't
* forget the & on your function declaration.
*
* @param User $user
* @access public
*/
function initUser( &$user ) {
$vb_find_user_query = "SELECT email FROM user WHERE LOWER(username)=LOWER('" .
addslashes($user->mName) . "')";
$vb_find_result = mysql_query($vb_find_user_query, $this->vb_database);
if(mysql_num_rows($vb_find_result) == 1) {
$vb_user_info = mysql_fetch_array($vb_find_result);

/* weeno comment
the following two lines copy the email over and make it validated
so it can be used in the wiki */

$user->mEmail = $vb_user_info['email'];
$user->mEmailAuthenticated = wfTimestampNow();
}
else {
// ERROR?
}
}
}


?>



Other changes I had to make:

vBulletin AdminCP: exclude the characters from new registrations so it's not an ongoing issue.

I edited out some of the html in the MediaWiki code under SpecialPreferences.php to remove any options to change usernames and passwords, so people couldn't get their accounts out of sync.

any questions? It's still rather crude. but works. I'm working on more forum<->wiki interaction like listing recent articles and stuff. this stuff is still in progress.


arn

sammyman
11-04-2005, 12:12 AM
AWESOME! Thanks arn. One last question for everyone. . . Does the wiki need to be in the same database? Or can it be in a seperate database? I currently have it installed in a seperate db.

Thanks everyone.

weeno
11-04-2005, 12:34 AM
AWESOME! Thanks arn. One last question for everyone. . . Does the wiki need to be in the same database? Or can it be in a seperate database? I currently have it installed in a seperate db.

Thanks everyone.

it can be separate.

arn

sammyman
11-04-2005, 06:05 AM
I can't seem to get this to work. I made a user group like you did, and added a user to it. The usergroup number was 11 instead of 17, and I changed those numbers. Still nothing.

require_once( "includes/DefaultSettings.php" );
require_once("AuthPlugin_vBulletin.php");
$wgAuth = new AuthPlugin_vBulletin("localhost", "name", "pass", "db_name");

Is that code right? Then the authplugin_vbulletin.php file is in the main directory with localsettings.php. I can't think of anything else.

Do I need to first manually put all of the users in the wiki db? I can't figure this out, and am not much of a coder. Is there anyway to test to see what part of this equation is not working? Thank you all for the help.

weeno
11-04-2005, 09:02 PM
I can't seem to get this to work.

require_once("AuthPlugin_vBulletin.php");
$wgAuth = new AuthPlugin_vBulletin("localhost", "name", "pass", "db_name");


try putting it at the end of LocalSettings.php

arn

sammyman
11-05-2005, 01:40 AM
Fatal error: Call to a member function on a non-object in /home/user/public_html/manuals/includes/SpecialUserlogin.php on line 314

I figured it OUT! I am the smartest man alive! I googled this

Thus, I simply amended line 264 of SpecialUserlogin.php from this:
$u =& $this->initUser( $u );
to this:
$u = $this->initUser( $u );

P.S. Arn, you have an awesome site there.

I wanted to know why the wiki installs like wiki/index.php/Main_Page? Arn, you don't seem to have this problem. How did you get around this one?

weeno
11-05-2005, 06:40 PM
Fatal error: Call to a member function on a non-object in /home/user/public_html/manuals/includes/SpecialUserlogin.php on line 314

I figured it OUT! I am the smartest man alive! I googled this

Thus, I simply amended line 264 of SpecialUserlogin.php from this:
$u =& $this->initUser( $u );
to this:
$u = $this->initUser( $u );

P.S. Arn, you have an awesome site there.

I wanted to know why the wiki installs like wiki/index.php/Main_Page? Arn, you don't seem to have this problem. How did you get around this one?

I don't know why you had to change that. I didn't. Make sure you copied the Auth code correctly. I've included my actual file as an upload so you don't have to copy/paste.

I had to use .htaccess rewrites to fix the /wiki/ subdirectory issue. I also use my own frontpage.php file which is just a php script that is not the wiki script. Main_Page redirects to my frontpage.

There is a potential problem with doing these redirects. you have to explicity exclude any subdirectories that you want to be able to access, otherwise it will try to directed everything to your wiki script


RewriteRule ^$ /frontpage.php?%{QUERY_STRING} [L]
RewriteRule ^Main_Page$ /?%{QUERY_STRING} [L,R]

RewriteCond %{REQUEST_URI} !^/skins/.*
RewriteCond %{REQUEST_URI} !^/images/.*
RewriteCond %{REQUEST_URI} !^/frontpage\.php
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.*)$ /index.php?title=$1&%{QUERY_STRING}

ndahiya
11-05-2005, 08:40 PM
Fatal error: Call to a member function on a non-object in /home/user/public_html/manuals/includes/SpecialUserlogin.php on line 314

I figured it OUT! I am the smartest man alive! I googled this

Thus, I simply amended line 264 of SpecialUserlogin.php from this:
$u =& $this->initUser( $u );
to this:
$u = $this->initUser( $u );



Actually, there is another way to fix this error (i was getting them for a long time!!)...
on line 314, insert the following:
$unique_varname_xyzabc = $u;




The problem is actually a PHP problem (likely restricted to PHP 4.3.11)... so only a few lucky ones like sammyman and me get it! :)

it has something to do with php getting confused about the variable scope...

Dsyn11
11-21-2005, 01:30 AM
any updates on this? I need a vBulletin Wiki like a zombie needs brains.

Deafwasp
11-21-2005, 10:58 AM
I'm using Kai Backman's script at the moment on MW 1.5 and there seems to be a problem.

When I try to login at MediaWiki, I get this MYSQL error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xassius/public_html/wiki/AuthPlugin_vBulletin.php on line 47

line 47 in Kai's Auth script is:

if(mysql_num_rows($vb_find_result) == 1) {

Could anyone please help (I've tried weeno's code as well, without luck)

GrendelKhan{TSU
11-21-2005, 03:42 PM
I saw a 3.5.1 forums with Wiki integration. :/
are they using this??

anyway.... any word on an official release? :p :)

Dsyn11
11-21-2005, 07:00 PM
is there any way to get the Wiki software integrated into the vB database so my users only need to log into my site? I don't want to make them log into the MediaWiki site...

can I pay someone to do this?

LunaTech
11-21-2005, 11:47 PM
I'm sharing Deafwasp's problem with weeno's version.

Line 11 of my LocalSettings has

require_once("AuthPlugin_vBulletin.php");
$wgAuth = new AuthPlugin_vBulletin ( "localhost", "admin", "xxxxxxxxx", "db");

When it tries to access a user the following error pops up: Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/html/wiki/AuthPlugin_vBulletin.php on line 47

I tested and it is logging into the db right, but there must be something when it selects the data that messes it up. Any ideas?

Is there a way to make the AuthPlugin_vBulletin.php output text? If I can have it output variables onto the screen, I could try to debug the issue.

Dsyn11
11-23-2005, 05:29 AM
is anyone else developing Wiki software for vB? I'm under time constraints to get this up.

MarsNIIT
11-23-2005, 12:55 PM
I'm sharing Deafwasp's problem with weeno's version.

Line 11 of my LocalSettings has

require_once("AuthPlugin_vBulletin.php");
$wgAuth = new AuthPlugin_vBulletin ( "localhost", "admin", "xxxxxxxxx", "db");

When it tries to access a user the following error pops up: Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/html/wiki/AuthPlugin_vBulletin.php on line 47

I tested and it is logging into the db right, but there must be something when it selects the data that messes it up. Any ideas?

Is there a way to make the AuthPlugin_vBulletin.php output text? If I can have it output variables onto the screen, I could try to debug the issue.


I'm error too, :(, i use prefix table name .

ndahiya
11-23-2005, 08:42 PM
Add this snippet to you LocalSettings.php. Insert your vBulletin DB information:

require_once("AuthPlugin_vBulletin.php");

$wgAuth = new AuthPlugin_vBulletin(<hostname>, <vb_username>, <vb_password>, <vb_dbName);


And then AuthPlugin_vBulletin.php itself:
.......



This works perfectly fine, but for one problem.... Inserting the code in LocalSettings.php creates a "session" to mysql every time someone accesses *any* page in the wiki... (you can see this by putting in the wrong password). On my server, this caused too many sessions being created in mysql, and resulted in the intermittent access problems (as the db was unavailable)!!


The way around this is to insert this code at the begining of

wiki/includes/User.php and
wiki/includes/SpecialUserlogin.php (not sure if we need to insert the code in this file, but just to be sure... :) )

This takes care of the excess pinging problem, as the vb database is accessed only when a user tries to login.

LunaTech
11-23-2005, 09:04 PM
I'm error too, :(, i use prefix table name .

You got it! :D

I just changed all "FROM user" to (for my prefix) "FROM vb3_user" in AuthPlugin_vBulletin.php

I'll look into the changes suggested by ndahiya now. :)

Update: Tested, putting the code in wiki/includes/User.php is all that is needed. Putting it in SpecialUserlogin.php seemed to mess things up. My guess is because it is a class file.

Now I'm looking how to remove certain text and better customize wiki.

MarsNIIT
11-24-2005, 01:20 AM
It works fine now, thanks :D

http://www.wiki.niitvn.info/index.php/Main_Page

Error with MediaWiki VBulletin stats extension, please help me :(

Warning: end(): Passed variable is not an array or object in /home/wikiniit/public_html/includes/Parser.php on line 489

STGU_daNo
12-10-2005, 03:20 PM
Is there any way those who made this script could create a new post either here on vb.org or over on meta for mediawiki outlining step-by-step what one has to do to integrate vb and mediawiki?

FeralTitan
12-18-2005, 03:17 AM
Is there any way those who made this script could create a new post either here on vb.org or over on meta for mediawiki outlining step-by-step what one has to do to integrate vb and mediawiki?

Can you code gurus do a release please... I would love to have this integration. also a step by step guide to install would be great. Thanks for all the stuff done so far.
Cheers

InsanityPwns
12-18-2005, 03:21 AM
Can you code gurus do a release please... I would love to have this integration. also a step by step guide to install would be great. Thanks for all the stuff done so far.
Cheers

I would agree. I have been watching this for a while now and I'm not too comfortable with all the little code changes here and there from the different posts. I'm afraid I might mess something up. I can't wait for a release of this though.

Darax The Good
12-18-2005, 11:26 PM
well I just got my template addon upgraded to 3.5. Is there a 'main thread' for this? I only have about 8 hours a week to dedicate to this, but I'd love to help out.

GrendelKhan{TSU
12-23-2005, 08:23 AM
so is this...like.... still happening? I can't wait for this :)

Hellcat
12-29-2005, 01:24 AM
I just tried the vb-auth thing posted in this thread.
Nice one!
Works just like what I need for a project I'm currently working on, the vB members can login with the same user/pass on the wiki. GREAT!
With a bit of tweaking of the config one can also prevent not registered members to edit (or even view) the wiki pages and the wiki "register new account" can be turned of as well.

I'd be happy to participate in any way I can to take this further, but for the moment this works great for me! :)

Oh yes, either removing or (better) redirecting the discussion links into the vB would be cool, indeed....

Cyburbia
01-10-2006, 02:20 PM
I put my MediaWiki project on hold, thanks to drug spam. I'm waiting for something where I can integrate MediWiki, or some other wiki script, withe the vBulletin user database. I would like to limit Wiki editing privileges to those who have posted a few messages in vBulletin, to prevent drive-by registration for vandalism and spam. If a vBulletin user is banned, their Wiki editing privileges would be removed. I don't think that's possible with a bridge; if you ban or remove a vBulletin user, the user is still there on the MediaWiki side.

silurius
01-10-2006, 04:30 PM
I'm still very enthusiastic about a vBulletin-MediaWiki solution and will fully support such an effort in any way I can if someone wants to pick this up. Cyburbia raises mportant considerations, but I'm optimistic.

IndeGuru
01-13-2006, 06:41 PM
How do I prevent users that are not logged in from posting in MW though? Can't find that flag.

Hellcat
01-13-2006, 07:31 PM
In the wiki config you can specify certain permissions for different user, like "not logged in", "logged in", "admin" and such.

There you can deny not logged in users to edit MW pages by setting that permission to "false".

IndeGuru
01-13-2006, 10:25 PM
In the wiki config you can specify certain permissions for different user, like "not logged in", "logged in", "admin" and such.

There you can deny not logged in users to edit MW pages by setting that permission to "false".
I looked in LocalSettings but couldn't find one that appeared to control that. Am I looking in the right file? (didn't think there was another)

Hellcat
01-13-2006, 11:22 PM
This is what I have in my config:
$wgGroupPermissions['*' ]['createaccount'] = false;
$wgGroupPermissions['*' ]['edit'] = false;

$wgGroupPermissions['user' ]['move'] = false;
$wgGroupPermissions['user' ]['read'] = true;
$wgGroupPermissions['user' ]['edit'] = true;
$wgGroupPermissions['user' ]['upload'] = true;

In the inculde directory you find a file "DefaultSettings.php" - you can browse trhough this one, there's a ton of more possible settings.
Everything you want to change, copy it into your localsettings.php and set the options like you need them.

Dsyn11
01-16-2006, 07:16 PM
I'm waiting for something where I can integrate MediWiki, or some other wiki script, withe the vBulletin user database.
I've been waiting for this as well..

The Drupal hack has a wiki-type software that works, but it works somewhat funky.... for some reason when I click "View" on older revisions, I don't see them, but only see the current version.

https://vborg.vbsupport.ru/showthread.php?p=873272#post873272

mfarmerhi
02-18-2006, 08:55 PM
3.0.8 vB / 1.5 MediaWiki. Got it working.

Notes for those following in my footsteps:

I used Kai's suggested code in post #10. I would add details to make the process clearer that the new php file "AuthPlugin_vBulletin.php" needs to go in "includes". Copy his code exactly from that post as others *claim* to have fixed, modified and/or improved his code, but I couldn't get ANY of the other suggested coding working.

In addition Kai's addition to LocalSettings.php should be added to the end of that file, as suggested by Weno in post #52

Weeno's suggested coding in post #48 did not work for me. Niether does his attached code in post #54 Compare them side by side to Kai's and you'll see a number of differences.

For that reason, again, I'd suggest simply copying Kai's coding in post #10

I had the same problems described in Sammyman's and ndahiya's posts (the "Fatal error: Call to a member function on a non-object in /home/user/public_html/manuals/includes/SpecialUserlogin.php on line 314" error).

ndahiya's suggested fix in post #55 is not the suggested fix. Although it works, it requires users to log in twice (claiming the first time that the password was incorrect, even if it was correct).

Sammyman's suggested fix in post #54 works flawlessly.


~ Mark

elam83
02-20-2006, 06:52 AM
I noticed that WikiSysop cannot login when applying the code listed in post #10.

Any ideas? When I comment out the lines added to LocalSettings.php, WikiSysop can login.

mfarmerhi
02-20-2006, 06:55 AM
I had no problems logging in as a WikiSysop using the code listed in post #10. Note tho, that it now uses your vB Admin log in... NOT whatever you might have originally used as your WikiSysop log in prior to integrating the DBs.

~ Mark

elam83
02-20-2006, 07:11 AM
I see. Let me double check.

Thank you!

Okay, un-commented out the lines added and when I login as my vB admin account, I cannot see protect, etc...

mfarmerhi
02-20-2006, 07:33 AM
Try one more time -- first as your WikiSysOp, then as your vBAdmin. Either working?

silurius
03-08-2006, 08:53 PM
During my initial install, I defined a WikiSysop username which I've now realized is identical to one of my vBulletin usernames. The passwords are not the same but it gets rejected either way. How should I best address that problem?

Edit: Got around part of the problem by taking out the vB lines from LocalSettings.php temporarily, logging in as another user, logging out and logging in as the WikiSysop user, granting full access to second user, logging out, restoring the vB lines to LocalSettings.php. I was able to log in as the other user and am good to go on administration.

However I still can't login as the original user specified as a WikiSysop. I assume this has to do with the fact that the WikiSysop name got added to my MediaWiki database during the initial install, and now the Wiki sees the name in two places, or something. I'm wondering if locating and removing it will address the problem - anyone know where that might get stored, or have altnernative ideas? (Both users are in the Wiki Contributors usergroup).

petjofi
03-22-2006, 10:22 PM
3.5.2 vB / 1.5.7 MediaWiki. It works GREAT. :banana:

I used Kai's suggested code in post #10:

require_once( 'AuthPlugin_vBulletin.php' );

$wgAuth = new AuthPlugin_vBulletin( 'someHostName' , 'someUserName', 'somePassWord', 'someDBName');
, but put it in "includes/User.php" and then uploaded "AuthPlugin_vBulletin.php" direct in my wiki "includes" folder

Thanks a lot! :cool:

I've noticed just a small problem with international characters .. It didn't work out with umlauts - "?, ?, ?, ?, ?, ?" and maybe "?" ..

alan92rttt
03-23-2006, 04:00 PM
I got it working on my forum and I used the changes from post #48 to restrict the wiki to a special group.

HAs anyone used drak's code for linking the wiki discussion to use the vbb for discussions? It looks right.

How do I impliment the template change required. I can't find how to do that in the metawiki help.

silurius
03-23-2006, 09:02 PM
I'm also very interested in the integrated thread function. Is it the case for others here that in order to authenticate against the wiki, a user's primary vBulletin usergroup must be the associated wiki editors user group?

alan92rttt
03-25-2006, 12:24 AM
I'm also very interested in the integrated thread function. Is it the case for others here that in order to authenticate against the wiki, a user's primary vBulletin usergroup must be the associated wiki editors user group?
Not for me.

They have to have the subgroup that I have programmed it to require(post 48 for code).


WHere is s good place to find information configuring the wiki. I have some questiosn and I have no clue where to look or post.

silurius
03-25-2006, 03:10 AM
WHere is s good place to find information configuring the wiki. I have some questiosn and I have no clue where to look or post.The MediaWiki Handbook (http://meta.wikimedia.org/wiki/Help:Contents) is a great place to start. Also check out MediaWiki extensions (http://meta.wikimedia.org/wiki/MediaWiki_Hacks_and_Extensions).

ffevo
04-06-2006, 01:27 AM
It wouldnt let me install on VBs database so i had to create a new database to install it on. Is there another way to do this or maybe conect the two databases.

Cyburbia
04-07-2006, 11:16 PM
Is there wasy integration like this yet?

http://www.ipbwiki.com/index.php/Ipb_Wiki:Integration_Of_Invision_Power_Board_with_ MediaWiki

I don't know if it's a bridge or real integration, but it's better than nothing.

birdcat
04-12-2006, 02:57 AM
I'm having a problem that some people had earlier, I'm getting this error message when a member trys to log in:

Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/html/wiki/AuthPlugin_vBulletin.php on line 47

They're told that there is no user by that name, and to check their spelling or create a new account.

I saw someone mention something about prefix table name, and changing "FROM user" in Authplugin_vbulletin.php

Could someone explain this to me? I'm not a coder, and generall have to muck my way through this stuff as best as I can, but I'm afraid I'm at a dead end here.

mdcarlson
04-26-2006, 04:21 PM
Actually, there is another way to fix this error (i was getting them for a long time!!)...
on line 314, insert the following:
$unique_varname_xyzabc = $u;

The problem is actually a PHP problem (likely restricted to PHP 4.3.11)... so only a few lucky ones like sammyman and me get it! :)

it has something to do with php getting confused about the variable scope...

I was also getting this error with PHP 4.3.11. Sammyman's fix worked for me.

Mark

iMisspell
04-30-2006, 09:42 PM
Is there wasy integration like this yet?

http://www.ipbwiki.com/index.php/Ipb_Wiki:Integration_Of_Invision_Power_Board_with_ MediaWiki

I don't know if it's a bridge or real integration, but it's better than nothing.

Been working on somthing like that, vBmediaWiki-GUI (http://anotherwebcom.com/). Its still in the begining stages and i have not typed much info about it yet, but the link below has some examples. Smilies and BBcode will be added later for the Wiki end of the project and the login/register integration is working right now.

Anyway, heres the link...
http://forums.anotherwebcom.com/vb/showthread.php?t=61


_

FrankP
07-15-2006, 02:38 PM
Hi together,

I need to push up this thread again.

We've set up MW 1.6.7 with vB 3.5.4, tried Kai's code from #10 as well as the code found on http://meta.wikimedia.org/wiki/VBulletin/Users_Integration. Both are working fine, as long as you don't need this in Germany ;-).

Our problem is the existance of german special characters (Umlaute, ????). Because for us these characters are standard, a lot of usernames are containing them.

And unfortunatly, I don't have any idea where to look, hack or modifiy the code to allow usernames like "B?rchen". I tried multiple things now for two days, but now giving up.

It's OK not to support chars like "~, +, *" and so on, but the Umlaute are really required....

If there is anybody out there who has an information where to find the required information, this would be very, very cool.

Thanks in advance for any response, I know this is more a MW related question than vB, but, who knows, maybe another german board has allready found the solution.

bye for now,
Frank

Rowen
09-14-2006, 05:00 PM
Does anyone know how this project is coming along?

vBulletin 3.6.1 is now out, last I heard, this was for 3.5.4

I would be willing to donate to help progression of this plugin.

Smitty
12-10-2006, 04:11 PM
My guess from post dates is that it has been abandoned. I heard the code in post 10 worked OK.

It looks good and I'd like to know, if anyone is still 'listening' to this thread, is anyone using it with vB 3.6.4?

pipin
12-10-2006, 06:31 PM
My guess from post dates is that it has been abandoned. I heard the code in post 10 worked OK.

It looks good and I'd like to know, if anyone is still 'listening' to this thread, is anyone using it with vB 3.6.4?

maybe you should wait for the vbwiki project.

http://www.arcanetek.com/forums/index.php

the code is used at http://www.luxurywiki.com/

but they stated that they will release a vbwiki and a vbwiki pro version.

release date unknown.

Smitty
12-10-2006, 07:07 PM
Yeah - I was watching it for a while but that sorta seemed to peter out. The key is: "Release date Unknown".

Murty
12-10-2006, 10:32 PM
Well i am very keen for a wiki that can integrate with vb. Is there a thread i can subscribe to or something?

ElfMage
01-05-2007, 02:35 AM
:-) vbWiki Pro has been released.

We moved to www.nuhit.com

storpappa
01-08-2007, 01:48 AM
This is great information. Thanks, I am going to looka t all the info ahere and test it out

Zia
01-11-2007, 06:29 PM
dont know my qus is totally out of the track or not...tho asking

its about media wiki intigration/bridge

umm wht about wikipedia.org intigration or fetcher for vb?

Smitty
01-11-2007, 06:38 PM
This is great information. Thanks, I am going to looka t all the info ahere and test it out

I've got it on my production server. Works very good.

domaino
08-08-2008, 12:36 PM
:-) vbWiki Pro has been released.

We moved to www.nuhit.com

Shame it's not around anymore!

I looked at your website and was really excited to find a way I could integrate a wiki into my vbulletin design. Unfortunately it appears as though the author of this software has fled, and now the product suffers from a lack of updates and consequently, uncompatibility with recent updates to mediaWiki.

I was wondering if anyone knows of any alternative software similar to vbWiki Pro that I could use to integrate a fully fledged mediaWiki into my site? I want to share users between my wiki and vbulletin.

Any assistance would be greatly appreciated although unfortunately I don't hold out much hope.

Cheers.

dypsisdean
01-31-2009, 04:43 AM
It's really a shame this platform has shriveled away. I have a two year old integration and have really put a lot of demands on it. And it has never even locked up once. I am presently looking to hire someone with some knowledge of this to help move me to some other situation.

Tahm
03-03-2009, 02:06 PM
I did some testing with this and the code found here ( http://www.mediawiki.org/wiki/Extension:VBulletin/Users_Integration ) seems to work fine with the current version of MediaWiki. My problem is controlling access with UserGroups via vBulletin. Does anyone know how to do that or could possibly point me in the right direction?

Thank you.

DrPrepper
11-08-2012, 01:52 PM
I did some testing with this and the code found here ( http://www.mediawiki.org/wiki/Extension:VBulletin/Users_Integration ) seems to work fine with the current version of MediaWiki. My problem is controlling access with UserGroups via vBulletin. Does anyone know how to do that or could possibly point me in the right direction?


In the mean time a couple of years later, but I wanted this bridge between mediawiki and vbulletin too, and got it working, albeit with a few tweaks.

My setup:

* vBulletin 4.2.0 PL3
* Mediawiki 1.19.2
* PHP 5.3.17

I added a custom usergroup 'wiki' to vB. Members of this group (and admins and mods) are granted to log in to the wiki.

I used the code from the quoted extention above, but ran into 2 things:


Group selection was to 'tight' for me. I wanted to control the wiki access with an additional custom usergroup (so not the primary group)
I wanted to allow spaces, dashes and dots in usernames, since both Mediawiki as vB allow that currently


@group selection

In the functions userExists (and authenticate subsequently) I changed the query from

$vb_find_user_query = "SELECT usergroupid FROM " . $this->vb_prefix . "user WHERE LOWER(username)=LOWER('" . $username . "')";


to

$vb_find_user_query = "SELECT CONCAT_WS(',',usergroupid,membergroupids) as groups FROM " . $this->vb_prefix . "user WHERE LOWER(username)=LOWER('" . $username . "')";


With this, you can query both usergroup & membersgroups together.
Since you can have multiple id's in this 'group', the code to match it to the $this->allowed_usergroups needed a little tweaking.

I changed the bottom part of the same 2 functions from


if (in_array($vb_userinfo['usergroupid'], $this->allowed_usergroups)) {
return TRUE;
}


to


if (count(array_intersect($this->allowed_usergroups, explode(",",$vb_userinfo['groups']))) >= 1) {
return TRUE;
}


This way it doesn't matter if a member had one or more matching groups with the allowed_usergroups.

@allowed characters

Unfortunately I didn't succeed in modifying the search pattern to only accept alphanumeric or underscore characters in usernames. I did a dirty workaround to bypass the whole check.

I replaced

(!preg_match($this->searchpattern, $username))

with

(count_chars($username) > 0 )

in both functions.
If someone has a better solution I'd like to hear it. I'm not that kind of a guru at PHP ;)

Sangheili
11-13-2012, 12:51 AM
In the mean time a couple of years later, but I wanted this bridge between mediawiki and vbulletin too, and got it working, albeit with a few tweaks.

My setup:

* vBulletin 4.2.0 PL3
* Mediawiki 1.19.2
* PHP 5.3.17

I added a custom usergroup 'wiki' to vB. Members of this group (and admins and mods) are granted to log in to the wiki.

I used the code from the quoted extention above, but ran into 2 things:


Group selection was to 'tight' for me. I wanted to control the wiki access with an additional custom usergroup (so not the primary group)
I wanted to allow spaces, dashes and dots in usernames, since both Mediawiki as vB allow that currently


@group selection

In the functions userExists (and authenticate subsequently) I changed the query from

$vb_find_user_query = "SELECT usergroupid FROM " . $this->vb_prefix . "user WHERE LOWER(username)=LOWER('" . $username . "')";


to

$vb_find_user_query = "SELECT CONCAT_WS(',',usergroupid,membergroupids) as groups FROM " . $this->vb_prefix . "user WHERE LOWER(username)=LOWER('" . $username . "')";


With this, you can query both usergroup & membersgroups together.
Since you can have multiple id's in this 'group', the code to match it to the $this->allowed_usergroups needed a little tweaking.

I changed the bottom part of the same 2 functions from


if (in_array($vb_userinfo['usergroupid'], $this->allowed_usergroups)) {
return TRUE;
}


to


if (count(array_intersect($this->allowed_usergroups, explode(",",$vb_userinfo['groups']))) >= 1) {
return TRUE;
}


This way it doesn't matter if a member had one or more matching groups with the allowed_usergroups.

@allowed characters

Unfortunately I didn't succeed in modifying the search pattern to only accept alphanumeric or underscore characters in usernames. I did a dirty workaround to bypass the whole check.

I replaced

(!preg_match($this->searchpattern, $username))

with

(count_chars($username) > 0 )

in both functions.
If someone has a better solution I'd like to hear it. I'm not that kind of a guru at PHP ;)

I've applied all the edits above and it stops it from working, I get incorrect password errors. Did you miss anything out? Is anything posted incorrectly?

Edit:

I did this in a different way and it worked.

DrPrepper
11-13-2012, 09:25 AM
I did this in a different way and it worked.

Good to hear! What did you do differently?