To check if a user is logged in in Magento is easy. The PHP condition below can help you find out:
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()): // do something endif; ?>