From 35358b1b7b70ee1707f78e16cc908e1c8e2a7830 Mon Sep 17 00:00:00 2001 From: lwcorp Date: Tue, 5 Mar 2024 22:31:06 +0200 Subject: [PATCH 1/2] Update users.php Allowed to filter by confirmed and/or non blacklisted - and not just by unconfirmed and/or blacklisted --- public_html/lists/admin/users.php | 50 ++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/public_html/lists/admin/users.php b/public_html/lists/admin/users.php index d27dbe89e..6589c622b 100644 --- a/public_html/lists/admin/users.php +++ b/public_html/lists/admin/users.php @@ -45,6 +45,8 @@ } $unconfirmed = !empty($_GET['unconfirmed']) ? sprintf('%d', $_GET['unconfirmed']) : 0; $blacklisted = !empty($_GET['blacklisted']) ? sprintf('%d', $_GET['blacklisted']) : 0; +$confirmed = !empty($_GET['confirmed']) ? sprintf('%d', $_GET['confirmed']) : 0; +$nonblacklisted = !empty($_GET['nonblacklisted']) ? sprintf('%d', $_GET['nonblacklisted']) : 0; if (isset($_GET['sortorder'])) { if ($_GET['sortorder'] == 'asc') { $sortorder = 'asc'; @@ -147,10 +149,15 @@ $subselect = "{$tables['user']}.id = {$tables['listuser']}.userid and {$tables['listuser']}.listid = {$tables['list']}.id and {$tables['list']}.owner = ".$_SESSION['logindetails']['id']; if ($unconfirmed) { $subselect .= ' and !confirmed '; + } elseif ($confirmed) { + $subselect .= ' and confirmed '; } if ($blacklisted) { $subselect .= ' and blacklisted '; + } elseif ($nonblacklisted) { + $subselect .= ' and !blacklisted '; } + if ($find && $findbyselect) { $listquery = "select DISTINCT {$tables['user']}.email,{$tables['user']}.id,$findfield,confirmed from ".$table_list." where $subselect and $findbyselect"; $count = Sql_query("SELECT count(distinct {$tables['user']}.id) FROM ".$table_list." where $subselect and $findbyselect"); @@ -167,9 +174,13 @@ if ($find && $findbyselect) { if ($unconfirmed) { $findbyselect .= ' and !confirmed '; + } elseif ($confirmed) { + $findbyselect .= ' and confirmed '; } if ($blacklisted) { $findbyselect .= ' and blacklisted '; + } elseif ($nonblacklisted) { + $findbyselect .= ' and !blacklisted '; } $listquery = "select DISTINCT {$tables['user']}.email,{$tables['user']}.id,$findfield,{$tables['user']}.confirmed from ".$table_list." where $findbyselect"; $count = Sql_query('SELECT count(*) FROM '.$table_list." where $findbyselect"); @@ -195,21 +206,35 @@ if ($find && $findbyselect) { if ($unconfirmed) { $findbyselect .= ' and !confirmed '; + } elseif ($confirmed) { + $findbyselect .= ' and confirmed '; } if ($blacklisted) { $findbyselect .= ' and blacklisted '; + } elseif ($nonblacklisted) { + $findbyselect .= ' and !blacklisted '; } $listquery = "select {$tables['user']}.email,{$tables['user']}.id,$findfield,{$tables['user']}.confirmed from ".$table_list." where $findbyselect"; $count = Sql_query('SELECT count(*) FROM '.$table_list." where $findbyselect"); $unconfirmedcount = Sql_query('SELECT count(*) FROM '.$table_list." where !confirmed and $findbyselect"); } else { $subselect = ''; - if ($unconfirmed || $blacklisted) { + if ($unconfirmed || $blacklisted || $confirmed || $nonblacklisted) { $subselect = ' where '; if ($unconfirmed && $blacklisted) { $subselect .= ' !confirmed and blacklisted '; + } elseif ($confirmed && $nonblacklisted) { + $subselect .= ' confirmed and !blacklisted '; + } elseif ($unconfirmed && $nonblacklisted) { + $subselect .= ' !confirmed and !blacklisted '; + } elseif ($confirmed && $blacklisted) { + $subselect .= ' confirmed and blacklisted '; } elseif ($unconfirmed) { $subselect .= ' !confirmed '; + } elseif ($confirmed) { + $subselect .= ' confirmed '; + } elseif ($nonblacklisted) { + $subselect .= ' !blacklisted '; } else { $subselect .= ' blacklisted'; } @@ -280,6 +305,16 @@ } else { $bll = ''; } +if ($confirmed) { + $nonunc = 'checked="checked"'; +} else { + $nonunc = ''; +} +if ($nonblacklisted) { + $nonbll = 'checked="checked"'; +} else { + $nonbll = ''; +} if (!isset($start)) { $start = 0; } @@ -290,15 +325,22 @@ - - ', + + +
+ + ', $start, htmlspecialchars(stripslashes($find)), htmlspecialchars(stripslashes($findby)), $GLOBALS['I18N']->get('Show only unconfirmed users'), $unc, $GLOBALS['I18N']->get('Show only blacklisted users'), - $bll); + $bll, + $GLOBALS['I18N']->get('Show only confirmed users'), + $nonunc, + $GLOBALS['I18N']->get('Show only non blacklisted users'), + $nonbll); //print ''; $select = ''; foreach (array( From 871e8b4392af82ce967d2e580cf53531ccae183b Mon Sep 17 00:00:00 2001 From: lwcorp Date: Mon, 11 Mar 2024 02:04:10 +0200 Subject: [PATCH 2/2] Changed users to subscribers --- public_html/lists/admin/users.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public_html/lists/admin/users.php b/public_html/lists/admin/users.php index 6589c622b..635f53a39 100644 --- a/public_html/lists/admin/users.php +++ b/public_html/lists/admin/users.php @@ -333,13 +333,13 @@ $start, htmlspecialchars(stripslashes($find)), htmlspecialchars(stripslashes($findby)), - $GLOBALS['I18N']->get('Show only unconfirmed users'), + $GLOBALS['I18N']->get('Show only unconfirmed subscribers'), $unc, - $GLOBALS['I18N']->get('Show only blacklisted users'), + $GLOBALS['I18N']->get('Show only blacklisted subscribers'), $bll, - $GLOBALS['I18N']->get('Show only confirmed users'), + $GLOBALS['I18N']->get('Show only confirmed subscribers'), $nonunc, - $GLOBALS['I18N']->get('Show only non blacklisted users'), + $GLOBALS['I18N']->get('Show only non blacklisted subscribers'), $nonbll); //print ''; $select = '';