remove_test_accounts.pl
Copying Source is Forbidden
71 lines of code
1
#!/usr/local/bin/perl
2
3
($<,$>) = (getpwnam('nobody'), getpwnam('nobody')) or die $!;
4
5
binmode(STDIN, ":utf8");
6
binmode(STDOUT, ":utf8");
7
8
# must have's!
9
use strict;
10
use warnings;
11
use CGI::Carp qw(fatalsToBrowser);
12
use DBI;
13
use URI::Escape;
14
15
use lib "/var/www/html/Pm";
16
17
use Html qw(pre_html_header header html_end);
18
use Bc_chef qw(cookie_get);
19
use Bc_misc qw(get_param referrer get_params_asHash);
20
use Bc_sql qw(sql_execute
21
get_constant
22
user_exists
23
$QUERY_PAGE
24
$QUERY_UID
25
$LOGGEDIN
26
27
$DB
28
);
29
use Redir qw(notice_redir error_redir);
30
use User qw(isUserSuperAdmin $USER_DATA);
31
use Security qw(banned remove_test_accounts);
32
33
my $DEBUG = 0;
34
35
my %params = get_params_asHash();
36
37
my $output;
38
39
if (not user_exists($LOGGEDIN) or banned($LOGGEDIN) or not isUserSuperAdmin($LOGGEDIN)) {
40
my $msg = "Access Denied";
41
if ($DEBUG) { $msg .= " (remove_test_accounts.pl)"; }
42
$output = error_redir("/", $msg);
43
} else {
44
############################################################
45
### YOUR CONTENT HERE
46
$output = pre_html_header();
47
$output .= header(
48
"REMOVE TEST ACCOUNTS",
49
"?nobg_img=1&nogrid=1",
50
0,
51
"setTimeout(removeMsg, " . get_constant("REMOVE_MSG_TIMEOUT") . ");",
52
"",
53
"style=\"padding: 2px;\""
54
);
55
56
remove_test_accounts();
57
58
foreach my $param (keys %params) {
59
$output .= "$param=$params{$param}<br>";
60
}
61
$output .= referrer() . "<br>";
62
63
### END YOUR CONTENT
64
$output .= html_end();
65
############################################################
66
}
67
68
#print $output;
69
print notice_redir(referrer(), "Test Accounts Deleted");
70
71
exit 1;