Force Users To Upload A Profile Image On Log In

Gooday All.

I bought a Yii 2.0 created dating script that is unfortunately no longer supported. The scripts works fine but, it does not ask for a profile image during registration and only during log in a modal-dialog pops up which you can by-pass by clicking anywhere on the screen.

I have been trying to find ways to either block the by-pass or insert a piece of code somewhere to force the user to upload their profile image and failure to doing so, they can not access the site.

Any ideas how one can achieve this or, are there any particular files i need to edit?

Screen Shot 2023-08-11 at 08.52.08

Before action, check if user have set profile image, if not redirect them to URL where they do set it up. That will prevent them from dodging it!

see yii2 - Execute my code before any action of any controller - Stack Overflow

Thank you Sir, i will try this and see if i get it to work. It is the closest i have come thus far and will be super happy if this works out.


You are welcome. If you do it correctly, it should work just fine!