Revert "Revert "[#59718918] Restricted access to account profile page""

This reverts commit 71fe1b6dbff5af064cbabb6faa366e33381cf18a.
Cleaned up php files (removed extra comments)