if( !Mage::getSingleton( 'customer/session' )->isLoggedIn() ){ $session = Mage::getSingleton('customer/session'); $beforAutoUrl = Mage::getBaseUrl('web').$_SERVER['REQUEST_URI']; $session->setBeforeAuthUrl($beforAutoUrl); Mage::app()->getResponse()->setRedirect(Mage::getUrl("customer/account/login")); }else{ echo "Operation Will Perform"; }