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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2012, 03:23 AM
chefy chefy is offline
 
Join Date: Jul 2012
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Closed forum and admins

On my forum I have 7 admins. As you know, when the forum is closed, the only ones who can still browse and even post on the forums just like if these were open are the admins. I want to remove this ability from 2 of my 7 admins so when they log in they will see the same message that every user get: "the forum is closed" and they will not be able to do anything until the forums come back to the open status just like any regular user. Is this possible?
Reply With Quote
  #2  
Old 08-12-2012, 11:09 AM
watty005 watty005 is offline
 
Join Date: Apr 2010
Location: Wales, UK
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you not create a different usergroup for these 2 admins and apply the permissions from there??
Reply With Quote
  #3  
Old 08-12-2012, 02:51 PM
chefy chefy is offline
 
Join Date: Jul 2012
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't believe that there is a specific setting to prevent admins from browsing the forums when closed.
Reply With Quote
  #4  
Old 08-12-2012, 03:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you would have to modify the class_bootstrap.php file manually in order to add in the userids for those two admins. Basically, if they have admin permissions and have access to the admincp, then they have access to the forum when it is off.
Reply With Quote
  #5  
Old 08-12-2012, 03:18 PM
chefy chefy is offline
 
Join Date: Jul 2012
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't locate the file class_bootstrap.php on my vB 3.8.7 installation
Reply With Quote
  #6  
Old 08-12-2012, 04:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, I was looking at the vB4 files. Check global.php
Reply With Quote
  #7  
Old 08-12-2012, 04:23 PM
chefy chefy is offline
 
Join Date: Jul 2012
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the code snippet that controls that:

PHP Code:
// #############################################################################
// check that board is active - if not admin, then display error
if (!$vbulletin->options['bbactive'] AND THIS_SCRIPT != 'login')
{
    if (!(
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']))
    {
        if (
THIS_SCRIPT == 'external')
        {
            
// don't output HTML for external data
            
exit;
        }
        
$show['enableforumjump'] = true;
        eval(
'standard_error("' str_replace("\\'""'"addslashes($vbulletin->options['bbclosedreason'])) . '");');
        unset(
$db->shutdownqueries['lastvisit']);
    }
    else
    {
        
// show the board disabled warning message so that admins don't leave the board turned off by accident
        
eval('$warning = "' fetch_template('board_inactive_warning') . '";');
        
$header $warning $header;
        
$footer .= $warning;
    }

So I think that I should play with this line:

PHP Code:
if (!($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) 
With that conditional, the system will detect all my admins (there are 7 of them) and allow them to use the forums even when closed. How can I also evaluate if they are let's say userid=1 and userid=2 to disallow them access i.e. send them to the else part of the code?
Reply With Quote
  #8  
Old 08-13-2012, 02:29 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe... (not testing and I'm not sure my parenthesis add up correctly):

if (!($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) AND (!in_array($vbulletin->userinfo['userid'],array(1,2)))

I always play with these things on my test site when it comes to conditions, but that's the basic idea.
Reply With Quote
  #9  
Old 08-16-2012, 07:51 PM
chefy chefy is offline
 
Join Date: Jul 2012
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne, just tested your code and not only it didn't work but also made every .php of my forum (i.e. index.php, forumdisplay.php, showthread.php) to result in a blank page

Could you please review the code again?
Reply With Quote
  #10  
Old 08-16-2012, 08:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$vbulletin['userid'] should actually be $vbulletin->userinfo['userid'], so that was wrong. (But, you'll still need to check the parenthesis as that will cause issues if they don't add up correctly.)
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 08:46 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.04077 seconds
  • Memory Usage 2,259KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete