Login History with Deletion

sahostking

Verified User
Joined
Jan 29, 2021
Messages
113
Location
South Africa
Anyone have a script to delete accounts "Safely" from DA after outputting a list of customers that didint login after a certain amount of time:

find /usr/local/directadmin/data/users/*/login.hist -name "*" -ctime +60
 
Last edited:
Interesting. I don't have the answer but want to why you would want to do this. What is the logic behind this?
 
maybe some kind of free hosting with limited ressources to attract possible customers for higher plans later.
 
maybe some kind of free hosting with limited resources to attract possible customers for higher plans later.

I just don't understand the logic because somebody could be very active in updating their website and never login to DA after the initial setup. Why delete them?
 
good point, didnt thought at it. right, from this view it makes really no sense.
 
We are considering offering a sort of free hosting. But as you know it will attract alot of people that will signup and host nonsense on the servers or signup and not use it at all. we are thinking of offering something similar to infinityfree that attracts customers signs up and if they dont login in 60 days it terminates the account. They have to login once evry 30 or 60 days to kerp it active. We will have backups though to restore. We have over 50 dell servers we cant sell as they are R710s and R610s and not sure what to do with.
 
I just don't understand the logic because somebody could be very active in updating their website and never login to DA after the initial setup. Why delete them?
Why keep them if they not paying anything or using it. We want it mainly for brand awareness. But we trying to figure out details still as to how we will do it. Anyone have any recommendations are welcome.
 
Why keep them if they not paying anything or using it. We want it mainly for brand awareness. But we trying to figure out details still as to how we will do it. Anyone have any recommendations are welcome.

So far what you have said really has nothing to do with whether they login to DA or not.
 
ok let me try and explain my idea in steps. We are considering the following:

Customer signsup with us for free plan
DA account get created
Customer logs into DA and uses it or doesnt
Customer is required to login to DA once evey 30 days to keep it active.
If they dont login it deletes the account.

This is how infinityfree does it.
 
WHMCS but cant find plugin that does this.

Hello,

You might write your own then, you can use DirectAdmin API for it:

Code:
/api/users/{username}/login-history

for example:

Bash:
$ curl -X 'GET' \
  'https://server.domain.com:2222/api/users/zeiter/login-history' \
  -H 'accept: application/json'

A response example:

JSON:
[
  {
    "attempts": 1,
    "host": "55.74.78.123",
    "timestamp": "2024-04-22T10:59:01.597Z"
  }
]

It will be an empty reply, if the user never logged-in and if an user had a session you can compare the timestamp of the last session.
 
Back
Top