Subversion Repositories SmartDukaan

Rev

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

Rev 14890 Rev 14891
Line 103... Line 103...
103
    }
103
    }
104
 
104
 
105
    function checkToken() {
105
    function checkToken() {
106
		$headers =  $this->getallheaders();
106
		$headers =  $this->getallheaders();
107
        $this->log(print_r($headers,1),'headers');
107
        $this->log(print_r($headers,1),'headers');
108
        if(isset($headers['Token'] && !empty($headers['Token']))) {
108
        if(isset($headers['Token']) && !empty($headers['Token'])) {
109
        	$this->loadModel('SocialProfile');
109
        	$this->loadModel('SocialProfile');
110
        	$options = array('conditions'=>'access_token'=>$headers['Token'],'fields'=>array('user_id'),'recursive'=>-1);
110
        	$options = array('conditions'=>array('access_token'=>$headers['Token'],'fields'=>array('user_id'),'recursive'=>-1));
111
        	$user = $this->SocialProfile->find('first',$options);
111
        	$user = $this->SocialProfile->find('first',$options);
112
        	// debug($user);
-
 
113
        	$userId = $this->request->query('user_id');
112
        	$userId = $this->request->query('user_id');
114
			if(isset($userId) && !empty($userId)){
113
			if(isset($userId) && !empty($userId)){
115
				if($userId == $user['SocialProfile']['user_id']){
114
				if($userId == $user['SocialProfile']['user_id']){
116
					return true;
115
					return true;
117
				}
116
				}