The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#3
|
|||
|
|||
![]()
How would one control access to a hack that was just a mod to an existing vB script?
For example, Erwin's excellent little Microstats hack installs in function print_output in the file functions.php. It contains a hard-coded test for usergroup of 6. To change this default access, or update it later on, an administrator would have to modify functions.php. What would be easier to manage would be a Feature Permission associated with the hack. In such a case, the contributor could simply add a permission name so that administrators would only have to use the AdminCP to control access to the hack. In the case of Microstats, let's say that Erwin wanted to associate the permission name "Microstats" with the hack. His code would be delivered looking something like this: Code:
if (defined('FEATURE_PERMISSIONS')) // Feature permissions installed { require_once('./includes/functions_feature_permissions'); $grant_access = fp_access_allowed('Microstats'); } if (!isset($grant_access)) // Use default access check { $grant_access = ($bbuserinfo[usergroupid]==6) } To control access using feature permissions, the administrator would define the permissions before installing the hack. For example, here is a mockup of AdminCP values required to restrict the hack to usergroups 6-9 or supermoderators or userids 46 or 101: AdminCP:: Feature Permissions:: Define Permission Permission name: Microstats Usergroups: 6-9, supermoderators Userids: 46, 101 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|