vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Setting default super moderator permissions? (https://vborg.vbsupport.ru/showthread.php?t=278512)

vBNinja 02-13-2012 12:40 PM

Setting default super moderator permissions?
 
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:

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.


All times are GMT. The time now is 02:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00987 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete