If testuser signed in the day before the command was executed - i.e.
yesterday - he/she is well within the past 6 months and therefore
*shouldn't* be disabled.

Rhino

----- Original Message ----- 
From: "Allan P. Magmanlac" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Thursday, May 05, 2005 12:53 PM
Subject: radius account management using sql


> Hello,
>     We have  radius server and using mysql. I would like to determine
> who are the users
> who have not login to our dialup server for over six months and then
> disable the account
> In the example below, I'm just using > 10 days
>
> mysql> SELECT distinct
> username,framedipaddress,acctstarttime,acctstoptime from radacct where
> DATEDIFF(CURDATE(),acctstoptime) > 10 order by username;
>
+------------+-----------------+---------------------+---------------------+
> | username   | framedipaddress | acctstarttime       | acctstoptime
|
>
+------------+-----------------+---------------------+---------------------+
> | testuser   | 191.168.2.37  | 2005-04-11 14:56:40 | 2005-04-11 15:02:45 |
> | testuser   | 191.168.2.47  | 2005-04-24 15:23:18 | 2005-04-24 15:35:58 |
> | testuser   | 191.168.2.42  | 2005-04-19 18:38:51 | 2005-04-19 19:06:11 |
> | testuser  | 191.168.2.51  | 2005-04-14 16:57:14 | 2005-04-14 18:16:20 |
> | testuser   | 191.168.2.41  | 2005-04-25 16:22:30 | 2005-04-25 16:32:44 |
>
> The problem here is that  "testuser"  may have logged in the day before
> the command was executed. So my question is how to get the  users last
> login to the server and
> if it's more than 6 months disable the account.
>
> Thanks
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.11.5 - Release Date: 04/05/2005
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.5 - Release Date: 04/05/2005


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to