| Line 258... |
Line 258... |
| 258 |
}
|
258 |
}
|
| 259 |
|
259 |
|
| 260 |
function getAutoLoginUrl($userId,$next) {
|
260 |
function getAutoLoginUrl($userId,$next) {
|
| 261 |
$this->loadModel('User');
|
261 |
$this->loadModel('User');
|
| 262 |
$this->User->Behaviors->attach('Containable');
|
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);
|
263 |
$options = array('contain'=>array('UserAccount'), 'conditions'=>array('User.id'=>$userId),'fields'=>array('username','email'),'recursive'=>-1);
|
| 264 |
$user = $this->User->find('first',$options);
|
264 |
$user = $this->User->find('first',$options);
|
| - |
|
265 |
$this->log("user_accounts ".print_r($user,1));
|
| 265 |
$data = array('email'=>$user['User']['email'],'Id'=>$user['UserAccount'][0]['account_key'],'isPrivateDealUser'=>1);
|
266 |
$data = array('email'=>$user['User']['email'],'Id'=>$user['UserAccount'][0]['account_key'],'cartId' => $user['UserAccount'][1]['account_key'],'isPrivateDealUser'=>1);
|
| 266 |
$data = '?data='.base64_encode(serialize($data));
|
267 |
$data = '?data='.base64_encode(serialize($data));
|
| 267 |
$token = '&token='.md5(Configure::read('saholicapikey').'|'.$user['UserAccount'][0]['account_key']);
|
268 |
$token = '&token='.md5(Configure::read('saholicapikey').'|'.$user['UserAccount'][0]['account_key']);
|
| 268 |
return Configure::read('saholicauthurl').$data.$token.$next;
|
269 |
return Configure::read('saholicauthurl').$data.$token.$next;
|
| 269 |
}
|
270 |
}
|
| 270 |
}
|
271 |
}
|