vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Mods edit access masks including child forums (https://vborg.vbsupport.ru/showthread.php?t=28654)

Scott MacVicar 09-21-2001 10:00 PM

There was another version around on the board but it had problems with moderators who had access to moderate a forum through inheritance, ie they were moderator of a category. This code is in no way based on the other version, but no doubt will be similar as there isn't really much of a difference you can make.

This is just really an alternative to letting mods ban people from the whole forum, they can simply ban from a single forum.

Once you have done what it says in the instructions when you add a moderator you will have permission to say if they can edit forum access masks for that particular forum. Remember if they are mod of a category and the edit acccess masks option is enabled then all the forums in this category moderated by the user through inheritance have the ability.

Supermods and Admins can edit all access masks via the mod control panel.

This has been tested on
vb 2.0.1, 2.0.2 and 2.0.3 they all work
also tested on
vb 2.2.0 and 2.2.1 these also work.

I had a small error in the permissions checking for the updateaccess which i just noticed and corrected, so if you have installed this before November 21st it may be advisable to update the /mod/user.php part which involves the updateaccess part.
Not that your mods would want to change access masks for forums they don't mod :)

Bitmap 11-02-2001 01:24 PM

hey ... this hack is great!
i think it works with 2.2.0 as well :) i just installed it.

Martyjp 11-03-2001 12:14 PM

Just installed it on 2.2.0 and it works great

There is a slight change in mod/index.php

Quote:

on line 145 below
<a href="user.php?s=<?php echo $session[sessionhash]; ?>&action=find"> View </a> |
add
<a href="user.php?s=<?php echo $session[sessionhash]; ?>&action=find"> Edit Acess Masks </a>
will be

Change
PHP Code:

makenavoption("View","user.php?action=find"); 

to
PHP Code:

makenavoption("View","user.php?action=find","|");
makenavoption("Edit Access Masks","user.php?action=find"); 


Scott MacVicar 11-03-2001 01:53 PM

Whoops i updated the top message and forgot to update the file.

Your right thats the only change from 2.0.x to 2.2.x

SharkY-GA 11-03-2001 07:07 PM

OMG!!! Thank you thank you thank you!! I love you!! :D

Scott MacVicar 11-03-2001 07:34 PM

i love me to :cool:

i'm glad its working for everyone on vb 2.0.x and 2.2.x.

SharkY-GA 11-03-2001 07:46 PM

My stupidity! Sorry! :P

mcncyo 11-07-2001 10:34 AM

I am getting this error
[QUOTE]
Database error in vBulletin Control Panel 2.2.0:


Invalid SQL: SELECT username FROM user WHERE userid=
mysql error: You have an error in your SQL syntax near '' at line 1


mysql error number: 1064


Date: Wednesday 07th of November 2001 06:26:21 AM
Script: http://www.christian-forum.com/admin...moderatorid=13
Referer: http://www.christian-forum.com/admin...?action=modify

Scott MacVicar 11-07-2001 03:06 PM

the edit moderator part of /admin/forum.php should look like this

PHP Code:

// ###################### Start edit moderator #######################
if ($action=="editmoderator") {

$moderator=$DB_site->query_first("SELECT forumid,userid,newpostemail,newthreademail,caneditposts,candeleteposts,canviewips,canmanagethreads,canopenclose,caneditthreads,caneditstyles,canbanusers,canviewprofile,canannounce,canmassmove,canmassprune,canmoderateposts,canmoderateattachments,caneditaccess FROM moderator WHERE moderatorid=$moderatorid"); 

you have an error with this part

Nam 11-08-2001 02:09 AM

Sorry for stupid question, I installed it, had no problem, but where is the access mask control panel for mod? I logged in as mod, but couldn't find where, and I did turn access list ON in the control panel option.

Scott MacVicar 11-08-2001 06:07 AM

did you add the new bit to /mod/index.php and upload?

it should be a new option that says [Edit Access Masks] in the menu, click it and it will prompt you to find a username.

Nam 11-08-2001 09:31 AM

got it now, thank you :).

Snake~eyes 11-12-2001 09:39 PM

I am having some problems with installing this hack. I can't get the link on the mod/index.php page to show.


Here's what I have

PHP Code:

// *************************************************
makenavoption("Add","announcement.php?action=add","|");
makenavoption("Edit","announcement.php?action=modify");
makenavselect("Announcements");
// *************************************************
makenavoption("New Posts","moderate.php?action=posts","<br>");
makenavoption("New Attachments","moderate.php?action=posts");
makenavselect("Moderation Lists");
// *************************************************
makenavoption("Ban","user.php?action=find","|");
makenavoption("View","user.php?action=find","|");
makenavoption("Edit Access Masks","user.php?action=find");
makenavselect("User Actions");
// *************************************************
makenavoption("Mass Move","thread.php?action=move","<br>");
makenavoption("Mass Prune","thread.php?action=prune");
makenavselect("Thread Control","<hr>");
// ************************************************* 


I don't think any of it is working right but is there somthing wrong wtih this?

Scott MacVicar 11-13-2001 11:16 AM

did you remember to upload the new /mod/index.php

the code that you have there is correct if not then its a problem with cache.

Snake~eyes 11-14-2001 06:15 PM

I figured that was the problem.. Tried today and it worked!

Awsome hack!

thx

Scott MacVicar 11-14-2001 07:23 PM

no problem

i also forgot to upload the /mod/index.php while doing it and spent 20 minutes perplexed :p

Nemesis77 11-20-2001 11:28 PM

Is there a way to set this hack to allow a Mod to edit the access mask of another mod. becasue right now it says Can't edit access masks of someone who is not a regular user or something like that. See there is a Ladies forum on the borad, ladies only, but males are allowed if the mod of the foums invites them. She want to invited some of the other Mods that are male but when she edites their access masks to give them access to the laddies only forum she get's that message.

Scott MacVicar 11-21-2001 03:15 PM

change

PHP Code:

  if ($edituser['usergroupid']!=or $ismod) { 

in /mod/user.php too

PHP Code:

  $editperms=getpermissions(0$userid);
  if (
$perms['cancontrolpanel']) { 

this should work :)

Nemesis77 11-21-2001 10:21 PM

Thanks. I'll give this a try later tonight.

ladyfyre 12-01-2001 05:05 PM

will this hack also allow mods of private forums to GRANT access through access masks for their forum????

Bitmap 12-01-2001 11:02 PM

Quote:

Originally posted by ladyfyre
will this hack also allow mods of private forums to GRANT access through access masks for their forum????
yes ... i think so :)

Snake~eyes 12-02-2001 01:03 AM

[QUOTE]Originally posted by ladyfyre
will this hack also allow mods of private forums to GRANT access through access masks for their forum????

Wayne2k1.com 12-19-2001 12:15 PM

Great hack, man!

Exactly what I was looking for.

Thanx.

Snake~eyes 01-09-2002 12:48 PM

I'm havin some problems and getting a dumb error,

help please...

Database error in vBulletin Mod Control Panel 2.2.1:

Invalid SQL: SELECT * FROM moderator WHERE userid=
info[userid] AND (canbanusers=1 OR canviewprofile=1 OR caneditaccess=1)
mysql error: You have an error in your SQL syntax near '[userid] AND (canbanusers=1 OR canviewprofile=1 OR caneditaccess=1)' at line 2

mysql error number: 1064


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm not trying to do anything and I guess this is from adding the moderator hack - that allows mods to edit access masks
i get that error in the email. It's when moderators try to add access


Why am i getting this erro all of a sudden? :(

Help is appreciated,

thx

Scott MacVicar 01-10-2002 09:29 AM

i have a feeling that

info[userid] should be $bbuserinfo[userid]

don't know where the $bbuser went

Martz 01-10-2002 10:06 AM

Great hack PPN - I'd love to see a usergroup version of this!

Scott MacVicar 01-10-2002 03:22 PM

i'll see what i can do for you, I don't think it should be too much bother though.

Martz 01-10-2002 04:29 PM

Well, instead of having a list of forums which they can grant access on, instead a list of usergroups that they can move the user into. (excluding moderators, admins, or even using a system that checks if the usergroup has a setting such as allowmodchange group checked.


1 optional thing for me would be not to let the user be moved into a different usergroup unless they are in the registered usergroup already. This would mean a moderator (with permission) has to release them from their current group back into registered.

Just a thought, I don't expect anyone to do any of this! The access list one is pretty smart, but usergroups are easier to keep track of imho.

Snake~eyes 01-10-2002 06:31 PM

ya lost me :confused:

Could ya give me some idiot proof instructions? :D

Scott MacVicar 01-10-2002 07:33 PM

open up mod/user.php look for

PHP Code:

SELECT FROM moderator WHERE userid=info[userid] AND (canbanusers=OR canviewprofile=OR caneditaccess=1

change to

PHP Code:

SELECT FROM moderator WHERE userid=$bbuserinfo[userid] AND (canbanusers=OR canviewprofile=OR caneditaccess=1

you've copied some of the text wrongly and missed out parts of the query.

Snake~eyes 01-10-2002 08:41 PM

Okay..

the wierd thing i was having the main problem with was that i never edited that file then all of a suddent it didn't work. that's why i asked, if you look a couple posts bafck i had it working.

thankyou - great support

also, i have a quesiton.

I don't know if this is your hack or the boards but here it goes.

I add moderators to boards and if i say add a moderator to board a he has acces to board b which is privated. It automatically gives it to him. Any ideas? and i don't want this.

What i'm saying is i add a mod to one board and he has access to evrything - i just want him to have access to his priv board that he moderates

thx

Scott MacVicar 01-10-2002 11:13 PM

does it simply show all of the forums when he goes to the page which lists access masks in the mod control panel?

--------------------------

other problem could be that you may have the access masks set for the private forum so that all moderators can see it.

Snake~eyes 01-11-2002 12:06 AM

no

what happens is they automatically have access - they can only change masks to their forums - but as soon as i make someone a mod they get all the permissions for the private forums.

[QUOTE]other problem could be that you may have the access masks set for the private forum so that all moderators can see it.

Snake~eyes 01-12-2002 06:03 PM

^^^^^^^^^^^^^^^^^^^^^
*bump*

Scott MacVicar 01-12-2002 08:23 PM

Admin Panel > Usergroups > Forum permissions

is where they are contained, there is nothing in the code which would allow mods to see private forums, unless they are a mod of that forum or category and they set it themselves for them to see it using this hack, that is the one issue.
I'm gonna have to find a solution to that, as one of my mods gave themselves permission to see the admin forum as they were a mod of the category they were in.

Snake~eyes 01-12-2002 10:55 PM

okay.. but i don't put my mods ina user group. they're all normal registered users. The way they become mods is

Modify forums -> add moderator

But i just don't get why when they become a moderator they get access toe vrey.. doesn't make sense

Martz 01-12-2002 11:01 PM

Quote:

Originally posted by dhogan444
no

what happens is they automatically have access - they can only change masks to their forums - but as soon as i make someone a mod they get all the permissions for the private forums.


how do i change that? ^^^^^^^

Your running into the same problems as I did :)

When you add a moderator, they automatically get shifted into the Moderators usergroup, and access masks are set for all private forums.

This is how my ### Start Insert ### in admin/forum.php looks
PHP Code:

     $mods=$DB_site->query("SELECT DISTINCT moderator.userid FROM moderator,user WHERE moderator.userid=user.userid AND user.usergroupid<>6 AND user.usergroupid<>5");
    if (
$DB_site->num_rows($mods)) {
      while (
$mod=$DB_site->fetch_array($mods)) {
        
$accessto[] = $mod['userid'];
      }
      while ( list(
$key,$userid)=each($accessto) ) {

// CODE EDIT BY MARTZ!!!
// Line was commented out to stop custom permissions for all moderators on the board being assigned
// when a new private forum is added.

       //  $DB_site->query("INSERT INTO access (userid,forumid,accessmask) VALUES ('$userid','$forumid',1)");
      
}
    }
  } 


It's messy I know, but it solves the problem. :)

HTH

Snake~eyes 01-13-2002 03:10 AM

can you tel me where to put this? lol

i'm no genius - hell, i'm a dumb idiot

Scott MacVicar 01-13-2002 09:17 AM

in /admin/forum.php

look for

$DB_site->query("INSERT INTO access (userid,forumid,accessmask) VALUES ('$userid','$forumid',1)");

put a double slash (//) or a hash (#) in front of it, these are the simpliest ways to comment it out.

Snake~eyes 01-13-2002 01:56 PM

sounds simple enough


All times are GMT. The time now is 04:52 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.01550 seconds
  • Memory Usage 1,846KB
  • 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
  • (9)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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