Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2014, 01:29 PM
alcazarx's Avatar
alcazarx alcazarx is offline
 
Join Date: Jul 2014
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Default admin permissions?

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.
Attached Images
File Type: jpg screen1.jpg (85.7 KB, 0 views)
Reply With Quote
  #2  
Old 10-04-2014, 01:32 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-04-2014, 08:03 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by alcazarx View Post
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.
Reply With Quote
  #4  
Old 10-05-2014, 08:35 AM
alcazarx's Avatar
alcazarx alcazarx is offline
 
Join Date: Jul 2014
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not creating a plugin then ozzy?
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

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 .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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06006 seconds
  • Memory Usage 2,207KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete