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
  #2  
Old 09-17-2001, 07:47 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you keep this up firefly, and vb is going to throw you into the staff lineup. If one didnt know better, a person would swear that you and tubedog are having a hack release contest...

Keep up the good work!
Reply With Quote
  #3  
Old 09-17-2001, 08:25 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by ToraTora!
you keep this up firefly, and vb is going to throw you into the staff lineup. If one didnt know better, a person would swear that you and tubedog are having a hack release contest...

Keep up the good work!
Reply With Quote
  #4  
Old 09-17-2001, 09:06 AM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I look forward to adding this You're a hacking machine!
Reply With Quote
  #5  
Old 09-17-2001, 11:52 AM
orca's Avatar
orca orca is offline
 
Join Date: Oct 2001
Location: Switzerland
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Had the following mySQL-error:
Code:
Database error in vBulletin Control Panel: Invalid SQL: SELECT userid,username,usergroupid,password,email,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,posts FROM user WHERE userid IN ()
mysql error: You have an error in your SQL syntax near ')' at line 1
mysql error number: 1064
Date: Monday 17th of September 2001 08:45:51 AM
Script: /admin/user.php
Referer: http://forum.arachid.org/admin/user....ion=findaccess
It seems there's a missing line in the form because the variable $inquery is empty (I guess it should be between the ()...
Reply With Quote
  #6  
Old 09-17-2001, 11:54 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ooops, if there are no results I should bring you back to the search screen.
I'll fix it in a mo.
Reply With Quote
  #7  
Old 09-17-2001, 11:59 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed.
If no users are found an appropriate line appears and you are brought back to main search screen.
Reply With Quote
  #8  
Old 09-17-2001, 12:00 PM
orca's Avatar
orca orca is offline
 
Join Date: Oct 2001
Location: Switzerland
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It fails even if there should be search results. I checked it on a forum where everyone has access and it gets me that error. Actually, the members should be listed there.
Other question: If the forum's set that only admins and mods can post and reply but users can only read it, will that be included in the search?
Reply With Quote
  #9  
Old 09-17-2001, 12:02 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You missed something:
This searches by access masks, not by regular forum/usergroup permissions.

So only users that you specifically selected Yes for them will appear.

See this thread for more info:
http://www.vbulletin.com/forum/showt...threadid=27668
Reply With Quote
  #10  
Old 09-17-2001, 12:04 PM
orca's Avatar
orca orca is offline
 
Join Date: Oct 2001
Location: Switzerland
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, ok, now after the bug fix I see somehow how it's working...
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 04:01 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.06357 seconds
  • Memory Usage 2,334KB
  • Queries Executed 23 (?)
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)bbcode_code
  • (4)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)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_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