Skip to content

Commit

Permalink
Update editUser.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaphster authored Nov 28, 2016
1 parent 2b4245a commit e0d5c47
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions editUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@
}
break;
case "activateUser":
$q = "UPDATE db.user SET activeuserflag = 1 where id = ?";
if($conn->update($q, '', $_POST['id'])){
$q = "UPDATE db.user SET activeuserflag = ? where id = ?";
if($conn->update($q, "1", $_POST['id'])){
echo json_encode(array("success"=> 'User activated'));
} else {
echo json_encode(array("error"=> 'User activation failed'));
}
break;
case "deactivateUser":
$q = "UPDATE db.user SET activeuserflag = 0 where id = ?";
if($conn->update($q, '', $_POST['id'])){
$q = "UPDATE db.user SET activeuserflag = ? where id = ?";
if($conn->update($q, "0", $_POST['id'])){
echo json_encode(array("success"=> 'User deactivated'));
} else {
echo json_encode(array("error"=> 'User deactivation failed'));
}
break;
case "adminify":
$q = "UPDATE db.user SET isadmin = 1 where id = ?";
if($conn->update($q, '', $_POST['id'])){
$q = "UPDATE db.user SET isadmin = ? where id = ?";
if($conn->update($q, '1', $_POST['id'])){
echo json_encode(array("success"=> 'User is now an admin'));
} else {
echo json_encode(array("error"=> 'Adminification failed'));
}
break;
case "deadminify":
$q = "UPDATE db.user SET isadmin = 0 where id = ?";
if($conn->update($q, '', $_POST['id'])){
$q = "UPDATE db.user SET isadmin = ? where id = ?";
if($conn->update($q, '0', $_POST['id'])){
echo json_encode(array("success"=> 'User is no longer an admin'));
} else {
echo json_encode(array("error"=> 'De-admnification failed'));
Expand Down

0 comments on commit e0d5c47

Please sign in to comment.