Very helpfull topic. Could you please extend it a bit saying me how I can set a default value per bitfield (for all usergroups) ?
I've the following code in bitfield_vbmates.xml
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="vbmates">
<bitfielddefs>
<group name="ugp">
<group name="vbmates">
<bitfield name="canuse" group="vbmates_permissions" phrase="vbmates_can_use">1</bitfield>
<bitfield name="canadd" group="vbmates_permissions" phrase="vbmates_can_add">2</bitfield>
..... and others below..........
</group>
</group>
</bitfielddefs>
</bitfields>
Then I setup correctly persmissions per user group. Why with the code:
Code:
if(!$permissions['vbmates'] & $vbulletin->bf_ugp['vbmates']['canadd']){
$vbulletin->url = "vbmates.php?" . $vbulletin->session->vars['sessionurl'] ."";
eval(print_standard_redirect('vbmates_no_add_profile', true, true));
}
a usergroup can go on while they dont have permission for it? Please note:
1.- I changed bitfield_vbmates.xml after the first product installation
2.- I've also trying to use in this file: <group name="vbmates_permissions"> but no chance.
Ok, I found it. It needed one couple of parenthesis more. Instead of:
if(!$permissions['vbmates'] & $vbulletin->bf_ugp['vbmates']['canadd'])
should be ...
if(!($permissions['vbmates'] & $vbulletin->bf_ugp['vbmates']['canadd']))