This modification is no longer available or supported.
This originally made changes to add new facilities to your FlachChat & vb set-up. However, all the features added are now part of standard Flashchat (4.6.0 and above). This now just supplies the latest vb 3.0 CMS file, which depending on circumstances, may either be the same as, or newer than, the one supplied with Flashchat itself.
To install the latest 3.0 CMS file - unzip it, edit the usergroups access and options as required, and then copy the file to the ../chat/inc/cmses/ folder on your server.
Optionally, you can also edit inc\langs\en.php.
Finding ;
Code:
'banned' => "You've been banned",
and replacing with ;
Code:
'banned' => "You do not have permission to enter the chat",
* Version 1.82 was the last version of the old hack (for Flashchat 4.2.1 upwards).
History of the 3.0 CMS file
* v1.13 - updated vbulletin30CMS.php file for vb 3.0 and Flashchat 4.5.2+ this contains a fix for a cookie security issue.
* v1.14 - Added ability to login direct to a room using ../flashchat.php?username=_int_&room=n
* v1.15 - Alterations to caching code.
* v1.16 - Minor fix to Get User for membergroupids.
* v1.17 - Security (anti-hacking) code added (as supplied by Darren).
* v1.18 - Usergroup settings moved to top of CMS file.
* v1.19 - Fixed error message when accessing chat admin area.
* v1.20 - Default role changed.
* v1.21 - Minor bug fix to Avatar detection, login code changes, tidy up.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Make the following changes to your vbulletinCMS file (whichever one you are using).
Find;
PHP Code:
$this->getUserStmt = new Statement("SELECT userid AS id, username AS login, usergroupid FROM {$GLOBALS['tableprefix']}user WHERE userid=?");
Replace with;
PHP Code:
$this->getUserStmt = new Statement("SELECT userid AS id, username AS login, usergroupid, membergroupids FROM {$GLOBALS['tableprefix']}user WHERE userid=?");
$rec['usergroupid'] .= ",".$rec['membergroupids'] ; //added by Paul M
$rec['roles'] = $this->getRoles($rec['usergroupid']);
Find the getRoles function ;
PHP Code:
function getRoles($usergroupid) {
< # current block of code # >
}
Replace it with a new version ;
PHP Code:
// Paul M Version - Edit to set user roles for different vB usergroups
function getRoles($usergroupid) {
// Set default access
$userrole = ROLE_NOBODY ;
$groups = explode(',',$usergroupid);
// Set Allowed groups
if (in_array(2,$groups)) $userrole = ROLE_USER;
if (in_array(7,$groups)) $userrole = ROLE_USER;
//Set Staff groups
if (in_array(5,$groups)) $userrole = ROLE_ADMIN;
if (in_array(6,$groups)) $userrole = ROLE_ADMIN;
//Set Banned groups
if (in_array(8,$groups)) $userrole = ROLE_NOBODY;
if (in_array(9,$groups)) $userrole = ROLE_NOBODY;
return $userrole;
}
Edit the above function for your usergroups. This is working fine on my test system.
This version assigns access in the following priority based on both primary and secondary groups.
1. Assign default access (which is set to NO access).
2. If they are a member of an allowed group, grant USER access.
3. If they are a member of a staff group, grant ADMIN access.
4. If they are a member of a banned group, grant NO access.