File: Hits.pm

package info (click to toggle)
pnopaste 1.4-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 356 kB
  • sloc: perl: 1,043; sh: 45; sql: 37; makefile: 5
file content (36 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package Hits;

# This file is part of the pnopaste program
# Copyright (C) 2008-2010 Patrick Matthäi <pmatthaei@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

use warnings;
use strict;
use lib::Database;


### Inc the Badword hit.
sub Inc_Badword {
	my($ID) = @_;

	my $Query = 'UPDATE blacklist_word SET hits = hits + 1 WHERE id = ? LIMIT 1';
	$Query = $Database::dbh->prepare($Query);
	$Query->execute($ID);
}


### Inc the Badhost hit.
sub Inc_Badhost {
	my($ID) = @_;

	my $Query = 'UPDATE blacklist_ip SET hits = hits + 1 WHERE id = ? LIMIT 1';
	$Query = $Database::dbh->prepare($Query);
	$Query->execute($ID);
}


1;