delete.php 393 B

123456789101112131415161718192021222324
  1. <?php
  2. session_start();
  3. include_once("tools/util.php");
  4. if (!check_login()) {
  5. echo "unauthorized";
  6. die();
  7. }
  8. include_once ('tools/htpasswd.php');
  9. $ini = read_config();
  10. $htpasswd = new htpasswd ( $ini ['secure_path'] );
  11. if (isset ( $_POST['user'] )) {
  12. $user = $_POST['user'];
  13. if ($htpasswd->user_delete($user)) {
  14. echo "success";
  15. } else {
  16. echo "error";
  17. }
  18. } else {
  19. echo "error";
  20. }
  21. ?>