delete.php 508 B

12345678910111213141516171819202122232425262728
  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. $use_metadata = $ini ['use_metadata'];
  11. $htpasswd = new htpasswd ( $ini ['secure_path'], $use_metadata );
  12. if (isset ( $_POST['user'] )) {
  13. $user = $_POST['user'];
  14. if ($htpasswd->user_delete($user)) {
  15. if ($use_metadata) {
  16. $htpasswd->meta_delete($user);
  17. }
  18. echo "success";
  19. } else {
  20. echo "error";
  21. }
  22. } else {
  23. echo "error";
  24. }
  25. ?>