Automatic sliding doors

Can you please help me with this one? I need to write a program for automatic sliding doors, like those in the stores. So, we have 2 sensors, 2 limit switches and the servo motor.
Please, I need help:)

Have you got any of those components working on their own?

How do you plan to have the servo open the door?

Well, that is project i need for school, i won't use it in real life. Sorry i didn't mention that.

benjak:
Please, I need help:)

What do you have so far?