-
Notifications
You must be signed in to change notification settings - Fork 1
/
deletemainadmin.php
58 lines (48 loc) · 1.98 KB
/
deletemainadmin.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
<?php
require_once('application.inc.php');
if (!authorized()) { exit; }
if (!$_SESSION['AUTH_ISMAINADMIN']) { exit; } // additional security
if (!isset($_POST['cancel']) || !setVar($cancel, $_POST['cancel'], 'cancel')) { unset($cancel); }
if (!isset($_POST['save']) || !setVar($save, $_POST['save'], 'save')) { unset($save); }
if (!isset($_POST['check']) || !setVar($check, $_POST['check'], 'check')) { unset($check); }
if (!isset($_POST['deleteconfirmed']) || !setVar($deleteconfirmed, $_POST['deleteconfirmed'], 'deleteconfirmed')) { unset($deleteconfirmed); }
if (!isset($_POST['mainuserid']) || !setVar($mainuserid, $_POST['mainuserid'], 'userid')) {
if (!isset($_GET['mainuserid']) || !setVar($mainuserid, $_GET['mainuserid'], 'userid')) { unset($mainuserid); }
}
if (isset($cancel)) {
redirect2URL('managemainadmins.php');
exit;
}
if (isset($deleteconfirmed)) {
// get the user from the database
$result = DBQuery("
DELETE FROM
" . SCHEMANAME . "vtcal_adminuser
WHERE
id='" . sqlescape($mainuserid) . "'
");
redirect2URL('managemainadmins.php');
exit;
}
elseif (isset($check) && empty($mainuserid)) {
// reroute to sponsormenu page
redirect2URL('update.php?fbid=userdeletefailed');
exit;
}
// print page header
pageheader(lang('delete_main_admin', false), '');
contentsection_begin(lang('delete_main_admin'));
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="mainuserid" value="<?php echo htmlspecialchars($mainuserid, ENT_COMPAT, 'UTF-8'); ?>" />
<input type="hidden" name="deleteconfirmed" value="1" />
<p><strong><?php echo lang('delete_main_admin_confirm'); ?> "<?php echo $mainuserid; ?>"</strong></p>
<p><input type="submit" name="save" value="<?php echo htmlspecialchars(lang('ok_button_text', false), ENT_COMPAT, 'UTF-8'); ?>" />
<input type="submit" name="cancel" value="<?php echo htmlspecialchars(lang('cancel_button_text', false), ENT_COMPAT, 'UTF-8'); ?>" /></p>
</form>
<?php
contentsection_end();
pagefooter();
DBclose();
?>