Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
emulab-devel
Commits
c9c69ac2
Commit
c9c69ac2
authored
22 years ago
by
Leigh B. Stoller
Browse files
Options
Downloads
Patches
Plain Diff
Add dangerous delete option!
parent
f5bd1a8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/wideareakeys.php3
+32
-19
32 additions, 19 deletions
www/wideareakeys.php3
with
32 additions
and
19 deletions
www/wideareakeys.php3
+
32
−
19
View file @
c9c69ac2
...
...
@@ -23,17 +23,19 @@ if (isset($deletekey)) {
# Get the actual key.
#
$query_result =
DBQueryFatal
(
"select * from widearea_privkeys "
.
DBQueryFatal
(
"select wa.*,i.node_id from widearea_privkeys as wa "
.
"left join interfaces as i on wa.IP=i.IP "
.
"where privkey='
$deletekey
'"
);
if
(
!
mysql_num_rows
(
$query_result
))
{
USERERROR
(
"No such widearea private key!"
,
1
);
}
$row
=
mysql_fetch_array
(
$query_result
);
$name
=
$row
[
user_name
];
$email
=
$row
[
user_email
];
$when
=
$row
[
requested
];
$IP
=
$row
[
IP
];
$row
=
mysql_fetch_array
(
$query_result
);
$name
=
$row
[
user_name
];
$email
=
$row
[
user_email
];
$when
=
$row
[
requested
];
$IP
=
$row
[
IP
];
$nodeid
=
$row
[
node_id
];
#
# We run this twice. The first time we are checking for a confirmation
...
...
@@ -49,7 +51,7 @@ if (isset($deletekey)) {
</h2></center>
\n
"
;
echo
"<br>
Back to <a href=
cdrompriv
keys.php>Back to Widearea Keys.</a>
\n
"
;
Back to <a href=
widearea
keys.php
3
>Back to Widearea Keys.</a>
\n
"
;
PAGEFOOTER
();
return
;
...
...
@@ -58,17 +60,9 @@ if (isset($deletekey)) {
if
(
!
$confirmed
)
{
PAGEHEADER
(
"Widearea Private Key Deletion Request"
);
echo
"<center><h
2
><br>
echo
"<center><h
3
><br>
Are you <b>REALLY</b> sure you want to delete this Key?<br>
Deleting a key that has a widearea node attached is a bad
thing!
</h2>
\n
"
;
echo
"<form action=cdromprivkeys.php method=post>"
;
echo
"<input type=hidden name=deletekey value=
$deletekey
>
\n
"
;
echo
"<b><input type=submit name=confirmed value=Confirm></b>
\n
"
;
echo
"<b><input type=submit name=canceled value=Cancel></b>
\n
"
;
echo
"</form>
\n
"
;
</h3>
\n
"
;
echo
"</center>
\n
"
;
echo
"<table align=center border=1 cellpadding=2 cellspacing=2>
\n
"
;
...
...
@@ -76,15 +70,34 @@ if (isset($deletekey)) {
<td>
$name
</td>
<td>
$email
</td>
<td>
$IP
</td>
<td>
$nodeid
</td>
<td>
$when
</td>
</tr>
\n
"
;
echo
"</table>
\n
"
;
echo
"<center>
\n
"
;
echo
"<form action=wideareakeys.php3 method=post>"
;
echo
"<input type=hidden name=deletekey value=
$deletekey
>
\n
"
;
echo
"<b><input type=submit name=confirmed value=Confirm></b>
\n
"
;
echo
"<b><input type=submit name=canceled value=Cancel></b>
\n
"
;
echo
"</form>
\n
"
;
echo
"</center>
\n
"
;
echo
"<br><font color=red>
This will delete all trace including the node, vnodes, and
interface table entries. Needless to say, deleting a key
record of an active widearea node is a bad thing. Be sure!
</font>
\n
"
;
PAGEFOOTER
();
return
;
}
DBQueryFatal
(
"delete from widearea_privkeys where privkey='
$deletekey
'"
);
header
(
"Location: cdromprivkeys.php"
);
DBQueryFatal
(
"delete from interfaces where node_id='
$nodeid
'"
);
DBQueryFatal
(
"delete from nodes where node_id='
$nodeid
'"
);
DBQueryFatal
(
"delete from nodes where phys_nodeid='
$nodeid
'"
);
DBQueryFatal
(
"delete from reserved where node_id='
$nodeid
'"
);
header
(
"Location: wideareakeys.php3"
);
}
#
...
...
@@ -128,7 +141,7 @@ while ($row = mysql_fetch_array($query_result)) {
echo
"<tr>
<td align=center>
<A href='
cdrompriv
keys.php?deletekey=
$privkey
'>
<A href='
widearea
keys.php
3
?deletekey=
$privkey
'>
<img alt=X src=redball.gif></A></td>
<td>
$name
</td>
<td>
$email
</td>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment