Commit Graph

82 Commits

Author SHA1 Message Date
evazion
cae9a5d7e3 Drop dmail filters.
Few people used dmail filters (~900 users in 5 years) and even fewer
used them correctly. Most people used them to try to block dmail spam,
but usually they either blocked too much (by adding common words that
are present in nearly all dmails, causing all mails to them to be
filtered) or too little (blocking specific email addresses or urls,
which usually are never seen again after the spammer is banned).
Nowadays the spam detection system does a better job of filtering spam.
2020-01-21 00:10:20 -06:00
evazion
4a7322b197 users: rework privacy mode into private favorites (fix #4257).
* Rename 'privacy mode' to 'private favorites'.
* Make the private favorites setting only hide favorites, not favgroups
  and not the user's uploads on their profile page.
* Make the favgroup is_public flag default to true instead of false and
  fix existing favgroups to be public if the user didn't have privacy mode
  enabled before.
* List _all_ public favgroups on the /favorite_groups index, not just
  favgroups belonging to the current user.
* Add a /users/<id>/favorite_groups endpoint.
2020-01-17 22:24:29 -06:00
BrokenEagle
223a6df5d8 Add API data to show/index views 2020-01-04 22:02:44 +00:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
48e0569832 login: add /login & /logout routes, rename 'sign in' to 'login'.
* Replace /session/new with /login and /session/sign_out with /logout.
* Rename 'sign in' to 'login'.

This changes are to make urls cleaner and terminology more consistent.
2019-12-14 15:27:13 -06:00
evazion
6e5e07022d Have single result searches go to the show pages for certain controllers #4204 2019-11-04 14:24:10 -06:00
evazion
a5ab25d0ba pagination: avoid counting pages outside searches.
Replace this common pattern in controllers:

    @tags = Tag.search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])

with this:

    @tags = Tag.paginated_search(params)

`search_count` is used to skip doing a full page count when we're not
doing a search (on the assumption that the number of results will be
high when not constrained by a search). We didn't do this consistently
though. Refactor to do this in every controller.
2019-10-07 22:02:03 -05:00
evazion
bf51d68f15 users: add dark mode account setting (fix #4158). 2019-09-19 13:20:06 -05:00
evazion
22fd90eee9 api: support the expiry param on all GET requests. 2019-09-08 15:32:31 -05:00
evazion
3f7e05316d api: refactor default options for xml responses.
In xml responses, if the result is an empty array we want the response
to look like this:

   <posts type="array"/>

not like this (the default):

   <nil-classes type="array"/>

This refactors controllers so that this is done automatically instead of
having to manually call `@things.to_xml(root: "things")` everywhere. We
do this by overriding the behavior of `respond_with` in `ApplicationResponder`
to set the `root` option by default in xml responses.
2019-09-08 15:32:31 -05:00
evazion
4fb24c812f Fix #4155: Fix profile/settings metadata discrepancy. 2019-09-05 00:14:11 -05:00
evazion
95b8420ba2 Drop unused common_searches code. 2019-09-01 15:54:00 -05:00
evazion
f673552743 users: add /settings page.
Add /settings page and link to it instead of /users/:id/edit.
2019-09-01 15:00:27 -05:00
evazion
ff92b32f02 users: add /profile page (fix #4151).
* Add /profile, /profile.json endpoints.
* Make "My Account" link to /profile.
* Add 'User ID' field to profile page.
2019-09-01 15:00:23 -05:00
evazion
d75d2266c9 users: fix error handling for /users?name=<does_not_exist>. 2019-08-21 23:32:34 -05:00
evazion
692981e964 Fix #4111: Cache custom CSS. 2019-08-01 00:06:18 -05:00
Albert Yi
17ae357da9 eliminate mixpanel references 2019-01-23 16:37:44 -08:00
Albert Yi
4d07183a1d Merge pull request #3957 from evazion/fix-related-tags
Related tags: build html server-side, eliminate cookies
2018-10-24 17:34:14 -07:00
Albert Yi
b999fc86ea mixpanel fixes 2018-10-22 16:54:38 -07:00
Albert Yi
5097babfaa add opt out for mixpanel tracking 2018-10-22 16:01:39 -07:00
evazion
ae52b487e8 related tags: eliminate favorite_tags cookie (#3955). 2018-10-12 21:18:15 -05:00
Albert Yi
9cfb629891 rename similar posts to recommended posts, refactor menu on posts/show 2018-07-20 16:36:14 -07:00
Albert Yi
da34c95da5 add expiry parameter 2018-05-22 14:57:46 -07:00
Albert Yi
72d72fd3d0 eliminate usage of localstorage to cache tag autocomplete results (fixes #3543) 2018-05-17 09:54:37 -07:00
evazion
a6499b5169 post tooltips: add disable option (#3689).
* Add "disable post tooltips" account setting.
* Add back title attribute for when fancy tooltips are disabled.
2018-04-28 23:50:51 -05:00
evazion
f7a44ae8dd Fix redirect in "disable responsive mode" link. 2018-04-26 21:31:53 -05:00
evazion
909c9aad5a Fix user id cache expiration.
Use a delayed job instead of a HTTP request to invalidate the user id
cache on both servers.
2018-04-19 00:45:51 -05: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
BrokenEagle
d829ab3a00 Move all order logic to models
- Have a default order for each model
-- The overall default is ID DESC
- Allow for custom orderings
-- When comma-separated IDs are used
2018-01-29 11:42:53 -08:00
evazion
1fc2284874 /users/new: show error message when account signup fails. 2017-12-27 13:34:20 -06:00
r888888888
a95af95eae move desktop mode to user pref 2017-12-15 13:52:25 -08:00
evazion
8d8a2f9c1e Make recaptcha optional on signup page. 2017-11-29 18:09:37 -06:00
r888888888
01240f3a10 add option for desktop mode in user settings 2017-09-25 15:26:11 -07:00
r888888888
704816066d add recaptcha for signup process 2017-09-16 12:44:17 -07:00
evazion
6682ae10eb /users/:id/edit: redirect back to settings instead of profile. 2017-07-21 01:18:42 -05:00
evazion
cda1ee3d88 /users: allow banned users to edit account settings.
The member_only check prevents banned users from editing their account
settings. This isn't needed since check_privilege handles the privilege check.
2017-07-06 18:39:42 -05:00
evazion
d5b9b7162c /user_upgrades/new: fix page wrapper id.
* Move related css to user_upgrades.scss.
* Delete users/upgrade_information.html.erb as it is unused.
2017-05-22 13:07:31 -05:00
evazion
e10327219d /users/1234.json: include upload_limit/max_upload_limit/favorite_group_count. 2017-04-29 12:26:25 -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
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
r888888888
f41c362bf4 keep better track of per-user ip addrs 2016-08-24 15:58:22 -07:00
Toks
c251e7fd3f Better error when linking to username that doesn't exist 2015-11-20 21:55:32 -05:00
r888888888
b695a7980f unify user notifications for permission/level changes #2470 2015-10-27 11:12:05 -07:00
r888888888
3a81f1ee8e fixes #2470: Neutral records to keep track of permissions 2015-10-26 14:27:34 -07:00
r888888888
1abdcb3cf3 fixes #2419 2015-06-30 13:21:39 -07:00
r888888888
cbf48ad948 add stripe integration for safebooru 2014-11-06 17:03:17 -08:00
Toks
f132e42a12 Fix user renames and deletions
related to #1941
2014-05-30 02:57:23 -04:00
r888888888
cc9b5a0c61 Create new transaction log table to track user conversions 2014-02-10 13:35:39 -08:00
Toks
657606cb73 #1323: Limit to user show pages 2013-12-15 19:55:28 -05:00
Toks
e83fde873e fixes #2035 2013-11-20 15:48:51 -05:00