vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Moderators able to ban more than usergroup members (https://vborg.vbsupport.ru/showthread.php?t=42888)

Glock 08-29-2002 07:01 AM

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.

Logician 08-29-2002 07:33 AM

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
}

Glock 08-29-2002 07:37 AM

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.

Logician 08-29-2002 11:10 AM

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>";
  } 


Glock 08-29-2002 04:00 PM

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.

Glock 08-29-2002 04:03 PM

I am using 2.2.7 by the way, I believe I upgraded it correctly at least.

Logician 08-29-2002 04:24 PM

Are you an Opera browser user? Then dont copy paste from here, try to type manually.. It shouldnt give you a parse error..

Glock 08-29-2002 05:00 PM

Nope, IE 6.

Logician 08-29-2002 06:31 PM

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..

Logician 09-01-2002 08:26 AM

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?


All times are GMT. The time now is 01:33 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.01085 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete