Commit Graph

27 Commits

Author SHA1 Message Date
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -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
ad74d9e75a Fix #3464: CurrentUser.ip_addr isn't set for anonymous users. 2017-12-27 13:34:20 -06:00
evazion
e34754c65c Possible fix for #3460: Timeout in update_last_ip_addr.
Set the user's statement timeout as soon as possible, before updating
anything in the database.
2017-12-27 12:42:11 -06:00
evazion
fd291c8b42 bans: fix exception when user with expired ban logs in.
`ban.destroy` fails because users have many `bans`, not a single `ban`.
Destroying the expired ban isn't necessary anyway.
2017-05-07 12:13:19 -05:00
r888888888
7c6243bca0 remove unused listbooru check in session loader 2017-03-20 13:52:54 -07:00
r888888888
f41c362bf4 keep better track of per-user ip addrs 2016-08-24 15:58:22 -07:00
r888888888
40957e04fd base listbooru refresh on user login 2016-02-17 17:02:35 -08:00
r888888888
64516b3a37 fixes #2389 2015-06-18 17:03:33 -07:00
r888888888
6772566665 fixes #2166 2014-07-23 15:15:47 -07:00
r888888888
bb402f5a27 fixes #2197 2014-07-17 16:34:54 -07:00
Toks
4a45d1e6bb Potential fix for #2124 2014-06-06 13:43:27 -04:00
r888888888
7e07b874a4 implementation for #1469
This reverts commit 18edc937fd.
2014-03-14 18:39:31 -07:00
Toks
99cb177398 potential fix for bugged frequent tags 2013-06-20 18:01:35 -04:00
r888888888
d4007e8093 potential fix for #1769, add missing jquery ui icons 2013-06-19 12:56:21 -07:00
r888888888
af25507480 fixes #813 2013-06-10 16:33:26 -07:00
r888888888
0535237704 fixes #1512 2013-05-07 18:19:30 -07:00
albert
15986b3afe fixes #1067 2013-03-25 22:51:18 -04:00
albert
4606ec4763 priv users now have 6sec timeout, platinum users have 9sec timeout 2013-03-21 07:46:49 -07:00
albert
7470d189c3 add api authentication 2013-03-20 15:43:17 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
d912ba6172 fixes #764 2013-03-05 17:18:01 -05:00
albert
5ab9887923 only store partial hash in cookies for validation 2013-03-05 16:49:09 -05:00
albert
f52181db94 Major revamp of security. Passwords are first SHA1 hashed and then
that hash is bcrypted.  Bcrypted hashes are stored in a new column on
users.  This separate column is only to allow for rollbacks,
eventually the old SHA1 hash column will be removed.  Sensitive cookie
details are now encrypted to prevent user tampering and more stringent
checks on secret_token and session_secret_key are enforced.
2013-03-04 22:55:41 -05:00
albert
000be2de6d update users last_logged_in_at more frequently, disable tag subscription processing for users who have been inactive for more than one year 2012-06-07 17:31:55 -04:00
albert
a7267cf00b fixed tests 2011-10-16 01:40:42 -04:00
albert
d324f4a071 refactored login process, added remember option for login 2011-10-15 16:36:07 -04:00