| 1 |
lars |
1 |
<?
|
|
|
2 |
$self=basename($PHP_SELF);
|
|
|
3 |
$DB="DNS_SERVER";
|
|
|
4 |
require_once "connect.php";
|
|
|
5 |
if ($action=="update")
|
|
|
6 |
{
|
|
|
7 |
if (!$ID)
|
|
|
8 |
{ // insert Dummy-Entry
|
|
|
9 |
$query = "insert into $DB (Zone,erstellt_am,erstellt_von,letzte_Aenderung_am,letzte_Aenderung_von) VALUES ('$Zone',NOW(),'$PHP_AUTH_USER',NOW(),'$PHP_AUTH_USER')";
|
|
|
10 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query."<hr>");
|
|
|
11 |
$ID=mysql_insert_id();
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
unset($HTTP_POST_VARS[action]);
|
|
|
15 |
unset($HTTP_POST_VARS[ID]);
|
|
|
16 |
|
|
|
17 |
foreach(array_keys($HTTP_POST_VARS) as $elem)
|
|
|
18 |
{
|
|
|
19 |
if ($elem[0] == "_")
|
|
|
20 |
{
|
|
|
21 |
unset($HTTP_POST_VARS[$elem]);
|
|
|
22 |
$button=$$elem;
|
|
|
23 |
$elem=substr($elem,1);
|
|
|
24 |
$Pfad=$HTTP_POST_VARS[$elem."_Pfad"];
|
|
|
25 |
unset($HTTP_POST_VARS[$elem."_Pfad"]);
|
|
|
26 |
$image=$$elem;
|
|
|
27 |
$image_name=$elem."_name";
|
|
|
28 |
$image_name=urlencode($$image_name);
|
|
|
29 |
switch ($button)
|
|
|
30 |
{
|
|
|
31 |
case 0:
|
|
|
32 |
break;
|
|
|
33 |
case 1:
|
|
|
34 |
$HTTP_POST_VARS[$elem]='';
|
|
|
35 |
break;
|
|
|
36 |
case 2:
|
|
|
37 |
//$image_name=$ID."_".$image_name;
|
|
|
38 |
$image_name=$ID.strrchr($image_name,".");
|
|
|
39 |
$HTTP_POST_VARS[$elem]=$image_name;
|
|
|
40 |
copy($image,$Pfad.$image_name);
|
|
|
41 |
break;
|
|
|
42 |
default:
|
|
|
43 |
break;
|
|
|
44 |
}
|
|
|
45 |
}
|
|
|
46 |
}
|
|
|
47 |
$names=array();
|
|
|
48 |
foreach(array_keys($HTTP_POST_VARS) as $elem)
|
|
|
49 |
{
|
|
|
50 |
array_push($names,"$elem='$HTTP_POST_VARS[$elem]'");
|
|
|
51 |
}
|
|
|
52 |
$query="update $DB set ".join($names,', ');
|
|
|
53 |
$query=$query." ,letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER' where ID = '$ID'";
|
|
|
54 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
|
|
|
55 |
header("Location: ".$self);
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
if ($action=="delete")
|
|
|
59 |
{
|
|
|
60 |
if ($ID)
|
|
|
61 |
{
|
|
|
62 |
$condition=array();
|
|
|
63 |
foreach ($ID as $elem)
|
|
|
64 |
{
|
|
|
65 |
array_push($condition," ID = '$elem'");
|
|
|
66 |
}
|
|
|
67 |
$cond=join(" or ",$condition);
|
|
|
68 |
$query = "DELETE FROM $DB WHERE $cond";
|
|
|
69 |
$result = mysql_query ("$query") or die (mysql_errno().": ".mysql_error());
|
|
|
70 |
header("Location: ".$self);
|
|
|
71 |
}
|
|
|
72 |
}
|
|
|
73 |
if (!$action)
|
|
|
74 |
{
|
|
|
75 |
$action="select_edit";
|
|
|
76 |
}
|
|
|
77 |
if (!$sort) {$sort='Zone';}
|
|
|
78 |
?>
|
|
|
79 |
|
|
|
80 |
<html>
|
|
|
81 |
<head>
|
|
|
82 |
<title>DNS-SERVER</title>
|
|
|
83 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
84 |
<link rel=stylesheet type="text/css" href="file:///L|/weban.de/DNS/redaktion.css">
|
|
|
85 |
<style type="text/css"><? require_once "redaktion.css"; ?></style>
|
|
|
86 |
<meta name="description" content="Redaktionssystem">
|
|
|
87 |
<meta name="author" content="Webagentur Niewerth">
|
|
|
88 |
<meta name="robots" content="noindex">
|
|
|
89 |
</head>
|
|
|
90 |
<body bgcolor="#FFFFFF" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" alink="#999999">
|
|
|
91 |
<form method="post" action="#" name="formname" enctype="multipart/form-data">
|
|
|
92 |
<table width="662" border="0" cellspacing="0" cellpadding="0">
|
|
|
93 |
<tr valign="top">
|
|
|
94 |
<td width="585" bgcolor="#FFFFFF">
|
|
|
95 |
<!-- Auswahl Löschen START -->
|
|
|
96 |
<?
|
|
|
97 |
if ($action=="delete")
|
|
|
98 |
{
|
|
|
99 |
$query="SELECT * FROM $DB ";
|
|
|
100 |
$query=$query."order by $sort";
|
|
|
101 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
102 |
if (mysql_num_rows($result) == 0)
|
|
|
103 |
{
|
|
|
104 |
?>
|
|
|
105 |
<p class="error">Es sind keine Daten eingetragen !</p>
|
|
|
106 |
<p></p>
|
|
|
107 |
<?
|
|
|
108 |
}
|
|
|
109 |
else
|
|
|
110 |
{
|
|
|
111 |
?>
|
|
|
112 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
113 |
<tr bgcolor="#CCCCCC">
|
|
|
114 |
<td colspan="3" class="headline">DNS-Eintrag: Löschen</td>
|
|
|
115 |
</tr>
|
|
|
116 |
<tr>
|
|
|
117 |
<td width="65%" bgcolor="#666666"><a href="<? echo $self?>?action=delete&sort=Zone"><font color="#FFFFFF"><b>Domain</b></font></a></td>
|
|
|
118 |
<td colspan="2" bgcolor="#666666"><a href="<? echo $self?>?action=delete&sort=DNS_Server_IP"><font color="#FFFFFF"><b>Master</b></font></a></td>
|
|
|
119 |
</tr>
|
|
|
120 |
<?
|
|
|
121 |
while ($zeile=mysql_fetch_array($result))
|
|
|
122 |
{
|
|
|
123 |
$von=date2human($zeile[von]);
|
|
|
124 |
$bis=date2human($zeile[bis]);
|
|
|
125 |
?>
|
|
|
126 |
<tr>
|
|
|
127 |
<td width="65%">
|
|
|
128 |
<? echo $zeile[Zone] ?>
|
|
|
129 |
</td>
|
|
|
130 |
<td width="28%">
|
|
|
131 |
<? echo $zeile[DNS_Server_IP] ?>
|
|
|
132 |
</td>
|
|
|
133 |
<td width="7%" align="center">
|
|
|
134 |
<input type="checkbox" name="ID[]" value="<? echo $zeile[ID] ?>">
|
|
|
135 |
</td>
|
|
|
136 |
</tr>
|
|
|
137 |
<?
|
|
|
138 |
}
|
|
|
139 |
?>
|
|
|
140 |
<tr bgcolor="#CCCCCC">
|
|
|
141 |
<td colspan="3" align="right">
|
|
|
142 |
<input type="hidden" name="action" value='delete'>
|
|
|
143 |
<input type="submit" value="LÖSCHEN">
|
|
|
144 |
<input type="reset" name="Button22" value="Zurücksetzen">
|
|
|
145 |
</td>
|
|
|
146 |
</tr>
|
|
|
147 |
</table>
|
|
|
148 |
<?
|
|
|
149 |
}
|
|
|
150 |
?>
|
|
|
151 |
<?
|
|
|
152 |
}
|
|
|
153 |
?>
|
|
|
154 |
<!-- Auswahl Löschen ENDE -->
|
|
|
155 |
<!-- Auswahl SELECT_EDIT START -->
|
|
|
156 |
<?
|
|
|
157 |
|
|
|
158 |
if ($action=="select_edit")
|
|
|
159 |
{
|
|
|
160 |
$query="SELECT * FROM $DB ";
|
|
|
161 |
$query=$query."order by $sort";
|
|
|
162 |
|
|
|
163 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
164 |
if (mysql_num_rows($result) == 0)
|
|
|
165 |
{
|
|
|
166 |
?>
|
|
|
167 |
<p class="error">Es sind keine
|
|
|
168 |
Daten eingetragen !</p>
|
|
|
169 |
<p></p>
|
|
|
170 |
<?
|
|
|
171 |
}
|
|
|
172 |
else
|
|
|
173 |
{
|
|
|
174 |
?>
|
|
|
175 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
176 |
<tr bgcolor="#339999">
|
|
|
177 |
<td class="headline" colspan="3" bgcolor="#CCCCCC">DNS-Eintrag: Bearbeiten</td>
|
|
|
178 |
</tr>
|
|
|
179 |
<tr>
|
|
|
180 |
<td width="65%" bgcolor="#666666"><a href="<? echo $self?>?action=select_edit&sort=Zone"><font color="#FFFFFF"><b>Domain</b></font></a></td>
|
|
|
181 |
<td bgcolor="#666666"><a href="<? echo $self?>?action=select_edit&sort=DNS_Server_IP"><font color="#FFFFFF"><b>Master</b></font></a></td>
|
|
|
182 |
</tr>
|
|
|
183 |
<?
|
|
|
184 |
while ($zeile=mysql_fetch_array($result))
|
|
|
185 |
{
|
|
|
186 |
$von=date2human($zeile[von]);
|
|
|
187 |
$bis=date2human($zeile[bis]);
|
|
|
188 |
|
|
|
189 |
?>
|
|
|
190 |
<tr>
|
|
|
191 |
<td width="65%"><a href="file:///L|/weban.de/DNS/<? echo $self?>?action=edit&ID=<? echo $zeile[ID]; ?>">
|
|
|
192 |
<? echo $zeile[Zone] ?>
|
|
|
193 |
</a></td>
|
|
|
194 |
<td>
|
|
|
195 |
<? echo $zeile[DNS_Server_IP] ?>
|
|
|
196 |
</td>
|
|
|
197 |
</tr>
|
|
|
198 |
<?
|
|
|
199 |
}
|
|
|
200 |
?>
|
|
|
201 |
<tr bgcolor="#339999">
|
|
|
202 |
<td colspan="3" bgcolor="#CCCCCC">
|
|
|
203 |
<div align="right">
|
|
|
204 |
<input type="hidden" name="action" value='edit'>
|
|
|
205 |
</div>
|
|
|
206 |
</td>
|
|
|
207 |
</tr>
|
|
|
208 |
</table>
|
|
|
209 |
<?
|
|
|
210 |
}
|
|
|
211 |
?>
|
|
|
212 |
<?
|
|
|
213 |
}
|
|
|
214 |
?>
|
|
|
215 |
<!-- Auswahl SELECT_EDIT ENDE -->
|
|
|
216 |
<?
|
|
|
217 |
if ($action=="edit")
|
|
|
218 |
{
|
|
|
219 |
if ($ID)
|
|
|
220 |
{
|
|
|
221 |
$result = mysql_query ("SELECT * FROM $DB where ID = '$ID'") or die (mysql_errno().": ".mysql_error());
|
|
|
222 |
$zeile=mysql_fetch_array($result);
|
|
|
223 |
$erstellt_am=datetime2human($zeile[erstellt_am]);
|
|
|
224 |
$letzte_Aenderung_am=datetime2human($zeile[letzte_Aenderung_am]);
|
|
|
225 |
}
|
|
|
226 |
?>
|
|
|
227 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
228 |
<tr bgcolor="#CCCCCC">
|
|
|
229 |
<td colspan="4" class="headline">DNS-Eintrag:
|
|
|
230 |
<?
|
|
|
231 |
if ($ID)
|
|
|
232 |
{
|
|
|
233 |
?>
|
|
|
234 |
Bearbeiten
|
|
|
235 |
<?
|
|
|
236 |
}
|
|
|
237 |
else
|
|
|
238 |
{
|
|
|
239 |
?>
|
|
|
240 |
Neueintrag
|
|
|
241 |
<?
|
|
|
242 |
}
|
|
|
243 |
?>
|
|
|
244 |
</td>
|
|
|
245 |
</tr>
|
|
|
246 |
<tr>
|
|
|
247 |
<td bgcolor="#CCCCCC" class="headline" width="20%">Domain: </td>
|
|
|
248 |
<td colspan="3">
|
|
|
249 |
<input type="text" size="25" name="Zone" value="<? echo $zeile[Zone] ?>">
|
|
|
250 |
(domain.de) </td>
|
|
|
251 |
</tr>
|
|
|
252 |
<tr>
|
|
|
253 |
<td bgcolor="#CCCCCC" class="headline" width="20%">Master:</td>
|
|
|
254 |
<td colspan="3">
|
|
|
255 |
<? if (!$zeile[DNS_Server_IP]) {$zeile[DNS_Server_IP]='213.68.40.76';} ?>
|
|
|
256 |
<INPUT TYPE=TEXT NAME=DNS_Server_IP SIZE=25 VALUE="<? echo $zeile[DNS_Server_IP] ?>" maxlength="15">
|
|
|
257 |
</td>
|
|
|
258 |
</tr>
|
|
|
259 |
<? if ($ID) {?>
|
|
|
260 |
<tr>
|
|
|
261 |
<td bgcolor="#CCCCCC" class="headline" colspan="4"> </td>
|
|
|
262 |
</tr>
|
|
|
263 |
<tr>
|
|
|
264 |
<td bgcolor="#CCCCCC" class="headline" width="20%">erstellt:</td>
|
|
|
265 |
<td colspan="3">am:
|
|
|
266 |
<? echo $erstellt_am[Datum] ?>
|
|
|
267 |
um:
|
|
|
268 |
<? echo $erstellt_am[Zeit] ?>
|
|
|
269 |
von:
|
|
|
270 |
<? echo $zeile[erstellt_von] ?>
|
|
|
271 |
</td>
|
|
|
272 |
</tr>
|
|
|
273 |
<tr>
|
|
|
274 |
<td bgcolor="#CCCCCC" class="headline" width="20%" nowrap>letzte Änderung:</td>
|
|
|
275 |
<td colspan="3">am:
|
|
|
276 |
<? echo $letzte_Aenderung_am[Datum] ?>
|
|
|
277 |
um:
|
|
|
278 |
<? echo $letzte_Aenderung_am[Zeit] ?>
|
|
|
279 |
von:
|
|
|
280 |
<? echo $zeile[letzte_Aenderung_von] ?>
|
|
|
281 |
</td>
|
|
|
282 |
</tr>
|
|
|
283 |
<? } ?>
|
|
|
284 |
<tr bgcolor="#CCCCCC">
|
|
|
285 |
<td align="right" colspan="4">
|
|
|
286 |
<input type="hidden" name="ID" value="<? echo $ID ?>">
|
|
|
287 |
<input type="hidden" name="action" value="update">
|
|
|
288 |
<input type="submit" value=" OK ">
|
|
|
289 |
<input type="reset" name="Button" value="Zurücksetzen">
|
|
|
290 |
</td>
|
|
|
291 |
</tr>
|
|
|
292 |
</table>
|
|
|
293 |
<?
|
|
|
294 |
}
|
|
|
295 |
?> </td>
|
|
|
296 |
<td width="77" align="right" bordercolor="#CCCCCC">
|
|
|
297 |
<table width="67" border="1" cellspacing="2" cellpadding="3" bordercolorlight="#000000" bordercolordark="#000000" bordercolor="#000000">
|
|
|
298 |
<tr>
|
|
|
299 |
<td bgcolor="#CCCCCC" bordercolor="#000000"><a href="<? echo $self ?>?action=edit">NEU</a></td>
|
|
|
300 |
</tr>
|
|
|
301 |
<tr>
|
|
|
302 |
<td bgcolor="#CCCCCC" bordercolor="#000000"><a href="<? echo $self ?>?action=select_edit">BEARBEITEN</a></td>
|
|
|
303 |
</tr>
|
|
|
304 |
<tr>
|
|
|
305 |
<td bgcolor="#CCCCCC" bordercolor="#000000"><a href="<? echo $self ?>?action=delete">LÖSCHEN</a></td>
|
|
|
306 |
</tr>
|
|
|
307 |
<!--
|
|
|
308 |
<tr>
|
|
|
309 |
<td bgcolor="#CCCCCC" bordercolor="#000000"> </td>
|
|
|
310 |
</tr>
|
|
|
311 |
<tr>
|
|
|
312 |
<td bgcolor="#CCCCCC" bordercolor="#000000"><a href="javascript:;">ANWENDEN</a></td>
|
|
|
313 |
</tr>
|
|
|
314 |
-->
|
|
|
315 |
</table>
|
|
|
316 |
</td>
|
|
|
317 |
</tr>
|
|
|
318 |
</table>
|
|
|
319 |
</form>
|
|
|
320 |
</body>
|