View Full Version : Custom Group Permissions
noppid
06-10-2005, 09:23 AM
Thanks for the nice work. So far the info is coming fast and it's been a big help, but we're stuck in a holding pattern on this one...
Many of us need to convert group permissions from init.php to the /include/xml/bitfield_vbulletin.xml file as best I can tell.
That shows us the new option in the control panel form when we add a new <bitfield>, however submitting the form with the new option checked has no effect on the DB field.
Can we get a heads up as to if we're going in the right direction and what may be necessary next?
Regards
Andreas
06-10-2005, 04:07 PM
I just posted a HowTo here (https://vborg.vbsupport.ru/showthread.php?t=82844).
noppid
06-10-2005, 05:49 PM
Thanks a bunch, I can read it with my coffee. :)
loneranger
06-10-2005, 05:49 PM
hi i have followed your tutorial and managed to set permissions when i call
if($permissions['imghost'] & $vbulletin->bf_ugp_genericpermissions['can_upload_img']){
echo "welcome admin";
}else{
print_no_permission();
}
but as an admin i still don't have access is there something i am doing wrong??
Andreas
06-10-2005, 06:31 PM
Your code is wrong, assuming you added a bitfield can_upload_img:
if($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['can_upload_img']){
echo "welcome admin";
}else{
print_no_permission();
}
Anyway, it's not a good idea to user standard bitfields for custom permissions, as you will run into problems sooner or later if you do so.
loneranger
06-10-2005, 06:53 PM
i have got them under a group called imghost not under generic permissions where am i going wrong please
Andreas
06-10-2005, 07:21 PM
Please post your XML-File
loneranger
06-11-2005, 10:37 AM
<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="vbulletin">
<bitfielddefs>
<group name="ugp">
<group name="imghost">
<bitfield name="canupload" group="imghost" phrase="can_upload_img" install="">1</bitfield>
<bitfield name="canadmin" group="imghost" phrase="can_admin_img" install="">2</bitfield>
<bitfield intperm="true" name="imghostset" group="imghost" phrase="max_file_size">100</bitfield>
</group>
if i do permissions['imghost'] it will return true i think i need to work out the value and settings myself if this is right can some1 give me an example?
Andreas
06-11-2005, 11:42 AM
if ($permissions['imghost'] & $vbulletin->bf_ugp['imghost']['canupload'])
{
echo "Upload Permission set";
}
else
{
echo "Upload Permission not set;
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.