-
Notifications
You must be signed in to change notification settings - Fork 0
/
bremove.php
59 lines (50 loc) · 1.06 KB
/
bremove.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
require_once("auth.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CBSD Project</title>
<link type="text/css" href="./css/all.css" rel="stylesheet" />
<style>
body {
background-image: url("/img/adm_bg.jpg");
background-color: #84CF99;
font-size:14px;
}
</style>
</head>
<body>
<?php
require('cbsd.php');
if (!isset($_GET['jname'])) {
echo "Empty jname";
exit(0);
}
if (isset($_GET['sure'])) {
$sure=1;
} else {
$sure=0;
}
$jname=$_GET['jname'];
if ($sure==0) {
$str = <<<EOF
<script type="text/javascript">
<!--
var answer = confirm("Really remove $jname VM?")
if (!answer)
window.location="blist.php"
else
window.location="bremove.php?jname=$jname&sure=1"
// -->
</script>
EOF;
echo $str;
exit(0);
}
$handle=popen("env NOCOLOR=1 /usr/local/bin/sudo /usr/local/bin/cbsd task owner=cbsdweb mode=new /usr/local/bin/cbsd bremove inter=0 jname=$jname", 'r');
$read = fgets($handle, 4096);
echo "Job Queued: $read";
pclose($handle);
header( 'Location: blist.php' ) ;
?>