Project

General

Profile

Download (6.2 KB) Statistics
| Branch: | Tag: | Revision:
1 f1f60c92 Ermal Luçi
<?php
2
/* $Id$ */
3
/*
4 1d7ba683 ayvis
	Copyright (C) 2008 Ermal Luçi
5 29aef6c4 Jim Thompson
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6 f1f60c92 Ermal Luçi
	All rights reserved.
7
8
	Redistribution and use in source and binary forms, with or without
9
	modification, are permitted provided that the following conditions are met:
10
11
	1. Redistributions of source code must retain the above copyright notice,
12
	   this list of conditions and the following disclaimer.
13
14
	2. Redistributions in binary form must reproduce the above copyright
15
	   notice, this list of conditions and the following disclaimer in the
16
	   documentation and/or other materials provided with the distribution.
17
18
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
	POSSIBILITY OF SUCH DAMAGE.
28
*/
29 1d333258 Scott Ullrich
/*
30
	pfSense_MODULE:	dnsupdate
31
*/
32 f1f60c92 Ermal Luçi
33 6b07c15a Matthew Grooms
##|+PRIV
34
##|*IDENT=page-services-rfc2136clients
35
##|*NAME=Services: RFC 2136 clients page
36
##|*DESCR=Allow access to the 'Services: RFC 2136 clients' page.
37
##|*MATCH=services_rfc2136.php*
38
##|-PRIV
39
40 f1f60c92 Ermal Luçi
require("guiconfig.inc");
41
42
if (!is_array($config['dnsupdates']['dnsupdate']))
43
	$config['dnsupdates']['dnsupdate'] = array();
44
45
$a_rfc2136 = &$config['dnsupdates']['dnsupdate'];
46
47
if ($_GET['act'] == "del") {
48 e766bd84 bcyrill
	unset($a_rfc2136[$_GET['id']]);
49 f1f60c92 Ermal Luçi
50 e766bd84 bcyrill
	write_config();
51 f1f60c92 Ermal Luçi
52 e766bd84 bcyrill
	header("Location: services_rfc2136.php");
53
	exit;
54 f1f60c92 Ermal Luçi
}
55
56 1c108cef Rafael Lucas
$pgtitle = array(gettext("Services"), gettext("RFC 2136 clients"));
57 f1f60c92 Ermal Luçi
include("head.inc");
58
?>
59
60
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
61
<?php include("fbegin.inc"); ?>
62
<form action="services_rfc2136.php" method="post" name="iform" id="iform">
63
<?php if ($input_errors) print_input_errors($input_errors); ?>
64 d3c90ddd Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="rfc2136">
65 e766bd84 bcyrill
  <tr>
66
	<td>
67 f1f60c92 Ermal Luçi
<?php
68
	$tab_array = array();
69 1c108cef Rafael Lucas
	$tab_array[] = array(gettext("DynDns"), false, "services_dyndns.php");
70
	$tab_array[] = array(gettext("RFC 2136"), true, "services_rfc2136.php");
71 f1f60c92 Ermal Luçi
	display_top_tabs($tab_array);
72
?>
73 e766bd84 bcyrill
	</td>
74
  </tr>
75 f1f60c92 Ermal Luçi
  <tr>
76 e766bd84 bcyrill
	<td>
77
	  <div id="mainarea">
78 d3c90ddd Colin Fleming
	  <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
79 e766bd84 bcyrill
		<tr>
80 bcafa618 jim-p
		  <td width="5%"  class="listhdrr"><?=gettext("If");?></td>
81
		  <td width="15%" class="listhdrr"><?=gettext("Server");?></td>
82
		  <td width="20%" class="listhdrr"><?=gettext("Hostname");?></td>
83
		  <td width="25%" class="listhdrr"><?=gettext("Cached IP");?></td>
84
		  <td width="25%" class="listhdr"><?=gettext("Description");?></td>
85 e766bd84 bcyrill
		  <td width="10%" class="list"></td>
86
		</tr>
87
		<?php $i = 0; foreach ($a_rfc2136 as $rfc2136): ?>
88 a04da9bf jim-p
		<tr ondblclick="document.location='services_rfc2136_edit.php?id=<?=$i;?>'">
89 e766bd84 bcyrill
		  <td class="listlr">
90
		  <?php
91
			$iflist = get_configured_interface_with_descr();
92
			foreach ($iflist as $if => $ifdesc) {
93
				if ($rfc2136['interface'] == $if) {
94 e5da6830 bcyrill
					if (!isset($rfc2136['enable']))
95
						echo "<span class=\"gray\">{$ifdesc}</span>";
96
					else
97
						echo "{$ifdesc}";
98 e766bd84 bcyrill
					break;
99
				}
100
			}
101
		  ?>
102
		  </td>
103
		  <td class="listr">
104 bcafa618 jim-p
		  <?php
105
			if (!isset($rfc2136['enable']))
106 d3c90ddd Colin Fleming
				echo "<span class=\"gray\">" . htmlspecialchars($rfc2136['server']) . "</span>";
107 bcafa618 jim-p
			else
108
				echo htmlspecialchars($rfc2136['server']);
109
		  ?>
110
		  </td>
111
		  <td class="listr">
112 e5da6830 bcyrill
		  <?php
113
			if (!isset($rfc2136['enable']))
114 d3c90ddd Colin Fleming
				echo "<span class=\"gray\">" . htmlspecialchars($rfc2136['host']) . "</span>";
115 e5da6830 bcyrill
			else
116
				echo htmlspecialchars($rfc2136['host']);
117
		  ?>
118 e766bd84 bcyrill
		  </td>
119 bcafa618 jim-p
		  <td class="listr">
120
		  <?php
121
			$filename = "{$g['conf_path']}/dyndns_{$rfc2136['interface']}_rfc2136_" . escapeshellarg($rfc2136['host']) . "_{$rfc2136['server']}.cache";
122
			if (file_exists($filename)) {
123
				echo "IPv4: ";
124
				if (isset($rfc2136['usepublicip']))
125
					$ipaddr = dyndnsCheckIP($rfc2136['interface']);
126
				else
127
					$ipaddr = get_interface_ip($rfc2136['interface']);
128
				$cached_ip_s = explode("|", file_get_contents($filename));
129
				$cached_ip = $cached_ip_s[0];
130
				if ($ipaddr <> $cached_ip)
131
					echo "<font color='red'>";
132
				else
133
					echo "<font color='green'>";
134
				echo htmlspecialchars($cached_ip);
135
				echo "</font>";
136
			} else {
137
				echo "IPv4: N/A";
138
			}
139
			echo "<br />";
140
			if (file_exists("{$filename}.ipv6")) {
141
				echo "IPv6: ";
142
				$ipaddr = get_interface_ipv6($rfc2136['interface']);
143
				$cached_ip_s = explode("|", file_get_contents("{$filename}.ipv6"));
144
				$cached_ip = $cached_ip_s[0];
145
				if ($ipaddr <> $cached_ip)
146
					echo "<font color='red'>";
147
				else
148
					echo "<font color='green'>";
149
				echo htmlspecialchars($cached_ip);
150
				echo "</font>";
151
			} else {
152
				echo "IPv6: N/A";
153
			}
154
		  ?>
155
		  </td>
156 e766bd84 bcyrill
		  <td class="listbg">
157 e5da6830 bcyrill
		  <?php
158
			if (!isset($rfc2136['enable']))
159 d3c90ddd Colin Fleming
				echo "<span class=\"gray\">" . htmlspecialchars($rfc2136['descr']) . "</span>";
160 e5da6830 bcyrill
			else
161
				echo htmlspecialchars($rfc2136['descr']);
162
		  ?>
163 e766bd84 bcyrill
		  </td>
164 d3c90ddd Colin Fleming
		  <td valign="middle" class="list nowrap">
165
			<a href="services_rfc2136_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
166
			&nbsp;<a href="services_rfc2136.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this client?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a>
167 e766bd84 bcyrill
		  </td>
168
		</tr>
169
		<?php $i++; endforeach; ?>
170
		<tr>
171 bcafa618 jim-p
		  <td class="list" colspan="5">&nbsp;</td>
172 d3c90ddd Colin Fleming
		  <td class="list"><a href="services_rfc2136_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
173 e766bd84 bcyrill
		</tr>
174
		<tr>
175
		  <td colspan="3" class="list">
176 1d7ba683 ayvis
			<p class="vexpl"><span class="red"><strong><br /></strong></span></p>
177 e766bd84 bcyrill
		  </td>
178
		  <td class="list">&nbsp;</td>
179
		</tr>
180
	  </table>
181
	  </div>
182 f1f60c92 Ermal Luçi
	</td>
183
	</tr>
184
</table>
185
</form>
186
<?php include("fend.inc"); ?>
187
</body>
188 d3c90ddd Colin Fleming
</html>