video.cut.php 667 B

123456789101112131415161718192021
  1. <?php
  2. if(isset($_POST["from"]) AND $_POST["from"] == "video.cut"){
  3. require_once "../core/controllers/session.php";
  4. $execute = fichier::cut();
  5. if($execute["success"] == TRUE){
  6. unlink("../video/" . $_POST['md5']. ".mp4");
  7. rename("../video/_" . $_POST['md5']. ".mp4", "../video/" . $_POST['md5']. ".mp4");
  8. $durationInSeconds = fichier::getVideoDuration("../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. }