Commit Graph

5323 Commits

Author SHA1 Message Date
Keith Mitchell
a82bc65192 OAuth2 scopes: Space-separate multiple scopes 2015-01-15 11:15:14 -08:00
honestbleeps
ad42be6c94 Fix links getting marked as visited on right click 2015-01-15 09:54:21 -08:00
Jordan Milne
bb4d85fbe1 Allow setting c.site via the r param in GETs
Fixes flair not displaying when using GET_morechildren
2015-01-14 14:23:39 -08:00
Jordan Milne
12ae73b84e Add a username-relative userpage redirect at /user/me 2015-01-14 14:23:34 -08:00
Jordan Milne
cfd3a1cf1a Check if thing.childlisting is falsy before including it
This fixes bold `False`s showing up in the `.json-html`
and `.json-compact` renderstyles. Apparently been an issue for
5 years, but it was only noticed now.
2015-01-14 14:23:29 -08:00
Brian Simpson
034e267b45 Subreddit._by_name: always allow stalecache when retrieving names->ids.
Subreddit names never change. The subsequent Subreddit._byID will continue
to respect the supplied `stale` kwarg.
2015-01-14 17:17:36 -05:00
John-William Trenholm
32c1229d4c Add run time to promote.py 2015-01-13 13:14:20 -08:00
MelissaCole
a1ba729e67 Stop propagation in gold checkout for creddits 2015-01-13 12:49:28 -08:00
MelissaCole
236de26753 Make room for submit button on friends/ban page
The width is reduced to allow room for the submit button when the input element is edited.
2015-01-13 12:49:23 -08:00
Chad Birch
6b51528648 Subreddit.random_reddits(): fix logic error
The logic of this code contained a couple subtle errors that could cause
strange behavior. In reddit's current state of having two "automatic
subreddits" (which are always included in the front page set, and not
counted towards the limit), the fact that the automatic_ids list could
have an item removed while being iterated over meant that unsubscribing
from the first automatic subreddit (/r/blog) made it so that it was
effectively impossible to unsubscribe from the second one
(/r/announcements). If you unsubscribed, it would still be present in
your front page regardless, and if you stayed subscribed it would
actually be present twice.
2015-01-12 16:45:05 -07:00
Chad Birch
5c4f80d6ee Revert "Add back POST_update for API clients."
This reverts commit 605fa72772fa84b9245498f817cdc6d872ab3bdd.

This endpoint has had no significant traffic for months, and should be
safe to remove again at this point.
2015-01-12 16:45:01 -07:00
Keith Mitchell
159cb9f600 Prefix OAuth2 Access Tokens with user ID 2015-01-12 11:38:38 -08:00
Brian Simpson
4368be7d91 Allow sponsors to look up users by email. 2015-01-12 14:37:11 -05:00
Brian Simpson
003ca6e0bc Add AccountsByCanonicalEmail. 2015-01-12 14:37:11 -05:00
David Wick
680dcddc04 Fix text for password field on register.compact not appearing
Strength meter relies css/events from restyled login.  This
ensures it's there before trying to add the meter.
2015-01-12 11:31:28 -08:00
Brian Simpson
ac9b7141b5 Add tracking pixel url in response header for api requests. 2015-01-09 03:04:13 -05:00
Neil Williams
af09fa8dee Update license headers to 2015.
The highlight of each year for me.
2015-01-08 13:35:03 -08:00
David Wick
3a7cee6233 login/register: Add "an" before "account" 2015-01-08 12:59:50 -08:00
David Wick
3f0b7d3f35 Display reason for being flagged 2015-01-08 12:59:42 -08:00
David Wick
f8762d200b Reject fraudulent ads automatically 2015-01-08 12:59:36 -08:00
David Wick
5eca8e81ac Add community_email method 2015-01-08 12:59:23 -08:00
David Wick
705b49f073 Add listing for promotions suspected of fraud 2015-01-08 12:59:23 -08:00
David Wick
0baff564e5 Add a hook for when bids are edited 2015-01-08 12:57:57 -08:00
David Wick
6992ad4f00 Remove fraud checks from public code 2015-01-08 12:57:43 -08:00
David Wick
73d290b065 Log when empty emails are rejected 2015-01-08 12:56:58 -08:00
David Wick
05df5bec12 Centralize fraud email sending
Also provides a generic `Kind` for fraud hooks.
2015-01-08 12:56:50 -08:00
Brian Simpson
b76322f8e4 Add alerts for suspicious selfserve advertising payments. 2015-01-08 12:53:41 -08:00
xiongchiamiov
6b3f4b69de Feature flags: add filtering by gold
While we can always hard-code checks for gold, putting this into the feature
flag system allows us to move things from gold-only to everyone with only a
config change.
2015-01-08 12:19:06 -08:00
Chad Birch
583206cdb2 Username mentions: enable for all users
Removes the requirement to have reddit gold to receive username mentions
in your inbox.
2015-01-08 00:50:50 -07:00
Brian Simpson
ec22bd54f8 Don't allow editing a deleted PromoCampaign. 2015-01-06 14:55:56 -05:00
Brian Simpson
e3f092ac68 message: Add classes to subject text, sender, recipient, and subreddit. 2015-01-06 14:27:39 -05:00
Brian Simpson
0ae5072a91 CoinbaseController: cleanly ignore non-payment events. 2015-01-06 14:27:34 -05:00
MelissaCole
ca60378e87 Remove check for give gold link
The 'give gold' link only appears for comments and posts that can be gilded.
2015-01-07 09:46:10 -08:00
MelissaCole
0055f9a6cd Can reveal identity or write a message in gildings
This allows the option for non-anonymous gildings or to write a message.
Whether the user purchased anonymously or non-anonymously for gildings will
be remembered and applied to future gildings (initializes to False so it's
still anonymous until the user decides to change it).
2015-01-06 19:31:23 -08:00
Neil Williams
e51d9f2f0f Feature flags: Handle logged-out users better.
If specific user accounts were allowed to use a feature, logged-out
users would cause the feature flag check to fail because
UnloggedUser.name exists but raises NotImplementedError.  This makes the
feature-world return None for user if no user is logged in.
2015-01-06 14:28:14 -08:00
Brian Simpson
5863fb6b8f pixel: Use user id36 rather than user name. 2015-01-06 04:01:12 -05:00
xiongchiamiov
94984b78af Robots: allow crawling of mobile pages
We got a message from Google Webmaster Tools letting us know they'd like to
pretend to be a mobile device and crawl our mobile pages, but can't, because we
disallow it in our `robots.txt` rules.  We have canonicalization set up to
point towards desktop pages, so we shouldn't be hurt by allowing this.

We should also at some point provide two-way annotations to let them go from
desktop -> mobile[0], but for now this should suffice.

[0]: https://developers.google.com/webmasters/mobile-sites/mobile-seo/configurations/separate-urls
2015-01-06 12:03:41 -08:00
Chad Birch
9fc5d0f1eb message.new hook: Call before determining rels 2015-01-06 12:49:07 -07:00
Aedx
bca1c9e7a4 Added missing closing head tag 2015-01-06 11:31:53 -08:00
xiongchiamiov
45ab808c44 Flair selector: minor restyling
This is a tiny little touch-up of the flair selector box that just adds a
little more space between things, because I was annoyed at looking at it.  As
far as my choices for things:

* The `.flairselector h2` change was to make it consistent with the other
  dividing lines in the box.
* The button margin was chosen to be consistent with the "add" button on
  /about/moderators.

I decided not to mess with the wonky vertical alignment on the flair because
that gets changed by subreddits' customizations to flair display, so it's
probably not worth it to try and make it look better.
2015-01-05 14:47:52 -08:00
Neil Williams
f95cb2b143 Rework login ratelimit system.
The goal of a login ratelimit system is to prevent brute force attacks
on passwords.

The current login ratelimit system is based on VDelay which uses
exponential backoff based on IP address after failed login attempts.
This is not ideal because of corporate proxies and LSN causing the
number of false positives to be very high resulting in users getting
the dreaded "you've been doing that too much".

This new system uses a factored out version of the core ratelimiting
system which uses fixed ratelimits per period (allowing some burstiness)
and is per-account. To help mitigate the effects of a denial of service
attack on a specific user, different ratelimit buckets are used
depending on whether or not the user has used the IP the login request
is coming from before.

As an escape hatch, successfully resetting an account's password adds
the current IP to that account's recent IPs allowing it into the safer
ratelimit bucket.

The ratelimit never applies if you are currently logged in as the user,
allowing account deletion to happen regardless of ongoing brute force /
denial of service attacks.
2015-01-05 14:06:46 -08:00
Eric
8fdc799564 Change SubredditSelector to use better wording
Currently, the subreddit selector when submitting a new link "/r/subreddit/submit" says "Popular Choices" and then lists the subreddits you are subscribed to.

I find this to be a big misnomer, as they are not popular choices at all, they are just a list of your subscribed subreddits. "Popular choices" implies that these are things other people have selected as well.

I know, it's super nitpicky, but I thought it might make more sense this way.
2015-01-05 16:11:14 -05:00
Brian Simpson
e0d5d77be9 Remove scrollupdater debug statements. 2015-01-05 16:11:08 -05:00
xiongchiamiov
d53b2a0d6b RSS feeds: fix timestamp
[Reported by][0] /u/josh64.

When the message RSS feeds were created, they erroneously had an extra timezone
appended to the `dc:date` element, which causes validation errors.

In most of the feeds we rely only upon `pubDate`; it's not clear to me why we
additionally use `dc:date` in the few places we do, but I suppose it doesn't
hurt anything.  The other two places using it are `subreddit.xml`, which never
had the extra timezone, and `comment.xml`, in which it was removed three years
ago (reddit/reddit@5675398).  This fixes the last incorrect instance.

Note: Although the reporter says they got an error in the W3C validator and the
format is clearly wrong, in my tests the validator passed the previous,
incorrect feed. *shrug*

[0]: http://redd.it/2r1plf
2015-01-05 11:24:57 -08:00
Jordan Milne
f7d53fbd91 Display points on XHR'd compact pages 2014-12-31 17:43:56 -04:00
Jordan Milne
159c51b2b4 Enforce floor of 0 on link scores across render styles
Thanks to @iKevinY for the report. Fixes #1205
2014-12-31 17:43:53 -04:00
Brian Simpson
4cfbf59af5 Update thing.recipient to thing.user_is_recipient in message.compact. 2014-12-30 19:18:33 -05:00
Brian Simpson
8d90f8be2c Message: don't distinguish author of parent comment. 2014-12-30 19:18:33 -05:00
Brian Simpson
586cc18f71 Messages: always show "from" first. 2014-12-30 19:18:33 -05:00
Brian Simpson
eb0cdbf25c Make messages from user as subreddit more visually distinct.
Previously they looked like a regular message sent from the current
user. Now they indicate they are sent via a subreddit.
2014-12-30 19:18:33 -05:00