<?php 
class ControllerAffiliate extends Controller { 
		
	function index() {
		$customer =& $this->locator->get('customer'); 
		$response =& $this->locator->get('response');
		$url      =& $this->locator->get('url');
		$request  =& $this->locator->get('request');
		if ($customer->getId()) {
	  		$response->redirect($url->ssl('account'));
    	}else {
    		$token = $request->get('invite_code','get');
    		if($token){
    			setcookie('invite_code',$token);
    		}
    		$response->redirect($url->ssl('account_login&invite_code='.$token));
    	}
	}
}
?>