Exemplo n.º 1
0
        } else {
            $url = cleanInput($_POST["url"]);
        }
        if (empty($_POST["title"])) {
            $title_error = "Video pealkirja määramine on kohustuslik";
        } else {
            $title = cleanInput($_POST["title"]);
        }
        if (empty($_POST["keywords"])) {
            $keywords_error = "Videole märksõnade lisamine on kohustuslik";
        } else {
            $keywords = cleanInput($_POST["keywords"]);
        }
        if ($url_error == "" && $title_error == "" && $keywords_error == "") {
            //echo "siin";
            $m = createVideo($url, $title, $keywords);
        }
    }
}
function cleanInput($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
getAllVideos();
//kontrollin kas kasutaja on sisse logitud
if (isset($_SESSION['logged_in_user_id'])) {
    //kasutaja muudab andmeid
    if (isset($_GET["update"])) {
Exemplo n.º 2
0
}
if (canView('Events')) {
    switch ($_REQUEST['action']) {
        case "video":
            if (empty($_REQUEST['videoFormat'])) {
                ajaxError("Video Generation Failure, no format given");
            } elseif (empty($_REQUEST['rate'])) {
                ajaxError("Video Generation Failure, no rate given");
            } elseif (empty($_REQUEST['scale'])) {
                ajaxError("Video Generation Failure, no scale given");
            } else {
                $sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?' . monitorLimitSql();
                if (!($event = dbFetchOne($sql, NULL, array($_REQUEST['id'])))) {
                    ajaxError("Video Generation Failure, can't load event");
                } else {
                    if ($videoFile = createVideo($event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $_REQUEST['scale'], !empty($_REQUEST['overwrite']))) {
                        ajaxResponse(array('response' => $videoFile));
                    } else {
                        ajaxError("Video Generation Failed");
                    }
                }
            }
            $ok = true;
            break;
        case 'deleteVideo':
            unlink($videoFiles[$_REQUEST['id']]);
            unset($videoFiles[$_REQUEST['id']]);
            ajaxResponse();
            break;
        case "export":
            require_once ZM_SKIN_PATH . '/includes/export_functions.php';
Exemplo n.º 3
0
        $defaultVideoFormat = $matches[1];
    } elseif ($matches[2] == '**') {
        $defaultPhoneFormat = $matches[1];
    }
}
if (!isset($_REQUEST['videoFormat'])) {
    if (isset($defaultPhoneFormat)) {
        $_REQUEST['videoFormat'] = $defaultPhoneFormat;
    } elseif (isset($defaultVideoFormat)) {
        $_REQUEST['videoFormat'] = $defaultVideoFormat;
    } else {
        $videoFormat = $ffmpegFormats[0];
    }
}
if (!empty($_REQUEST['generate'])) {
    $videoFile = createVideo($event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $videoSize, !empty($_REQUEST['overwrite']));
}
$videoFiles = array();
if ($dir = opendir($eventPath)) {
    while (($file = readdir($dir)) !== false) {
        $file = $eventPath . '/' . $file;
        if (is_file($file)) {
            if (preg_match('/-S([\\da-z]+)\\.(?:' . join('|', $videoFormats) . ')$/', $file, $matches)) {
                if ($matches[1] == $videoSize) {
                    $videoFiles[] = $file;
                }
            }
        }
    }
    closedir($dir);
}
Exemplo n.º 4
0
<?php

include 'functions/cURLFunctions.php';
include 'functions/config.php';
session_start();
if (!isset($_SESSION['login_user'])) {
    header("location: login");
}
if (isset($_POST['videoinputsection']) && isset($_POST['videoinputtitle']) && isset($_POST['videoinputdesc']) && isset($_POST['selectedyearvideo'])) {
    global $uploadDir;
    $video = createVideo($_POST['videoinputtitle'], $_POST['videoinputdesc'], "0", $_POST['videoinputsection'], $_POST['selectedyearvideo']);
    if (empty($_FILES['videoinputfile']) && $_FILES['videoinputfile']['name'] != "") {
        foreach ($video as $value) {
            $fileExt = end(explode(".", $_FILES["videoinputfile"]["name"]));
            $fileName = $value["ID"] . "." . $fileExt;
            move_uploaded_file($_FILES["videoinputfile"]["tmp_name"], $uploadDir . $fileName);
            chmod($uploadDir . $fileName, 0644);
        }
    }
    header("location: index?year=" . $_POST['selectedyearvideo'] . "&section=" . $_POST['videoinputsection']);
}
if (isset($_POST['updatevideoinputtitle']) && isset($_POST['updatevideoinputdesc']) && isset($_POST['updatevideoid']) && isset($_POST['updatevideoyear']) && isset($_POST['updatevideosection'])) {
    global $uploadDir;
    updateVideo($_POST['updatevideoinputtitle'], $_POST['updatevideoinputdesc'], "0", $_POST['updatevideosection'], $_POST['updatevideoyear'], $_POST['updatevideoid']);
    if (empty($_FILES['videoinputfile']) && $_FILES['updatevideoinputfile']['name'] != "") {
        echo "test1";
        $fileExt = end(explode(".", $_FILES["updatevideoinputfile"]["name"]));
        $fileName = $_POST['updatevideoid'] . "." . $fileExt;
        move_uploaded_file($_FILES["updatevideoinputfile"]["tmp_name"], $uploadDir . $fileName);
        chmod($uploadDir . $fileName, 0644);
    }