Subversion Repositories SmartDukaan

Rev

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

Rev 15383 Rev 15651
Line 152... Line 152...
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 true;
157
                        return 1;//success
158
                    } else{
158
                    } else{
159
                    	// token mismatch, so maybe hack attempt
159
                    	// token mismatch, so maybe hack attempt
160
                    	$this->log("Mismatch hence user not authenticated",'headers');
160
                    	$this->log("Mismatch hence user not authenticated",'headers');
161
                        return false;
161
                        return 0;//fail
162
                    }
162
                    }
163
                } else {
163
                } else {
164
                	// userId is not sent so maybe hack attempt
164
                	// userId is not sent so maybe hack attempt
165
                	$this->log("Id not sent hence user not authenticated",'headers');
165
                	$this->log("Id not sent hence user not authenticated",'headers');
166
                	return false;
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 true;
170
            return -1;//token not set in cookie
171
        }
171
        }
172
    }
172
    }
173
 
173
 
174
    function getallheaders() { 
174
    function getallheaders() { 
175
	   $headers = ''; 
175
	   $headers = '';