video.cut.php 721 B

123456789101112131415161718192021
  1. <?php
  2. if (isset($_POST["from"]) and $_POST["from"] == "video.cut") {
  3. require_once ROOT_DIR . "/core/controllers/session.php";
  4. $execute = fichier::cut();
  5. if ($execute["success"] == TRUE) {
  6. unlink(ROOT_DIR . "/video/" . $_POST['md5'] . ".mp4");
  7. rename(ROOT_DIR . "/video/_" . $_POST['md5'] . ".mp4", ROOT_DIR . "/video/" . $_POST['md5'] . ".mp4");
  8. $durationInSeconds = fichier::getVideoDuration(ROOT_DIR . "/video/" . $_POST["md5"] . ".mp4");
  9. fichier::updateTime($_POST["id"], $durationInSeconds);
  10. } else {
  11. core::print_r($execute);
  12. exit();
  13. }
  14. header("Location: /edit/" . $_POST["hash"]);
  15. exit();
  16. } else {
  17. header("Location: /");
  18. exit();
  19. }