-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_Delete.php
57 lines (51 loc) · 1.68 KB
/
user_Delete.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
<?php
/*
* Practical Agile Scrum tool
*
* Copyright 2013-2017, P.P. Labuschagne
* Released under the MIT license.
* https://github.com/paul-lab/practical-agile/blob/master/_Licence.txt
*
* Homepage:
* http://practicalagile.co.uk
* http://practicalagile.uk
*
*/
include 'include/header.inc.php';
if ($Usr['Admin_User'] == 1 ) {
$showForm = true;
}else{
$showForm = false;
}
if ($_REQUEST['delete'] && $Usr['Admin_User'] == 1) {
$sql='select ((select count(ID) from story where story.Owner_ID ='.$_REQUEST['id'].')+ (select count(ID) from task where task.User_ID ='.$_REQUEST['id'].'))as counted';
$row = $DBConn->directsql($sqlp);
if ($row[0]['counted']==0) {
auditit(0,0,$_SESSION['Email'],'Deleted User',$_REQUEST['id'].'-'.$_REQUEST['desc']);
$sql='DELETE FROM user_project WHERE User_ID = '.($_REQUEST['id'] + 0);
$result=$DBConn->directsql($sql);
$sql='DELETE FROM user WHERE ID = '.($_REQUEST['id'] + 0);
$result=$DBConn->directsql($sql);
if ($result>0){
$showForm = false;
$deleted = true;
}
}
} else if ($_REQUEST['nodelete']) {
$showForm = false;
$deleted = false;
}
if ($showForm) {
echo '<form method="post" action="?">'.
'<p>Are you sure you want to delete this User?<p>'.
$_REQUEST['id'].' - '.$_REQUEST['desc'].'<p>'.
'<input type="hidden" name="id" value="'.$_REQUEST['id'].'">'.
'<input type="hidden" name="desc" value="'.$_REQUEST['desc'].'">'.
'<input class="btn" type="submit" name="delete" value="Yes, Delete"> '.
'<input class="btn" type="submit" name="nodelete" value="No, Don\'t Delete">'.
'</form>';
} else {
header('Location:user_List.php');
}
include 'include/footer.inc.php';
?>