Subversion Repositories SmartDukaan

Rev

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

Rev 14098 Rev 14150
Line 254... Line 254...
254
		    'result' => $result,
254
		    'result' => $result,
255
		    '_serialize' => array('result')
255
		    '_serialize' => array('result')
256
		));
256
		));
257
		$this->render('/Elements/json');
257
		$this->render('/Elements/json');
258
	}
258
	}
-
 
259
 
-
 
260
	function getAutoLoginUrl($userId,$next) {
-
 
261
		$this->loadModel('User');
-
 
262
		$this->User->Behaviors->attach('Containable');
-
 
263
		$options = array('contain'=>array('UserAccount'=>array('conditions'=>array('account_type'=>'saholic'))), 'conditions'=>array('User.id'=>$userId),'fields'=>array('username','email'),'recursive'=>-1);
-
 
264
		$user = $this->User->find('first',$options);
-
 
265
		$data = array('email'=>$user['User']['email'],'Id'=>$user['UserAccount'][0]['account_key'],'isPrivateDealUser'=>1);
-
 
266
		$data = '?data='.base64_encode(serialize($data));
-
 
267
		$token = '&token='.md5(Configure::read('saholicapikey').'|'.$user['UserAccount'][0]['account_key']);		
-
 
268
		return Configure::read('saholicauthurl').$data.$token.$next;
-
 
269
	}
259
}
270
}