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 |
#32
|
|||
|
|||
It is at the bottom of "vBulletin : General Administration"
Thanks, Alan. |
#33
|
|||
|
|||
I'm getting frustrated because I can't get it to work.
This is for vBulletin 3.6.0 RC 3 Install Code PHP Code:
PHP Code:
admindata_start PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#34
|
|||
|
|||
I have this in my custom XML file - the canadminnetwork option works fine, however the canadminrankings part (using your code) returns a value of 2 when Yes, or 0 when No.
Code:
<bitfielddefs> <group name="misc"> <group name="customadminperms"> <bitfield name="canadminnetwork">1</bitfield> <bitfield name="canadminrankings">2</bitfield> </group> </group> </bitfielddefs> |
#35
|
|||
|
|||
Quote:
|
#36
|
|||
|
|||
Yes, but how do I put that into a print_yes_no_row for use in adminpermissions.php
|
#37
|
|||
|
|||
I have no idea. I need help with it as well.
|
#38
|
||||
|
||||
This is somewhat unrelated, but where can I get info on how to give my plugin an admincp back-end? I'm working on a small plugin for my forum and this would be very useful.
|
#39
|
||||
|
||||
Hello, Andreas, I've a problem: The permissions are not stored. When I click save and return to the Permission Overview, The Right i snot saved. (No is ever selected)
I dont know, where the problem is. Thanks for Help !!! Surviver Because of my bed English: http://surviver.bokuv.de/ablage/admi...dminperms.html //All ok, thanx Andreas |
#40
|
||||
|
||||
Same problem here.
First, Does this works with 3.6.0? If so what are the right steps to make it work. Second, Any particular reason why doesnt save the permissions? it just don't do it, I have try in so many ways, but it appears vbulletin for some reason doesnt store the changes. I am using vbulletin 3.6.0+ Also could you make this hack works with more than one custom permissions? Thanks on advance. |
#41
|
||||
|
||||
Quote:
Example: Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields> <bitfielddefs> <group name="misc"> <group name="customadminperms"> <bitfield name="canadminmyhack">1</bitfield> </group> </group> </bitfielddefs> </bitfields> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|