General developer forum

How to programatically do something after a user login?

 
Picture of wz z
How to programatically do something after a user login?
 

I want to get the username after a user login ( the first time login is better), then post the username to an external http service to get some data, then write the fetched data to a local moodle database table. How to make it? I read the official documentation here, but no explicit guide.

 
Average of ratings: -
Picture of Conn Warwicker
Re: How to programatically do something after a user login?
Core developersParticularly helpful MoodlersPlugin developers

Make a local plugin and create a function to run on the user_loggedin event.

 
Average of ratings: -
Picture of wz z
Re: How to programatically do something after a user login?
 

Thank you for your tip! I will read the relevant doc.

 
Average of ratings: -