User login tech question

Hi

I would like to try integrating this into the custom cms system we have here. The custom work is as yet not finnished, and the gallery that was started by the previous person is a real mess.

The system has a login already that gives them access to various functions within the site, what I need to do is have your gallery detect if a user is already logged in, if so, allow them the normal user access to the gallery, if not logged in, either prompt them to log in or simply display only public images and gallerys with no access to any gallery admin functions.

Can you offer me any guidance on achieving this.

Thanks