diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/admin.inc | 13 | ||||
-rw-r--r-- | includes/ban.inc | 8 | ||||
-rw-r--r-- | includes/config.inc | 23 | ||||
-rw-r--r-- | includes/function.inc | 4 | ||||
-rw-r--r-- | includes/theme.inc | 1 | ||||
-rw-r--r-- | includes/user.inc | 4 | ||||
-rw-r--r-- | includes/watchdog.inc | 9 |
7 files changed, 33 insertions, 29 deletions
diff --git a/includes/admin.inc b/includes/admin.inc index 2d13c7c17..2825d728f 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -23,27 +23,28 @@ function admin_header() { td { font-family: helvetica, arial; } </STYLE> <BODY BGCOLOR="#FFFFFF" LINK="#006699" VLINK="#004499" ALINK="#FF0000"> - <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="780"> + <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="2"> <TR><TD COLSPAN="10"><H1><? echo "$site_name"; ?> administration center</H1></TD></TR> - <TR><TD BGCOLOR="#000000" COLSPAN="10" WIDTH="100%"><IMG SRC="images/pixel.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR> + <TR><TD BGCOLOR="#000000" COLSPAN="11" WIDTH="100%"><IMG SRC="images/pixel.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR> <TR> <? admin_icon("stories"); admin_icon("comments"); admin_icon("diaries"); admin_icon("accounts"); - admin_icon("misc"); - admin_icon("bans"); admin_icon("watchdog"); + admin_icon("blobs"); + admin_icon("cron"); + admin_icon("bans"); admin_icon("stats"); admin_icon("info"); admin_icon("home"); ?> </TR> - <TR><TD BGCOLOR="#000000" COLSPAN="10" WIDTH="100%"><IMG SRC="images/pixel.gif" WIDTH="1" HEIGHT="0" ALT=""></TD></TR> + <TR><TD BGCOLOR="#000000" COLSPAN="11" WIDTH="100%"><IMG SRC="images/pixel.gif" WIDTH="1" HEIGHT="0" ALT=""></TD></TR> <TR><TD COLSPAN="10"> </TD></TR> <TR> - <TD COLSPAN="10"> + <TD COLSPAN="11"> <? } diff --git a/includes/ban.inc b/includes/ban.inc index 8a4045945..f31ef849a 100644 --- a/includes/ban.inc +++ b/includes/ban.inc @@ -4,11 +4,13 @@ $type2index = array("addresses" => 0x01, "profanity" => 0x02, "hostnames" => 0x03, "usernames" => 0x04); + $index2type = array(0x01 => "addresses", 0x02 => "profanity", 0x03 => "hostnames", 0x04 => "usernames"); + function ban_match($mask, $category) { ### Perform query: $result = db_query("SELECT * FROM bans WHERE type = $category AND LOWER('$mask') LIKE LOWER(mask)"); @@ -21,14 +23,14 @@ function ban_add($mask, $category, $reason, $message = "") { global $index2type; if (empty($mask)) { - $message = "Failed: empty banmasks are not allowed.<P>\n"; + $message = "failed: empty banmasks are not allowed.<P>\n"; } else if ($ban = db_fetch_object(db_query("SELECT * FROM bans WHERE type = $category AND '$mask' LIKE mask"))) { - $message = "Failed: ban is already matched by '$ban->mask'.<P>\n"; + $message = "failed: ban is already matched by '$ban->mask'.<P>\n"; } else { $result = db_query("INSERT INTO bans (mask, type, reason, timestamp) VALUES ('$mask', '$category', '$reason', '". time() ."')"); - $message = "Added new ban with mask `$mask'.<P>\n"; + $message = "added new ban with mask `$mask'.<P>\n"; ### Add log entry: watchdog("message", "added new ban `$mask' to category `". $index2type[$category] ."' with reason `$reason'."); diff --git a/includes/config.inc b/includes/config.inc index a2ec3763f..87726021f 100644 --- a/includes/config.inc +++ b/includes/config.inc @@ -5,10 +5,10 @@ # ### host: "http://www.drop.org/": -#$db_host = "zind.net"; -#$db_name = "droporg"; -#$db_pass = "DropIes"; -#$db_name = "droporg"; +$db_host = "zind.net"; +$db_name = "droporg"; +$db_pass = "DropIes"; +$db_name = "droporg"; ### host: "http://beta.drop.org/": #$db_host = "zind.net"; @@ -17,10 +17,10 @@ #$db_name = "dries"; ### host: "http://localhost/": -$db_host = "localhost"; -$db_name = "drop"; -$db_pass = "drop"; -$db_name = "drop"; +#$db_host = "localhost"; +#$db_name = "drop"; +#$db_pass = "drop"; +#$db_name = "drop"; # # Administrative information @@ -134,11 +134,4 @@ $submission_rate = array("comment" => "60", // 60 seconds = 1 minute # $submission_size = 12000; // 12.000 characters is more or less 300 lines -# -# Watchdog history: -# how long we should store the log files generated by the -# watchdog -# -$watchdog_history = 604800; // 604.800 seconds = 1 week - ?> diff --git a/includes/function.inc b/includes/function.inc index 8f9336603..3d4f5253f 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -32,6 +32,10 @@ function check_input($message) { return strip_tags(addslashes(substr($message, 0, $submission_size)), $allowed_html); } +function check_code($message) { + return $message; +} + function check_output($message, $nl2br = 0) { global $allowed_html; if ($nl2br == 1) return nl2br(strip_tags(stripslashes($message), $allowed_html)); diff --git a/includes/theme.inc b/includes/theme.inc index 4736f6c3d..70fa3ecc7 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -4,6 +4,7 @@ include "includes/config.inc"; include "includes/database.inc"; include "includes/watchdog.inc"; include "includes/function.inc"; +include "includes/blob.inc"; include "includes/widget.inc"; include "includes/user.inc"; diff --git a/includes/user.inc b/includes/user.inc index 0db582121..75bd5cfaf 100644 --- a/includes/user.inc +++ b/includes/user.inc @@ -71,4 +71,8 @@ function user_setHistory(&$user, $field, $value) { db_query($query); } +function user_clean() { + // todo - called by cron job +} + ?> diff --git a/includes/watchdog.inc b/includes/watchdog.inc index 0bc33dfbf..2a007e3ce 100644 --- a/includes/watchdog.inc +++ b/includes/watchdog.inc @@ -22,12 +22,11 @@ function watchdog($id, $message) { // Perform query to add new watchdog entry: db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')"); +} - // Periodically remove old watchdog entries: - if (time() % 20 == 0) { - $timestamp = time() - $watchdog_history; - db_query("DELETE FROM watchdog WHERE timestamp < $timestamp"); - } +function watchdog_clean($history = "604800") { + $timestamp = time() - $history; + db_query("DELETE FROM watchdog WHERE timestamp < $timestamp"); } ?> |