![]() |
|
Article Options |
Custom Administrator Permissions
by
![]() 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:
In your ACP Navigation XML Files, add the Parameter permissions to your Navgroup:
In order to display Text in the Admin Permissions Editor, you must create a Phrase in Phrasegroup Permissions:
Make sure that it is attached to your Product and inserted into GLOBAL Language! As the Permissions Editor only takes care of standard Permissions, you must create 4 Plugins: admin_permissions_form
customadminperms[canadminmyhack] must the Name of the Bit(field) you want to use, $vbulletin->bf_misc_customadminperms['canadminmyhack'] the Value of the Bit You must also create a Plugin for the Administrator Datamanager admindata_start
Now we need a Plugin to save our Permission setting after editing it: admin_permissions_process
Now, finally, we need a Plugin to actually check this Permission can_administer
Here again, $vbulletin->bf_misc_customadminperms['canadminmyhack'] must be the Value of your Bit. 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:
And this Uninstall-Code
Bitfield Usage customadminperms (this will be updated if other Authors use it too) 1 - KirbyDE No members have liked this post.
Last edited by Andreas; 02 Mar 2008 at 12:59.. Reason: Example Code cleanup (assuming nobody is interested in vBulletin 3.5.0 code anymore ;)) |
||||||||||||||||||||||||||||||||||||
Views: 30055
|
Comments |
#2
|
|||
|
|||
Wow. Thanks man!
I may try doing this when I have a few hours. :P No members have liked this post.
|
#3
|
||||
|
||||
Thanks Kirby !
now do you know how to add permissions for customs categories ? Like, in vb3.0 I use
in vb3.5 what should I do to use $_CATEGORYOPTIONS['cancontainthreads'] in my code ? thanks for any help. No members have liked this post.
|
#4
|
|||
|
|||
Thanks Kirby, this will be very handy.
__________________
IMPORTANT: I'm afraid that I no longer develop software / modifications for vBulletin. However, thank you to everyone who installed / supported my modifications! No members have liked this post.
|
#5
|
||||
|
||||
@deathemperor
I don't know what you are talking about; $_CATEGORYOPTIONS does not seem to exist in any standard vBulletin 3.0 file. No members have liked this post.
|
#6
|
||||
|
||||
Originally Posted by KirbyDE
you're right, it's not vbulletin default. and I was asking for a custom permissions for custom categories system (like v3article or vbadvanced gallery).
I'm thinking if a bitfield_something.xml file would do the trick. No members have liked this post.
|
#7
|
||||||||
|
||||||||
Should perhaps be something more like
eh? Also, can you please explain what you mean by "Bitfield Usage customadminperms (this will be updated if other Authors use it too)"? TIA ![]() No members have liked this post.
|
#8
|
||||
|
||||
Yep, the ; is missing.
Well "Bitfield Usage customadminperms" just describes how this Bitfield is used, eg. what the Bits stand for ![]() No members have liked this post.
|
#9
|
||||
|
||||
so Kirby, is there any solution for my question ?
No members have liked this post.
|
#10
|
||||
|
||||
Yes, Bitfield XMLs are the way to go.
No members have liked this post.
|
#11
|
||||
|
||||
thanks, glad to hear that, I'll try it
No members have liked this post.
|
#12
|
|||
|
|||
Hi Kirby, just 1 quick question if I may.
Thanks, Alan.
__________________
IMPORTANT: I'm afraid that I no longer develop software / modifications for vBulletin. However, thank you to everyone who installed / supported my modifications! No members have liked this post.
|
#13
|
||||
|
||||
Therer was an apparent restructuring of the file class_dbalter.php changing the class and functions used in Kirby's uninstall example.
fetch_table_info has now changed to fetchTableInfo and drop_field has changed to dropField and lastly table_field_data has changed to fetchFieldInfo. new coding
Lastly TABLE_PREFIX is no longer needed... No members have liked this post.
Last edited by Dark_Wizard; 03 Oct 2005 at 19:21. |
#14
|
|||
|
|||
I did everything the tutorial said and I can see the radio button in the admin permissions but when I click "yes" and save it, it goes back to "no".
Do I change customadminperms? No members have liked this post.
|
#15
|
|||
|
|||
Originally Posted by harmor19
Yes, same problem for me...
No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 11:35.