Subversion Repositories SmartDukaan

Rev

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

Rev 15651 Rev 15767
Line 145... Line 145...
145
        $this->log("CheckToken : $checkToken",'headers');
145
        $this->log("CheckToken : $checkToken",'headers');
146
        if(isset($checkToken) && !empty($checkToken) && isset($token) && !empty($token)) {
146
        if(isset($checkToken) && !empty($checkToken) && isset($token) && !empty($token)) {
147
                $this->loadModel('SocialProfile');
147
                $this->loadModel('SocialProfile');
148
                $options = array('conditions'=>array('access_token'=>$token),'fields'=>array('user_id'),'recursive'=>-1);
148
                $options = array('conditions'=>array('access_token'=>$token),'fields'=>array('user_id'),'recursive'=>-1);
149
                $user = $this->SocialProfile->find('first',$options);
149
                $user = $this->SocialProfile->find('first',$options);
150
                $this->log(print_r($user['SocialProfile'],1),'headers');
150
                $this->log($userId." ".print_r($user['SocialProfile'],1),'headers');
151
                /*if(!$userId){
151
                /*if(!$userId){
152
                	$userId = $this->request->query('user_id');
152
                	$userId = $this->request->query('user_id');
153
                }*/                
153
                }                */
154
                if(isset($userId) && !empty($userId)){
154
                if(isset($userId) && !empty($userId)){
155
                    if($userId == $user['SocialProfile']['user_id']){
155
                    if($userId == $user['SocialProfile']['user_id']){
156
                    	$this->log("User authenticated",'headers');
156
                    	$this->log("User authenticated",'headers');
157
                        return 1;//success
157
                        return 1;//success
158
                    } else{
158
                    } else{
Line 165... Line 165...
165
                	$this->log("Id not sent hence user not authenticated",'headers');
165
                	$this->log("Id not sent hence user not authenticated",'headers');
166
                	return 0;//fail
166
                	return 0;//fail
167
                }
167
                }
168
        } else {    
168
        } else {    
169
        	$this->log("Old User hence pass",'headers');            
169
        	$this->log("Old User hence pass",'headers');            
170
            return -1;//token not set in cookie
170
            return 1;//token not set in cookie
171
        }
171
        }
172
    }
172
    }
173
 
173
 
174
    function getallheaders() { 
174
    function getallheaders() { 
175
	   $headers = ''; 
175
	   $headers = ''; 
Line 561... Line 561...
561
    	$this->make_request($url,null);
561
    	$this->make_request($url,null);
562
    	$this->loadModel('User');
562
    	$this->loadModel('User');
563
    	$sql = "UPDATE users SET activation_time = NOW() WHERE id = $id";
563
    	$sql = "UPDATE users SET activation_time = NOW() WHERE id = $id";
564
    	$this->User->query($sql);
564
    	$this->User->query($sql);
565
    }
565
    }
566
}
-
 
567
566
}
-
 
567