aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2023-01-13 21:01:52 +0100
committerKeith Whyte <keith@rhizomatica.org>2023-11-23 01:39:36 +0000
commit59f823037bd3939329ed71e098d3bf2a793299bd (patch)
tree8a511a1a873cf4d6f7ef9e50054b96b245d3ce99
parent08b6fe7e80af5144e74487fbf8991753ca255efc (diff)
Add a time limit to show subscribers last-seen
There was a comment in gerrit I7f0573381a6d0d13841ac6d42d50f0e8389decf4 mentioning concern that the show subscriber commands I added had no limits I see now my mistake. Change-Id: I170e1025d534881281379efee0f5f8f51b88fc06
-rw-r--r--src/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index c2b4abe..3d46533 100644
--- a/src/db.c
+++ b/src/db.c
@@ -53,7 +53,7 @@
static const char *stmt_sql[] = {
[DB_STMT_SEL_ALL] = "SELECT " SEL_COLUMNS " FROM subscriber;",
[DB_STMT_SEL_ALL_ORDER_LAST_SEEN] = "SELECT " SEL_COLUMNS " FROM subscriber "
- "WHERE last_lu_seen IS NOT NULL ORDER BY last_lu_seen;",
+ "WHERE last_lu_seen IS NOT NULL AND last_lu_seen > datetime('now','-1 month') ORDER BY last_lu_seen;",
[DB_STMT_SEL_FILTER_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn LIKE $search ORDER BY msisdn",
[DB_STMT_SEL_FILTER_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi LIKE $search ORDER BY imsi",
[DB_STMT_SEL_FILTER_IMEI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imei LIKE $search ORDER BY imei",