From: Jean-Marc Pigeon Date: Tue, 25 Nov 2025 12:28:14 +0000 (-0500) Subject: Simpler sql request X-Git-Tag: tag-0.19~44 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=8cd58c674386dfa4003b697aaa645021cd6178a8;p=jmp%2Fmailleur Simpler sql request --- diff --git a/www/lvlmai.php b/www/lvlmai.php index a9db15e..e110a7f 100644 --- a/www/lvlmai.php +++ b/www/lvlmai.php @@ -105,8 +105,8 @@ if (isset($_POST['offset'])) $rqst=NEW probe("actions",$limit,$offset); if (isset($_POST['username'])) { $username=trim(($_POST['username'])); - $rqst->where("smtpfrom","like","%$username%"); -} + $rqst->where("smtpfrom like '%$username%'"); + } $numrec=$rqst->getnumrec(); if (isset($_POST['scanner'])) { $scanner=$_POST['scanner']; @@ -133,7 +133,6 @@ $actions=$rqst->order("smtpfrom asc") $line=""; $count=$offset; foreach($actions as $action) { - rou_alert(0,"JMPDBG count=$count"); $info=substr($action['info'],3,1); $status=$action['status']; $subject=htmlspecialchars($action['subject'],ENT_QUOTES); @@ -176,7 +175,9 @@ foreach($actions as $action) { $line=$line.""; //end of generation $count++; -} + } +$rqst->close(); + $start=starthtml(NULL); $stop=endhtml(); $top=topper($isadmin,$logname,"$myfilename"); diff --git a/www/lvlrmt.php b/www/lvlrmt.php index e9f5b2e..087e551 100644 --- a/www/lvlrmt.php +++ b/www/lvlrmt.php @@ -96,8 +96,8 @@ if (isset($_POST['offset'])) $rqst=NEW probe("remotes",$limit,$offset); if (isset($_POST['remoteip'])) { $remoteip=trim(($_POST['remoteip'])); - $rqst->where("remoteip","like","%$remoteip%"); -} + $rqst->where("remoteip like '%$remoteip%'"); + } $numrec=$rqst->getnumrec(); if (isset($_POST['scanner'])) { $scanner=$_POST['scanner']; @@ -143,6 +143,7 @@ foreach($remotes as $remote) { $line=$line."$credit\r\n"; $line=$line.""; } +$rqst->close(); $start=starthtml("directives"); $stop=endhtml(); diff --git a/www/lvlusr.php b/www/lvlusr.php index 7028f25..69fe20f 100644 --- a/www/lvlusr.php +++ b/www/lvlusr.php @@ -97,7 +97,7 @@ $rqst=NEW probe("emails",$limit,$offset); if (isset($_POST['username'])) { $username=trim(($_POST['username'])); $rqst->where("email like '%$username%'"); -} + } $numrec=$rqst->getnumrec(); if (isset($_POST['scanner'])) { $scanner=$_POST['scanner'];