PDA

View Full Version : Setting default super moderator permissions?


vBNinja
02-13-2012, 12:40 PM
Hello,

I need some help with setting the default super mod permissions. For example, when a member is made a super mod, he automatically gets all the permissions enabled, i want to change the defaults so i dont have to fix the permissions everytime theres a new super moderator.

By permissions i mean "Can delete threads, can set forum password, can delete visitor messages, can edit profile, etc"

I'm sure this is possible, it's probably just changing the values of a file/database table
Thanks in advance

kh99
02-13-2012, 02:17 PM
I think you just want to edit the Super Moderator user group.

vBNinja
02-13-2012, 02:25 PM
No, thats different permissions

kh99
02-13-2012, 02:53 PM
Oh right - that's why you listed the ones you were interested in :o

Anyway it looks like a super moderator gets all permissions by default (if you haven't edited the permissions). So you'd probably need to change the code to do what you want. You'd either have to insert a record in the moderator table whenever a user is made a super moderator, or else change the code in function fetch_moderator_permissions() (in includes/functions.php). Near the end of that function there's this code:

if ($useglobalperms)
{
if (!$hasglobalperms)
{
// super mod without a record, give them all permissions
$globalperms['permissions'] = array_sum($vbulletin->bf_misc_moderatorpermissions) - ($vbulletin->bf_misc_moderatorpermissions['newthreademail'] + $vbulletin->bf_misc_moderatorpermissions['newpostemail']);
$globalperms['permissions2'] = array_sum($vbulletin->bf_misc_moderatorpermissions2);
}


So I think if you were to set $globalperms['permissions'] and $globalperms['permissions2'] to have the bits set only for the permissions you want by default, it might work.