no concat in postgres, use pipes
This commit is contained in:
		
							parent
							
								
									891fb0478e
								
							
						
					
					
						commit
						41811385fa
					
				@ -40,7 +40,7 @@ class User {
 | 
				
			|||||||
	public static function by_session($name, $session) {
 | 
						public static function by_session($name, $session) {
 | 
				
			||||||
		global $config, $database;
 | 
							global $config, $database;
 | 
				
			||||||
		$row = $database->get_row(
 | 
							$row = $database->get_row(
 | 
				
			||||||
				"SELECT * FROM users WHERE name = ? AND md5(concat(pass, ?)) = ?",
 | 
									"SELECT * FROM users WHERE name = ? AND md5(pass || ?) = ?",
 | 
				
			||||||
				array($name, get_session_ip($config), $session)
 | 
									array($name, get_session_ip($config), $session)
 | 
				
			||||||
		);
 | 
							);
 | 
				
			||||||
		return is_null($row) ? null : new User($row);
 | 
							return is_null($row) ? null : new User($row);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user