| Line 143... |
Line 143... |
| 143 |
$this->log('email '.$email ,'registration');
|
143 |
$this->log('email '.$email ,'registration');
|
| 144 |
$this->loadModel('UserAccount');
|
144 |
$this->loadModel('UserAccount');
|
| 145 |
$options = array('conditions'=>array('user_id' => $userId,'account_type' => 'saholic'),'recursive'=>-1);
|
145 |
$options = array('conditions'=>array('user_id' => $userId,'account_type' => 'saholic'),'recursive'=>-1);
|
| 146 |
$exists = $this->UserAccount->find('count',$options);
|
146 |
$exists = $this->UserAccount->find('count',$options);
|
| 147 |
if(!$exists){
|
147 |
if(!$exists){
|
| 148 |
$url = $this->apihost."register?email=$email";
|
148 |
$url = $this->apihost."register?email=$email&from=profitmandi";
|
| 149 |
$response = $this->make_request($url,null);
|
149 |
$response = $this->make_request($url,null);
|
| 150 |
$this->log('response '.print_r($response,1),'registration');
|
150 |
$this->log('response '.print_r($response,1),'registration');
|
| 151 |
if(!empty($response)){
|
151 |
if(!empty($response)){
|
| - |
|
152 |
if($response['userId']<1)return;
|
| 152 |
$data = array('account_type'=>'saholic','user_id'=>$userId,'account_key'=>$response['userId']);
|
153 |
$data = array('account_type'=>'saholic','user_id'=>$userId,'account_key'=>$response['userId']);
|
| 153 |
$this->UserAccount->create();
|
154 |
$this->UserAccount->create();
|
| 154 |
$this->UserAccount->save($data);
|
155 |
$this->UserAccount->save($data);
|
| 155 |
$data = array('account_type'=>'cartId','user_id'=>$userId,'account_key'=>$response['cartId']);
|
156 |
$data = array('account_type'=>'cartId','user_id'=>$userId,'account_key'=>$response['cartId']);
|
| 156 |
$this->UserAccount->create();
|
157 |
$this->UserAccount->create();
|