How to Force Visitors to Login On prestashop 1.5

How to force your visitors to login to your online shop, so they could see your entire online shop. I know there is an easy way by using a private shop module. But, this is just for those who like to try it on their shop.
how to force visitor to login on prestashop 1.5


1. Goto
classes\controller\FrontController.php

2. Find the function
public function init()

3. Paste the below mentioned code after
parent::init();



the code
if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password')
Tools::redirect('index.php?controller=authentication?back=my-account'); 


Please keep in mind that if you use this modification on your prestashop 1.5, any website that hot linking to your online store they would become useless / not working. So, you may want to double check for this.