Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 09-16-2001 Last Update: Never Installs: 78
 
No support by the author.

This was requested by David Copeland.
He wanted to be able to list all users that have or don't have access to a certain forum.
This is very very easy to install, you just need to add one block of code and a link!

Demo:
http://www.vbulletin.com/forum/attac...&postid=172632

Install:
In user.php (admin folder), add this code:
PHP Code:
  echo "<li><a href=\"user.php?s=$session[sessionhash]&action=findaccess\">List by access masks</a></li>\n"
right after
PHP Code:
  echo "<li><a href=\"user.php?s=$session[sessionhash]&action=find\">List all users</a></li>\n"
Still in user.php, add this code:
PHP Code:
// ###################### Start Find by Access #######################
if ($action=="dofindaccess") {

  if (
$checkaccess!="1" and $checkaccess!="0") {
    
$action "findaccess";
  } else {
    
$lists $DB_site->query("SELECT * FROM access");
    
$inquery "";

    while (
$list $DB_site->fetch_array($lists)) {
      if (
$list[forumid]==$forumfrom and $list[accessmask]==$checkaccess) {
        if (
$inquery) {
          
$inquery .= ",";
        }
        
$inquery .= "$list[userid]";
      }
    }

    if (
$inquery=="") {
      echo 
"No users found.";
      
$action "findaccess";
    } else {
      
$users $DB_site->query("SELECT userid,username,usergroupid,password,email,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,posts FROM user WHERE userid IN ($inquery)");

      echo 
"<p>Click username to view forum profile.</p>";
      
doformheader("","");

      echo 
"<tr class='tblhead'>";

      echo 
"<td><p><b><span class='tblhead'>Name</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Options</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Email</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Password</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Join Date</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Last Visit</span></b></p></td>";
      echo 
"<td><p><b><span class='tblhead'>Posts</span></b></p></td>";

      echo 
"</tr>\n";

      while (
$user=$DB_site->fetch_array($users)) {

        echo 
"<tr class='".getrowbg()."'>";

        echo 
"<td><p><a href='../member.php?s=$session[sessionhash]&action=getinfo&userid=$user[userid]' target='_blank'>$user[username]</a>&nbsp;</p></td>";
        echo 
"<td><p>".
              
makelinkcode("edit","user.php?s=$session[sessionhash]&action=edit&userid=$user[userid]").
              
makelinkcode("email password","user.php?s=$session[sessionhash]&action=emailpassword&email=$user[email]").
              
makelinkcode("remove","user.php?s=$session[sessionhash]&action=remove&userid=$user[userid]").
              
makelinkcode("edit access masks","user.php?s=$session[sessionhash]&action=editaccess&userid=$user[userid]").
              
"</p></td>";
        echo 
"<td><p><a href='mailto:$user[email]'>$user[email]</a>&nbsp;</p></td>";
        echo 
"<td><p>$user[password]&nbsp;</p></td>";
        echo 
"<td><p>$user[joindate]</p></td>";
        echo 
"<td><p>$user[lastvisit]</p></td>";
        echo 
"<td><p>$user[posts]</p></td>";

        echo 
"</tr>\n";

      }
      echo 
"</table></td></tr></table></form>";
    }
  }

}

// ###################### Start List by Access #######################

if ($action=="findaccess") {

  
doformheader("user","dofindaccess");

  
maketableheader("List Users by Access Masks","",0);
  echo 
"<tr class='firstalt'><td colspan=2><p>Here you can list all users that match the settings you set below.</p></td></tr>\n";

  
maketableheader("Forum Select");

  
makeforumchoosercode("Forum you'd like to order by:",forumfrom);
  
makeyesnocode("Does the user has access to that forum?",checkaccess,"2");
  echo 
"</p></td></tr>\n";

  
doformfooter("List users");

right before
PHP Code:
cpfooter();
?> 
The end.
See, I told you it's easy!
Now you have a link for this under Users => Find => List by access masks (under List all users).

By the way, I know that one part of the code there could be combined with the other search part, but this is just as good.
Sue me.
Feedback please.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-05-2002, 10:51 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot, even for such a fast answer!
Anyway...


I can't manage to use 'UNION' on two simple select ... Even returning the 'userid' alone....

ERRATA CORRIGE: ooops. The UNION [ALL] SQL command requires +4.x version of MySQL...
I think the hack should merge itself the different result sets within php code and not sql-query...

Bye
Reply With Quote
  #23  
Old 01-12-2002, 03:26 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks this hack works great! And it makes it MUCH more convenient when trying to find out who all has access to certain forums.

As previously stated, it seems that it doesn't list users that have access to certain forums because they are allowed entry because of the user group they are in. Unless it is actually selected in the persons access masks, it doesn't list them as having access to that forum.

But this is better than nothing.

Thanks.
Reply With Quote
  #24  
Old 01-20-2002, 10:17 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
I'll see what I can come up with Jawelin, but I can't promise anything.
I know what you said, but just for reminder... :supwink:

Meanwhile I tried myself but can't manage to merge different result sets within php code, as my server has mySQL 3.2x and not +4...
Anyway is very hard to findout an algorithm to select and make explicit permissions with inherited ones...
:noid:

Thnx
Reply With Quote
  #25  
Old 01-20-2002, 02:53 PM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MY question:

why isnt firefly on vbb staff? damn man u can do ANYTHING and what u do with ur skillz is awesome

:up: :up:
Reply With Quote
  #26  
Old 01-27-2002, 12:55 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Shenlong
MY question:

why isnt firefly on vbb staff? damn man u can do ANYTHING and what u do with ur skillz is awesome
:up: :up:
Above all, if he isn't an official vb developer, they should listen to him when upgrading to a newer release... :greedy:
leased:

P.S.: it's a bump, did you realize that ?
Reply With Quote
  #27  
Old 02-02-2002, 06:19 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok....i am VERY sorry to be such a brat...but I have a BIG request here......

Any way I could talk you into adding a link in this hack that would reset a user's "custom status'" to usergroup defaults for ALL forums?? I have over 300 at present...and doing it by hand if a mod gets demoted gets REALLY old.
Reply With Quote
  #28  
Old 02-05-2002, 04:33 AM
Recluse's Avatar
Recluse Recluse is offline
 
Join Date: Feb 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works fine on my forums, thanks
Reply With Quote
  #29  
Old 02-05-2002, 08:16 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a tip:
what about
1) choose a forum from a combo-list (best ordered the same way in jump-combo is, not alphabetically), fixing a parameter, this way.
2) seek all the user table checking :
PHP Code:
                 $permissions=getpermissions($forum[forumid],$userid);
                 if (
$permissions['canview'] == 1/) {
                   
// add this user to the enabled/disabled list
                 

The complexity should be linear than the usercount, and this way the search should keep the inheritance, the access table, the usergroup permission, etc.

???

Thanks, FF.
Reply With Quote
  #30  
Old 02-22-2002, 04:58 AM
KISS's Avatar
KISS KISS is offline
 
Join Date: Jan 2002
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The man, much needed installed great too.
Reply With Quote
  #31  
Old 02-25-2002, 09:38 AM
over over is offline
 
Join Date: Nov 2001
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

niec hack cheers makes my life easier
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 09:31 AM.


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.04817 seconds
  • Memory Usage 2,348KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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