vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Default admin permissions? (https://vborg.vbsupport.ru/showthread.php?t=314706)

alcazarx 10-04-2014 01:29 PM

Default admin permissions?
 
1 Attachment(s)
Hello Folks,

another small question.
Normally if you edit an administrators permissions, its all set to "No" (if its a new record).
Is there a plugin/option/whatsoever to set this to predefined values? (i. e. see attachment)
Me know that the free software MyBB (boo!) has an "default group permissions" option for this, but we dont need this, since our admins have (mostly) the same permissions.
All we could found in the code is, that when editing an administrator an "empty" record with only the user_id is created in the "administrator" table.
Thanks.

ozzy47 10-04-2014 01:32 PM

No, it was designed that way as most owners might want to assign different permissions to different admins. :)

It should not take long at all to set up, also it's not like you are adding new admins every ten minutes.

tbworld 10-04-2014 08:03 PM

Quote:

Originally Posted by alcazarx (Post 2517639)
All we could found in the code is, that when editing an administrator an "empty" record with only the user_id is created in the "administrator" table.
Thanks.

Administrator permissions are held in table 'administrator' column 'adminpermissions' as a bit field. You could easily create a query to copy the bit field from one 'userid' to another or handle it manually. Like @Ozzy47 said it is not something you will do every day, but I get the headache. :)

Please backup your database. :)

alcazarx 10-05-2014 08:35 AM

Why not creating a plugin then ozzy? :rolleyes:
You did many great plugins here (some we use too)...

@tbworld: You could do also with changing the "default" value of the field, but we didnt want to manipulate the database.
But your idea of "copying the bitfield" lead to the simple solution, thanks.

Simple, but working solution:
Since the "adminpermissions" field is 0 for new admins, just check for it and set the desired value (15605220 for us) before the
Code:

        foreach (convert_bits_to_array(...))
        {
                print_yes_no_row(...);
        }

block. So all permissions that they should have are set to "Yes" then :cool:

Background: Of course its not something you do every day, but there is (how do you say in US?) "reorganization in progress" and a merge with another community (they had a different script) so there will be a new "org chart" then :p .In the end there will be only 2 people with "$config['SpecialUsers']['superadministrators']" so the change above will be removed afterwards.
Thanks, can be closed like the other thread.


All times are GMT. The time now is 10:03 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.00924 seconds
  • Memory Usage 1,720KB
  • 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)bbcode_quote_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