Subversion Repositories SmartDukaan

Rev

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

Rev 15378 Rev 15606
Line 178... Line 178...
178
		    'result' => $result,
178
		    'result' => $result,
179
		    'callback' => $callback,
179
		    'callback' => $callback,
180
		    '_serialize' => array('result')
180
		    '_serialize' => array('result')
181
		));
181
		));
182
		$this->log(print_r($result,1),'registration');
182
		$this->log(print_r($result,1),'registration');
-
 
183
		$this->identifyUser($$data['user_id']);
183
		$this->render('/Elements/json');
184
		$this->render('/Elements/json');
184
	}
185
	}
185
 
186
 
-
 
187
	private function identifyUser($id) {
-
 
188
		$options = array('conditions'=>array('id'=>$id),'recursive'=>-1);
-
 
189
		$user = $this->User->find('first',$options);
-
 
190
		$pmaurl = Configure::read('pmaurl');
-
 
191
		if(!empty($user)) {
-
 
192
			$data = array('id'=>$user['User']['id'],'email'=>$user['User']['email'],'mobilenumber'=>$user['User']['mobilenumber'],'name'=>$user['User']['first_name'],'referral_code'=>$user['User']['referrer']);
-
 
193
			$this->post_request($pmaurl.'/identify',$data);	
-
 
194
		}
-
 
195
	}
-
 
196
 
186
	private function updateSaholicUser($userId,$email=null) {
197
	private function updateSaholicUser($userId,$email=null) {
187
		if(!$email){
198
		if(!$email){
188
			//Handle it properly
199
			//Handle it properly
189
			return;
200
			return;
190
		}
201
		}