Commit Graph

46 Commits

Author SHA1 Message Date
Cinder
a0b51e40bc
[Users] Rework login pages and increase password requirements (#825) 2024-12-14 17:37:53 -08:00
Donovan Daniels
d9f6653e02
[Posts] Overhaul destroyed posts (#672) 2024-07-13 17:05:50 -07:00
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
b7b9a8c400
[Users] Remove the contributor rank
We don't use that anymore. Next one up is former staff, so the checks
look a bit goofy now.
2023-08-21 21:24:31 +02:00
Earlopain
f5f29f8673
[Tests] Remove workaround for bcrypt slowdown
81a1b4b544 says this was done to make tests significantly faster, I'm
not seeing any slowdown with this change though. The real culprit was
probably the MX lookups.
2023-06-06 19:52:02 +02:00
Earlopain
731fc5a42f
[Users] Style usernames by default
This only takes effect when logged out and for newly created accounts.
2022-11-27 17:44:03 +01:00
Earlopain
55d020877f
[Tests] Replace FFaker with FactoryBot sequences 2022-11-25 14:33:02 +01:00
Kira
436d2aea38 [Ruby 3] Fix up some deprecations involving ruby 3
Still pending are gems that make poor choices and need to be removed,
replaced, or fixed up.

Memoist
ActiveModelSerializers
2020-11-11 21:06:12 -08:00
Kira
81a1b4b544 Make tests about 300x faster by not doing expensive ops 2019-09-09 12:58:18 -07:00
Kira
6fb1e3ceaf Fix up users being broken in tests and fix a few basic tests 2019-09-09 12:58:18 -07:00
Kira
fffe6b1c19 Fix test fixtures and seeds 2019-09-09 12:58:18 -07:00
Kira
4024108f1c Convert builder -> janitor for user rank 2019-06-29 12:58:28 -07:00
Kira
16af051931 Convert platinum -> contributor for user rank 2019-06-29 12:06:13 -07:00
Kira
9fa294ba31 Convert gold -> privileged for user level 2019-06-29 08:45:58 -07:00
Kira
f4f030f726 Password migration/upgrade
NOTE: All existing passwords in development no longer work after
this change! Change your users password using the rails console.

Automatically convert and ugrade old passwords to using bcrypt
Removed the seemingly pointless transformation and hashing on top
of the actual password with a static salt.
Disabled logging in using password hashes, because that's just not
secure in any way, and negates cracking passwords at all.
Disabled sending the password hash to the client as a cookie, even
if it was signed.
Disabled legacy API logins.
2019-02-21 21:10:20 -08:00
Albert Yi
c144159dd9 fix tests 2018-05-09 14:36:03 -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
19e91f438b bans: add test for logging in with expired ban. 2017-05-07 12:13:25 -05:00
r888888888
48e9856f37 fixes #3007: Eliminate Janitor role 2017-05-01 14:38:30 -07:00
evazion
64b4004bbf tests: add favorite groups controller tests. 2017-02-06 18:48:35 -06:00
Albert Yi
b9a1e115fb add additional mod actions 2017-01-03 16:02:36 -08:00
evazion
8672604ee7 Add upvote:/downvote: editing metatags. 2016-10-26 23:23:47 -05:00
evazion
5e75dcecea Add test cases for anon/banned/member voting. 2016-10-14 04:47:51 +00:00
r888888888
6480864718 fixes #2469 2015-10-15 15:24:24 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
r888888888
f02f72fac1 implement saved searches, move user boolean settings to bitprefs 2014-06-18 16:16:27 -07:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
albert
b19994396d fix tests, fixes #1173 2013-04-03 17:23:25 -04:00
albert
a4b67fa072 fix tests and typo bugs 2013-03-22 18:54:37 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
66fc05e30b change privileged accounts to gold accounts, add platinum accounts, add favorite and tag query limiting based on level 2013-02-20 00:02:43 -05:00
albert
17881068e1 * Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3
* Fixed tests
2012-06-01 19:22:58 -04:00
albert
7269ec0076 removed small image support 2012-03-13 18:28:32 -04:00
albert
5158d1b274 fixes for upgrade schema script 2011-11-06 10:12:23 -05:00
albert
04103c3352 added invites 2011-07-29 19:42:25 -04:00
albert
04ab2f4701 fixed unit tests 2011-07-16 20:21:28 -04:00
albert
58c3d2af13 fixing tests 2011-07-16 19:20:02 -04:00
albert
502aeb6a16 added user func test 2011-02-02 15:53:28 -05:00
albert
3d5873c182 some fixes to janitor trials, implemented jan trial controller test 2011-01-14 16:45:10 -05: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
albert
9eb578927c added limit methods to user, more work on post views 2010-03-12 15:18:30 -05:00
albert
ac98d7db37 stubbed in blank controllers/helpers/functional tests 2010-03-10 18:21:43 -05:00
albert
e6888ea1dd fixed tag and pending post tests, added category multiget helper to tag, post/unapproval/post version in progress still 2010-02-10 16:12:30 -05:00
Albert Yi
341a24e22e tag unit test 2010-02-06 23:11:26 -05:00
Albert Yi
3bfae1f0db added user test, basic user methods 2010-02-06 16:48:40 -05:00