Added a timeout for unlocked dir folders. Stays unlocked for aprox 3 minutes.
This commit is contained in:
parent
2398775229
commit
76ef1b813f
|
@ -1,14 +1,12 @@
|
|||
<?php
|
||||
|
||||
$MEDIAPLAYER = "mpv ";
|
||||
$MPLAYER_WH = " -xy 1600 -geometry 50%:50% ";
|
||||
$MUSICPLAYER = "/opt/deadbeef/bin/deadbeef";
|
||||
$IMGVIEWER = "mirage";
|
||||
$OFFICEPROG = "libreoffice";
|
||||
$PDFVIEWER = "evince";
|
||||
$TEXTVIEWER = "leafpad";
|
||||
$FILEMANAGER = "spacefm";
|
||||
$LOCKEDFOLDERS = "./dirLockCheck/";
|
||||
$LOCKPASSWORD = "1234";
|
||||
|
||||
$MEDIAPLAYER = "mpv ";
|
||||
$MPLAYER_WH = " -xy 1600 -geometry 50%:50% ";
|
||||
$MUSICPLAYER = "/opt/deadbeef/bin/deadbeef";
|
||||
$IMGVIEWER = "mirage";
|
||||
$OFFICEPROG = "libreoffice";
|
||||
$PDFVIEWER = "evince";
|
||||
$TEXTVIEWER = "leafpad";
|
||||
$FILEMANAGER = "spacefm";
|
||||
$LOCKEDFOLDERS = "./dirLockCheck/";
|
||||
$LOCKPASSWORD = "1234";
|
||||
?>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
// Start of retrieving dir data
|
||||
|
|
|
@ -6,9 +6,14 @@
|
|||
$LOCKS = explode("::::", $LOCKEDFOLDERS);
|
||||
$size = sizeof($LOCKS);
|
||||
|
||||
if ($_SESSION["unlockTime"] > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $size; $i++) {
|
||||
if (strpos($NEWPATH, $LOCKS[$i]) !== false) {
|
||||
if ($PASSWD == $LOCKPASSWORD) {
|
||||
$_SESSION["unlockTime"] = 60;
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
// Start the session
|
||||
session_start();
|
||||
include 'config.php';
|
||||
|
||||
if (isset($_SESSION["refreshState"])) {
|
||||
$state = $_SESSION["refreshState"];
|
||||
|
@ -9,10 +10,16 @@
|
|||
$_SESSION["refreshState"] = $state;
|
||||
}
|
||||
|
||||
if (isset($_SESSION["unlockTime"])) {
|
||||
$_SESSION["unlockTime"] += 1;
|
||||
}
|
||||
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
echo "data:" . $state . "\n\n";
|
||||
|
||||
$_SESSION["refreshState"] = "none";
|
||||
$UNLOCKTIME = 0;
|
||||
|
||||
flush();
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue