Subversion Repositories SmartDukaan

Rev

Rev 14432 | Rev 14509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14432 Rev 14441
Line 273... Line 273...
273
		$this->loadModel('User');
273
		$this->loadModel('User');
274
		$this->User->Behaviors->attach('Containable');
274
		$this->User->Behaviors->attach('Containable');
275
		$options = array('contain'=>array('UserAccount'), 'conditions'=>array('User.id'=>$userId),'fields'=>array('username','email'),'recursive'=>-1);
275
		$options = array('contain'=>array('UserAccount'), 'conditions'=>array('User.id'=>$userId),'fields'=>array('username','email'),'recursive'=>-1);
276
		$user = $this->User->find('first',$options);
276
		$user = $this->User->find('first',$options);
277
		$this->log("user_accounts ".print_r($user,1));
277
		$this->log("user_accounts ".print_r($user,1));
278
		$data = array('email'=>$user['User']['email'],'Id'=>$user['UserAccount'][0]['account_key'],'cartId' => $user['UserAccount'][1]['account_key'],'isPrivateDealUser'=>1);
278
		$data = array('email'=>$user['User']['email'],'Id'=>$user['UserAccount'][0]['account_key'],'cartId' => $user['UserAccount'][1]['account_key'],'isPrivateDealUser'=>1,'next'=>$next);
279
		$data = '?data='.base64_encode(serialize($data));
279
		$data = '?data='.base64_encode(serialize($data));
280
		$token = '&token='.md5(Configure::read('saholicapikey').'|'.$user['UserAccount'][0]['account_key']);		
280
		$token = '&token='.md5(Configure::read('saholicapikey').'|'.$user['UserAccount'][0]['account_key']);		
281
		return Configure::read('saholicauthurl').$data.$token.$next;
281
		return Configure::read('saholicauthurl').$data.$token;
282
	}
282
	}
283
}
283
}