Permalink
Browse files

geoip: s/1/true/, note distance units are km

fixed s/ParseFloat/parseFloat/
  • Loading branch information...
1 parent 2fe9502 commit 71427a74fe6e930246f10362649976c8a8bfc791 @msimerson msimerson committed Jan 21, 2014
Showing with 4 additions and 4 deletions.
  1. +2 −2 config/connect.geoip.ini
  2. +2 −2 plugins/connect.geoip.js
View
4 config/connect.geoip.ini
@@ -15,6 +15,6 @@ show_region=1
calc_distance=0
; if calculating distance, an additional 'too_far' key in the geoip
-; connection note can be set to true if the distance exceeds the limit.
-; A suggested use for that data is the karma plugin.
+; connection note can be set to true if the distance exceeds the limit (in
+; kilometers). A suggested use for that data is the karma plugin.
;too_far=4000
View
4 plugins/connect.geoip.js
@@ -55,8 +55,8 @@ function calculate_distance(plugin, connection, cfg) {
var gcd = haversine(local_geoip.ll[0], local_geoip.ll[1],
connection.notes.geoip.ll[0], connection.notes.geoip.ll[1]);
- if (cfg.main.too_far && (ParseFloat(cfg.main.too_far) < parseFloat(gcd))) {
- connection.notes.geoip.too_far=1;
+ if (cfg.main.too_far && (parseFloat(cfg.main.too_far) < parseFloat(gcd))) {
+ connection.notes.geoip.too_far=true;
};
connection.notes.geoip.distance = gcd;
};

0 comments on commit 71427a7

Please sign in to comment.