Set additional video options plus secured against notn dir scan
This commit is contained in:
parent
e0097e173e
commit
7d9d110d16
@ -35,7 +35,7 @@ function getDir(query) {
|
|||||||
// Create path from array of items
|
// Create path from array of items
|
||||||
for (pathNode of pathNodes) { path += pathNode; }
|
for (pathNode of pathNodes) { path += pathNode; }
|
||||||
|
|
||||||
formULPTH.value = path; // Used when upoading a file
|
formULPTH.value = path; // Used when uploading a file
|
||||||
path = "dirQuery=" + path;
|
path = "dirQuery=" + path;
|
||||||
process(path);
|
process(path);
|
||||||
}
|
}
|
||||||
@ -48,7 +48,13 @@ function process(path) {
|
|||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState === 4 && this.status === 200) {
|
if (this.readyState === 4 && this.status === 200) {
|
||||||
// Send the returned data to further process
|
// Send the returned data to further process
|
||||||
|
if (this.responseXML != null) {
|
||||||
updatePage(this.responseXML);
|
updatePage(this.responseXML);
|
||||||
|
} else {
|
||||||
|
document.getElementById('dynDiv').innerHTML =
|
||||||
|
"<p class=\"error\" style=\"width:100%;text-align:center;\"> "
|
||||||
|
+ "No content returned. Check the folder path.</p>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhttp.open("POST", "resources/php/process.php", true); // Open the connection
|
xhttp.open("POST", "resources/php/process.php", true); // Open the connection
|
||||||
@ -57,7 +63,7 @@ function process(path) {
|
|||||||
xhttp.send(path); // Start the process
|
xhttp.send(path); // Start the process
|
||||||
|
|
||||||
// Use a cookie for persistence during browser session....
|
// Use a cookie for persistence during browser session....
|
||||||
document.cookie = path +"; path=" + document.URL;
|
document.cookie = path +"; path=" + document.URL + "; expires=Sun, 31 Dec 2034 12:00:00 UTC";
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePage(returnData) {
|
function updatePage(returnData) {
|
||||||
|
@ -4,7 +4,7 @@ function openFile($FILE) {
|
|||||||
include 'config.php';
|
include 'config.php';
|
||||||
$EXTNSN = strtolower(pathinfo($FILE, PATHINFO_EXTENSION));
|
$EXTNSN = strtolower(pathinfo($FILE, PATHINFO_EXTENSION));
|
||||||
|
|
||||||
if (preg_match('(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg)', $EXTNSN) === 1) {
|
if (preg_match('(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg|mp4|webm)', $EXTNSN) === 1) {
|
||||||
shell_exec($MEDIAPLAYER . $MPLAYER_WH . "\"" . $FILE . "\" > /dev/null &");
|
shell_exec($MEDIAPLAYER . $MPLAYER_WH . "\"" . $FILE . "\" > /dev/null &");
|
||||||
} else if (preg_match('(png|jpg|jpeg|gif)', $EXTNSN) === 1) {
|
} else if (preg_match('(png|jpg|jpeg|gif)', $EXTNSN) === 1) {
|
||||||
shell_exec($IMGVIEWER . ' "' . $FILE . '" > /dev/null &');
|
shell_exec($IMGVIEWER . ' "' . $FILE . '" > /dev/null &');
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
// Retrieve data
|
// Retrieve data
|
||||||
function dirListing($PATH) {
|
function dirListing($PATH) {
|
||||||
|
if (is_dir($PATH)) {
|
||||||
$GeneratedXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DIR_LIST>"
|
$GeneratedXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DIR_LIST>"
|
||||||
. "<PATH_HEAD>" . $PATH . "</PATH_HEAD>";
|
. "<PATH_HEAD>" . $PATH . "</PATH_HEAD>";
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ function dirListing($PATH) {
|
|||||||
}
|
}
|
||||||
$GeneratedXML .= "</DIR_LIST>";
|
$GeneratedXML .= "</DIR_LIST>";
|
||||||
echo $GeneratedXML;
|
echo $GeneratedXML;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determin action
|
// Determin action
|
||||||
|
Loading…
Reference in New Issue
Block a user