This blob has been accessed 290 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- error_reporting(E_ERROR);
- if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)) {
- foreach ($data as $key => $value){
- $data[$key] = stripslashes_array($value);
- }
- return $data;
- }
- else {
- return stripslashes($data);
- }
- }
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- $login_username = file_get_contents("data/username.txt");
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
- }
- else {
- $offset = 0;
- }
- function rmdirr($recurse_dirname) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
- rmdirr("$recurse_dirname/$recurse_entry");
- }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['target']) and !empty($_REQUEST['target'])) {
- if ($_REQUEST['target'] == "album") {
- rmdirr("images/{$_REQUEST['entry']}/album");
- rmdirr("data/items/{$_REQUEST['entry']}/album");
- rmdirr("data/albums/{$_REQUEST['entry']}");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
- if ($_REQUEST['target'] == "filedrop") {
- rmdirr("data/items/{$_REQUEST['entry']}/filedrop");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
- if ($_REQUEST['target'] == "pdf") {
- rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
- rmdirr("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}");
- if (file_exists("data/comments/latest/$cmonth/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/latest/$cmonth/{$_REQUEST['entry']}");
- }
- if (file_exists("data/comments/pending/{$_REQUEST['entry']}") and ($_REQUEST['type'] == "pending")) {
- $comment_count_value = file_get_contents("data/comments/pending/{$_REQUEST['entry']}/count.txt");
- if ($comment_count_value <= 1) {
- rmdirr("data/comments/pending/{$_REQUEST['entry']}");
- }
- else {
- $comment_count_value = $comment_count_value - 1;
- }
- }
- header("Location: index.php?entry={$_REQUEST['entry']}&show=comments");
- }
- if ($_POST['action'] == "delete") {
- if (file_exists("data/comments/latest/$cmonth/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/latest/$cmonth/{$_REQUEST['entry']}");
- }
- if (file_exists("data/items/{$_REQUEST['entry']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}");
- }
- if (file_exists("images/{$_REQUEST['entry']}")) {
- rmdirr("images/{$_REQUEST['entry']}");
- }
- if (file_exists("data/albums/{$_REQUEST['entry']}")) {
- rmdirr("data/albums/{$_REQUEST['entry']}");
- }
- if (file_exists("data/sticky/{$_REQUEST['entry']}")) {
- unlink("data/sticky/{$_REQUEST['entry']}");
- }
- if (file_exists("data/comments/pending/{$_REQUEST['entry']}")) {
- rmdirr("data/comments/pending/{$_REQUEST['entry']}");
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
- }
- if ($_POST['action'] == "edit") {
- header("Location: edit.php?entry={$_REQUEST['entry']}");
- }
- if ($_POST['action'] == "home") {
- header("Location: index.php");
- }
- }
- if (!isset($_REQUEST['entry'])) {
- }
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- }
- ?>
- <title>Delete</title>
- <style>
- body {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial, helvetica, sans-serif;
- background-color: #FFFFFF;
- }
- p, td {
- font-size: 11px;
- }
- a {
- font-weight: bold;
- text-decoration: none;
- }
- a:link, a:visited {
- color: #666666;
- }
- a:hover {
- color: #336699;
- }
- a:active {
- color: #336699;
- }
- .input_submit {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 125px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px
- }
- #panel_title {
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
- }
- #panel_body {
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 1px 1px 1px 1px;
- border-style: solid solid solid solid;
- }
- #panel_footer {
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$font_panel_footer},";
- }
- ?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 5px 5px 5px 5px;
- background-color: #FFFFFF;
- margin: 0px;
- border-color: #CCCCCC;
- border-width: 0px 1px 1px 1px;
- border-style: none solid solid solid;
- }
- </style>
- <p><table border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"><tr><td width="525">
- <div id="panel_footer"><font style="font-size: 10px; color: #999999;"><?php readfile("data/items/{$_REQUEST['entry']}/date.txt"); ?></font></div>
- </td></tr></table></p>
- <p><table border="0" cellspacing="2" cellpadding="0">
- <tr><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type="hidden" name="entry" value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="delete">
- <input class="input_submit" type="submit" value="delete">
- </form>
- </td><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="edit">
- <input class="input_submit" type="submit" value="edit">
- </form>
- </td><td>
- <form enctype="multipart/form-data" action="del.php" method="post">
- <input type=hidden name=entry value="<?php echo $_REQUEST['entry']; ?>">
- <input type="hidden" name="action" value="home">
- <input class="input_submit" type="submit" value="home">
- </form>
- </td></tr>
- </table>