From a9b7f9b1bc88b196a165ebb1bb74d01081d1e6fd Mon Sep 17 00:00:00 2001
From: Michael Foster
{% trans %}Your IP address is{% endtrans %} {{ ban.ip }}.
- {% if post %} + {% if config.ban_page_extra %} +{{ config.ban_page_extra }}
+ {% endif %} + + {% if post and config.ban_show_post %}You were banned for the following post on {{ board.url }}:
+{% trans %}You were banned for the following post on {% endtrans %}{{ board.url }}:
{{ post }}{{ config.ban_page_extra }}
+ {% if config.ban_appeals %} ++ {% trans %}You submitted an appeal for this ban on{% endtrans %} + {{ pending_appeal|date(config.ban_date) }}. {% trans %}It is still pending{% endtrans %}. +
+ {% elseif denied_appeals|length >= config.ban_appeals_max %} + {% if denied_appeals|length == 1 %} ++ {% trans %}You appealed this ban on{% endtrans %} + {{ denied_appeals[0]|date(config.ban_date) }} + {% trans %}and it was denied. You may not appeal this ban again.{% endtrans %} +
+ {% else %} +{% trans %}You have submitted the maximum number of ban appeals allowed. You may not appeal this ban again.{% endtrans %}
+ {% endif %} + {% else %} + {% if denied_appeals|length %} + {% if denied_appeals|length == 1 %} ++ {% trans %}You appealed this ban on{% endtrans %} + {{ denied_appeals[0]|date(config.ban_date) }} + {% trans %}and it was denied.{% endtrans %} +
+{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}
+ {% else %} ++ {% trans %}You last appealed this ban on{% endtrans %} + {{ denied_appeals[denied_appeals|length - 1]|date(config.ban_date) }} + {% trans %}and it was denied.{% endtrans %} +
+{% trans %}You may appeal this ban again. Please enter your reasoning below.{% endtrans %}
+ {% endif %} + {% else %} +{% trans %}You may appeal this ban. Please enter your reasoning below.{% endtrans %}
+ {% endif %} + + {% endif %} {% endif %} -{% endfilter %} - +{% endfilter %} \ No newline at end of file diff --git a/templates/mod/ban_appeals.html b/templates/mod/ban_appeals.html new file mode 100644 index 00000000..f43b7db5 --- /dev/null +++ b/templates/mod/ban_appeals.html @@ -0,0 +1,106 @@ +{% for ban in ban_appeals %} + + +
--
cgit v1.3
From 39be89ba4945238f6311454283a66930b94577be Mon Sep 17 00:00:00 2001
From: Michael Foster
+
\ No newline at end of file
--
cgit v1.3
From fcbc21131431725e4cb4cafde0fd907e9c607fa1 Mon Sep 17 00:00:00 2001
From: Michael Foster
+
+ {% for var in cached_vars %}
+ Key
+ Hits
+ Created
+ Expires
+ Size
+ Value
+
+
+ {% endfor %}
+{{ var.key }}
+ {{ var.num_hits }}
+ {{ var.creation_time|ago }} ago
+ {{ (var.creation_time + var.ttl)|until }} (ttl: {{ var.ttl }}s)
+ {{ var.mem_size }} bytes
+
+ {% set value = var.value|json_encode %}
+
+ {{ value[:80]|e('html') }}{% if value|length > 80 %}…{% endif %}
+ Created
Expires
Size
- Value
{% for var in cached_vars %}
-
{% endfor %}
\ No newline at end of file
--
cgit v1.3
From 4ce6218ba05fa4fbef02d35438fce9e7e2c928c7 Mon Sep 17 00:00:00 2001
From: Michael Foster {{ var.key }}
+ {% if var.key %}{{ var.key }}{% else %}{{ var.info }}{% endif %}
{{ var.num_hits }}
{{ var.creation_time|ago }} ago
- {{ (var.creation_time + var.ttl)|until }} (ttl: {{ var.ttl }}s)
+ {{ (var.creation_time + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})
{{ var.mem_size }} bytes
-
- {% set value = var.value|json_encode %}
-
{{ value[:80]|e('html') }}{% if value|length > 80 %}…{% endif %}
-
-
{% endfor %}
--
cgit v1.3
From 6eefc5ea2a450d868ecb18465eafea7e8bdb9693 Mon Sep 17 00:00:00 2001
From: Michael Foster {% if var.key %}{{ var.key }}{% else %}{{ var.info }}{% endif %}
- {{ var.num_hits }}
- {{ var.creation_time|ago }} ago
- {{ (var.creation_time + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})
+ {{ var.key ? var.key : var.info }}
+ {{ var.nhits ? var.nhits : var.num_hits }}
+ {{ (var.ctime ? var.ctime : var.creation_time)|ago }} ago
+ {{ ((var.ctime ? var.ctime : var.creation_time) + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})
{{ var.mem_size }} bytes
-
{% endfor %}
--
cgit v1.3
From 04cfeaf01c5ea830b1caa1a442a864019a02ce39 Mon Sep 17 00:00:00 2001
From: Michael Foster {{ var.key ? var.key : var.info }}
- {{ var.nhits ? var.nhits : var.num_hits }}
- {{ (var.ctime ? var.ctime : var.creation_time)|ago }} ago
- {{ ((var.ctime ? var.ctime : var.creation_time) + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})
+ {{ var.key is defined ? var.key : var.info }}
+ {{ var.nhits is defined ? var.nhits : var.num_hits }}
+ {{ (var.ctime is defined ? var.ctime : var.creation_time)|ago }} ago
+ {{ ((var.ctime is defined ? var.ctime : var.creation_time) + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})
{{ var.mem_size }} bytes
Expires
Size
- {% for var in cached_vars %}
+ {% for var in cached_vars if (var.ctime is defined ? var.ctime : var.creation_time) + var.ttl > time() %}
{{ var.key is defined ? var.key : var.info }}
{{ var.nhits is defined ? var.nhits : var.num_hits }}
--
cgit v1.3
From c8062fbf767100a46e32a81ed34d8d8eaf5c45e7 Mon Sep 17 00:00:00 2001
From: Michael Foster
'));
@@ -2030,7 +2094,8 @@ function mod_config($board_config = false) {
'readonly' => $readonly,
'boards' => listBoards(),
'board' => $board_config,
- 'file' => $config_file
+ 'file' => $config_file,
+ 'token' => make_secure_link_token('config' . ($board_config ? '/' . $board_config : ''))
));
return;
}
@@ -2113,17 +2178,18 @@ function mod_config($board_config = false) {
}
}
- header('Location: ?/config', true, $config['redirect_http']);
+ header('Location: ?/config' . ($board_config ? '/' . $board_config : ''), true, $config['redirect_http']);
exit;
}
-
+
mod_page(_('Config editor') . ($board_config ? ': ' . sprintf($config['board_abbreviation'], $board_config) : ''),
'mod/config-editor.html', array(
'boards' => listBoards(),
'board' => $board_config,
'conf' => $conf,
- 'file' => $config_file
+ 'file' => $config_file,
+ 'token' => make_secure_link_token('config' . ($board_config ? '/' . $board_config : ''))
));
}
@@ -2149,6 +2215,11 @@ function mod_themes_list() {
}
}
closedir($dir);
+
+ foreach ($themes as $theme_name => &$theme) {
+ $theme['rebuild_token'] = make_secure_link_token('themes/' . $theme_name . '/rebuild');
+ $theme['uninstall_token'] = make_secure_link_token('themes/' . $theme_name . '/uninstall');
+ }
mod_page(_('Manage themes'), 'mod/themes.html', array(
'themes' => $themes,
@@ -2219,7 +2290,7 @@ function mod_theme_configure($theme_name) {
'theme_name' => $theme_name,
'theme' => $theme,
'result' => $result,
- 'message' => $message,
+ 'message' => $message
));
return;
}
@@ -2230,6 +2301,7 @@ function mod_theme_configure($theme_name) {
'theme_name' => $theme_name,
'theme' => $theme,
'settings' => $settings,
+ 'token' => make_secure_link_token('themes/' . $theme_name)
));
}
diff --git a/mod.php b/mod.php
index cf6423ed..f6a4aa0c 100644
--- a/mod.php
+++ b/mod.php
@@ -24,49 +24,51 @@ if (get_magic_quotes_gpc()) {
$query = isset($_SERVER['QUERY_STRING']) ? rawurldecode($_SERVER['QUERY_STRING']) : '';
$pages = array(
- '' => ':?/', // redirect to dashboard
- '/' => 'dashboard', // dashboard
- '/confirm/(.+)' => 'confirm', // confirm action (if javascript didn't work)
- '/logout' => 'logout', // logout
+ '' => ':?/', // redirect to dashboard
+ '/' => 'dashboard', // dashboard
+ '/confirm/(.+)' => 'confirm', // confirm action (if javascript didn't work)
+ '/logout' => 'secure logout', // logout
- '/users' => 'users', // manage users
- '/users/(\d+)' => 'user', // edit user
- '/users/(\d+)/(promote|demote)' => 'user_promote', // prmote/demote user
- '/users/new' => 'user_new', // create a new user
- '/new_PM/([^/]+)' => 'new_pm', // create a new pm
- '/PM/(\d+)(/reply)?' => 'pm', // read a pm
- '/inbox' => 'inbox', // pm inbox
+ '/users' => 'users', // manage users
+ '/users/(\d+)/(promote|demote)' => 'secure user_promote', // prmote/demote user
+ '/users/(\d+)' => 'secure_POST user', // edit user
+ '/users/new' => 'secure_POST user_new', // create a new user
- '/noticeboard' => 'noticeboard', // view noticeboard
- '/noticeboard/(\d+)' => 'noticeboard', // view noticeboard
- '/noticeboard/delete/(\d+)' => 'noticeboard_delete', // delete from noticeboard
- '/log' => 'log', // modlog
- '/log/(\d+)' => 'log', // modlog
- '/log:([^/]+)' => 'user_log', // modlog
- '/log:([^/]+)/(\d+)' => 'user_log', // modlog
- '/news' => 'news', // view news
- '/news/(\d+)' => 'news', // view news
- '/news/delete/(\d+)' => 'news_delete', // delete from news
+ '/new_PM/([^/]+)' => 'secure_POST new_pm', // create a new pm
+ '/PM/(\d+)(/reply)?' => 'pm', // read a pm
+ '/inbox' => 'inbox', // pm inbox
- '/edit/(\%b)' => 'edit_board', // edit board details
- '/new-board' => 'new_board', // create a new board
+ '/log' => 'log', // modlog
+ '/log/(\d+)' => 'log', // modlog
+ '/log:([^/]+)' => 'user_log', // modlog
+ '/log:([^/]+)/(\d+)' => 'user_log', // modlog
+ '/news' => 'secure_POST news', // view news
+ '/news/(\d+)' => 'secure_POST news', // view news
+ '/news/delete/(\d+)' => 'secure news_delete', // delete from news
- '/rebuild' => 'rebuild', // rebuild static files
- '/reports' => 'reports', // report queue
- '/reports/(\d+)/dismiss(all)?' => 'report_dismiss', // dismiss a report
+ '/noticeboard' => 'secure_POST noticeboard', // view noticeboard
+ '/noticeboard/(\d+)' => 'secure_POST noticeboard', // view noticeboard
+ '/noticeboard/delete/(\d+)' => 'secure noticeboard_delete', // delete from noticeboard
- '/IP/([\w.:]+)' => 'ip', // view ip address
- '/IP/([\w.:]+)/remove_note/(\d+)' => 'ip_remove_note', // remove note from ip address
- '/bans' => 'bans', // ban list
- '/bans/(\d+)' => 'bans', // ban list
- '/ban-appeals' => 'ban_appeals', // view ban appeals
+ '/edit/(\%b)' => 'secure_POST edit_board', // edit board details
+ '/new-board' => 'secure_POST new_board', // create a new board
+
+ '/rebuild' => 'secure_POST rebuild', // rebuild static files
+ '/reports' => 'reports', // report queue
+ '/reports/(\d+)/dismiss(all)?' => 'secure report_dismiss', // dismiss a report
+
+ '/IP/([\w.:]+)' => 'secure_POST ip', // view ip address
+ '/IP/([\w.:]+)/remove_note/(\d+)' => 'secure ip_remove_note', // remove note from ip address
- '/search' => 'search_redirect', // search
- '/search/(posts|IP_notes|bans|log)/(.+)/(\d+)' => 'search', // search
- '/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search
-
- // CSRF-protected moderator actions
'/ban' => 'secure_POST ban', // new ban
+ '/bans' => 'secure_POST bans', // ban list
+ '/bans/(\d+)' => 'secure_POST bans', // ban list
+ '/ban-appeals' => 'secure_POST ban_appeals', // view ban appeals
+
+ '/search' => 'search_redirect', // search
+ '/search/(posts|IP_notes|bans|log)/(.+)/(\d+)' => 'search', // search
+ '/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search
+
'/(\%b)/ban(&delete)?/(\d+)' => 'secure_POST ban_post', // ban poster
'/(\%b)/move/(\d+)' => 'secure_POST move', // move thread
'/(\%b)/edit(_raw)?/(\d+)' => 'secure_POST edit_post', // edit post
@@ -78,13 +80,13 @@ $pages = array(
'/(\%b)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread
'/(\%b)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread
- '/themes' => 'themes_list', // manage themes
- '/themes/(\w+)' => 'theme_configure', // configure/reconfigure theme
- '/themes/(\w+)/rebuild' => 'theme_rebuild', // rebuild theme
- '/themes/(\w+)/uninstall' => 'theme_uninstall', // uninstall theme
+ '/themes' => 'themes_list', // manage themes
+ '/themes/(\w+)' => 'secure_POST theme_configure', // configure/reconfigure theme
+ '/themes/(\w+)/rebuild' => 'secure theme_rebuild', // rebuild theme
+ '/themes/(\w+)/uninstall' => 'secure theme_uninstall', // uninstall theme
- '/config' => 'config', // config editor
- '/config/(\%b)' => 'config', // config editor
+ '/config' => 'secure_POST config', // config editor
+ '/config/(\%b)' => 'secure_POST config', // config editor
// these pages aren't listed in the dashboard without $config['debug']
'/debug/antispam' => 'debug_antispam',
diff --git a/templates/mod/ban_appeals.html b/templates/mod/ban_appeals.html
index f43b7db5..23eced12 100644
--- a/templates/mod/ban_appeals.html
+++ b/templates/mod/ban_appeals.html
@@ -1,6 +1,7 @@
{% for ban in ban_appeals %}