Subversion Repositories SmartDukaan

Rev

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

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