Add filt_login function and associated hooks