$_COOKIE = array(); // destroys cookies parameters session_destroy(); /* Redirects to protected script */ if (!empty($_POST['query_string'])) { header('Location: ' . curPathURL() . curPageName() . '?' . $_POST['query_string']); } else { header('Location: ' . curPathURL() . curPageName()); } die; } else { /* Get current actionname session */ $actionname = $_SESSION['actionname']; } } else { /* Create new actionname session */ $actionname = '.ht_' . uniqid(); $_SESSION['actionname'] = $actionname; } /* Check whitelist */ if (is_file($wl_filename)) { $whitelist = file($wl_filename, FILE_IGNORE_NEW_LINES); /* is IP in whitelist? */ if (!in_array($requester_IP, $whitelist)) { blocked($get_msg, $langcode, $lang_output, $actionname); } } else { /* Empty whitelist */ blocked($get_msg, $langcode, $lang_output, $actionname); } // Lets continue loading protected script
function show_admin() { $blocked = blocked($this->ip); if (isset($_POST['submit'])) { switch ($_POST['submit']) { case 'Save': $this->update2db(); break; case 'Delete': $this->deletedb(); $this->email('Deleted', 'This bug has been deleted.'); $this->msg('Bug deleted!', true); break; } } echo '<form action="index.php?show=bugreport&id=' . $this->_id . '" method="POST">'; echo '<table class="bug" cellspacing="0" align="center">'; echo '<caption class="bug_title">Administration</caption>'; echo '<tr class="bug_row"><td class="bug_info">'; echo '<b>Parent Bug: </b>'; if ($this->bug > 0) { echo '<a href="?show=bug&id=' . $this->bug . '">' . $this->bug . '</a> '; } echo ' <small><a href="javascript:pickBug(' . $this->_id . ')">Change</a></small'; echo '</td><td class="bug_info" rowspan="2">'; echo '<b>Reporter:</b> '; echo hideemail($this->email); echo '</td></tr>'; echo '<tr class="bug_row"><td class="bug_info">'; echo '<b>IP Address: </b>'; echo private_ip($this->ip); echo ' <small>'; echo '<a href="?show=bugreport&id=' . $this->_id . '&do=block">'; if ($blocked !== false) { echo 'Unblock'; } else { echo 'Block'; } echo '</a>'; echo ' '; echo '<a href="?show=bugreport&id=' . $this->_id . '&do=removeip">Remove</a>'; echo '</small></td></tr>'; echo '<tr class="bug_row"><td class="bug_info" align="right" colspan="2">'; echo '<input type="submit" name="submit" value="Delete"/>'; echo '</td></tr>'; echo '</table>'; echo '</form>'; }
include "../libs/lang.lib.php"; include "../libs/mail.lib.php"; include "lang/en"; if (isset($_GET['lang']) && is_readable("lang/" . $_GET['lang'])) { include "lang/" . $_GET['lang']; } if (!isset($_FILES['file']) && !isset($_POST['report'])) { die(text("nomessage")); } include '../libs/xml.class.php'; include '../libs/bugreport.class.php'; include '../libs/bug.class.php'; include '../libs/func.lib.php'; include '../config.inc.php'; include 'common.inc.php'; if (blocked($_SERVER['REMOTE_ADDR']) !== false) { die(text('blocked')); } $bugreport = new BugReport(); if (isset($_FILES['file'])) { $bugreport->load_report($_FILES['file']['tmp_name'], true); } elseif (isset($_POST['report'])) { $bugreport->load_report(stripslashes($_POST['report'])); } $r = $bugreport->check(); if (!$r) { die(text("invalid")); } $r = $bugreport->check_amsn_version(); if (!$r) { die(text("update"));