help to create script for added date to list users

hi my friends
im asking for the possibility to creat a script in ubuntu for added date to list users for doing this :

  • search in debug connected user of all connected users

  • if a new user is connect for the first time to my server
    the script record the date of the connection and added it to my list user
    where i have an other script to delet expired users

  • like this :
    user : test2 is in my user.cfg in this form =
    .....
    user:test1 passeword:test1
    user:test2 passeword:test2
    user:test3 passeword:test3
    .......

when this user is connect in the first time in this date = 12-05-2011

the script record this date and added it to the line user of the user test & become like this
.....
user:test1 passeword:test1 #11-04-2011
user:test2 passeword:test2 #12-05-2011
user:test3 passeword:test3
......

Perhaps you used a bad approach...
Consider giving here the script you wrote explaining where you are stuck or what you dont know how to do, then say "how can I solve this problem?". If you look at the forum you will see that more you give information and show what you are doing, more replies (and good ones...) you get. You don't expect others to do your work, no?