Commit Graph
1438 Commits
Author SHA1 Message Date
evazion dc0442bd17 bans: redirect to index page after creating new ban. 2020-04-03 15:39:14 -05:00
evazion 34337b0eb5 popular posts: fix exception when given blank date param.
Flexbooru calls this endpoint with a blank date param.
2020-03-31 21:57:34 -05:00
evazion 3051daf5eb password resets: fix exception when given user does not exist. 2020-03-31 21:57:34 -05:00
evazion 25776a062c posts/random: fix pundit exception when no post is found. 2020-03-31 21:57:34 -05:00
evazion e0a72ef135 tests: add more controller tests.
* Fix an exception in /artists/show_or_new.
2020-03-31 19:00:32 -05:00
evazion a272453bd0 wikis: redirect legacy title param to show page.
Redirect /wiki_pages?title=touhou to /wiki_pages/touhou.
2020-03-31 18:13:41 -05:00
evazion 81488c7608 controllers: declare search_params helper in app controller. 2020-03-31 18:10:27 -05:00
evazion 919a2868be Fix #4374: Unvoting comments is broken. 2020-03-28 21:15:51 -05:00
evazion d24c746417 Fix #4360: Something broke random=true.
When random mode is enabled @post_set.posts returns an array, which
caused `authorize` to try to lookup the wrong policy.

This only happens when `authorize` is given an array with more than one
element, which is why it wasn't caught by the tests.
2020-03-27 04:23:32 -05:00
evazion b2cf765d6d users: refactor login and authentication logic.
* Make authentication methods into User instance methods instead of
  class methods.
* Fix API key authentication to use a secure string comparison. Fixes a
  hypothetical (unlikely to be exploitable) timing attack.
* Move login logic from SessionCreator to SessionLoader.
2020-03-25 18:48:43 -05:00
evazion 9e455695a1 sessions: remove legacy user_name / password_hash cookies.
Remove support for logging in with the deprecated user_name /
password_hash cookies. Followup to 320ff01e0.
2020-03-25 18:48:43 -05:00
evazion b7bd6c8fdd users: require email verification for signups from proxies.
Require users who signup using proxies to verify their email addresses
before they can perform any edits. For verification purposes, the email
must be a nondisposable address from a whitelist of trusted email
providers.
2020-03-24 17:25:35 -05:00
evazion 5faa323729 users: clean up password update logic.
Pull the password reauthentication logic out of the user model and put
it in the password update controller where it belongs.

This fixes an issue where when a new user was created the user model had
an incorrect password error set on it by `encrypt_password_on_update`.
It was trying to verify the old password even though we don't have one
when creating a new user. This error caused the user create action to
redirect back to the signup page because `respond_with` thought that
creating the user failed.
2020-03-24 17:25:35 -05:00
evazion 0ad5619484 pundit: add missing authorize calls. 2020-03-24 00:38:07 -05:00
evazion 4a5bec71f6 signup: don't send welcome emails to invalid addresses.
Fix attempting to send welcome emails when user didn't provide a valid
email address.
2020-03-24 00:26:47 -05:00
evazion e79910431f emails: validate that email addresses are deliverable.
Reject email addresses that known to be undeliverable during signup.
Some users signup with invalid email addresses, which causes the welcome
email (which contains the email confirmation link) to bounce. Too many
bounces hurt our ability to send mail.

We check that an email address is undeliverable by checking if the
domain has a mail server and if the server returns an invalid address
error when attempting to send mail. This isn't foolproof since some
servers don't return an error if the address doesn't exist. If the
checks fail we know the address is bad, but if the checks pass that
doesn't guarantee the address is good. However, this is still good
enough to filter out bad addresses for popular providers like Gmail and
Microsoft that do return nonexistent address errors.

The address existence check requires being able to connect to mail
servers over port 25. This may fail if your network blocks port 25,
which many home ISPs and hosting providers do by default.
2020-03-23 23:45:18 -05:00
evazion f23df47c09 ip addresses: add ip address show page.
* Add IP address show page at /ip_addresses/1.2.3.4.
* Add "Details", "Ban IP", "Ban User" options to the /ip_addresses listing.
2020-03-23 01:48:59 -05:00
evazion 41ab3c9f63 post versions: fix undo action. 2020-03-21 23:06:42 -05:00
evazion d775c625bb application controller: remove role_only! methods. 2020-03-20 18:03:50 -05:00
evazion 7f742242e4 pundit: convert uploads to pundit. 2020-03-20 18:03:01 -05:00
evazion d51b0dfe17 pundit: convert moderator/post/posts to pundit. 2020-03-20 18:03:01 -05:00
evazion 1344d4c161 pundit: convert moderator/dashboard to pundit.
Make it visible to everyone since there's no non-public information here.
2020-03-20 18:03:01 -05:00
evazion a5418abb31 pundit: convert posts to pundit. 2020-03-20 18:03:01 -05:00
evazion dd39913e55 pundit: convert post replacements to pundit. 2020-03-20 18:03:01 -05:00
evazion 3bb3c0b990 pundit: convert saved searches to pundit. 2020-03-20 18:03:01 -05:00
evazion 415d9591c5 pundit: convert post votes to pundit.
Side effects:

* The data-current-user-is-voter <body> attribute has been removed.
* {{upvote:self}} no longer works. {{upvote:<name>}} should be used instead.
2020-03-20 18:03:01 -05:00
evazion 33d81d0d1b pundit: convert post flags to pundit. 2020-03-20 18:03:01 -05:00
evazion ffae64f127 pundit: convert post versions to pundit. 2020-03-20 18:03:01 -05:00
evazion ba0a5dda8a pundit: convert post disapprovals to pundit. 2020-03-20 18:03:01 -05:00
evazion 84c654464d pundit: convert post approvals to pundit. 2020-03-20 18:03:01 -05:00
evazion cbee23f9ad pundit: convert post appeals to pundit. 2020-03-20 18:03:01 -05:00
evazion ab5432d149 pundit: convert pools to pundit. 2020-03-20 18:03:01 -05:00
evazion 83eae1bf11 pundit: convert passwords to pundit. 2020-03-20 18:03:01 -05:00
evazion 62835ac9fc pundit: convert notes to pundit. 2020-03-20 18:03:01 -05:00
evazion 2c4c29b81a pundit: convert favorite groups to pundit. 2020-03-20 18:03:01 -05:00
evazion 50fa674a3e pundit: convert emails to pundit. 2020-03-20 18:03:01 -05:00
evazion a440c56ed8 pundit: convert comment votes to pundit. 2020-03-20 18:03:01 -05:00
evazion ce1133dd69 pundit: convert artist commentaries to pundit. 2020-03-20 18:03:01 -05:00
evazion 3d83c3154e pundit: convert forum topic visits to pundit. 2020-03-20 18:03:01 -05:00
evazion f1f489c40b pundit: convert favorites to pundit. 2020-03-20 18:03:01 -05:00
evazion cc2b4abd09 pundit: convert forum post votes to pundit. 2020-03-20 18:03:01 -05:00
evazion be59e85d25 pundit: convert ip addresses to pundit. 2020-03-20 18:03:01 -05:00
evazion 92aeb8728f pundit: convert ip bans to pundit. 2020-03-20 18:03:01 -05:00
evazion 9242bf522b pundit: convert moderation reports to pundit. 2020-03-20 18:03:01 -05:00
evazion 480f39c34a pundit: convert dmails to pundit. 2020-03-20 18:03:01 -05:00
evazion 19817a6f85 pundit: convert modqueue to pundit. 2020-03-20 18:03:00 -05:00
evazion 3d72e62c77 pundit: convert bans to pundit. 2020-03-20 18:03:00 -05:00
evazion ff1d71af2e pundit: convert artists to pundit. 2020-03-20 18:03:00 -05:00
evazion 79a365abe0 pundit: convert bulk update requests to pundit. 2020-03-20 18:03:00 -05:00
evazion b83c612246 pundit: convert delayed jobs to pundit. 2020-03-20 18:03:00 -05:00