Version: , by Admin (Coder)
Developer Last Online: Nov 2024
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!
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("","");
// ###################### 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.
In case others also didn't get it, this doesn't search by usergroups and permissions.
*sound of disappointment*
It searches for users that were given special access to this forum or another.
Just go here http://www.forums.com/admin/user.php...ccess&userid=1 and see what I mean.
Originally posted by FireFly In case others also didn't get it, this doesn't search by usergroups and permissions.
*sound of disappointment*
It searches for users that were given special access to this forum or another.
Just go here http://www.forums.com/admin/user.php...ccess&userid=1 and see what I mean.
Hi FireFly. First of all, thanks for this great hack (not crack!!!), which works perfectly on 2.2.1.... I installed it a long ago, and I asked about even a long ago...
Hwr. I'm keepin'it up 'cause I need some enhancement:
I know (guess...) it would be VERY VERY difficult to check all the concurrent permissions at usergroup lever along with the access table ones, but I was thinking about....
Well, how do you figure out a select (with UNION, I think) to search for all the groups (and the users within, of course...);
I mean search the chosen forum in forumpermission, find out the usergroupid, then all the users...
It should be simple enough, less - at least to me - the UNION SELECT clause removing dupes... ...
Could you investigate and give me (us) any tip to follow this path ?
Main problem lasting I think should be the forum categories: inheritance - even in your hack - is not checked... Infact, if I choose a forum category and in the access table I haven't that forumid, my search is empty! ....