Easy temporary fix for you:
Code: Select all
[root@efa mailscanner]# diff -c lists.php.org lists.php
*** lists.php.org Wed Nov 22 01:27:25 2017
--- lists.php Wed Nov 22 01:28:18 2017
***************
*** 30,35 ****
--- 30,37 ----
html_start(__('wblists07'), 0, false, false);
+ if (isset($_GET['showall'])) { $showall=true; }
+
if (isset($_GET['type'])) {
$url_type = deepSanitizeInput($_GET['type'], 'url');
if (!validateInput($url_type, 'urltype')) {
***************
*** 302,309 ****
* @param string $list
* @return array
*/
! function build_table($sql, $list)
{
$sth = dbquery($sql);
$table_html = '';
$entries = $sth->num_rows;
--- 304,312 ----
* @param string $list
* @return array
*/
! function build_table($sql, $list, $showall=false)
{
+ if ($showall) {
$sth = dbquery($sql);
$table_html = '';
$entries = $sth->num_rows;
***************
*** 325,330 ****
--- 328,336 ----
} else {
$table_html = __('noentries07') . "\n";
}
+ } else {
+ $table_html = "Results hidden\n";
+ }
return array('html' => $table_html, 'entry_number' => $entries);
}
***************
*** 412,422 ****
$whitelist = build_table(
'SELECT id, from_address, to_address FROM whitelist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
! 'w'
);
$blacklist = build_table(
'SELECT id, from_address, to_address FROM blacklist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
! 'b'
);
echo '</table>
</form>
--- 418,430 ----
$whitelist = build_table(
'SELECT id, from_address, to_address FROM whitelist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
! 'w',
! $showall
);
$blacklist = build_table(
'SELECT id, from_address, to_address FROM blacklist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
! 'b',
! $showall
);
echo '</table>
</form>
tl;dr; hate reading diffs
0/ edit lists.php
1/ add this code after line 32
Code: Select all
if (isset($_GET['showall'])) { $showall=true; }
2/ change this line:
to this:
Code: Select all
function build_table($sql, $list, $showall=false)
3/ change this section from this:
Code: Select all
function build_table($sql, $list, $showall=false)
{
$sth = dbquery($sql);
to this:
Code: Select all
function build_table($sql, $list, $showall=false)
{
if ($showall) {
$sth = dbquery($sql);
4/ change this section from this:
Code: Select all
} else {
$table_html = __('noentries07') . "\n";
}
return array('html' => $table_html, 'entry_number' => $entries);
to this (yes, I was too lazy to change the indentation of the whole function):
Code: Select all
} else {
$table_html = __('noentries07') . "\n";
}
} else {
$table_html = "Results hidden\n";
}
return array('html' => $table_html, 'entry_number' => $entries);
5/ and finally change this:
Code: Select all
$whitelist = build_table(
'SELECT id, from_address, to_address FROM whitelist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
'w'
);
$blacklist = build_table(
'SELECT id, from_address, to_address FROM blacklist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
'b'
to this:
Code: Select all
$whitelist = build_table(
'SELECT id, from_address, to_address FROM whitelist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
'w',
$showall
);
$blacklist = build_table(
'SELECT id, from_address, to_address FROM blacklist WHERE ' . $_SESSION['global_list'] . ' ORDER BY from_address',
'b',
$showall
To make your list reappear, just add a ?showall to your url, so from this:
Code: Select all
https://<efa-server>/mailscanner/lists.php
to this:
Code: Select all
https://<efa-server>/mailscanner/lists.php?showall
Note that is is just a temporary hack that will disappear on the next efa update. However, it's a trivial fix to add back. Also, if anyone thinks this should be a feature for mailwatch, this is not the right way to do it. It should be something configurable in the settings and properly localized.