Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2002, 07:01 AM
Glock Glock is offline
 
Join Date: Apr 2002
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Moderators able to ban more than usergroup members

I want Moderators to be able to ban everyone who isn't a Administrator or Moderator. From reading another thread I figured out I should replace

if ($bangroup['usergroupid']>6) {

with

if ($banuser['usergroupid']!=6 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
} else {

My Administrator usergroup is 6, and this code does not work. Just wondering what the proper code is, and what one for allowing Moderators to ban Moderators also is, in case of a compromise of security.
Reply With Quote
  #2  
Old 08-29-2002, 07:33 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if ($banuser['usergroupid']==6 or $banuser['usergroupid']==5 or $banuser['usergroupid']==7)
{
//user is a mod, s.mod or admin
}

if ($banuser['usergroupid']!=6 and $banuser['usergroupid']!=5 and $banuser['usergroupid']!=7)
{
//user is someone else
}
Reply With Quote
  #3  
Old 08-29-2002, 07:37 AM
Glock Glock is offline
 
Join Date: Apr 2002
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where do I implement this, could you show me an example? And also I do not have a usergroup 7, banned is 8 if that's what you meant.
Reply With Quote
  #4  
Old 08-29-2002, 11:10 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

edit mod/user.php, find:

PHP Code:
 if ($banuser['usergroupid']!=or $ismod) {
    echo 
"<p>You may not ban someone who is not a normal registered user!</p>";
  } 
Replace it AS:

PHP Code:
 if ($banuser['usergroupid']==or $banuser['usergroupid']==OR $banuser['usergroupid']==7) {
    echo 
"<p>You can not ban someone who is a Mod. S.Mod or an Admin!</p>";
  } 
Reply With Quote
  #5  
Old 08-29-2002, 04:00 PM
Glock Glock is offline
 
Join Date: Apr 2002
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There are two instances of the original code to replace in user.php, I tried isnerting it in the first one as I didn't know the other existed and it did not work. I then found the other instance and then replaced both and got the following:

Parse error: parse error in /home/sites/site47/web/mod/user.php on line 96

I then tried replacing it in the last instance and it didn't work either. The code I'm using is

if ($banuser['usergroupid']==5 or $banuser['usergroupid']==6 ) {
echo "<p>You cannot ban Administrators or Moderators!</p>";
}

As we do not have regular and super moderators, I only have 5 and 6 listed.
Reply With Quote
  #6  
Old 08-29-2002, 04:03 PM
Glock Glock is offline
 
Join Date: Apr 2002
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am using 2.2.7 by the way, I believe I upgraded it correctly at least.
Reply With Quote
  #7  
Old 08-29-2002, 04:24 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you an Opera browser user? Then dont copy paste from here, try to type manually.. It shouldnt give you a parse error..
Reply With Quote
  #8  
Old 08-29-2002, 05:00 PM
Glock Glock is offline
 
Join Date: Apr 2002
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, IE 6.
Reply With Quote
  #9  
Old 08-29-2002, 06:31 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no error in my code and it's working, I tested out..

Make sure you apply it correctly..

Parse error can mean you are using an unappropriate tool to edit your file. Try notepad and try to type manually instead of copy/pasting.. The code is ok..
Reply With Quote
  #10  
Old 09-01-2002, 08:26 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You applied it correctly and it's working here too. I get no parse errors in your file.. (BTW.please remove the file from the thread, it's against rules to attach full vb file here). So I really dont know what your problem is, but may be it's you upload it incorrectly. Do you use ascii (not bin) to upload your file?
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:18 PM.


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.05053 seconds
  • Memory Usage 2,245KB
  • Queries Executed 13 (?)
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_postinfo_query
  • fetch_postinfo
  • 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