Commit Graph

37 Commits

Author SHA1 Message Date
Donovan Daniels
32a1367cfe
[Users] Consolidate password confirmation into singular route (#813) 2024-12-18 06:02:02 -08: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
40db4d6136
[Users] Remove weird behaviour from respond_with in api keys controller
There is no proper show action for api keys. Just do a redirect instead.
Remove a duplicate view action from the routes, be explicit that a show action exists
2023-08-29 20:32:42 +02:00
Earlopain
b2b86b5e38
[Misc] Remove duplicate dot from flash notices
A dot is already unconditionally added in the view
2023-04-10 14:31:44 +02:00
Kira
e6b2f64dfb [API] Don't allow unactivated users to create API keys 2021-04-18 14:22:25 -07:00
Kira
50c73ade23 [Email] Fix exception in email disable links controller 2020-10-25 06:00:23 -07:00
Kira
a7ce5237cc [Email] Make it easier to correct email mistakes 2020-06-20 02:57:12 -07:00
Kira
9b7a081767 [Deletion] Revise user deletion rules and clarify wording 2020-06-14 19:10:12 -07:00
Kira
2cbaf803ec [Login] Make login reminder more vague in response 2020-04-16 17:46:22 -07:00
Kira
ff79441a82 Email comparison should be case insensitive for reminders/resets
Due to frequent issues with users entering odd capitalizations
and then forgetting what they have entered, allow a bit of
fuzziness in the search.
2020-03-12 19:05:14 -07:00
Kira
ffd7b73c5c Fix user deletion system 2020-03-11 17:00:00 -07:00
Kira
b4370aae33 Temp disable account deletions page 2020-03-08 14:55:54 -07:00
Kira
cc71812fda Remove xml respond_to 2020-01-02 10:16:54 -08:00
Kira
f0a7f76136 Email confirmation 2019-08-31 20:06:20 -07:00
evazion
5ca95fa855 dmail filters: fix uninitialized constant error. 2019-08-15 04:24:02 -07:00
Kira
661eeaa590 Bad references to is_moderator? 2019-07-23 10:07:39 -07:00
Kira
583cd7e20d Make password resets closer to old e6 password resets 2019-06-12 21:39:45 -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
28663351d1 fixes #3757 2018-06-20 11:27:49 -07:00
Albert Yi
a0aa2f3f4a fixes #3276 2018-05-15 14:30:28 -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
24b2f2bf52 /user/dmail_filter: make available to banned users.
`ensure_ownership` handles the privilege check here.
2017-07-07 15:41:09 -05:00
evazion
d092b870ad /users/:id/api_keys: make available to banned users.
`check_privilege` already handles the privilege check here.
2017-07-07 15:40:40 -05:00
evazion
40092f21ba Remove redundant rescue_from calls.
These are redundant because ApplicationController rescues these exceptions already.
2017-02-25 02:18:16 -06:00
evazion
a92120e873 Fix #2785: Allow changing API key; require password to view or change key. 2016-12-18 06:30:48 -06:00
evazion
b0a0a32173 API: support PUT /maintenance/user/dmail_filter.json. 2016-11-12 01:10:14 -06:00
evazion
a16b91e2bf Fix exploit allowing dmail filters to be set on other users.
Exploit:

    curl \
      -u $USERNAME:$API_KEY \
      -X PUT "http://danbooru.donmai.us/maintenance/user/dmail_filter.json?dmail_id=1" \
      -d "dmail_filter[words]=owned&dmail_filter[user_id]=2"

...where dmail_id is any dmail you own (doesn't matter which) and user_id is the victim.
2016-11-12 01:10:14 -06:00
r888888888
4c5e7a2708 fixes #2478: Add links for easy opt-out of emails 2015-09-03 17:03:03 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
67e46f6e5c fixes #2418 (includes hiding deleted dmails and allowing filtering on user name) 2015-07-07 17:32:38 -07:00
r888888888
1abdcb3cf3 fixes #2419 2015-06-30 13:21:39 -07:00
Toks
744daa6c0c When email change fails, give appropriate error message
Previously it would always say "Password was incorrect" on failure,
whether that was the actual problem or not.
2014-01-24 13:52:43 -05:00
r888888888
eab2eb1d82 fixes #1651 2013-05-21 17:52:03 -07:00
r888888888
0a9e2a39b0 add account deletion 2013-05-16 15:15:00 -07:00
r888888888
a25242f68d in progress 2013-04-30 23:25:26 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
72e9da01b5 fixing functional tests 2011-07-17 16:42:26 -04:00