Commit Graph

34 Commits

Author SHA1 Message Date
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
79bada3392
[Search] Unify user lookup
There was lots of duplication between id/name searching, with a plethora
of different approaches. Now it's all in one place.
A few places that didn't have name/id search previously now do.
2023-08-04 20:46:59 +02:00
clragon
3a2987c84f
[Search] Allow ascending order for IDs 2023-07-07 14:55:30 +02:00
Earlopain
7c0fec2be9
[ModActions] Display ip ban subnet and reason 2023-04-06 15:49:46 +02:00
Earlopain
fd28503e03
[Admin] Expose and improve ip ban search 2023-03-01 19:25:19 +01:00
Earlopain
e0a74468df
[IpBans] Add back missing validation 2022-04-13 08:24:44 +02:00
Kira
9bbc5afe28 [Rails] More deprecation warnings 2021-02-25 12:08:09 -08:00
Kira
b64d223b46 Update validations to use new syntax 2019-09-05 05:59:51 -07:00
evazion
6beb8a81e1 Fix #4106: Allow moderators to IP ban subnets. 2019-08-13 03:24:26 -07:00
evazion
a9d5b09122 ip bans: remove unused code. 2019-08-13 03:20:07 -07:00
Kira
ebc23caa77 Refactor mod action log sites 2019-04-14 02:34:04 -07:00
evazion
80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
f2a7d3c41a /janitor_trials, /ip_bans: fix default ordering. 2018-02-04 16:48:35 -06:00
BrokenEagle
3c45273694
Add category for mod actions 2018-01-13 20:55:52 -08:00
evazion
c1834ab8dd Inherit models from ApplicationRecord instead of ActiveRecord::Base. 2017-06-16 13:28:31 -05:00
Type-kun
5ce26c2e52 Remaining fixes to mod actions on user feedbacks and IP bans 2017-01-16 18:21:09 +05:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Type-kun
9da5e67a65 Another partial fix for issue #2824, which also affected ip bans and feedback
Also fixed minor errors with IP bans
2017-01-09 13:57:16 +05:00
Albert Yi
b9a1e115fb add additional mod actions 2017-01-03 16:02:36 -08:00
Type-kun
3d2b81d1e8 Commented out references to pool_versions table 2017-01-02 11:44:06 +05:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
ec8c0e8f19 fix ip ban bug 2013-02-23 11:20:16 -05:00
albert
4c3159b662 more robust validation for ip bans 2013-02-23 11:16:23 -05:00
albert
8749c43b3e refactored search 2013-01-10 17:45:52 -05:00
albert
80f34d08d9 revert default scope change 2013-01-07 17:24:03 -05:00
albert
040059c491 add default scopes to every model 2013-01-07 17:12:43 -05:00
albert
dceda1b073 added ip bans controller 2011-01-14 15:50:17 -05:00
albert
f8ab736677 fixed tests 2010-11-19 17:20:13 -05:00
albert
ad39553aac updated tests, switched to rails 3.0.0rc2 2010-08-26 14:36:02 -04:00
albert
23656e3fa9 * Continued work on improving post view templates
* Added statistics-based estimator for related tag calculator
* Fleshed out IpBan class based on changes to Danbooru 1.xx
2010-04-29 17:32:15 -04:00
albert
e46bfb3d76 separated out ip ban logic from regular bans, users can no longer register if an ip ban is in place 2010-03-18 17:55:57 -04:00