Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
MediaWiki/vBulletin Single Sign-On Details »»
MediaWiki/vBulletin Single Sign-On
Version: 2.2.0, by NoeJeko NoeJeko is offline
Developer Last Online: Apr 2011 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.8.x Rating:
Released: 05-06-2009 Last Update: Never Installs: 115
Uses Plugins
Additional Files  
No support by the author.

Overview:
This hack provides single sign-on capability for MediaWiki using your vBulletin users. You must ensure your cookie path in Admin CP is set to '/' for this to work. Also, I have not tested this if your wiki and your forums are on different subdomains - but as long as your have your cookie domain set properly it *should* work. This is not a user bridge - it is a complete single sign-on using your vBulletin user repository.

The install process has been extremely simplified in version 2.x of this product. You only have to edit LocalSettings.php, import a product, and change a setting in your Admin Control Panel. It's been completely packaged as a vBulletin product - unlike the previous hacked up version, heh. I didn't originally plan to release this so I designed it so it worked - not so it could be redistributed. I searched high and low for a functional MediaWiki bridge - almost bought NuHIT's product, and then realized it had been abandoned for over a year.

This hack no longer requires an edit to class_core.php.

I'll do my best to support it, but I can make no promises.

This thread is for discussion of this mod on vB 3.8.x. For vB 3.7.x, please use the MediaWiki/vBulletin Single Sign-On 3.7 thread

Demo of plugin in action: MyMMOGames - Multiplayer Gaming and Media Community

Also, if you use memcached - ensure you do not cache sessions. If you do, restart it at least once a week. If you don't, you'll end up with invalid session errors out of MediaWiki.

Requirements:
MediaWiki Version: 1.11.0-1.14.0
vBulletin Version: 3.6.9-3.8.2

Features:
- Provides single sign on capability between vBulletin and Mediawiki. vBulletin user repository is used
- Configurable sysop/bureaucrat groups
- Configurable disallowed user groups
- Configurable "Who's Online" display
- Counts users viewing wiki in vBulletin's "Who's Online"

Installation/Upgrade:
Please read the included "readme.txt" file in the "docs (do not upload)" folder.

Options:
Admin Control Panel->vBulletin Options->MMOG Wiki Options

Change Log:
1.0.0.0 - Sep 18, 2008
- Initial Release

1.0.3.0 - Sep 29, 2008
- Bugfix: Incorrect redirects for login/logout

2.0.0.0 - Sep 30, 2008
- Feature: Streamlined installation procedure
- Feature: Wiki path set in ACP
- Bugfix: Forum paths no longer hardcoded

2.1.0 - Oct 4, 2008
- Feature: ACP option to use MediaWiki Short URLs
- Feature: ACP option to set sysop groups
- Feature: ACP option to set bureaucrat groups
- Feature: ACP option to disallow login to certain groups
- Feature: ACP option to change WOL display text

2.2.0 - May 1, 2005
- Bugfix: Users are not logged out when logging out of the forum
- Bugfix: No longer requires modification to class_core.php
- Feature: Mediawiki 1.13.0+ supported (verified on 1.14.0 also)

If you like it, please click "mark as installed" The more people that use this, the more time I will make to try and support/update it.

Been pulling your hair out looking for this as long as I have? Nominate it for Mod of the Month =]

AuthPlugin was inspired by and modified from this existing MediaWiki Extension:

http://www.mediawiki.org/wiki/Extension:QISSingleSignOn

Download Now

File Type: zip mmog_wiki_v2.2.0.zip (9.1 KB, 1011 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Wired1

Comments
  #162  
Old 02-04-2010, 03:30 PM
simunaqv simunaqv is offline
 
Join Date: May 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by benjaminlwells View Post
did you just use the instructions in the readme file?

Ben
I already had the SSO working with vb 3.8.1 on my local setup. I created a separated installation vb 4.0 and upgraded it to vb 4.01 and applied the changes to the AuthPlugin_VBSSO.php file as suggested byBRotondi, and it is working, at least on my local setup.
Reply With Quote
  #163  
Old 02-06-2010, 10:15 AM
bepe bepe is offline
 
Join Date: Nov 2009
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've got the whole thing pretty much working now... but had to rewrite almost everything for 4.0.1

... Right now my biggest problem is that the wiki css is somehow in conflict with the vB css
I'm just starting to learn all that php, css suff... but no idea where to continue now

https://vborg.vbsupport.ru/showthread.php?t=235147
Reply With Quote
  #164  
Old 02-06-2010, 10:38 AM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@bepe: Install Firebug! You can click any element and change CSS and Html realtime. For PHP Xampp is perhaps the best solution.

I'm wondering why this mod works for 4.0.1 on your site... perhaps a Problem with the german version?
Reply With Quote
  #165  
Old 02-06-2010, 10:46 AM
bepe bepe is offline
 
Join Date: Nov 2009
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not really a mod... it's more like a new version

AuthPlugin_vbMediaWiki.php
PHP Code:
<?php
/**
 */
# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
# http://www.mediawiki.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html

/**
 * 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.
 */

$current_dir getcwd();
chdir'../forum' );
require_once( 
"global.php" );
require_once( 
"includes/functions.php" );
chdir$current_dir );

require_once( 
"$IP/includes/AuthPlugin.php" );

/**
 * Users can't change their passwords here
 */
class AuthPlugin_vbMediaWiki extends AuthPlugin {

    public function 
allowPasswordChange() {
        return 
false;
    }
}
$wgAuth = new AuthPlugin_vbMediaWiki();

/**
 * Set the 'vbmediawikiskin' skin as default and prevent users from changing it
 * - we have only one integrated skin right now
 */
$wgDefaultSkin   'vbwikiskin';
$wgAllowUserSkin false;

/**
 * Disable email and real name
 * - Not sure yet how to solve conflicts between vBulletin and MediWiki user data changes
 */
$wgEnableEmail   false;
$wgAllowRealName false;

/**
 * Disable 'pretty' URLs, e.g. index.php/Page_title
 * - We need to disable it or rewrite code for vBulletin's "Who's Online"
 */
$wgUsePathInfo false;

/**
 * Set this to false to avoid forcing the first letter of links to capitals.
 * - vBulletin user names can be lower case, so we need that
 */
$wgCapitalLinks false;
 
/**
 * Disabling new user registrations and anonymous edits
 * - vBulletin user names can be lower case, so we need that
 */
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;

/**
 * Disable manual login and logout functions for all users and remove the ChangePassword page
 * - vBulletin will do the login/logout stuff and also the Password should be changes there
 */
function SpecialPage_initListHook( &$aSpecialPages )
{
    unset( 
$aSpecialPages['Userlogout'] );
    unset( 
$aSpecialPages['Userlogin'] );
    unset( 
$aSpecialPages['Resetpass'] );
    return 
true;
}
$wgHooks['SpecialPage_initList'][] = 'SpecialPage_initListHook';

/**
 * Remove login and logout buttons for all users
 * - vBulletin shows them in the navbar anyway
 */
function PersonalUrlsHook( &$personal_urls, &$title )
{
    unset( 
$personal_urls["login"] );
    unset( 
$personal_urls["logout"] );
    unset( 
$personal_urls['anonlogin'] );    
    return 
true;
}
$wgHooks['PersonalUrls'][] = 'PersonalUrlsHook';

/**
 * User Group Translation
 * - NoLogin:    Can't login to wiki... only to vBulletin
 * - Sysop:      Wiki Administrators
 * - Bureaucrat: Could edit user rights... but they will be reseted anyway
 *               It's more clear if we only allow a group like moderators to Administrate the Wiki
 */
$vwNoLoginGroups    = array();
$vwSysopGroups      = array(6,7);
$vwBureaucratGroups = array(6);

/**
 * Minimum number of posts a user need in to login to the Wiki 
 * - This is a community portal... only real members of the community should edit the Wiki
 */
$vwMinReputationPosts       5;
$vwMinReputationPostsNotice 'wiki_posts';

/**
 * Sync user to vBulletin
 * - Same user for the Wiki as in vBulletin
 */
function UserLoadFromSessionHook$user, &$result ) {
    global 
$vbulletin;
    global 
$vwNoLoginGroups$vwSysopGroups$vwBureaucratGroups;
    global 
$vwMinReputationPosts$vwMinReputationPostsNotice;

    
// check if user is authenticated (by another hook)
    
if ( $user != null ) {
        if ( !
$user->isAnon() ) {
            
// User is not anonymous. 
            // Check for the existence of a valid vB userid.  If we don't have one, log the old user out.
            
if ( $vbulletin->userinfo['userid'] == ) {
                
$user->logout();
            }

            
// Check vwNoLoginGroups
            // If they're logged in and shouldn't be, log them out!
            
if ( is_member_of$vbulletin->userinfo$vwNoLoginGroups ) ) {
                
$user->logout();
                break;
            }
            
            if( 
$vbulletin->userinfo['posts'] < $vwMinReputationPosts ) {
                
                if( 
$vwMinReputationPostsNotice != null ) {
                    
$vbulletin->noticecache = array(
                        
$vwMinReputationPostsNotice => array(
                            
'has_x_postcount' => array(0,$vwMinReputationPosts 1)
                        )
                    );
                }
                
                
$user->logout();
                break;
            }

            return 
true;
        }
        
$user->logout();
    }
    
    if ( 
$vbulletin->userinfo['userid'] )
    {
        
// Check vwNoLoginGroups
        
if ( is_member_of$vbulletin->userinfo$vwNoLoginGroups ) ) {
            return 
true;
        }

        if( 
$vbulletin->userinfo['posts'] < $vwMinReputationPosts ) {
            
            if( 
$vwMinReputationPostsNotice != null ) {
                
$vbulletin->noticecache = array(
                    
$vwMinReputationPostsNotice => array(
                        
'has_x_postcount' => array(0,$vwMinReputationPosts 1)
                    )
                );
            }
            
            return 
true;
        }
            
        
$username $vbulletin->userinfo['username'];

        if ( 
$username ) {
            
$u User::newFromName$username );
            if (
is_null($u)) {
                
// Invalid username or some other error...
                
return;
            }
            if ( 
$u->getID() == ) {
                
$u->addToDatabase();
                
$u->setToken();
            }
            else 
$u->loadFromDatabase();
            
            
$user $u;
            
$user->setOption'rememberpassword');
            
$user->saveSettings();
            
$user->setCookies();
            
            
// Check vwSysopGroups.
            
$user->removeGroup'sysop' );
            if ( 
is_member_of$vbulletin->userinfo$vwSysopGroups ) ) {
                
$user->addGroup'sysop' );
            }

            
// Check vwBureaucratGroups.
            
$user->removeGroup'bureaucrat' );
            if ( 
is_member_of$vbulletin->userinfo$vwBureaucratGroups ) ) {
                
$user->addGroup'bureaucrat' );
            }
        }
    }
    else 
$user->logout();

    return 
true;
}    
$wgHooks['UserLoadFromSession'][] = 'UserLoadFromSessionHook';
and there are much more changes, like a new wiki skin and other changes for getting the vB WOL working right
Reply With Quote
  #166  
Old 02-06-2010, 11:53 AM
bepe bepe is offline
 
Join Date: Nov 2009
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BRotondi View Post
@bepe: Install Firebug! You can click any element and change CSS and Html realtime. For PHP Xampp is perhaps the best solution.

I'm wondering why this mod works for 4.0.1 on your site... perhaps a Problem with the german version?
thank you so much!! Firebug is just perfect for it ... did not know that tool yet :$
Reply With Quote
  #167  
Old 02-06-2010, 03:04 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bepe View Post
It's not really a mod... it's more like a new version

AuthPlugin_vbMediaWiki.php
It works! Pasted your above code in my wiki\includes\AuthPlugin_vBSSO.php and WOW! 1001 Thanks!!

Bruno
Reply With Quote
  #168  
Old 02-16-2010, 02:04 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BRotondi View Post
Modifications
  • For use with Wiki short-URLs you should remove this in product-mmog_wiki.xml (after installation in Plugin "MMOG Wiki: Online Location Hack"):
Code:
      <phpcode><![CDATA[if (strpos($userinfo['location'], ( $vbulletin->options['mmog_wiki_path'] . '/' )) !== false)
so you can use /w which will work with /w/... and /wiki/...

If checking for /w ist not enough, you could also use multiple
Code:
if (...) {$userinfo['activity'] = 'wiki';}
  • For German platforms you may change the hardcoded english in product-mmog_wiki.xm:
Code:
$userinfo['action'] = 'Viewing Wiki';
Greetings, Bruno
I tried this, and while it did work for the Wiki, it also rewrote users playing in ibProArcade. The link stayed the same, but it said they were viewing the wiki.
Reply With Quote
  #169  
Old 02-21-2010, 06:44 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ngh... and again not working 100% after upgrading to 4.0.2 ...

The "who is online" gives me no wiki-link, and unallowed users have an empty login-window in in the wiki (instead of the IP) ... Now I'm testing vbMediaWiki (Beta AddOn) which is VERY interesting:Greetings, Bruno
Reply With Quote
  #170  
Old 02-24-2010, 06:21 AM
Art Andrews Art Andrews is offline
 
Join Date: Jan 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I saw someone asked earlier if the wiki and vb could be on separate dbs and the answer was "yes." Can they be on separate domains and still have a single login?
Reply With Quote
  #171  
Old 02-27-2010, 12:01 PM
luan7749's Avatar
luan7749 luan7749 is offline
 
Join Date: Apr 2008
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could I use bbcode in this addon ?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 09:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05906 seconds
  • Memory Usage 2,420KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete