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.
Sorry to ask this question, how come my registered members still can access to the forum topic that i do not want them to access? I already try a lot of unchecked in the CP and double check the script. Kindly advise me.