The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Custom Administrator Permissions
Your Hack has an Admin Backend? Then you should consider protecting it with custom Admin Permissions - not every Admin has to be able to control everything. First of all, you have to decide on a uniqe Key for your Admin Permission, just like your Product ID. In this example I will use canadminmyhack. Go to your ACP File(s) and place the following Code below the Back-End requirement: PHP Code:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <navgroups product="myhack"> <navgroup phrase="myhack_settings" hr="true" permissions="canadminmyhack"> <navoption> <phrase>demohack_foo</phrase> <link>demohack.php?do=foo</link> </navoption> <navoption> <phrase>demohack_modcp</phrase> <link>../{$vbulletin->config[Misc][modcpdir]}/foobar.php</link> </navoption> </navgroup> </navgroups> Code:
Varname: can_administer_myhack Text: Can Administer Myhack As the Permissions Editor only takes care of standard Permissions, you must create 4 Plugins: admin_permissions_form PHP Code:
You must also create a Plugin for the Administrator Datamanager admindata_start PHP Code:
admin_permissions_process PHP Code:
can_administer PHP Code:
As you can see, I used customadminperms as the Bitfield. This is the Bitfield I will use for my Hacks, Bit 1 is already in use. If others want to use it too (to avoid having to create there own (Bit)fields) - feel free to do so. But please, first post here and state which Bit you are going to use and wait for an Okay so there won't be conflicts. To use it, create an appropriate Bitfield XML File. The following Install Code should be used then: PHP Code:
PHP Code:
1 - KirbyDE |
#52
|
||||
|
||||
I'd like to have it too. (3.6.+)
|
#53
|
|||
|
|||
I would love to see this packaged up as a installable product. Has anyone revised this for 3.7.x?
|
#54
|
|||
|
|||
How do you remove any traces of this from the database? I started working on it quite some time ago and never got it going. Now anytime I try to save anything to define rights to my individual administrators I get the following errors... I think I just need to get rid of it out of the database but not sure exactly what to do...
Code:
Database error in vBulletin 3.8.2: Invalid SQL: UPDATE vb_administrator SET ### Bitfield: vb_administrator.adminpermissions ### adminpermissions = IF(adminpermissions & 4, adminpermissions - 4, adminpermissions), adminpermissions = IF(adminpermissions & 8, adminpermissions - 8, adminpermissions), adminpermissions = IF(adminpermissions & 16, adminpermissions - 16, adminpermissions), adminpermissions = IF(adminpermissions & 32, adminpermissions - 32, adminpermissions), adminpermissions = IF(adminpermissions & 64, adminpermissions - 64, adminpermissions), adminpermissions = IF(adminpermissions & 128, adminpermissions - 128, adminpermissions), adminpermissions = IF(adminpermissions & 256, adminpermissions - 256, adminpermissions), adminpermissions = IF(adminpermissions & 512, adminpermissions - 512, adminpermissions), adminpermissions = IF(adminpermissions & 1024, adminpermissions - 1024, adminpermissions), adminpermissions = IF(adminpermissions & 2048, adminpermissions - 2048, adminpermissions), adminpermissions = IF(adminpermissions & 4096, adminpermissions - 4096, adminpermissions), adminpermissions = IF(adminpermissions & 8192, adminpermissions - 8192, adminpermissions), adminpermissions = IF(adminpermissions & 16384, adminpermissions - 16384, adminpermissions), adminpermissions = IF(adminpermissions & 65536, adminpermissions - 65536, adminpermissions), adminpermissions = IF(adminpermissions & 131072, adminpermissions - 131072, adminpermissions), adminpermissions = IF(adminpermissions & 262144, adminpermissions - 262144, adminpermissions), blogpermissions = 3, ### Bitfield: vb_administrator.customadminperms ### customadminperms = IF(customadminperms & 1, customadminperms - 1, customadminperms), cssprefs = 'vBulletin_3_Default', dismissednews = '66,67,70,72,74' WHERE userid = 1; MySQL Error : Unknown column 'adminpermissions' in 'field list' Error Number : 1054 Request Date : Wednesday, May 13th 2009 @ 10:55:58 PM Error Date : Wednesday, May 13th 2009 @ 10:55:58 PM Script : http://www.myforum.com/forum/admincp/adminpermissions.php?do=update Referrer : http://www.myforum.com/forum/admincp/adminpermissions.php?do=edit&u=1 IP Address : xx.xxx.xx.xx Username : Admin Classname : vB_Database MySQL Version : 5.0.67-community |
#55
|
|||
|
|||
I'm apparently a bit dense - where would one put the install/uninstall code and the bitfield file?? I have an existing set of plugins/modifications that I would like to add a custom admin permission to..
Thanks in advance |
#56
|
|||
|
|||
I'm using vbulletin 3.7.2. All user groups can not access FlashChat. How do I solve the problem. Standard member groups successful entry. Member group created by my login failed
Thanks |
#57
|
||||
|
||||
Any update for this to work with vB4?
|
#58
|
|||
|
|||
This would be awesome if created?
|
#59
|
||||
|
||||
Hi Andreas. Does this still work on vb4?
|
#60
|
||||
|
||||
Yes, should still work (though I havn't tested that yet).
|
#61
|
|||
|
|||
Took me forever to undestand that after adding the plugins, creating the bitfield XML file, and adding the new field in the database, you need to REBUILD the bitfields. To do that, you need to use tools.php or to import any product. More information: http://www.vbulletin.com/forum/forum...ding-bitfields
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|