-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
72 lines (63 loc) · 1.5 KB
/
index.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
60
61
62
63
64
65
66
67
68
69
70
71
72
<html>
<title>DUDI - Distributed Useraccount Disabler</title>
<body bgcolor="ffffff" text="#00000" link="#ff0000" vlink="#ff0000">
<?
error_reporting(E_ALL);
$DelFile = "/home/www-data/user.dat";
if (file_exists($DelFile)) {
echo "<center><img src=\"dudi.png\" border=\"0\"><br>There is an account already in the queue to be disabled.<br>Please try again in five minutes.</center></html>";
exit;
}
if ( $_POST['action'] == "add") {
$UserDel = $_POST['useracct'];
$fp = fopen( $DelFile , 'w' );
fwrite($fp, $UserDel);
fclose($fp);
// set perms so script owner can delete after exec.
chmod( $DelFile, 0777 );
print "<center><img src=\"dudi.png\" border=\"0\"><br><br><b>Account queued to be disabled.<br>Click <a href=index.php>HERE to return.</a><br /></center>";
}
else
{
$script = getenv("SCRIPT_NAME");
?>
<center>
<table>
<tr>
<td rowspan="2"><img src="dudi.png" border="0"></td>
<td valign="bottom">
<form action="<? echo "$script"; ?>" method="POST">
<input type="hidden" name="action" value="add">
Enter account to disable:
</td>
</tr>
<tr>
<td valign="top">
<input type="text" name="useracct" size="15">
<input type="submit" value="submit">
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2" align="center">
Last account disabled
</td>
</tr>
<tr>
<td colspan="2" align="center">
<?
$LastAccts = file('/home/www-data/log');
print_r($LastAccts[0]);
?>
</td>
</tr>
</table>
</center>
<?
}
?>
<body>
</html>