Figured out php sessions...
This commit is contained in:
parent
7d9d110d16
commit
2b1b7feda6
@ -10,13 +10,12 @@ function openFile($FILE) {
|
||||
shell_exec($IMGVIEWER . ' "' . $FILE . '" > /dev/null &');
|
||||
} else if (preg_match('(psf|mp3|ogg|flac)', $EXTNSN) === 1) {
|
||||
shell_exec($MUSICPLAYER . ' "' . $FILE . '" > /dev/null &');
|
||||
} else if (preg_match('(odt|doc|docx|rtf)', $EXTNSN) === 1) {
|
||||
shell_exec($OFFICEPROG . ' "' . $FILE . '" > /dev/null &');
|
||||
} else if (preg_match('(txt)', $EXTNSN) === 1) {
|
||||
shell_exec($TEXTVIEWER . ' "' . $FILE . '" > /dev/null &');
|
||||
} else if (preg_match('(pdf)', $EXTNSN) === 1) {
|
||||
shell_exec($PDFVIEWER . ' "' . $FILE . '" > /dev/null &');
|
||||
// Has to be below b/c pdf somehow regesters as an office app.... wtf....
|
||||
} else if (preg_match('(odt|doc|docx|rtf)', $EXTNSN) === 1) {
|
||||
shell_exec($OFFICEPROG . ' "' . $FILE . '" > /dev/null &');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// Retrieve data
|
||||
// Retrieve data
|
||||
function dirListing($PATH) {
|
||||
if (is_dir($PATH)) {
|
||||
$GeneratedXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DIR_LIST>"
|
||||
|
@ -1,14 +1,15 @@
|
||||
<?php
|
||||
// Prompt an update clint side when sse checks that there is updateListing.
|
||||
$myfile = fopen("../vars.txt", "r");
|
||||
$state = fgets($myfile);
|
||||
fclose($myfile);
|
||||
// Start the session
|
||||
session_start();
|
||||
|
||||
$myfile = fopen("../vars.txt", "w");
|
||||
fclose($myfile);
|
||||
if ($_SESSION["state"] != null || $_SESSION["state"] == "undefined") {
|
||||
$state = $_SESSION["state"];
|
||||
}
|
||||
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
echo "data:" . $state . "\n\n";
|
||||
|
||||
$_SESSION["state"] = "none";
|
||||
flush();
|
||||
?>
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
function uploadFiles($targetDir) {
|
||||
echo "<!DOCTYPE html>"
|
||||
. "<head>"
|
||||
@ -56,11 +59,7 @@ function uploadFiles($targetDir) {
|
||||
}
|
||||
echo "</body></html>";
|
||||
|
||||
// Prompt an update clint side when sse checks that there is updateListing.
|
||||
$myfile = fopen("resources/vars.txt", "w+");
|
||||
$txt = "updateListing";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
$_SESSION["state"] = "updateListing";
|
||||
}
|
||||
|
||||
// Check access type.
|
||||
|
Loading…
Reference in New Issue
Block a user