diff --git a/contrib/admin/theme.php b/contrib/admin/theme.php index dce3b26d..d79c5c5f 100644 --- a/contrib/admin/theme.php +++ b/contrib/admin/theme.php @@ -20,8 +20,7 @@ class AdminPageTheme extends Themelet { global $user; $html = " -

- ".$user->get_auth_html()." + ".make_form(make_link("admin_utils"))."
"; } if($mode == "editor"){ $html = "
+ ".$user->get_auth_html()."
+ ".$user->get_auth_html()."
"; if($is_admin){ $html .= "
+ ".$user->get_auth_html()."
"; } $html .= "
+ ".$user->get_auth_html()."
+ ".$user->get_auth_html()."
+ ".$user->get_auth_html()."
"; @@ -102,6 +109,7 @@ class ArtistsTheme extends Themelet { $html = '
+ '.$user->get_auth_html().' @@ -127,6 +135,7 @@ class ArtistsTheme extends Themelet { global $page; $html = " + ".$user->get_auth_html()."
Name:
@@ -223,6 +232,7 @@ class ArtistsTheme extends Themelet { { $html = ' + '.$user->get_auth_html().'
Name:
Aliases:
@@ -238,6 +248,7 @@ class ArtistsTheme extends Themelet { { $html = ' + '.$user->get_auth_html().'
Alias:
@@ -254,6 +265,7 @@ class ArtistsTheme extends Themelet { { $html = ' + '.$user->get_auth_html().'
Members:
@@ -271,6 +283,7 @@ class ArtistsTheme extends Themelet { $html = ' + '.$user->get_auth_html().' @@ -287,6 +300,7 @@ class ArtistsTheme extends Themelet { $html = ' + '.$user->get_auth_html().' @@ -303,6 +317,7 @@ class ArtistsTheme extends Themelet { $html = ' + '.$user->get_auth_html().' @@ -491,4 +506,4 @@ class ArtistsTheme extends Themelet { } } -?> \ No newline at end of file +?> diff --git a/contrib/blotter/theme.php b/contrib/blotter/theme.php index 39874682..6fdd2d88 100644 --- a/contrib/blotter/theme.php +++ b/contrib/blotter/theme.php @@ -45,8 +45,7 @@ class BlotterTheme extends Themelet { "; $add_new = " - - ".$user->get_auth_html()." + ".make_form(make_link("blotter/add"))." diff --git a/contrib/bulk_add/theme.php b/contrib/bulk_add/theme.php index 973a2504..d83f8ba8 100644 --- a/contrib/bulk_add/theme.php +++ b/contrib/bulk_add/theme.php @@ -28,8 +28,7 @@ class BulkAddTheme extends Themelet {
Note: this is the folder as seen by the server -- you need to upload via FTP or something first. -

- ".$user->get_auth_html()." +

".make_form(make_link("bulk_add"))." Directory to add: diff --git a/contrib/downtime/theme.php b/contrib/downtime/theme.php index 7fe05ed0..f1c1827d 100644 --- a/contrib/downtime/theme.php +++ b/contrib/downtime/theme.php @@ -19,6 +19,7 @@ class DowntimeTheme extends Themelet { $login_link = make_link("user_admin/login"); header("HTTP/1.0 503 Service Temporarily Unavailable"); + $auth = $user->get_auth_html(); print << @@ -34,6 +35,7 @@ class DowntimeTheme extends Themelet {

Admin Login

+ $auth
URL:
diff --git a/contrib/et/theme.php b/contrib/et/theme.php index 88c14a14..3ddd5786 100644 --- a/contrib/et/theme.php +++ b/contrib/et/theme.php @@ -38,8 +38,10 @@ Tags: {$info['stat_tags']} Applications: {$info['stat_image_tags']} Extensions: {$info['sys_extensions']} EOD; + $auth = $user->get_auth_html(); $html = << + $auth
diff --git a/contrib/favorites/theme.php b/contrib/favorites/theme.php index 9c6449da..47983e6f 100644 --- a/contrib/favorites/theme.php +++ b/contrib/favorites/theme.php @@ -7,8 +7,8 @@ class FavoritesTheme extends Themelet { $i_image_id = int_escape($image->id); $name = $is_favorited ? "unset" : "set"; $label = $is_favorited ? "Un-Favorite" : "Favorite"; - $html = " - ".$user->get_auth_html()." + $html = " + ".make_form(make_link("change_favorite"))." diff --git a/contrib/featured/theme.php b/contrib/featured/theme.php index 8d93b042..ffdac9e2 100644 --- a/contrib/featured/theme.php +++ b/contrib/featured/theme.php @@ -11,8 +11,7 @@ class FeaturedTheme extends Themelet { public function get_buttons_html($image_id) { global $user; return " - - ".$user->get_auth_html()." + ".make_form(make_link("featured_image/set"))." diff --git a/contrib/forum/theme.php b/contrib/forum/theme.php index d3c83f41..ea460b47 100644 --- a/contrib/forum/theme.php +++ b/contrib/forum/theme.php @@ -21,8 +21,7 @@ class ForumTheme extends Themelet { { global $config, $user; $max_characters = $config->get_int('forumMaxCharsPerPost'); - $postUrl = make_link("forum/create"); - $html = '
'; + $html = make_form(make_link("forum/create")); if (!is_null($threadTitle)) @@ -58,8 +57,7 @@ class ForumTheme extends Themelet { $max_characters = $config->get_int('forumMaxCharsPerPost'); - $postUrl = make_link("forum/answer"); - $html = ''; + $html = make_form(make_link("forum/answer")); $html .= ''; @@ -226,4 +224,4 @@ class ForumTheme extends Themelet { return $html; } } -?> \ No newline at end of file +?> diff --git a/contrib/image_hash_ban/theme.php b/contrib/image_hash_ban/theme.php index 296fbc2c..c5b81788 100644 --- a/contrib/image_hash_ban/theme.php +++ b/contrib/image_hash_ban/theme.php @@ -30,7 +30,7 @@ class ImageBanTheme extends Themelet {
$h_bans - + ".make_form(make_link("image_hash_ban/add"))." @@ -80,7 +80,7 @@ class ImageBanTheme extends Themelet { */ public function get_buttons_html(Image $image) { $html = " - + ".make_form(make_link("image_hash_ban/add"))." diff --git a/contrib/ipban/theme.php b/contrib/ipban/theme.php index b4d02479..78482473 100644 --- a/contrib/ipban/theme.php +++ b/contrib/ipban/theme.php @@ -27,8 +27,7 @@ class IPBanTheme extends Themelet { $h_bans - - ".$user->get_auth_html()." + ".make_form(make_link("ip_ban/add"))." diff --git a/contrib/notes/theme.php b/contrib/notes/theme.php index f6d72111..08c4f815 100644 --- a/contrib/notes/theme.php +++ b/contrib/notes/theme.php @@ -23,26 +23,21 @@ class NotesTheme extends Themelet { '; } public function request_button($image_id) { - return ' - - + return make_form(make_link("note/add_request")) . ' '; } public function nuke_notes_button($image_id) { - return ' - + return make_form(make_link("note/nuke_notes")) . ' '; } public function nuke_requests_button($image_id) { - return ' - - + return make_form(make_link("note/nuke_requests")) . ' @@ -167,7 +162,7 @@ class NotesTheme extends Themelet {
-
+ ".make_form(make_link("note/add_note"))." @@ -189,7 +184,7 @@ class NotesTheme extends Themelet {
-
+ ".make_form(make_link("note/edit_note"))." @@ -211,7 +206,7 @@ class NotesTheme extends Themelet { if($adminOptions) $html .= " - + ".make_form(make_link("note/delete_note"))."
{$ban['hash']} {$ban['reason']} - + ".make_form(make_link("image_hash_ban/remove"))." @@ -48,7 +48,7 @@ class ImageBanTheme extends Themelet {
HashReasonAction
{$ban['banner_name']} {$end_human} - - ".$user->get_auth_html()." + ".make_form(make_link("ip_ban/remove"))." @@ -47,8 +46,7 @@ class IPBanTheme extends Themelet {
IPReasonByUntilAction
{$user->name}
@@ -371,4 +366,4 @@ class NotesTheme extends Themelet { } } - ?> \ No newline at end of file + ?> diff --git a/contrib/pools/theme.php b/contrib/pools/theme.php index cca13450..1f44a904 100644 --- a/contrib/pools/theme.php +++ b/contrib/pools/theme.php @@ -17,7 +17,7 @@ class PoolsTheme extends Themelet { $h .= ""; } $editor = " - + ".make_form(make_link("pool/add_post"))." @@ -81,13 +81,15 @@ class PoolsTheme extends Themelet { * HERE WE DISPLAY THE NEW POOL COMPOSER */ public function new_pool_composer(Page $page) { - $create_html = " -
- - - - -
Title:
Public?
Description:
+ $create_html = " + ".make_form(make_link("pool/create"))." + + + + + +
Title:
Public?
Description:
+ "; $blockTitle = "Create Pool"; @@ -168,7 +170,8 @@ class PoolsTheme extends Themelet { public function sidebar_options(Page $page, $pool, $check_all) { global $user; - $editor = "
+ $editor = " + ".make_form(make_link("pool/import"))." @@ -191,7 +194,7 @@ class PoolsTheme extends Themelet { } - + ".make_form(make_link("pool/nuke"))."
diff --git a/contrib/rating/theme.php b/contrib/rating/theme.php index 414b9d93..87efa7ef 100644 --- a/contrib/rating/theme.php +++ b/contrib/rating/theme.php @@ -22,7 +22,7 @@ class RatingsTheme extends Themelet { public function display_bulk_rater() { global $page; $html = " -
+ ".make_form(make_link("admin/bulk_rate"))." diff --git a/contrib/regen_thumb/theme.php b/contrib/regen_thumb/theme.php index 7c55c7af..2d8b7d68 100644 --- a/contrib/regen_thumb/theme.php +++ b/contrib/regen_thumb/theme.php @@ -6,7 +6,7 @@ class RegenThumbTheme extends Themelet { */ public function get_buttons_html($image_id) { return " - + ".make_form(make_link("regen_thumb"))." diff --git a/contrib/report_image/theme.php b/contrib/report_image/theme.php index 837bd441..d05cb5bf 100755 --- a/contrib/report_image/theme.php +++ b/contrib/report_image/theme.php @@ -42,7 +42,7 @@ class ReportImageTheme extends Themelet {
Search {$image_link} Report by $userlink: $h_reason -
+ ".make_form(make_link("image_report/remove"))."
@@ -73,7 +73,7 @@ class ReportImageTheme extends Themelet { $i_image = int_escape($image->id); $html = " -
+ ".make_form(make_link("image_report/add"))." diff --git a/contrib/tag_history/theme.php b/contrib/tag_history/theme.php index 92d6137e..46ed3564 100644 --- a/contrib/tag_history/theme.php +++ b/contrib/tag_history/theme.php @@ -5,7 +5,7 @@ class Tag_HistoryTheme extends Themelet { global $user; $start_string = "
- + ".make_form(make_link("tag_history/revert"))."
    "; @@ -46,7 +46,7 @@ class Tag_HistoryTheme extends Themelet { public function display_global_page(Page $page, $history) { $start_string = "
    - + ".make_form(make_link("tag_history/revert"))."
      "; $end_string = " diff --git a/contrib/tips/theme.php b/contrib/tips/theme.php index e8f93ade..d06e0bd7 100644 --- a/contrib/tips/theme.php +++ b/contrib/tips/theme.php @@ -11,8 +11,7 @@ class TipsTheme extends Themelet { $select .= ""; $html = " - -".$user->get_auth_html()." +".make_form(make_link("tips/save"))." diff --git a/contrib/wiki/theme.php b/contrib/wiki/theme.php index 84960bd3..45b7bee4 100644 --- a/contrib/wiki/theme.php +++ b/contrib/wiki/theme.php @@ -51,7 +51,7 @@ class WikiTheme extends Themelet { $lock = ""; } return " - + ".make_form(make_link("wiki_admin/save"))." @@ -71,7 +71,7 @@ class WikiTheme extends Themelet { $edit = "
      Enable:
      "; $edit .= Wiki::can_edit($user, $page) ? " - - diff --git a/core/util.inc.php b/core/util.inc.php index 7786641e..fe8b6a95 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -216,6 +216,21 @@ function make_http($link) { return $link; } +/** + * Make a form tag with relevant auth token and stuff + * + * @retval string + */ +function make_form($target, $method="POST", $multipart=False) { + global $user; + $auth = $user->get_auth_html(); + $extra = ""; + if($multipart) { + $extra .= " enctype='multipart/form-data'" + } + return "$auth"; +} + /** * Make a link to a static file in the current theme's * directory diff --git a/ext/alias_editor/theme.php b/ext/alias_editor/theme.php index 08bad4ba..671dec8a 100644 --- a/ext/alias_editor/theme.php +++ b/ext/alias_editor/theme.php @@ -12,7 +12,7 @@ class AliasEditorTheme extends Themelet { $action = ""; $add = " - + ".make_form(make_link("alias/add"))." @@ -36,7 +36,7 @@ class AliasEditorTheme extends Themelet { if($is_admin) { $h_aliases .= " " : ""; $html = " - - ".$user->get_auth_html()." + ".make_form(make_link("ext_manager/set"))." -
      + ".make_form(make_link("wiki_admin/edit"))." @@ -80,12 +80,12 @@ class WikiTheme extends Themelet { ""; if($user->is_admin()) { $edit .= " - + ".make_form(make_link("wiki_admin/delete_revision"))."
      +
      ".make_form(make_link("wiki_admin/delete_all"))."
      Action
      - + ".make_form(make_link("alias/remove"))." @@ -60,7 +60,7 @@ class AliasEditorTheme extends Themelet { "; $bulk_html = " -
      + ".make_form(make_link("alias/import"), multipart=True)."
      diff --git a/ext/comment/theme.php b/ext/comment/theme.php index a32171f6..9c76f723 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -173,7 +173,7 @@ class CommentListTheme extends Themelet { $captcha = $config->get_bool("comment_captcha") ? captcha_get_html() : ""; return " -
      + ".make_form(make_link("comment/add"))." diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index 7af8459b..99f8e12a 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -5,8 +5,7 @@ class ExtManagerTheme extends Themelet { global $user; $en = $editable ? "
      Enabled
      - ".$user->get_auth_html()." - - $rows - -
      NameValue
      + ".make_form(make_link("setup/save"))." + + + $rows + +
      NameValue
      + "; $page->set_title("Shimmie Setup"); diff --git a/ext/tag_edit/theme.php b/ext/tag_edit/theme.php index f73ba0e6..0684b3dd 100644 --- a/ext/tag_edit/theme.php +++ b/ext/tag_edit/theme.php @@ -7,7 +7,7 @@ class TagEditTheme extends Themelet { */ public function display_mass_editor(Page $page) { $html = " -
      + ".make_form(make_link("tag_edit/replace"))." diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 6c88eaa2..41ca6886 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -50,7 +50,7 @@ class UploadTheme extends Themelet { }); }); - + ".make_form(make_link("upload"), multipart=True)."
      Search
      Replace
      $upload_list @@ -120,7 +120,7 @@ class UploadTheme extends Themelet { }); }); - + ".make_form(make_link("upload"), multipart=True)." $upload_list diff --git a/ext/user/theme.php b/ext/user/theme.php index 749a71d6..5f1491e1 100644 --- a/ext/user/theme.php +++ b/ext/user/theme.php @@ -53,7 +53,7 @@ class UserPageTheme extends Themelet { $reca = ""; $html .= " - + ".make_form(make_link("user_admin/create"))."
      Tags
      ".captcha_get_html()."
      @@ -82,7 +82,7 @@ class UserPageTheme extends Themelet { public function display_login_block(Page $page) { global $config; $html = " - + ".make_form(make_link("user_admin/login"))."
      Name
      Password
      @@ -150,10 +150,8 @@ class UserPageTheme extends Themelet { protected function build_options(User $duser) { global $config, $database, $user; - $html = ""; - - $html .= " - + $html = " + ".make_form(make_link("user_admin/change_pass"))."
      @@ -163,7 +161,7 @@ class UserPageTheme extends Themelet {
      Change Password
      -

      +

      ".make_form(make_link("user_admin/change_email"))." @@ -177,10 +175,10 @@ class UserPageTheme extends Themelet { $i_user_id = int_escape($duser->id); $h_is_admin = $duser->is_admin() ? " checked" : ""; $html .= " -

      - - Admin: - +

      ".make_form(make_link("user_admin/set_more"))." + + Admin: + "; } diff --git a/ext/view/theme.php b/ext/view/theme.php index 0dd53b84..4fdca762 100644 --- a/ext/view/theme.php +++ b/ext/view/theme.php @@ -112,7 +112,7 @@ class ViewImageTheme extends Themelet { $html = " (edit info)"; $html .= "

      -
      + ".make_form(make_link("post/set"))."
      Change Email