plz enable deleting post by ip matching and not just cookie/password. it's silly that i can see my post history in a private window or different device but can't delete a post because of that.
in
https://github.com/fallenPineapple/NPFchan/blob/master/post.php line 212
foreach ($delete as &$id) {
$query = prepare(sprintf("SELECT `id`,`thread`,`time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
if ($post = $query->fetch(PDO::FETCH_ASSOC)) {
$thread = false;
if ($config['user_moderation'] && $post['thread']) {
$thread_query = prepare(sprintf("SELECT `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$thread_query->bindValue(':id', $post['thread'], PDO::PARAM_INT);
$thread_query->execute() or error(db_error($query));
$thread = $thread_query->fetch(PDO::FETCH_ASSOC);
}
if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password))
error($config['error']['invalidpassword']);
change to:
foreach ($delete as &$id) {
$query = prepare(sprintf("SELECT `id`,`thread`,`time`,`password`,`ip` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
if ($post = $query->fetch(PDO::FETCH_ASSOC)) {
$thread = false;
if ($config['user_moderation'] && $post['thread']) {
// Include 'ip' in the thread SELECT as well
$thread_query = prepare(sprintf("SELECT `time`,`password`,`ip` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$thread_query->bindValue(':id', $post['thread'], PDO::PARAM_INT);
$thread_query->execute() or error(db_error($query));
$thread = $thread_query->fetch(PDO::FETCH_ASSOC);
}
$ip_match = ($_SERVER['REMOTE_ADDR'] == $post['ip']);
if (!$ip_match && $thread)
$ip_match = ($_SERVER['REMOTE_ADDR'] == $thread['ip']);
if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password) && !$ip_match)
error($config['error']['invalidpassword']);