I do not want the login details to be displayed on the top right corner when a user logs in. This is when the user opens the moodle site from a external link. However when he/she logs in directly it must be shown.
I suspect you are talking a hack here, which is likely not a good idea.
When you say "external link" you mean somewhere like home or an internet cafe or halfway around the world and "directly" means on site? You will have to capture the server name and if it is not the same as your internal server name, then hide the details. Programmatically, not that difficult, I suspect, but where to put it in code... mmmmmmmmmmmm Good luck finding the right place if you don't know where to look. I am pretty sure this is just not going to work if placed in the Additional HTML dialog box..... You might ask for some assistance in the General Developer's Forum, that might yield a more positive result.
External link means coming form another site
Internal means directly loging into site
Will aso ost on developers forum