Revision ee91ae30
Added by jean.feltrin almost 15 years ago
usr/local/www/diag_dns.php | ||
---|---|---|
49 | 49 |
$host_esc = escapeshellarg(trim($_POST['host'])); |
50 | 50 |
|
51 | 51 |
if (!is_hostname($host) && !is_ipaddr($host)) |
52 |
$input_errors[] = "Host must be a valid hostname or IP address.";
|
|
52 |
$input_errors[] = gettext("Host must be a valid hostname or IP address.");
|
|
53 | 53 |
|
54 | 54 |
// Test resolution speed of each DNS server. |
55 | 55 |
if ((is_hostname($host) || is_ipaddr($host))) { |
... | ... | |
59 | 59 |
$dns_server = $pconfig['dns' . $dnscounter]; |
60 | 60 |
$query_time = `dig {$host_esc} @{$dns_server} | grep Query | cut -d':' -f2`; |
61 | 61 |
if($query_time == "") |
62 |
$query_time = "No response";
|
|
62 |
$query_time = gettext("No response");
|
|
63 | 63 |
$new_qt = array(); |
64 | 64 |
$new_qt['dns_server'] = $dns_server; |
65 | 65 |
$new_qt['query_time'] = $query_time; |
... | ... | |
68 | 68 |
} |
69 | 69 |
} |
70 | 70 |
|
71 |
$type = "unknown";
|
|
71 |
$type = gettext("unknown");
|
|
72 | 72 |
$resolved = ""; |
73 | 73 |
$ipaddr = ""; |
74 | 74 |
$hostname = ""; |
... | ... | |
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
if ($host == $resolved) { |
91 |
$resolved = "No record found";
|
|
91 |
$resolved = gettext("No record found");
|
|
92 | 92 |
} |
93 | 93 |
} |
94 | 94 |
} |
... | ... | |
103 | 103 |
<form action="diag_dns.php" method="post" name="iform" id="iform"> |
104 | 104 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
105 | 105 |
<tr> |
106 |
<td colspan="2" valign="top" class="listtopic">Resolve DNS hostname or IP</td>
|
|
106 |
<td colspan="2" valign="top" class="listtopic"> <?=gettext("Resolve DNS hostname or IP");?></td>
|
|
107 | 107 |
</tr> |
108 | 108 |
<tr> |
109 |
<td width="22%" valign="top" class="vncellreq">Hostname or IP</td>
|
|
109 |
<td width="22%" valign="top" class="vncellreq">gettext("Hostname or IP");?></td>
|
|
110 | 110 |
<td width="78%" class="vtable"> |
111 | 111 |
<?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"> |
112 | 112 |
<? if ($resolved && $type) { ?> |
... | ... | |
116 | 116 |
</tr> |
117 | 117 |
<?php if($_POST): ?> |
118 | 118 |
<tr> |
119 |
<td width="22%" valign="top" class="vncell">Resolution time per server</td>
|
|
119 |
<td width="22%" valign="top" class="vncell"><?=gettext("Resolution time per server");?></td>
|
|
120 | 120 |
<td width="78%" class="vtable"> |
121 | 121 |
<table width="170" border="1" cellpadding="2" style="border-width: 1px 1px 1px 1px; border-collapse: collapse;"> |
122 | 122 |
<tr> |
123 | 123 |
<td> |
124 |
<b>Server</b>
|
|
124 |
<b><?=gettext("Server");?></b>
|
|
125 | 125 |
</td> |
126 | 126 |
<td> |
127 |
<b>Query time</b>
|
|
127 |
<b><?=gettext("Query time);></b>
|
|
128 | 128 |
</td> |
129 | 129 |
</tr> |
130 | 130 |
<?php |
... | ... | |
148 | 148 |
<?php endif; ?> |
149 | 149 |
<?php if (!$input_errors && $ipaddr) { ?> |
150 | 150 |
<tr> |
151 |
<td width="22%" valign="top" class="vncell">More Information:</td>
|
|
151 |
<td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
|
|
152 | 152 |
<td width="78%" class="vtable"> |
153 |
<a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3">Ping</a> <br/>
|
|
154 |
<a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18">Traceroute</a>
|
|
153 |
<a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3"><?=gettext("Ping");?></a> <br/>
|
|
154 |
<a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18"><?=gettext("Traceroute");?></a>
|
|
155 | 155 |
<p/> |
156 |
NOTE: The following links are to external services, so their reliability cannot be guaranteed.<br/><br/>
|
|
157 |
<a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>">IP WHOIS @ DNS Stuff</a><br />
|
|
158 |
<a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>">IP Info @ DNS Stuff</a>
|
|
156 |
<?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?><br/><br/>
|
|
157 |
<a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a><br />
|
|
158 |
<a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff);?></a>
|
|
159 | 159 |
</td> |
160 | 160 |
</tr> |
161 | 161 |
<?php } ?> |
... | ... | |
163 | 163 |
<td width="22%" valign="top"> </td> |
164 | 164 |
<td width="78%"> |
165 | 165 |
<br/> |
166 |
<input name="Submit" type="submit" class="formbtn" value="DNS Lookup">
|
|
166 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("DNS Lookup");?>">
|
|
167 | 167 |
</td> |
168 | 168 |
</tr> |
169 | 169 |
</table> |
Also available in: Unified diff
Implement gettext() calls