-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdelete-account-admin.php
46 lines (28 loc) · 1.15 KB
/
delete-account-admin.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
<?php
require 'class.base.php';
require 'class.html.php';
require 'class.user.php';
$base_instance=new base();
$html_instance=new html();
$user_instance=new user();
$user_instance->check_for_admin();
$userid=isset($_REQUEST['userid']) ? (int)$_REQUEST['userid'] : exit;
if (isset($_POST['save'])) {
if (!empty($userid)) { $user_instance->delete_user($userid); }
$base_instance->show_message('User deleted','<a href="show-user-list.php">[Show all User]</a>'); exit;
}
else {
$data=$base_instance->get_data("SELECT * FROM {$base_instance->entity['USER']['MAIN']} WHERE ID='$userid'");
if (!$data) { $base_instance->show_message('User not found'); exit; }
$username=$data[1]->username;
}
$html_instance->add_parameter(
array('ACTION'=>'show_form',
'HEADER'=>'<font color="#ff0000">Delete this user?</font>',
'FORM_ACTION'=>$_SERVER['PHP_SELF'],
'BUTTON_TEXT'=>'Delete User'
));
$html_instance->add_form_field(array('TYPE'=>'hidden','NAME'=>'userid','VALUE'=>"$userid"));
$html_instance->add_form_field(array('TYPE'=>'label','TEXT'=>"Are you sure you want to delete the user <b>$username</b> and all items belonging to this user?"));
$html_instance->process();
?>