diff --git a/pheditor.php b/pheditor.php index 8a47707..841f1ff 100755 --- a/pheditor.php +++ b/pheditor.php @@ -76,6 +76,10 @@ if (empty(PASSWORD) === false && (isset($_SESSION['pheditor_admin']) === false | file_put_contents(LOG_FILE, serialize($log)); } + } else if (isset($_POST['action'])) { + header('HTTP/1.0 403 Forbidden'); + + die('Your session has expired.'); } die('Pheditor

Pheditor

' . (isset($error) ? '

' . $error . '

' : null) . '

'); @@ -728,6 +732,18 @@ $(function(){ $("#files").on("click", ".jstree-anchor", function(){ location.href = $(this).attr("href"); }); + + $(document).ajaxError(function(event, request, settings){ + var message = "An error occurred with this request."; + + if (request.responseText.length > 0) { + message = request.responseText; + } + + if (confirm(message + " Do you want to reload the page?")) { + location.reload(); + } + }); });