What version of Moodle are you running? From 1.9.4+ you can select 'My courses' from the Hide User Fields
option setting via Administration ► Users ► Permissions ► User policies
which will prevent those without the 'viewhiddenuserdetails' permission
from viewing these options.
If you're not using this or a later version let me know as we had a previous hack that did the job.
I hope this helps