From 6dac47a11a57bc4461cf563c213df17caf8c7e89 Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Tue, 6 Aug 2024 11:37:35 -0300 Subject: [PATCH] update form --- php/upload.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php/upload.php b/php/upload.php index 81601f6..09ea4b0 100755 --- a/php/upload.php +++ b/php/upload.php @@ -73,6 +73,11 @@ return 1; } + function push_to_git() { + $git_cmd = '-c user.name="www-data" -c user.email="no-replay@example.org"' + shell_exec('cd /var/www/src/AliceClass;' . $git_cmd . 'add _data/aulas.json;' . $git_cmd . 'commit -m "update data";' . $git_cmd . 'push'); + } + $username = $_SERVER['PHP_AUTH_USER']; $video_title = $_POST["videoTitle"]; @@ -86,8 +91,8 @@ $brute_file = $target_dir . "/src/" . $video_title . '.mkv'; $target_file = $target_dir . "/dest/" . $video_title . '.mp4'; - // create_user_dir($target_dir) || echo error && exit; - // check_file_extension($_FILES["fileToUpload"]["tmp_name"]) || echo error && exit; + create_user_dir($target_dir); //|| echo error && exit; + check_file_extension($_FILES["fileToUpload"]["tmp_name"]); // || echo error && exit; // !check_file_exists($brute_file) || echo error && exit; upload($orig_file, $brute_file); //|| echo error && exit; process_file($username, $video_title, $brute_file, $target_file); // || echo error && exit;