Subversion Repositories SmartDukaan

Rev

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

Rev 15414 Rev 15475
Line 293... Line 293...
293
	        		$this->log(print_r($exists,1),'activations');
293
	        		$this->log(print_r($exists,1),'activations');
294
	        		if(empty($exists)){
294
	        		if(empty($exists)){
295
	        			$result = array('success'=>false,'message'=>'Invalid referral code');
295
	        			$result = array('success'=>false,'message'=>'Invalid referral code');
296
	        			// unset($this->request->data['referrer']);
296
	        			// unset($this->request->data['referrer']);
297
	        			$updateRequired = false;
297
	        			$updateRequired = false;
298
	        		}
298
	        		}	        		
299
	        		$this->request->data['activated'] = 1;
-
 
300
	        		//Call user activation api
-
 
301
        			$this->markUserActivated($id);	        		
-
 
302
	        	}	        		
299
	        	}	        		
303
	        	if($updateRequired){
300
	        	if($updateRequired){
304
		            if ($this->User->save($this->request->data)) {
301
		            if ($this->User->save($this->request->data)) {
-
 
302
		            	if($this->request->data['activated'] == 1) {
-
 
303
		            		//Call user activation api
-
 
304
		        			$this->markUserActivated($id);
-
 
305
		            	}			        		
305
		                $result = array('success'=>true,'message'=>'Your profile has been saved');
306
		                $result = array('success'=>true,'message'=>'Your profile has been saved');
306
		            } else {
307
		            } else {
307
		                $result = array('success'=>false,'message'=> 'The user could not be saved. Please, try again.');
308
		                $result = array('success'=>false,'message'=> 'The user could not be saved. Please, try again.');
308
		            }
309
		            }
309
		        }
310
		        }