diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1,6 +1,16 @@ <?php include('config.php'); +$signout = '<a href="' . basename($_SERVER['PHP_SELF']) . '?signout">Sign out</a>'; + +if (isset($_GET['signout'])) { + if (isset($_COOKIE['password'])) { + unset($_COOKIE['password']); + setcookie('password', null, -1, '/', $_SERVER['SERVER_NAME']); + header('Location: ' . $url); + } +} + if ($_POST && $pass) { if ((hash("sha256", $_POST['password']) == $pass)) { if (isset($_POST['rememberme'])) { @@ -40,6 +50,8 @@ if ($_POST && $pass) { <?php exit(); } +} else { + $signout = ""; } function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f %s') { @@ -284,7 +296,7 @@ if ($headerfile) { echo file_get_contents($headerfile); } ?> -<pre><img src="/icons/blank.gif" alt="Icon "> <a href="<?php echo $nameurl; ?>">Name</a> <a href="<?php echo $modifiedurl; ?>">Last modified</a> <a href="<?php echo $sizeurl; ?>">Size</a> +<pre><img src="/icons/blank.gif" alt="Icon "> <a href="<?php echo $nameurl; ?>">Name</a> <a href="<?php echo $modifiedurl; ?>">Last modified</a> <a href="<?php echo $sizeurl; ?>">Size</a> <?php echo $signout; ?> <hr><?php for ($i = 0; $i < count($listing); $i++) { if (strlen($listing[$i]['filename']) > 23) { |