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)
-   -   [RELEASE v2.x.x] Moderators Being able to control Accessmasks via MODCP (https://vborg.vbsupport.ru/showthread.php?t=27724)

DarkReaper 09-23-2001 06:10 AM

Ok, it almost works now. Inheritence works, but they can edit it on forums they're should be able to.

Forum1
--forum2
----forum3

I have them as a moderator of forum1, but set it so they can't edit permissions for that. They can edit permissions for 2 and 3. It lets them edit permissions for both 1, 2, and 3...

Ashura 09-23-2001 06:22 AM

Oops my bad =)

Change this
PHP Code:

 if(( ismoderator($forum[forumid],"canmoderateposts") ||
$perms['ismoderator'] && $forum['allowmodaccess']) ||
$perms['cancontrolpanel']) 

To
PHP Code:

 if(( (ismoderator($forum[forumid],"canmoderateposts") ||
$perms['ismoderator']) && $forum['allowmodaccess']) ||
$perms['cancontrolpanel']) { 

Needed a set of ()'s around the stuff before the && and that should work for you :)

DarkReaper 09-23-2001 06:25 AM

Works just fine now :)

Would it be possible to have a hierarchial list of all the forums they can modify instead of having them enter the forum id?

Ashura 09-23-2001 06:35 AM

Gimme a few also going to make sure it doesn't allow things we don't want it to do either. =)

merk 09-23-2001 06:43 AM

You mean, get a list of forums for the second form i made?

that gives a list of all the people who have access masks listed?

Tweezy stuff there! :)

Something along the lines of>
PHP Code:

  function getchildren($parentid=-1)
  { global 
$DB_site$bbuserinfo;
  
  
$childquery "SELECT title,forumid,styleid,parentid ";
  
$childquery .= "FROM forum ";
  
$childquery .= "WHERE parentid=$parentid ";
  
$childquery .= "ORDER BY displayorder";
  
$childtemp=$DB_site->query($childquery);
    print(
"<ul>");
    while (
$children=$DB_site->fetch_array($childtemp)) {
        
        
$accesscheckquery="SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND forumid=$children[forumid]";
          
$accesstemp=$DB_site->query($accesscheckquery);
          while(
$accesscheck=$DB_site->fetch_array($accesstemp)) {
              
$modcheck[$accesscheck[forumid]]=$accesscheck;
          }
        if(
$modcheck[$children[forumid]][caneditstyles]>=1){ $colour="red"; } else { $colour="blue"; }
        
$canedit=$modcheck[$children[forumid]][caneditstyles];
        print(
"<li><font style=\"color:$colour\">$children[forumid]-$children[title]$children[parentid]--$canedit</font></li>");

        
getchildren($children[forumid]);
    }
      print(
"</ul>");
  } 

I wrote this, to get a list, and if they have caneditstyles=1, show it in red, else blue.

Just adapt the 'while' loop to check to see if they have moderator and the forum is caneditaccess=1

Shouldnt be too hard :)

Ashura 09-23-2001 08:39 AM

Update
- added some more checks just to make sure they have access (just like other mod panel functions do)
- added a check in edit so ONLY admin's can edit access of Super Mods and Admin's (just to be paranoid)
- Added 'forums' list if you hit list forums without a Forum ID

May need some more cleaning up but should work fine

Here is my current version of this file (Pretty sure we can post these as attachments).

Scott MacVicar 09-23-2001 08:40 AM

i released a working version under a different thread, and i sorted the inheritance to be more than one level.

http://vbulletin.com/forum/showthrea...threadid=28654

i also knew what i had done wrong in this version but its too much to fix XD

maverick1236 09-30-2001 04:14 AM

Parse error: parse error in c:\program files\nusphere\apache\htdocs\upload\mod\user.php on line 71

no idea
everything looks ok

??

mcncyo 10-08-2001 08:35 AM

When i try to update a user permssion i get a blank screen and it doesn't update. Does anyone know why this is happenning?

Ashura 10-08-2001 09:25 AM

For which version? Merk's or PPN's :)


All times are GMT. The time now is 03:24 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.01221 seconds
  • Memory Usage 1,755KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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