Query tickets login?

Hi, can someone help me to write a query for
users/super users:

select all of modified tickets since last login

Thanks, Zhiming.

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around


I don’t thinks that’s easly possible, cause RT doesn’t keep a “Last Time
Login” record… (does it?)
The sessions are stored in the database, so a customized
component/module could do this… but it doesn’t seem to exist (I didn’t
find anything with a quick search in the wiki)

Gilmar Santos Jr.

Zhiming Liu escreveu:

There is nothing within the RT code that allow for this …
I have a similar requirement, which I will be starting to work on in the
next couple of weeks … if you wish we can exchange ideas …
What I had in mind is :
Create new table UserLogins (3->4 fields --keeping it small
…(id,UserId, LoginTime,Logoff time)
create appropriate classes using factory
grab user login(session starting ) from web.pm and populate the table
with id,UserId, LoginTime
I am still investigating how to trap the session end … anyone any ideas
?? but once its known you can update that row with logoff time

Zhiming Liu wrote:

Roy El-Hames escreveu:

I am still investigating how to trap the session end … anyone any
ideas ?? but once its known you can update that row with logoff time

Things would be much easier if users clicked logout button… but someone
can just close the browser. I think there’s a maximum idle time
permitted to the session, after that if a connection attempt is made
then user needs to login again.
The problem is that RT is activated by the webserver, so to detect the
end of sessions there must be a stand alone tool running periodically…
There exists a tool to “purge old sessions” in the wiki. Some few
changes to it could insert a logout row in the table…
The stand alone tool with a change in the execution flow of the logout
proccess can achieve what you want :wink:

Gilmar Santos Jr


I guess the easiest way to get the logoff time is to map the session to
your User Login id. Afterwards you can always overwrite the logoff time
with the current time when the session is verified - thus you have the
time of the last request as the logoff time.


Roy El-Hames wrote:

Its better you mail the list than just me … someone else maybe able to
help quicker …
Regard your query, I think it does not work because there is nothing
related to anything happening …(a change in the transaction table) …
I think you should be looking at
http://wiki.bestpractical.com/index.cgi?EditCustomFieldsOnUpdate or
similar …

Zhiming Liu wrote: