mirror of
https://github.com/netfun2000/pheditor.git
synced 2026-02-27 09:45:14 +08:00
Add reload action after session expire
This commit is contained in:
@@ -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('<title>Pheditor</title><form method="post"><div style="text-align:center"><h1><a href="http://github.com/hamidsamak/pheditor" target="_blank" title="PHP file editor" style="color:#444;text-decoration:none" tabindex="3">Pheditor</a></h1>' . (isset($error) ? '<p style="color:#dd0000">' . $error . '</p>' : null) . '<input id="pheditor_password" name="pheditor_password" type="password" value="" placeholder="Password…" tabindex="1"><br><br><input type="submit" value="Login" tabindex="2"></div></form><script type="text/javascript">document.getElementById("pheditor_password").focus();</script>');
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user