In your magento module, you can use this code to check if current user is logged in
Code:
if (Mage::app()->isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
echo Mage::getSingleton('customer/session')->getCustomer()->getName();
}
And get current user information
Code:
$customer_data = Mage::getSingleton('customer/session')->getCustomer();
echo "<pre>" print_r($customer_data);
Then what you need is if user is not logged in you redirect to login URL. Your code will not check if the URL is login URL or register URL.
Bookmarks