Browse Source

NEW Can test a geoip conversion from the geoip setup page

Laurent Destailleur 2 years ago
parent
commit
381ecbb1fb
1 changed files with 17 additions and 0 deletions
  1. 17 0
      htdocs/admin/geoipmaxmind.php

+ 17 - 0
htdocs/admin/geoipmaxmind.php

@@ -163,6 +163,9 @@ $textoshow = str_replace('{s1}', '<a href="'.$url2.'" target="_blank" rel="noope
 print $textoshow;
 
 if ($geoip) {
+	print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
+	print '<input type="hidden" name="token" value="'.newToken().'">';
+
 	print '<br><br>';
 	print '<br><span class="opacitymedium">'.$langs->trans("TestGeoIPResult", $ip).':</span>';
 
@@ -214,6 +217,20 @@ if ($geoip) {
 		}
 	}
 
+	$ip = GETPOST("iptotest");
+	print '<br><input type="text class="width100" name="iptotest" id="iptotest" placeholder="'.dol_escape_htmltag($langs->trans("EnterAnIP")).'" value="'.$ip.'">';
+	print '<input type="submit" class="width40 button small smallpaddingimp" value=" -> ">';
+	if ($ip) {
+		$result = dol_print_ip($ip, 1);
+		if ($result) {
+			print $result;
+		} else {
+			print $langs->trans("Error");
+		}
+	}
+
+	print '</form>';
+
 	$geoip->close();
 }