summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/squark-filter.c6
-rw-r--r--www/blocked.cgi28
2 files changed, 32 insertions, 2 deletions
diff --git a/src/squark-filter.c b/src/squark-filter.c
index a5d4013..88e8a37 100644
--- a/src/squark-filter.c
+++ b/src/squark-filter.c
@@ -418,10 +418,12 @@ static void read_input(struct sqdb *db)
if (!auth_ok) {
send_redirect(BLOB_STR("login.cgi"), id, url, BLOB_STR("auth"), username);
} else if (((1ULL << category) & entry.p.block_categories) &&
+ (!entry.p.hard_block_categories) &&
(now < entry.override_time ||
- now > entry.override_time + FILTER_OVERRIDE_TIMEOUT ||
- ((1ULL << category) & entry.p.hard_block_categories))) {
+ now > entry.override_time + FILTER_OVERRIDE_TIMEOUT)) {
send_redirect(BLOB_STR("warning.cgi"), id, url, get_category_name(db, category), username);
+ } else if ((1ULL << category) & entry.p.hard_block_categories) {
+ send_redirect(BLOB_STR("blocked.cgi"), id, url, get_category_name(db, category), username);
} else
send_ok(id, get_category_name(db, category),
!!((1ULL << category) & entry.p.block_categories));
diff --git a/www/blocked.cgi b/www/blocked.cgi
new file mode 100644
index 0000000..e08d47d
--- /dev/null
+++ b/www/blocked.cgi
@@ -0,0 +1,28 @@
+#!/usr/bin/haserl
+Content-Type: text/html;charset=UTF-8
+Pragma: no-cache
+Cache-Control: no-cache
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>Content Filter Block</title>
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
+ </head>
+ <body>
+ <div><img id="warning" src="/static/warning.png" alt="Warning sign" /></div>
+ <div id="outer_container">
+ <div id="inner_container">
+ <h1>Content Filter Block</h1>
+ <p>Access to
+ <span class="deniedurl"><? echo -n ${GET_DENIEDURL} | cut -d "/" -f1-3 ?></span>
+ has been permanently denied in an attempt to protect you from harmful content.
+ </p>
+ <p>Reason for block: <? echo -n $GET_REASON ?></p>
+ <p>User credentials: <? echo -n $GET_USER ?></p>
+ <p>User IP-address: <? echo -n $REMOTE_ADDR ?></p>
+ </div>
+ </div>
+ </body>
+</html>
+