From a77e03c8a18df96075fac558110fe8ce3cca219e Mon Sep 17 00:00:00 2001 From: Christian Hagenest Date: Thu, 20 Jun 2024 17:30:35 +0200 Subject: [PATCH] WIP rm_accounts.py --- chatmaild/src/chatmaild/rm_accounts.py | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 chatmaild/src/chatmaild/rm_accounts.py diff --git a/chatmaild/src/chatmaild/rm_accounts.py b/chatmaild/src/chatmaild/rm_accounts.py new file mode 100644 index 00000000..3c5bbcf9 --- /dev/null +++ b/chatmaild/src/chatmaild/rm_accounts.py @@ -0,0 +1,53 @@ +import crypt +import json +import logging +import os +import sys +import time +import shutil +from pathlib import Path +from socketserver import ( + StreamRequestHandler, + ThreadingMixIn, + UnixStreamServer, +) + +from .config import Config, read_config +from .database import Database + + +def remove_users(db: Database, cutoff_date: int): + db.connect() + try: + delete_query = "DELETE FROM users WHERE last_login