| Line 311... |
Line 311... |
| 311 |
$this->loadModel('UserAccount');
|
311 |
$this->loadModel('UserAccount');
|
| 312 |
$options = array('conditions'=>array('user_id'=>$id,'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'account_key');
|
312 |
$options = array('conditions'=>array('user_id'=>$id,'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'account_key');
|
| 313 |
$userAccount = $this->UserAccount->find('first',$options);
|
313 |
$userAccount = $this->UserAccount->find('first',$options);
|
| 314 |
$suserId = $userAccount['UserAccount']['account_key'];
|
314 |
$suserId = $userAccount['UserAccount']['account_key'];
|
| 315 |
$url = Configure::read('saholicapihost')."/register!activateRsa?userId=$suserId&activationCode=$referrer";
|
315 |
$url = Configure::read('saholicapihost')."/register!activateRsa?userId=$suserId&activationCode=$referrer";
|
| 316 |
$response = $this->make_request ( $url, null );
|
316 |
$response = $this->make_request ( $url, null )['response'];
|
| 317 |
$this->log(print_r($response,1),'mydetails');
|
317 |
$this->log(print_r($response,1),'mydetails');
|
| 318 |
if(!empty($response['map']['isError'])){
|
318 |
if($response['map']['isError']){
|
| 319 |
$result = array('success'=>false,'message'=> 'Technical error occurred, please try again after some time');
|
319 |
$result = array('success'=>false,'message'=> 'Technical error occurred, please try again after some time');
|
| 320 |
$updateRequired=false;
|
320 |
$updateRequired=false;
|
| 321 |
}
|
321 |
}
|
| - |
|
322 |
|
| 322 |
if(!empty($response['map']['result'])){
|
323 |
if($response['map']['result']){
|
| 323 |
$this->request->data['activated'] = 1;
|
324 |
$this->request->data['activated'] = 1;
|
| 324 |
} else {
|
325 |
} else {
|
| 325 |
$this->loadModel('ActivationCode');
|
326 |
$this->loadModel('ActivationCode');
|
| 326 |
$opt['conditions'] = array('code' => strtoupper($referrer) , 'status'=> 0 );
|
327 |
$opt['conditions'] = array('code' => strtoupper($referrer) , 'status'=> 0 );
|
| 327 |
$exists = $this->ActivationCode->find('first',$opt);
|
328 |
$exists = $this->ActivationCode->find('first',$opt);
|