Hello,
I have many years of experience in Moodle withing my 14 years of experience in elearning systems.
I can do this for you, this will show course details whether or not the user is logged in, but will only show the enrollment for the user if he/she is logged in.
Please discuss this with me, or just provide me with your access details and award to me to do this for you.
Best regards,