src/login_github.php
public static function verify_user($oauth_token, $github_username) {
	$known_login = static::get_by_oauth_token($oauth_token);
	if (empty($known_login)) {
		return true;
	}
	
	if ($known_login->github_username != $github_username) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('oauth token switched user');
	}
	
	return true;
}
public static function verify_user($oauth_token, $github_username) {
	$known_login = static::get_by_oauth_token($oauth_token);
	if (empty($known_login)) {
		return true;
	}
	
	if ($known_login->github_username != $github_username) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('oauth token switched user');
	}
	
	return true;
}
public static function verify_user ( $ oauth_token , $ github_username ) { $ known_login = static :: get_by_oauth_token ( $ oauth_token ) ; if ( empty ( $ known_login ) ) { return true ; } if ( $ known_login -> github_username != $ github_username ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'oauth token switched user' ) ; } return true ; }
checks whether the username belongs to the user identified by the oauth token

@param  string    $oauth_token     as received by the oauth process
@param  strign    $github_username as received by ::get_user_info()
@return boolean                    returns true if there is no login for this token ..
.. or the usernames match
never returns false
@throws exception                  if the usernames don't match
checks whether the username belongs to the user identified by the oauth token