Do something when the user logs in

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
akb
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Aug 21, 2007 6:18 pm

Do something when the user logs in

Post by akb » Sun Sep 16, 2007 7:59 pm

Hi there,

I'd like to write a small plugin that gives the user some points every day he logs in. So I need to play around with events and it already almost works when using the onLoginUser() event. But there is one small problem with this: When onLoginUser() is triggered, the /plugins/user/joomla.php is already triggered and therefor the lastvisitDate is already updated. But I need to know the date of the last visit and not the already updated one. Any idea?

Regarding to this I also took a look at the onAuthentication() event, but I don't know how to use them. Could it be I could also do it using this event? But how? Do the authentication plugins have to be related to other authentication services than joomla itself, as the /plugins/authentication/joomla.php is already defined?

Hope there's someone who can help me with this.

Thanks in advance :-)

Arne

User avatar
matthewhayashida
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Sat Feb 10, 2007 8:26 pm
Location: Abbotsford, BC
Contact:

Re: Do something when the user logs in

Post by matthewhayashida » Tue Sep 18, 2007 12:43 am

MOD NOTE: Moving to Joombie Q/A
-Matt Hayashida

User avatar
edward_cox
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Aug 30, 2007 3:05 am

Re: Do something when the user logs in

Post by edward_cox » Sun Jan 20, 2008 11:55 pm

Hello Arne,

did you receive any responses to your query? I am looking to do something similar (recording logindate and logoutdate to a new table for each user id login) and am lost for examples or pointers.

In fact I can't event locate the code for mosMainFrame::login to see where Joomla actual identifies and stores lastvisitDate for the user.

Thanks!

Ed.


Post Reply