Is there any way to call a plugin function on basically every single moodle page? The after_config only seems to work in the admin, or in a weird way that $USER->id returns 0 even when a user logged in (it could be due to a cron event calling that). Something that's called regardless of the subfolder (/course, /my, admin, /, etc). WP has `init` or `plugins_loaded` for example which does what I am describing here.
If that's not possible, then is there a hook to listen for a successful login form submission, and another hook for the log out action?