Commit Graph

2098 Commits

Author SHA1 Message Date
Neil Lalonde 9611a1ac47 Validate username site settings 2014-06-11 16:20:57 -04:00
Régis Hanol ce732d2252 FEATURE: new "disable_edit_notifications" site setting
Should be used whenever you activate the "download_remote_images_to_local" site setting to prevent users from receiving a lot of edit notifications from the system user.
2014-06-11 17:14:00 +02:00
Sam 03087679f0 FEATURE: Support custom preferences for users, injected by plugins 2014-06-11 15:50:37 +10:00
Sam d13d4fc158 correct state leak 2014-06-11 12:00:02 +10:00
Sam 62abb873df FEATURE: support serializing user custom fields by plugins 2014-06-11 11:57:22 +10:00
Régis Hanol 0781531e3c Merge pull request #2415 from techAPJ/bulk-invite-users-5
FEATURE: Bulk Invite
2014-06-10 19:11:11 +02:00
Sam a044e3de58 Remove min_posts_for_search_in_topic
no longer needed, we always search in topic
2014-06-10 15:07:38 +10:00
Peter N Lewis 8b32fb5b6d Corrected typo, corrected accidental tab, removed unnecessary database rollback
Corrected it "do send" to it "does send"
Removed unnecessary user.update_column (rollback happens automatically)
Replaced Tab with spaces.
2014-06-10 11:36:20 +08:00
Neil Lalonde c61462662b Add ability to run validation on site settings. notification_email and other email address settings are now validated. 2014-06-09 16:59:20 -04:00
Justin Leveck a78df3d57d Add custom embed_by_username feature
Feature to allow each imported post to be created using a different discourse
username. A possible use case of this is a multi-author blog where discourse
is being used to track comments. This feature allows authors to receive
updates when someone leaves a comment on one of their articles because each of
the imported posts can be created using the discourse username of the author.
2014-06-09 12:35:38 -07:00
Neil Lalonde faed17aa18 Moderators should always be able to create topics too 2014-06-09 15:28:03 -04:00
Neil Lalonde f97d434174 Fix the spec for enum site settings 2014-06-09 15:28:03 -04:00
Robin Ward c176dc07c1 Merge pull request #2421 from peternlewis/reply_to_name
Use an appropriate name in the Reply-To header
2014-06-09 11:04:53 -04:00
Neil Lalonde 4d50d0d109 FIX: admins should be able to create topics, even if min_trust_to_create_topic is higher than their trust level 2014-06-09 11:03:21 -04:00
Peter N Lewis 87e254cc3a Added test to ensure email is sent to users with email_always set even if the notification has been read 2014-06-09 19:09:36 +08:00
Peter N Lewis 93f5f98b58 Corrected and added appropriate specs to confirm correct behaviour.
Tests ensure that the site name is used for public replies and the username is used for private replies.
2014-06-09 18:26:19 +08:00
Arpit Jalan 727184641e FEATURE: Bulk Invite 2014-06-09 01:43:39 +05:30
Andrew Bezzub 0a42901c40 do not use try in UserSerializer for fields coming from UserProfile 2014-06-07 13:30:35 -07:00
Andrew Bezzub 7db31adf35 move website from User to UserProfile 2014-06-06 21:54:32 -07:00
Sam Saffron 05ca1e6e46 Added code block normalization routing for import 2014-06-06 10:34:21 +10:00
Régis Hanol 0df666277d BUGFIXES: properly deal with bookmarks and deleted posts
BUGFIX: removing a bookmark from the activity feed was busted for deleted posts
BUGFIX: delete associated user actions when deleting a post
2014-06-04 17:41:11 +02:00
Sam e307bad89a One less TODO makes me on little bit more happy 2014-06-04 14:10:54 +10:00
Sam c6c412fd45 BUGFIX: no reading credit for posts you create 2014-06-04 14:10:54 +10:00
Neil Lalonde 3e16ac62c3 Add register_color_scheme for plugins 2014-06-03 12:37:29 -04:00
Sam 3405253405 FEATURE: rush posting read times for newly read posts
FEATURE: "read" indicator on posts
CHANGE: anon is now assumed to have read everything
2014-06-03 11:48:52 +10:00
Sam e087e37907 BUGFIX: blank name causes SSO to explode 2014-06-02 17:32:39 +10:00
Sam 0979e7b9af BUGFIX: tracking categories was not implemented 2014-06-02 13:55:01 +10:00
Sam 106838b92b Correct invalid spec 2014-05-30 14:48:07 +10:00
Sam 95221ee9c1 rebake based on version, not date 2014-05-30 14:45:55 +10:00
Sam fa6f22dd39 Move letter avatars out of upload system
FIX: S3 issues around system avatars
FIX: reduced backup file size
2014-05-30 14:45:55 +10:00
Sam fe594f5d1e Merge pull request #2372 from vikhyat/badge-system
Multiple grant badges
2014-05-30 10:18:00 +10:00
Neil Lalonde e6841d0849 FIX: user avatar urls need to be absolute in wordpress api 2014-05-29 17:19:49 -04:00
Sam 2ad756464e SECURITY: TopicView not correctly restricting to topic 2014-05-29 21:56:26 +10:00
Sam 0bc3525b10 BUGFIX: more robust onebox implementation 2014-05-28 17:15:10 +10:00
Sam d9f51961c4 BUGFIX: pick gravatar if it was just downloaded
BUGFIX: don't go rebaking unless all avatars are downloaded
2014-05-28 16:54:21 +10:00
Sam f6753d3d46 FEATURE: automatically rebake out-of-date posts 2014-05-28 12:30:57 +10:00
Sam 2791852bd8 FEATURE: ability to regenerate system avatars as needed
BUGFIX: made system letter avatar more thinner for less block look
2014-05-28 12:30:57 +10:00
Robin Ward 7c22d738b6 FEATURE: Add a location field to a user's profile 2014-05-27 13:54:04 -04:00
Sam 1e28668e9f missed one spot where route changed 2014-05-28 01:09:01 +10:00
Sam 6e0f54ba9a slow down the back fill process a bit 2014-05-27 20:46:17 +10:00
Sam Saffron 330ea82ce4 FIX broken spec 2014-05-27 13:52:39 +10:00
Vikhyat Korrapati a79bf11edb Admin badge creation bug fixes. 2014-05-27 09:03:55 +05:30
Sam 033cbc61bf BUGFIX: broken spec 2014-05-27 10:08:03 +10:00
Sam 504cfcff96 Fix specs for avatars
Implement avatar picker
Correct avatar related jobs
2014-05-27 10:08:03 +10:00
Sam 6c1c8be794 Work in progress, keeping avatars locally
This introduces a new model to store the avatars and 3 uploads per user (gravatar, system and custom)

user can then pick which they want.
2014-05-27 10:08:03 +10:00
Robin Ward 7900c7bd2f Allow multiple subcategories with the same name 2014-05-26 15:33:51 -04:00
Sam 67db561429 BUGFIX: missed a key rename
BUGFIX: API spec not enabling CSRF
2014-05-23 08:43:19 +10:00
Sam cf254000cf Revert "Revert "BUGFIX: improve error messages for invalid API keys""
This reverts commit e9afe28586.
2014-05-23 08:43:19 +10:00
Neil Lalonde e9afe28586 Revert "BUGFIX: improve error messages for invalid API keys" 2014-05-22 14:55:36 -04:00
Neil Lalonde c913c50c68 Remove that spec 2014-05-22 11:14:22 -04:00
Neil Lalonde d2c34d17b7 Fix failing spec. Stubbing intermittently does not stub... 2014-05-22 11:06:19 -04:00
Sam 8f445e835b FIX broken spec 2014-05-22 09:08:09 +10:00
Sam eeef775f21 BUGFIX: improve error messages for invalid API keys
BUGFIX: don't track last seen for message bus
2014-05-22 09:01:29 +10:00
Neil Lalonde 742841ddce Add Google Oauth2 authenticator. The current Google OpenID authentication has been deprecated by Google and will NOT work for any new websites. 2014-05-21 18:35:10 -04:00
Vikhyat Korrapati d208e4d517 Multiple grant badges. 2014-05-21 12:54:55 +05:30
Robin Ward 64355c989e FIX: Don't extract links from empty quotes 2014-05-20 17:20:52 -04:00
Neil Lalonde 4d3c19f736 OOPS: fix broken spec 2014-05-20 15:32:42 -04:00
Neil Lalonde 27cbc06563 Add fixed_category_positions site setting to handle whether categories are ordered by specified positions or by activity. 2014-05-16 11:33:52 -04:00
Sam 5914d0e132 Merge pull request #2311 from vikhyat/badge-system
Add automatically assigned trust level badges
2014-05-16 09:08:00 +10:00
Vikhyat Korrapati 8c2ec4c52a Get rid of update_badges mocks. 2014-05-15 23:13:04 +05:30
Sam 198cf851ff BUGFIX: exact username match not correctly prioritized on search 2014-05-15 12:22:35 +10:00
Robin Ward 3211c60bbe FEATURE: A new site setting `public_user_custom_fields` which allows you
to whitelist custom fields that will be exposed to the Ember client
application.
2014-05-14 14:39:01 -04:00
Vikhyat Korrapati c07244a4e6 Refactor BadgeGranter.update_trust_level_badges! -> update_badges. 2014-05-14 21:01:41 +05:30
Vikhyat Korrapati b144b75565 Add automatically assigned trust level badges. 2014-05-14 20:47:21 +05:30
Neil Lalonde c4d3aa3d47 Theming: a UI to choose some base colors that are applied to all the site css. CSS compiled outside of asset pipeline. 2014-05-14 10:18:12 -04:00
Neil Lalonde 55b37d3948 Let's try another fix for this smoke test 2014-05-13 18:14:01 -04:00
Neil Lalonde fb23f8f54c Update smoke_test.js for new user card 2014-05-13 17:45:30 -04:00
Régis Hanol 08dde3d881 BUGFIX: moderators can notify moderators 2014-05-13 17:47:00 +02:00
Neil Lalonde 6e0eb89697 Don't show suspended users in autocomplete fields unless you are staff 2014-05-13 11:44:15 -04:00
Wojciech Zawistowski 960d64930c Wiki Post 2014-05-13 08:53:11 -04:00
Neil Lalonde e68e97d986 FIX: moderators can't see private topics that they aren't invited to see. 2014-05-12 15:26:46 -04:00
Régis Hanol fca6738212 BUGFIX: could not see the revisions of a post in a deleted topic 2014-05-12 16:30:10 +02:00
Régis Hanol 1566693b6e BUGFIX: do not lightbox oneboxed images 2014-05-12 12:07:05 +02:00
Régis Hanol bc3de84ebf FEATURE: remove bookmark button in activity feed 2014-05-12 09:33:26 +02:00
Régis Hanol 9125453628 FEATURE: add the first 3 participants in a private message 2014-05-12 09:32:49 +02:00
Sam 084ec87850 FEATURE: admins can invite users to groups via the web UI 2014-05-09 18:22:36 +10:00
Sam 3f07c1d0a1 Backend support for group invites 2014-05-09 18:22:35 +10:00
Sam 34d1668f9f FEATURE: backend for inviting a user to a group 2014-05-09 18:22:35 +10:00
Sam ffd18ca0ca BUGFIX: smoke test regression due to anon button moving 2014-05-08 14:47:54 +10:00
Sam a2e2d0e886 Merge pull request #2316 from mutiny/refactor-where-first
Refactor `where(...).first` to `find_by(...)`
2014-05-08 09:10:45 +10:00
Régis Hanol 21e8ae0eca BUGFIX: the /top page now shows the first non-empty period 2014-05-07 19:04:39 +02:00
Neil Lalonde f44bd4ec28 Don't allow sending private messages to suspended users. Emails to suspended users should tell them how to respond, since they can't. 2014-05-06 15:01:27 -04:00
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Régis Hanol c21d3f41d0 BUGFIX: only redirect new users to top page once
Actually, new users will still be redirected to the top page during the first 30 seconds of their first visit.
2014-05-05 19:00:40 +02:00
Neil Lalonde 014bfc0512 Use 10k most common passwords instead of 5k 2014-05-02 12:01:21 -04:00
Neil Lalonde dc0a758ec6 FIX: quote whole post button was broken 2014-04-30 14:21:43 -04:00
Régis Hanol 11af466737 FEATURE: add a specific flag reason when a post has been hidden 2014-04-30 16:58:01 +02:00
Jeff Atwood f13e9e58e8 change "Log In" to "Sign In"
because
http://www.designcult.org/2011/08/why-do-we-call-in-logging-in.html
2014-04-30 01:10:32 -07:00
Sam f6c22cc299 Merge pull request #2297 from ligthyear/custom-fields
Custom fields for Topic, Category, Post and Group
2014-04-30 13:15:50 +10:00
Robin Ward cd6ab981f3 FIX: preferences URL changed 2014-04-29 21:18:23 -04:00
Neil Lalonde f61f29439e Track the ip address where user was registered 2014-04-29 14:37:56 -04:00
Benjamin Kampmann f757706861 Ensure Reload reloads custom_fields, too 2014-04-29 19:34:56 +02:00
Benjamin Kampmann 230453b411 use more explicit naming to prevent name clashes. fixes build. 2014-04-29 19:26:43 +02:00
Benjamin Kampmann 0cf07d41ae Move Concern from lib into app/models. refs #2279 2014-04-29 19:26:43 +02:00
Benjamin Kampmann 1e70c3cbbd Add Support for Arrays to CustomFields 2014-04-29 19:26:42 +02:00
Benjamin Kampmann e502122c51 Add Custom Fields on Topics 2014-04-29 19:26:42 +02:00
Benjamin Kampmann 48f016c7f5 fix double save missing error by using copy not actual reference 2014-04-29 19:26:42 +02:00
Benjamin Kampmann 2450088c03 Add CustomFields to Post, Category and Group 2014-04-29 19:26:42 +02:00
Benjamin Kampmann e6e03a1a96 move custom fields into its own concern 2014-04-29 19:26:42 +02:00
Régis Hanol 4371374ba6 FEATURE: support for enabling all upload file types
BUGFIX: authorized extensions is now case insensitive
2014-04-29 19:12:35 +02:00
Robin Ward 359d59242e If a new user receives a mention, quote or response to their post, allow
them to continue posting in a topic.
2014-04-29 12:59:14 -04:00
Sam 0fc4c47927 Merge pull request #2295 from vikhyat/badge-system
Titleable badges
2014-04-29 11:26:51 +10:00
Sam 35952055e2 BUGFIX: web crawlers messing with anon caching 2014-04-29 10:48:09 +10:00
Neil Lalonde 495f78f574 oops, fix broken current_user_spec 2014-04-28 14:01:22 -04:00
Neil Lalonde 1da59e7e2e FIX: deactivated users shouldn't be able to log in 2014-04-28 13:46:28 -04:00
Neil Lalonde 9fba385172 FIX: don't onebox hidden posts 2014-04-28 11:03:19 -04:00
Neil Lalonde 340fd303c8 FIX: in multisite setup, links to the current forum are whitelisted when looking for spam hosts 2014-04-28 10:37:28 -04:00
Vikhyat Korrapati b4e037dfb2 Allow badges to be marked as "titleable". 2014-04-28 10:30:38 +05:30
Sam e88e43bfb6 Merge pull request #2279 from fantasticfears/concern
move concerns to the model/concerns
2014-04-28 09:48:33 +10:00
Sam 4445b8c3c0 Factor out mocks 2014-04-28 00:34:55 +10:00
Neil Lalonde 47d000edcc Merge pull request #2292 from ligthyear/sass-variables
Improved Plugins SCSS management
2014-04-25 15:29:50 -04:00
Neil Lalonde 7993c27ce5 Also allow system_user to send pm's even if enable_private_messages is disabled 2014-04-25 14:52:57 -04:00
Benjamin Kampmann 64918c35f5 Improved Plugins SCSS management
- Moves the import of plugins for both mobile and desktop from common after discourse loading, allowing plugins to overwrite
 - Make desktop-option behave like the mobile-option: SCSS/CSS marked with that option will only be loaded for desktop from now on and ignored in mobile
 - Add variables-keyword, allowing plugins to ship and overwrite variables before they get imported by discourse (great for theming)
2014-04-25 18:25:45 +02:00
Régis Hanol f8d9fb7bdc Revert "Merge pull request #2284 from jaimeiniesta/patch-1"
This reverts commit a6b88d1e7e, reversing
changes made to 9bee0b6e2d.
2014-04-25 11:40:38 +02:00
Neil Lalonde feaaf55a0c Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet. 2014-04-24 16:49:12 -04:00
Sam a6b88d1e7e Merge pull request #2284 from jaimeiniesta/patch-1
escape gravatar URLs to comply with W3C standards
2014-04-24 12:56:16 +10:00
Sam 05efc8df16 BUGFIX: likes would cause whole post to re-render 2014-04-24 12:42:04 +10:00
Neil Lalonde ee8bbadfe8 Allow contact user to send private messages even if enable_private_messages is false 2014-04-23 17:00:22 -04:00
Robin Ward 84da39f5dc FIX: Admins should always be able to see groups so they can edit them. 2014-04-23 15:15:46 -04:00
Régis Hanol b61abe3107 FEATURE: warn the admin whenever we disable the download_remote_images_to_local site setting 2014-04-23 12:43:10 +02:00
Robin Ward af877781b7 Allow admins to choose if groups are visible or not. 2014-04-22 16:43:46 -04:00
Sam a3b2b4baca FEATURE: custom fields on User 2014-04-22 13:52:13 +10:00
Robin Ward b9ca124756 Support for /my/preferences to automatically redirect to the logged in
user.
2014-04-21 11:52:11 -04:00
Jaime Iniesta 2c3a10aa5b fixes user specs about ampersands in gravatar URLs 2014-04-21 10:52:58 +02:00
Erick Guan 6d45f71254 move concerns to the model/concerns 2014-04-19 12:00:40 +08:00
Régis Hanol 454f11e597 FEATURE: new title_sanitize site setting 2014-04-18 21:01:21 +02:00
Régis Hanol 756ea0178a Merge pull request #2276 from vikhyat/badge-system
Badge system updates
2014-04-18 11:46:19 +02:00
Régis Hanol b014d66b65 Merge pull request #2277 from vikhyat/fix-title-html
Fix HTML tags in topic titles
2014-04-18 11:37:33 +02:00
Vikhyat Korrapati 25a080a8e1 Fix HTML tags in topic titles.
We no longer sanitize titles before saving to the database since it
would cause problems like HTML entities showing up when you try to edit
a topic title. It isn't even really necessary since we only render
fancy_title directly and never title.

The escaping logic used here is the same that is used both in lodash and
onebox. See:

1. https://github.com/discourse/onebox/pull/190/files
2. https://github.com/lodash/lodash/blob/2.4.1/dist/lodash.compat.js#L6194
2014-04-18 10:47:00 +05:30
Vikhyat Korrapati 8113e8d897 Basic UI for selecting gold/silver badges as titles. 2014-04-18 09:20:51 +05:30
Robin Ward 64faee0935 Break down new topic counts by category if a digest contains many. 2014-04-17 16:42:40 -04:00
Régis Hanol b2cb4b27a1 Merge pull request #2273 from paully21/development-branch
Add blurb of post to search results via API
2014-04-17 21:06:03 +02:00
Neil Lalonde 890e53cd6e Remove the default_invitee_trust_level+1 privilege from trust level 3. 2014-04-17 15:05:15 -04:00
Robin Ward 87682f7539 FIX: Don't include image meta data when embedded in an email 2014-04-17 12:32:51 -04:00
Robin Ward b3ed8b6a32 Use query params for sortable table headings 2014-04-17 10:52:57 -04:00
paully21 84d100be85 Add blurb of post to search results via API 2014-04-17 07:58:51 -05:00
Vikhyat Korrapati b62606e7f1 Remove color_hexcode column from badge_types. 2014-04-17 05:36:29 +05:30
Vikhyat Korrapati 89f45901bc Create notification when badge is granted. 2014-04-17 01:58:01 +05:30
Vikhyat Korrapati 3136217fc1 Add badge page. 2014-04-17 01:57:57 +05:30
Vikhyat Korrapati acfcf0b64e Add /badges route that lists all defined badges. 2014-04-16 18:42:06 +05:30
Vikhyat Korrapati de23caa871 Slightly faster badge system specs. (Shaves off ~100ms) 2014-04-16 18:08:10 +05:30
Neil Lalonde 91bfd47419 FIX: don't show contents of hidden posts when quoting the post and when replying as new topic. Also don't allow public to view edit history of hidden posts. 2014-04-15 12:49:08 -04:00
Régis Hanol 542d54e6bf BUGFIX: uploads to S3 2014-04-15 13:04:14 +02:00
Régis Hanol 2505d18aa9 FEATURE: support email attachments 2014-04-14 22:55:57 +02:00
Robin Ward 0d238db43c Exclude category definition topics from similar search 2014-04-14 15:21:05 -04:00
Sam 63f4a0e050 Tighten API, add spec for recovery, keep mutex semantics 2014-04-14 10:51:46 +10:00
Vikhyat Korrapati 56ee1ac569 Extract scheduler cross-process locking into DistributedMutex. 2014-04-13 00:05:46 +05:30
Sam 6daef624c3 BUGFIX: smoke test was broken 2014-04-10 16:57:23 +10:00
Sam de9aa49b52 BUGFIX: default should register CSS for both mobile and desktop
If you want desktop only use :desktop option
2014-04-10 16:30:22 +10:00
Sam b9d4edd91a FEATURE: display unpinned state, allow unpinning by clicking on pin 2014-04-10 10:59:02 +10:00
Sam ac097e2d0f Merge pull request #2244 from vikhyat/css-import
Site Customization @import fixes
2014-04-10 07:01:34 +10:00
Robin Ward 034287033e Add back onebox support for flash video 2014-04-09 13:41:25 -04:00
Régis Hanol c3a1c867dd REFACTOR: poll mailbox specs 2014-04-09 19:26:19 +02:00
Sam 8cdf25532c Merge pull request #2207 from riking/list-setting
UI for list site settings
2014-04-09 09:34:50 +10:00
riking 9c4dd1cb35 Change comma-delim site settings to pipe-delim 2014-04-08 14:17:55 -07:00
Vikhyat Korrapati ce4f87e461 Pass sprockets context and environment to Sass::Engine. 2014-04-08 20:09:11 +05:30
riking 1540a3d5e5 Allow changing ownwership of posts by admins 2014-04-08 01:47:42 -07:00
Sam d71f62a9f9 Merge pull request #2180 from tomciopp/master
More idiomatic approach to finding drafts
2014-04-08 16:46:24 +10:00
Sam 3e41c8fd87 Merge pull request #2236 from ligthyear/mobile-styles-via-plugin
Allow plugins to ship custom styles only for mobile
2014-04-08 16:17:21 +10:00
Robin Ward 7e3ea5d644 Support for crawling topic links 2014-04-07 14:08:34 -04:00
Benjamin Kampmann d22df7731d Allow plugins to ship custom styles only for mobile
- adds another :mobile-flag to register_assets
- adds test for plugin registering of assets
- load plugins when on desktop and plugins_mobile when on mobile
2014-04-07 16:33:35 +02:00
Sam 0372b81d11 FEATURE: allow moderators to globally pin topics 2014-04-07 16:38:51 +10:00
Sam ae3b2a6e02 Disable problem spec 2014-04-07 15:21:37 +10:00
Robin Ward dbab628e16 Support for creating embedded topics via API 2014-04-03 14:42:44 -04:00
Neil Lalonde ecf211aa3f Send email to contact_email if there are flags submitted more than 48 hours ago. Configurable with the notify_about_flags_after site setting. 2014-04-03 14:34:40 -04:00
Robin Ward 10d0320532 FIX: Allow expanding posts when anonymous, add specs 2014-04-03 11:30:43 -04:00
Robin Ward 079123f008 Allow the `content_sha1` column of `topic_embed` to be nullable 2014-04-02 16:18:51 -04:00
Robin Ward 558a06a117 Adds better reusable error message support. Added to fetching remote
posts. /cc @riking
2014-04-02 13:22:10 -04:00
Robin Ward f5c7ccb4e6 New field: Whether or not to include an expandable first post for
embedded content.
2014-04-02 10:26:46 -04:00
Sam eff20fdda7 fix bust spec 2014-04-02 16:22:12 +11:00
Vikhyat Korrapati 317f9bcd08 Use custom DiscourseSassImporter for site customization SCSS compilation. 2014-04-01 23:05:02 +05:30
Régis Hanol 77a8a4083a Revert "Merge pull request #2125 from vikhyat/css-variables"
This reverts commit b537de3ca5, reversing
changes made to b925827e5b.
2014-04-01 16:24:29 +02:00
Vikhyat Korrapati df5ef38085 Use custom DiscourseSassImporter for site customization SCSS compilation. 2014-04-01 17:25:35 +05:30
Sam a3f270f0e9 BUGFIX: broken spec 2014-04-01 16:08:18 +11:00
Régis Hanol 706fd3c59a Merge pull request #2206 from riking/posted
Fix the 'posted' view so that it actually does something
2014-03-31 23:05:48 +02:00
Régis Hanol ef24a4c71c FEATURE: add redirect_users_to_top_page site setting (default to true) 2014-03-31 21:53:38 +02:00
Neil Lalonde 379f4a87d5 FIX: remove likes and other post actions before nuking a user 2014-03-31 14:06:35 -04:00
Sam 8fc2549873 Stop using global vars where not needed
Simplify local process site setting provider
Stop setting up methods over and over
Centralize cache clearing
2014-03-31 12:34:13 +11:00
Sam 64b0d7e0ea PERF: use before suite vs before file
BUGFIX: correctly punch through settings to local provider
2014-03-31 12:34:13 +11:00
Sam f3cc7360e0 BUGFIX: Correct after_fork semantics
After fork SiteSettings was not getting a new process id,
causing site settings not to refresh properly in unicorn

This code also centralizes the logic
2014-03-31 12:34:13 +11:00
riking df5229a399 Add spec for posted list
The test fails on 956b14a and passes on this branch
2014-03-30 14:21:35 -07:00
Régis Hanol 3ee8b087ca Merge pull request #2197 from aslakknutsen/feed_url_case
Normalize URL from Feed Entry after adding link to original in Topic
2014-03-28 15:09:55 +01:00
Régis Hanol e6989b5313 Merge pull request #2192 from jorgemanrubia/configurable-emails-prefix
Option to change the subject prefix in emails
2014-03-28 15:08:50 +01:00
Neil Lalonde fd504e741f FIX: reply by email can handle emails with attachments. Attachments are still ignored, but a post or topic can be created from the email now. 2014-03-28 09:57:20 -04:00
Aslak Knutsen f011fbdca9 Normalize URL from Feed Entry after adding link to original in Topic
Since a URL might be case sensitive, adding a link to the original
Feed Entry with changed case to the Topic could end in 404.
2014-03-27 20:48:01 +01:00
Jorge Manrubia 806924dd7e Option to change the email subject prefix
It adds a new setting 'email_prefix' to configure which [label] will be used in the subject of emails. Discourse currently uses '[title]'. The problem is that sometimes you need to set a longer title, that doesn't really work well for emails. I think this is very common since the HTML `<title>` tag is very important for SEO.

It will default to '[title]' if this setting is not used.

See: https://meta.discourse.org/t/where-to-change-the-email-subject-prefix/11989
2014-03-26 23:06:00 +01:00
Thomas Cioppettini 38882eb1a7 Remove threequals from ruby files 2014-03-26 12:20:41 -07:00
Sam be06156629 SECURITY: when enabled_local_logins is false users could log in via API
thanks @Nicholas Blanco
2014-03-26 15:39:44 +11:00
Sam 5897d3419c BUGFIX: identity_url was not fished out correctly
If I user logged in with Google and then changed email,
they would no longer be able to log in with google
2014-03-26 14:52:50 +11:00
Sam 4191972afe Merge pull request #2173 from vikhyat/badge-system
Forgot to specify "dependent: destroy" for UserBadges
2014-03-25 08:25:31 +11:00
Neil Lalonde ea86cfd4ef FIX: categories with non-ascii names will have broken next page urls 2014-03-24 13:36:23 -04:00
Vikhyat Korrapati b1e524e9c3 Specify `dependent: destroy` for UserBadges. 2014-03-24 22:39:58 +05:30
Robin Ward 539890afdf Let's not show tons of extra information about invites unless you're the
person who invited them.
2014-03-21 14:16:11 -04:00
Vikhyat Korrapati dcaa069bb5 Log badge grant/revoke to the staff actions log. 2014-03-21 11:10:07 +05:30
Neil Lalonde 342d09bc34 FIX: support sso_url that has query params 2014-03-19 17:14:31 -04:00
Robin Ward d3f1eb395d Updated import for TypePad 2014-03-19 15:02:49 -04:00
Neil Lalonde c708d6fcb8 FIX: post_mover_spec needs to order posts 2014-03-19 11:05:18 -04:00
Sam 9fc31932cf BUGFIX: don't alery myself when I link to myself 2014-03-19 12:07:48 +11:00
Neil Lalonde 0b1550f9d4 Add excerpt column to topics table to remove N+1 query in ListableTopicSerializer 2014-03-18 15:24:29 -04:00
Sam 5c26b3dad1 FIX: broken specs after new link alerting code 2014-03-18 15:22:53 +11:00
Neil Lalonde 2c725e2779 FEATURE: Trust level 4 abilities: pin/unpin, close, archive, make invisible, split/merge topic 2014-03-17 14:50:28 -04:00
Benjamin Kampmann e63b9b362e allow apps to give custom admin javascripts 2014-03-17 13:19:08 +01:00
Sam 798b8444cf BUGFIX: work correctly if process forks 2014-03-17 15:22:11 +11:00
Sam 90139efc6f Fix spec, remove pointless have_many etc preamble 2014-03-17 12:47:47 +11:00
Sam 2c8ae22b87 FEATURE: add a simple queue Scheduler::Defer.later {}
For quick jobs that do not need to be sent to sidekiq,
runs inline in a single thread but does not block
2014-03-17 12:16:19 +11:00
Sam fe63db7953 Merge pull request #2115 from vikhyat/badge-system
Initial badge system implementation
2014-03-17 10:06:37 +11:00
Sam f4c2fef407 Merge pull request #2121 from LessonPlanet/disable-name-edit-for-sso
Adding name to the list of uneditable items in preferences UI
2014-03-17 10:05:11 +11:00
Vikhyat Korrapati e3702ecb30 Improved crawler detection: add Twitterbot, Facebook, curl, Bing, Baidu. 2014-03-16 19:30:20 +05:30
Neil Lalonde 98284d771f Mark failing spec as pending for Robin to investigate 2014-03-14 18:13:45 -04:00
Robin Ward e22f1ae186 Support for a daily job at a certain hour. Convert backup job to run at
3am instead of randomly during the day.
2014-03-14 13:02:45 -04:00
Vikhyat Korrapati 9b26c8584e Initial badge system implementation. 2014-03-14 21:49:26 +05:30
Forest Carlisle e904b2faad Adding name to the list of uneditable items in preferences UI
* If enable_names,  enable_sso, and sso_overrides_name settings are true.
  * Added serialization of can_edit_name so the UI has access to the right.
2014-03-13 13:26:40 -07:00
Neil Lalonde 9f8477d0c1 Add support for categories page to smoke tests 2014-03-13 15:03:34 -04:00
Régis Hanol fd1c824187 Revert "Merge pull request #2116 from LessonPlanet/disable-name-edit-for-sso"
This reverts commit 91aa21671a, reversing
changes made to f19596af0d.
2014-03-13 18:17:59 +01:00
Neil Lalonde 283dc7dd2d Trust level 4: add ability to edit any post and see edit history 2014-03-13 10:47:49 -04:00
Forest Carlisle e8c7c6fab7 Adding name to the list of uneditable items in preferences UI
* If enable_names,  enable_sso, and sso_overrides_name settings are true.
2014-03-12 17:09:53 -07:00
Robin Ward 085f7997a2 FEATURE: Upload backups to S3 when complete. 2014-03-12 16:24:45 -04:00
Robin Ward 42ca83ece5 FEATURE: New site setting to enable a daily automatic backup 2014-03-12 13:30:47 -04:00
Neil Lalonde 9ca516e58d Rename nickname to username in the code. Use new hub routes. (Old routes still exist as aliases for old Discourse instances.) 2014-03-12 12:39:36 -04:00
Robin Ward dc1d6decf5 Support for removal of old backups automatically via a site setting 2014-03-12 12:24:35 -04:00
Neil Lalonde cf630207b7 Remove an unused variable in check_reviving_old_topic spec 2014-03-12 10:46:50 -04:00
Neil Lalonde 659e7fa4ce FEATURE: Warn when reviving a topic that has been inactive for X days. Setting warn_reviving_old_topic_age controls when the warning is shown. Set it to 0 to disable this feature. 2014-03-12 10:44:12 -04:00
Régis Hanol 363fabd3e7 add tests for ListController.best_period_for 2014-03-12 12:58:41 +01:00
Neil Lalonde 2838e1c3b5 FIX: don't show option to flag with notify_user to trust level 0 users. they can't send private messages. 2014-03-10 11:48:40 -04:00
Benjamin Kampmann 680197200e Add support for arrays to PluginStore 2014-03-10 14:59:59 +01:00
Sam 1b66ed903f Merge pull request #2091 from Xenograph/fix-sso-override
Added spec for SSO override username/email changes
2014-03-10 13:11:25 +11:00
Douglas Browne a1e70ac57e Added spec for SSO override username/email changes 2014-03-09 21:38:36 -04:00
Sam 3f0964bf60 BUGFIX: spec would blow up when DST kicked in 2014-03-10 10:12:09 +11:00
Régis Hanol 8214536614 BUGFIX: don't show redirect reason if you aren't redirected
Move the redirect to top page logic server-side and make sure the reason
is not shown when top is not in the navigation menu (top_menu).
2014-03-07 18:58:53 +01:00
Robin Ward c3e5ee1d7e FIX: Failing specs 2014-03-07 12:06:20 -05:00
Régis Hanol f618278b42 make sure topic specs aren't DST sensitive 2014-03-07 11:38:24 +01:00
Sam 73ef91cf27 junk code removed 2014-03-07 19:00:36 +11:00
Sam b19400726f BUGFIX/FEATURE: store topic changes in post revisions
History + edit notifications for title and category changes
2014-03-07 19:00:36 +11:00
Régis Hanol 11d91328ab Merge pull request #2056 from vikhyat/pm-likes
Don't suppress like notifications in private messages
2014-03-06 14:53:27 +01:00
Vikhyat Korrapati 944246f4af Add test to ensure creation of like notification in a PM. 2014-03-06 19:07:26 +05:30
Régis Hanol ac99947979 BUGFIX: topic specs were dependent on Time.now
which would fail when DST was around
2014-03-06 12:44:52 +01:00
Régis Hanol bce4130d39 Merge pull request #2036 from ArmedGuy/profile-backgrounds
FEATURE: Profile Backgrounds
2014-03-05 16:00:49 +01:00
Johan Jatko 98c479c3c4 FEATURE: Profile Backgrounds
Shares a modified codebase with avatars called "user_image"
2014-03-05 15:10:44 +01:00
Sam edf86a207b fix build 2014-03-05 14:26:42 +11:00
Sam adb6541635 FEATURE: mailing list mode always available 2014-03-05 14:21:53 +11:00
Sam 69b498da24 Merge pull request #2034 from birarda/custom_username_length
allow for custom username length via site setting
2014-03-05 12:06:23 +11:00
Stephen Birarda 4a2dab9c5e allow for custom min_username_length
change constant in user to be global range and not default
2014-03-04 16:37:05 -08:00
Sam ea553202f0 Merge pull request #2033 from birarda/master
add option to override user attributes from SSO payload
2014-03-05 11:33:32 +11:00
Robin Ward aa3f7f764d You can only reuse email tokens within 24 hours. 2014-03-04 14:03:04 -05:00
Stephen Birarda c3eb2025d8 add option to override user attributes from SSO payload
add an external_username attribute for username from SSO payload

repair the field name in SingleSignOnRecord migration

move setting of external_username for sso to controller

add settings toggle to override username/email from SSO payload

fix changing of external username after override toggle

complete tests and logic for sso override

add some extra context to username override option

add external_email and external_name to single sign on record

add setting for name override from SSO payload

complete override with stored external_email and external_name

add missing checks to tests

remove an unneeded describe block

break up a monster method for single sign on

fixes for sso attribute override after failed tests
2014-03-04 09:52:21 -08:00
Robin Ward 5e6764e9c9 FIX: Remove update, should fix issue with broken specs 2014-03-04 12:47:14 -05:00
Robin Ward a2b0e2b50f BUGFIX: Fix ailing tests 2014-03-03 16:24:20 -05:00
Robin Ward f9cd354a2c FEATURE: Button to reset new 2014-03-03 15:47:01 -05:00
Robin Ward 3abe84941f FEATURE: Add `new_since` column to `UserStat` so we can reset the "New"
date.
2014-03-03 15:47:00 -05:00
Sam 5c3f2feed4 BUGFIX: recovery code in case an unknown job is scheduled 2014-03-04 07:37:12 +11:00
Sam 172e517b31 Merge pull request #2012 from ligthyear/incoming-emails
Advanced New-Topic via Email Feature
2014-03-03 10:58:10 +11:00
Neil Lalonde b40313559b FIX: moderators should not be able to see site setting changes in the staff action logs. Fixes #2027 2014-02-28 16:30:54 -05:00
Benjamin Kampmann 024597e643 Switch to proper exception handling system for better user feedback
- Replace implicit return code-system in Email::Receiver with proper exception system
 - Update tests to check for exceptions instead
 - Test the PollMailbox for expected failures
 - Add proper email-handling of problematic emails
"
2014-02-28 17:02:58 +01:00
Benjamin Kampmann d32cb55837 Add public-inbox to Email-In-Feature
- Adds the advanced option to accept email from non-users per category email-address
 - Adds tests covering the new feature
 - Adds UI to configure this feature in the frontend
2014-02-28 16:53:58 +01:00
Benjamin Kampmann 37cea49459 Add Email-In-Per-Category
- allow the configuration of an inbox-email-address per category
 - post emails to that email into that category instead of global

 - Adds UI for configuration
 - Adds Documentation for configuration
 - Adds Tests for new feature
2014-02-28 16:53:58 +01:00
Benjamin Kampmann 4af2cf3f23 Refactor and clean up New-Topic via Email
With the new email_in admin configuration setting, emails to the email_in_address fetched via POP will now be processed and posted as new topics to the forum.

With the email_in_min_trust you can control the trust level the user needs to have at least to be able to post an email as a new topic.

Also contains tests for the email-in feature and minor clean ups
2014-02-28 16:53:58 +01:00
Sam 1992271bf9 FEATURE: white_listed_spam_host_domains for domains that are not blocked for spam
BUGFIX: bypass host spam detection for current host
2014-02-27 15:43:57 +11:00
Sam ed7c051fcc BUGFIX: no need for mock central here 2014-02-27 12:15:41 +11:00
Sam a4d7942dbd BUGFIX: Don't blow up on junk referers 2014-02-27 12:03:38 +11:00
Sam 9551f4aeea PERF: calculate scores for topics/posts faster
Only look at topics that changed in last day for 15 minuted schedule
Do a full recalc weekly, just in case
2014-02-27 11:45:40 +11:00
Sam 557af84ae2 FIX: broken spec 2014-02-26 10:52:11 +11:00
Sam 50a8d3caae BUGFIX: sso to send welcome emails 2014-02-26 10:28:03 +11:00
Sam 440435f023 FEATURE: SSO to handle return_path automatically 2014-02-26 09:58:30 +11:00
Robin Ward 9ebcdfba1f Merge pull request #2005 from eriko/plugin_store_delete
clean up plugin store when removing data instead of setting the value to...
2014-02-25 11:36:05 -05:00
Sam 6f31d3f0e5 FEATURE: single sign on support
Added support for outsourcing auth to a different website, documentation on meta
2014-02-25 14:31:03 +11:00
Erik Ordway db411860c2 clean up plugin store when removing data instead of setting the value to nil. 2014-02-24 16:11:31 -08:00
Robin Ward 4cd5ccdf1f BUGFIX: Don't return child categories if you can't see the parent
category.
2014-02-24 14:52:41 -05:00
Robin Ward 3151f59bc9 REFACTOR: We don't cache the json for the Site model anymore, so let's
rename and remove the methods leftover from that.
2014-02-24 14:25:37 -05:00
Wojciech Zawistowski d555df28f2 PostsController tests clean up. 2014-02-24 18:14:35 +01:00
Robin Ward 7aaa70770b Remove old onebox fixtures 2014-02-21 16:04:15 -05:00
Robin Ward 1aa27ade17 FEATURE: If you don't select any topics to "Dissmiss Read" it does all
by filter.
2014-02-21 15:18:45 -05:00
Robin Ward a07e9f7e71 FEATURE: Bulk `reset read` status. 2014-02-21 15:18:45 -05:00
Neil Lalonde 5fd390c600 FIX: nuke spammer from flags page 2014-02-21 14:14:30 -05:00
Sam Saffron 451598c511 BUGFIX: regresses correct job execution 2014-02-21 16:05:19 +11:00
Sam Saffron 9a3af8997b BUGFIX: handle partial job failure in multisite
log all failures
2014-02-21 15:31:15 +11:00
Sam Saffron 2ab76f60d1 FEATURE: Discoruse.handle_exception
to report exception via sidekiq helper, adds extra context
2014-02-21 14:30:25 +11:00
Robin Ward d95887c57d CHANGE: We now include the `_escaped_fragment_` support by default, but
only if the crawler check fails. It is a fallback for non-google search
engines that support the Ajax crawling API.
2014-02-20 17:02:26 -05:00
Robin Ward c4b5455c21 REFACTOR: Rename `GooglebotDetection` to `CrawlerDetection` because we
will likely whitelist more crawlers in the future.
2014-02-20 16:07:02 -05:00
Robin Ward b8448b6e39 Merge pull request #1982 from velesin/posts_controller_replies_tests
Adds tests for PostsController#replies.
2014-02-20 13:36:31 -05:00
Neil Lalonde b696c96a19 Look at the age of a user's first post to determine if the user can be nuked, instead of looking at when the user registered. 2014-02-20 12:29:40 -05:00
Wojciech Zawistowski cfbeba84d2 Adds tests for PostsController#replies. 2014-02-20 17:38:13 +01:00
Vikhyat Korrapati e781a758ad Preserve spoiler tags in post excerpts. 2014-02-20 15:01:44 +05:30
Régis Hanol d443ddd43d Merge pull request #1922 from joallard/language-toggle
Allow users to toggle interface language in their preferences
2014-02-19 18:28:00 +01:00
Wojciech Zawistowski 5e8db5ce14 Adds specs for PostsController#by_number. 2014-02-19 17:41:17 +01:00
Sam 2a8734f0d5 Suppress search in topic unless we have more than 10 posts
(configurable in site setting)
2014-02-19 08:59:18 +11:00
Robin Ward 18e98851e3 Use lower case group names in URLs 2014-02-18 16:43:19 -05:00
Sam 43612e9fde Merge pull request #1971 from velesin/posts_controller_refactoring
Refactors PostsController and adds unit tests.
2014-02-19 08:34:40 +11:00
Robin Ward f19b0b5fe0 Include members count on groups page. 2014-02-18 16:17:04 -05:00
Neil Lalonde 997a7c676e If flagging a topic with only one post, flag the post instead 2014-02-18 15:18:31 -05:00
Jonathan Allard 0592420e52 Add a site setting to allow users to toggle I18n.locale
It is false by default.
2014-02-18 14:54:00 -05:00
Jonathan Allard c513725f26 Allow users to toggle interface language in their preferences 2014-02-18 14:53:59 -05:00
Robin Ward 3f3c07f136 FEATURE: Can bulk update the notification level of topics 2014-02-18 13:02:22 -05:00
Neil Lalonde d0ecccb7e4 Translate asterisks in ip addresses to mask format so people can enter things like 127.*.*.* in screened ip addresses form 2014-02-18 13:00:55 -05:00
Wojciech Zawistowski 5b9a4d3581 Refactors PostsController and adds unit tests. 2014-02-18 17:19:38 +01:00
Neil Lalonde 6c23a1903e FIX: show ip address with mask again on /admin/logs/screened_ip_addresses 2014-02-18 10:33:08 -05:00
Sam 884346cbea Merge pull request #1951 from thoughtbot/bb-erb
Use ERB to pull conf files into app
2014-02-18 16:23:55 +11:00
Stephan Kaag f12925887c Drop Rails3 support 2014-02-17 19:42:08 +01:00
Régis Hanol 77e0096142 Merge pull request #1959 from chris-ramon/patch-1
fix typos in posts_controller_spec.
2014-02-17 09:48:04 +01:00
Sam abb2de22ab BUGFIX: search could break when expanding 2014-02-17 14:34:14 +11:00
Sam 2b10fdc97f FEATURE: search auto scopes on topic first 2014-02-17 13:54:51 +11:00
Sam 23af46a66c Merge pull request #1960 from verg/subcategory-search-links
Fix subcategories links from search
2014-02-17 10:33:35 +11:00
verg f723f11443 Fix subcategories links from search 2014-02-16 12:49:20 -05:00
Christian Ramón 566d25ea75 fix typos in posts_controller_spec.
fixing 'suceeds' typo.
2014-02-16 12:17:36 -05:00
Neil Lalonde d298e2e065 Detect Googlebot from user agent and use a different layout that doesn't load javascript 2014-02-15 17:54:34 -05:00
Britt Ballard 60e1a5aa69 Use ERB when importing conf files into app 2014-02-14 16:14:55 -08:00
Régis Hanol 3f3c9ca7cb FEATURE: add filters on email logs 2014-02-15 00:50:08 +01:00
Robin Ward 2f78dc775d FIX: double periods. How did that work?? 2014-02-14 17:57:38 -05:00
Robin Ward 16c6759818 FIX: i18n integrity check was not ignoring comments properly 2014-02-14 14:47:52 -05:00
Neil Lalonde 35dae76bbd Log when and why an email was not sent in email_logs 2014-02-14 13:06:39 -05:00
Régis Hanol b89d328de2 display/preload the logs of the last/current operation 2014-02-13 13:31:14 -08:00
Régis Hanol e7472dc374 readonly mode 2014-02-13 13:31:13 -08:00
Régis Hanol 3be1b5569a backups controller & specs 2014-02-13 13:31:13 -08:00
Régis Hanol 8344f0d8fd remove old import/export code 2014-02-13 13:31:13 -08:00
Neil Lalonde 8711762143 Users who have made no more than one post can delete their own accounts from their user preferences page. 2014-02-13 13:52:06 -05:00
Sam e8aa85d783 FEATURE: unread pms go in front of notification report
also refactor fat controller
2014-02-13 17:27:50 +11:00
Sam 4ff6780758 Merge pull request #1935 from eriko/remove_cas
Remove cas
2014-02-13 17:26:20 +11:00
Sam 81a4b4d97e Merge pull request #1939 from lukemelia/patch-1
Fixed typo in test name
2014-02-13 17:15:49 +11:00
Robin Ward f73a3f252a FIX: Don't allow parent categories to be deleted. Also, remove
duplicated logic and rely on the server response for `can_delete`
status.
2014-02-12 17:24:25 -05:00
Robin Ward a963dd9081 Support `embeddable_host` values that contain a HTTP/HTTPs protocol 2014-02-12 15:56:06 -05:00
Luke Melia e4ff06baad Fixed typo in test name 2014-02-12 15:24:44 -05:00
Robin Ward 669247977b FEATURE: Show the posts count on the groups page. It seems a bit odd
that it uses a new AJAX call, but I wanted to keep the count separate
from the group object itself.
2014-02-12 14:01:36 -05:00
Robin Ward 318e692290 FIX: If there is an exception when parsing one email, don't stop all
work, return an error code and continue.
2014-02-12 12:08:34 -05:00
Sam 9ec52d9425 BUGFIX: mailing list mode broke regular email 2014-02-12 16:51:26 +11:00
Sam 6fbd73d0eb include rb_trace to help debugging any hanging specs 2014-02-12 13:33:24 +11:00
Sam 71a38542a4 FEATURE: automatic orphan recovery
BUGFIX: improve scheduler robustness, in case redis is disconnected during operation

If sidekiq is terminated while task is running, it will be picked up and ran again
New owner on tasks to help debugging
better #stop semantics for tests
2014-02-12 13:33:24 +11:00
Erik Ordway 557d1886bb remove what little CAS testing there was. 2014-02-11 17:53:20 -08:00
Robin Ward b035c050d2 Merge pull request #1920 from nickborromeo/list-controller
Extract queries to keep logic in the Categories Model
2014-02-11 15:48:20 -05:00
Sam fd34932068 use discourse redis, not redis 2014-02-11 16:11:51 +11:00
Sam 4a35d055bc correct spec to account for category definition topics 2014-02-11 10:50:14 +11:00
Robin Ward ca17f8a437 FIX: Wrong text. Thanks @riking 2014-02-10 17:36:13 -05:00
Robin Ward b61df08d1b FEATURE: Admin selector to choose a primary group for a user, display it
and apply a CSS class to their posts.
2014-02-10 17:00:15 -05:00
Nick Borromeo b51bebb200 Extract queries to keep logic in the Categories Model
This creates two methods in the Category model. This moves the model
logic to the model and just calls the Category class methods in
ListController.

This also adds tests for the two methods created in the Category
model. The motivation for this refactor is the code climate score of the
this class and readability of the code.

 Please enter the commit message for your changes. Lines starting
2014-02-08 14:10:48 -08:00
Sam 90ae4c6224 Try to fix random failing spec 2014-02-09 07:55:11 +11:00
Neil Lalonde 5f992ae34c Merge pull request #1913 from davidcelis/default-category-fields
Default values for posts/topics fields on Category
2014-02-07 11:27:57 -05:00
Robin Ward 2490837929 Added some specs for the group controller methods 2014-02-07 11:07:23 -05:00
Régis Hanol cef2d8dc82 BUGFIX: make sure moderators can't view topics they aren't allowed to 2014-02-07 07:08:56 -08:00
Régis Hanol e47f462f54 Merge pull request #1916 from vikhyat/pm-dominating
Don't notify about dominating private messages
2014-02-07 00:28:27 -08:00
Sam 585fae0541 another try fixing this test 2014-02-07 14:38:00 +11:00
Sam 93434be16d SECURITY: reduce moderator rights
You can now hide particular categories from certain moderators
2014-02-07 14:11:52 +11:00
Vikhyat Korrapati 2f38316bfc Don't notify about dominating private messages. 2014-02-07 05:49:45 +05:30
Sam 227873df78 FEATURE: proper mailing list mode
once enable_mailing_list_mode is enabled any user can elect
to get every post via email unless they opt out of category or topic
2014-02-07 11:07:52 +11:00
David Celis e751b8d58f Default values for posts/topics fields on Category
When creating categories (or, at least, subcategories), certain integer
values are set to a default of NULL: topics_week, topics_month,
topics_year, posts_week, posts_month, and posts_year. This causes
consistent exceptions when trying to visit `/categories`, with the
offending line being in
`CategoryDetailedSerializer#count_with_subcategories`. This attempts to
coerce nil into Fixnum.

A fix could be to convert to 0 in the code, but these attributes should
really never be NULL. If there are no posts or topics, they should be 0
to maintain data integrity.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-06 12:04:03 -08:00
Sam e1f293ad66 FEATURE: new scheduler
Removed sidetiq, introduced new scheduler

- add basic UI
- add schedule discover
- add scheduling in initializer
2014-02-06 10:26:16 +11:00
Robin Ward aff16f372b FIX: Show a nicer error when a user tries to access a category they
can't see.
2014-02-05 15:33:52 -05:00
Robin Ward 1dac3cfd64 API endpoint for retrieving the current user 2014-02-05 13:46:24 -05:00
Vikhyat Korrapati 6acc5c19e7 Use LOAD_PLUGINS=1 instead of LOAD_PLUGINS=true for consistency. 2014-02-05 10:50:28 +05:30
Vikhyat Korrapati 7b46cc0962 Don't clear DiscoursePluginRegistry if LOAD_PLUGINS=true. 2014-02-05 08:05:35 +05:30
Robin Ward 659546c4e4 CHANGE: Hide category definition topics unless you are viewing that
category.
2014-02-04 15:55:30 -05:00
Régis Hanol 4fb274fb9d BUGFIX: history link doesn't work on deleted posts 2014-02-04 20:05:50 +01:00
Neil Lalonde 9601684405 Suggested topics includes closed and archived in new and unread, but not in random results 2014-02-04 12:26:49 -05:00
Sam 6c3c9345df use consistent style 2014-02-04 12:57:52 +11:00
Sam 5267e5bea6 BUGFIX: emails sent from "2 replies" as opposed to correct user 2014-02-04 12:56:28 +11:00
Régis Hanol d2974c2a15 BUGFIX: proper handling of top_menu_items 2014-02-03 16:08:00 +01:00
Sam d0a6dd88df FEATURE: exclude muted categories from the latest and new tabs 2014-02-03 16:05:49 +11:00
Sam 6205240a56 minor style fix 2014-02-03 14:50:19 +11:00
Régis Hanol ae401f0dc7 BUGFIX: JSON requests don't exclude categories from filters 2014-01-31 14:36:00 +01:00
Sam 51c06dea03 BUGFIX: hidden posts not absent from context 2014-01-31 16:37:40 +11:00
Robin Ward 6f23870327 Bulk close operation 2014-01-30 12:44:40 -05:00
Robin Ward 7564d9a20c Server side implementation for bulk editing categories 2014-01-30 11:44:29 -05:00
Robin Ward b315a5c28f Delegate bulk operations to a `TopicsBulkAction` object. 2014-01-30 11:44:29 -05:00
Sam ed45a1dce3 FEATURE: new scheduler so we can deprecate sidetiq
This is a work in progress, should have it finished tomorrow.
2014-01-30 16:21:38 +11:00
Neil Lalonde d343e9f360 Add DiscourseLocalOnebox 2014-01-29 14:14:07 -05:00
Robin Ward e453bfa073 Work in progress: Swap out onebox code for onebox gem 2014-01-29 14:14:07 -05:00
Robin Ward 2892153712 REMOVE: Get rid of the `hotness` control for good. 2014-01-29 11:54:34 -05:00
Sam cce5fb3303 BUGFIXES: improved performance of import an export
we no longer generate the entire dump in memory, instead we generate one table at a time
added some basic progress
2014-01-29 16:49:01 +11:00
Neil Lalonde 74f1c553e3 FIX: 1868 Security: Dangerous Send 2014-01-27 13:05:51 -05:00
Neil Lalonde 7cc5da08fe Track how many posts a user reads each day in user_visits 2014-01-27 11:20:19 -05:00
slainer68 748e1e0748 Allow using the API when Login required site setting is on. 2014-01-24 14:02:49 +01:00
Régis Hanol 245bc19379 BUGFIX: PMs could be created with a category
BUGFIX: hide category column when displaying the list of private messages
2014-01-24 12:57:48 +01:00
Régis Hanol bfc9664231 BUGFIX: site_contact_username was case-sensitive 2014-01-23 11:26:31 +01:00
Sam 7e5a17f277 FEATURE: mute/watch/track buttons for private conversations 2014-01-22 17:46:52 +11:00
Neil Lalonde da825451d0 Invite link can't be used to log in after you set a password or sign in with 3rd party 2014-01-21 16:56:41 -05:00
Neil Lalonde 1dbc1c56b4 FIX: inviting a user again after the first invite expires will create a new invite 2014-01-21 16:56:40 -05:00
Robin Ward 963793549c FIX: Remove failing ruby tests. The same thing is tested in JS and
passes due to the ability to create a document fragment.
2014-01-20 15:28:46 -05:00
Sam b85e5dc191 FEATURE: collapse PM notifications 2014-01-20 16:18:43 +11:00
Régis Hanol 8d2e5041bc BUGFIX: proper handling of /none subcategory 2014-01-18 19:27:25 +01:00
Robin Ward 4981525047 REFACTOR: Fixes poor class hierarchy for listing topics
- Upgrades Ember to latest
- Fixes a bunch of bugs with page titles and missing "active" states
2014-01-18 19:26:24 +01:00
Herb Jiang 5fa464e10b force_encoding according to the charset in mail, this solve encoding problem when not using ‘utf-8’ charset. 2014-01-19 02:12:38 +08:00
Robin Ward 8c29ed870e Non-staff users may not delete their posts in archived topics. 2014-01-17 17:42:12 -05:00
Neil Lalonde 1806a7d4b3 Trust Level 3: invited users start at default_invitee_trust_level + 1, unless default_invitee_trust_level is 2 or higher 2014-01-17 11:12:00 -05:00
Neil Lalonde 7c8ea8c166 Trust level 3 users can edit topic titles and change category 2014-01-16 11:59:26 -05:00
Neil Lalonde 89908cdb47 Admins don't see uncategorized on /categories if it has no topics and allow_uncategorized_topics is false 2014-01-15 14:11:36 -05:00
Neil Lalonde 4f6b208e8d Posts by trust level 3 users do not have nofollow on their external links. 2014-01-15 11:40:51 -05:00
Régis Hanol ad8755aa70 BUGFIX: inline spoiler for text, block spoiler for images 2014-01-15 00:53:06 +01:00
Régis Hanol b024bebbe2 BUGFIX: emoji's url were relatives (was breaking the wordpress plugin) 2014-01-14 23:51:36 +01:00
Robin Ward 4f6283ba56 FIX: Accept HTTPS or HTTP urls on redirect 2014-01-14 15:02:05 -05:00
Neil Lalonde e7a05c54e8 FIX: suggested topics sometimes adds new topics from other categories before new topics of the current category 2014-01-13 15:02:15 -05:00
Sam 2b64118df1 Merge pull request #1782 from ligthyear/group-mention
Allow groups to be used as aliases for user mentions
2014-01-12 14:36:45 -08:00
Régis Hanol 70161498b6 BUGFIX: spoiler tag on lightboxed images wasn't working 2014-01-12 19:38:46 +01:00
Neil Lalonde 52580f09af Rename favorite to starred everywhere 2014-01-10 14:54:19 -05:00
Robin Ward ca26d6d0d6 FIX: Uncaught promise on link click; fixes broken build 2014-01-09 16:31:26 -05:00
Neil Lalonde 259295d865 Add post_edit_time_limit site setting to limit the how long a post can be edited and deleted by the author. Default is 1 year. 2014-01-09 11:55:04 -05:00
Sam 74c1555885 BUGFIX: fix broken spec 2014-01-09 15:11:04 +11:00
Sam 1533a1163c use_ssl is just confusing, it means use_https , fix name of setting 2014-01-09 10:51:38 +11:00
Régis Hanol e732aa8a86 BUGFIX: we should not store absolute urls for locally uploaded avatar templates
Highly recommended to run: `RAILS_ENV=production bundle exec rake avatars:regenerate` to fix the avatar templates stored in the database.
2014-01-07 17:45:06 +01:00
Benjamin Kampmann c743a985a4 Allow groups to be used as aliases for user mention
when configured by the admin a group can be found through the @mentions
feature in both the compose/reply and the private message user-selectors
and once selected the mention will be replaced by the list of users in
the group
2014-01-08 02:36:24 +11:00
Sam 660d87a108 BUGFIX: cache did not support non strings
also reduced mocking in tests
2014-01-07 17:36:47 +11:00
Sam 6e2797112d Attempt to fix spec under vagrant 2014-01-07 09:26:30 +11:00
Régis Hanol 8d73b7f94d BUGFIX: hide sensitive site settings 2014-01-06 13:03:53 +01:00
Sam 6befdceabf BUGFIX: UserStat spec was over ambitious with its mocking 2014-01-06 16:50:55 +11:00
Sam b703d8c77a BUGFIX: redis-rails has always been a problem child
implemented an ActiveSupport::Cache::Store for our internal use.
* allows for expire by family
* works correctly in multisite
* namespaced correctly

Removed redis-rails from the project, no longer needed
2014-01-06 16:50:04 +11:00
Sam 7b7d6f3fa7 Merge pull request #1464 from GarantiaData/single_redis_db
Support single redis DB.
2014-01-05 16:30:41 -08:00
Robin Ward 1ffcf39448 Make embedded comments look nicer 2014-01-03 12:52:42 -05:00
Robin Ward f145060315 Don't employ the "too many replies" if the user is staff, or if they created the topic.
See: http://meta.discourse.org/t/what-is-the-point-of-limiting-new-users-to-three-replies-per-topic/11696
2014-01-02 12:57:40 -05:00
Sam 2da5d2311b FEATURE: Added UI for adding and removing watched and muted categories 2014-01-02 17:59:08 +11:00
Sam b482b280d6 FEATURE: Basic backend support for muted and watched categories 2014-01-02 12:00:29 +11:00
Sam 126433cf65 Merge pull request #1744 from verg/prevent_delete_uncategorized
Prevent deleting 'uncategorized' category
2014-01-01 16:09:49 -08:00
Sam 2ad190b9f6 FEATURE: allow for additional plugin defined global settings 2014-01-02 10:46:09 +11:00
Robin Ward 4f8aed295a FEATURE: Embeddable Discourse comments, now with simple-rss instead of feedzirra 2013-12-31 15:01:22 -05:00
Robin Ward 62db063e1e Revert "Support for Embeddable Comments via IFRAME" - it depends on Curl
which not every server has. Have to rethink this.

This reverts commit e3e4c62887.
2013-12-31 12:52:31 -05:00
Robin Ward e3e4c62887 Support for Embeddable Comments via IFRAME 2013-12-31 12:26:24 -05:00
verg 8a830fb8e3 Prevent deleting 'uncategorized' category 2013-12-31 11:22:44 -06:00
Godfrey Chan c6577fb98e Added a reload to fix a test broken on master
I am not sure why this is wokring on Rails 4, but the problem is that `post3`
here is holding on to an old reference of some associations so `PostDestroyer`
is not doing the right thing.
2013-12-30 14:36:51 -08:00
Neil Lalonde 47e1d00f96 Check that common passwords list is greater than 0 2013-12-30 14:26:02 -05:00
Sam 1915f292ad BUGFIX: invalid referer would cause 500 errors 2013-12-30 14:05:44 +11:00
Sam db1d01d1a2 Discourse as a Mailing List improvements
FEATURE: context is not emailed if we previously emailed you the post
FEATURE: site setting to enable_watch_new_topics , false by default.
  When enables users can elect to watch everything by default
FIX: Custom email subjects (x quoted you in [title], x replied to [title])
  was removed, this broke email grouping. TBD, include info in footer somehow
FIX: topic user specs were messy, reduce side effects
2013-12-30 13:02:12 +11:00
Sam 293b7e5857 add spec to demo blanking props 2013-12-30 08:42:55 +11:00
Neil Lalonde 2c19d8a136 Fix password_validator_spec 2013-12-27 11:15:53 -05:00
Neil Lalonde ab12695d63 Block passwords that are in the top 5000 most common passwords. Site setting block_common_passwords can disable this feature. 2013-12-27 11:00:21 -05:00
Régis Hanol 567d2bd23c add top page 2013-12-24 00:50:36 +01:00
Robin Ward 0c45eba037 FIX: Users can edit posts when they've reached the `newuser_max_replies_per_topic` threshold. 2013-12-20 11:30:51 -05:00
Sam f5f09933df Merge branch 'master' of github.com:discourse/discourse 2013-12-20 16:17:52 +11:00
Sam 7b8d2547d0 globals now implemented and documented 2013-12-20 16:17:21 +11:00
Neil Lalonde 854d9c8fc6 Minimum password length is configurable with the min_password_length site setting. FIX: reset password needs to validate password length. 2013-12-19 16:15:47 -05:00
Neil Lalonde 33c6997ded Move password validation into PasswordValidator 2013-12-19 16:15:47 -05:00
Robin Ward 1cac9fa257 New users can only post `newuser_max_replies_per_topic` times per topic. 2013-12-19 13:45:55 -05:00
Neil Lalonde c35af5d755 FIX: When re-opening a topic that auto-closed, make sure it won't auto-close again 2013-12-19 11:25:05 -05:00
Neil Lalonde 1f0a59584b Revert "Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations." 2013-12-18 14:47:22 -05:00
Neil Lalonde 3cc634d37b FIX: category_list_spec should not expect deterministic order 2013-12-17 12:53:29 -05:00
Sam ea307931a7 fix spec, categories without position are now always at the end of the list 2013-12-17 14:36:07 +11:00
Régis Hanol 2ce75a8523 FIX: canonical url should not use the CDN 2013-12-17 00:35:34 +01:00
Neil Lalonde 341adc93a4 Allow categories with null position, which means sort them based on activity. Mix absolutely positioned (position is not null) categories with null position categories. 2013-12-16 15:13:57 -05:00
Robin Ward acf262b631 Support for "no subcategories" 2013-12-16 13:06:35 -05:00
Régis Hanol ccd0f9c371 add onpdiff tests 2013-12-16 18:39:49 +01:00
Régis Hanol 206ef3dc08 add discourse_diff tests 2013-12-16 18:11:46 +01:00
Régis Hanol c6fb60e0a0 FIX: S3 upload when using dots in bucket name 2013-12-16 11:44:59 +01:00
Alexander d93e4fc65d add more info to rss feeds 2013-12-15 01:17:39 -08:00
Neil Lalonde 49c3482464 Show topic and post counts by day/week/month/year on categories page 2013-12-13 15:37:45 -05:00
Robin Ward 06e9cbc6cb FIX: Look up a url without the query string if it couldn't be found with it. 2013-12-13 12:56:20 -05:00
Sam 05a3c8090f Merge pull request #1658 from salbertson/sa-refactor-users-controller-create
Refactor UsersController#create
2013-12-12 22:16:50 -08:00
Régis Hanol 1884bd959f make sure extension-based oneboxes are first to run 2013-12-13 00:56:48 +01:00
Régis Hanol 1457a3792d that fix should have been in the emoji plugin 2013-12-12 16:42:27 +01:00
Régis Hanol be835785f8 FIX: allow new user to post emojis 2013-12-12 15:05:18 +01:00
Régis Hanol 06dd7ffe3c better revision history 2013-12-12 03:41:34 +01:00
Neil Lalonde 5171a23a9c Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations. 2013-12-11 11:19:22 -05:00
Neil Lalonde ed3d3ae1e1 Upgrade font-awesome to version 4 2013-12-11 10:31:09 -05:00
Robin Ward 6853f37bee Show estimated reading time near summarize button. 2013-12-10 13:47:36 -05:00
Neil Lalonde 561961eff6 FIX: can grant titles to regular users. Guardian initializer needs current_user, not the target user. 2013-12-10 12:46:35 -05:00
Neil Lalonde 2596f7dec2 Revert "Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations." 2013-12-09 16:28:11 -05:00
Neil Lalonde ca5d4d5e54 Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations. 2013-12-09 13:28:42 -05:00
Neil Lalonde 9a24d2651d Allow category to auto-close topics in X hours instead of days. FIX: the system message that says a topic was automatically closed was only counting in days. 2013-12-06 16:39:35 -05:00
Robin Ward 79427732b2 Show Gaps in the post stream when filters are active
Conflicts:
	app/assets/javascripts/discourse/templates/topic.js.handlebars
2013-12-05 16:46:59 -05:00
Scott Albertson 51eff92170 Refactor UsersController#create
* Simplify controller action
* Extract service classes
2013-12-05 10:11:16 -08:00
Neil Lalonde abed146cc7 FIX: Category description topics shouldn't auto-close 2013-12-04 10:31:25 -05:00
Jithu Gopal 9584ecb295 fixing gender sensitive pronouns 2013-12-03 10:19:54 +05:30
Régis Hanol 5150376e12 add wrapper class for lightboxes 2013-12-02 10:06:48 +01:00
Godfrey Chan 1a2114d87d Don't abuse as_json, it's not meant for consumption
The `as_json` API is a hook for JSON encoders to call, not meant for
consumption like this, and the result is not guarenteed to be stable
across Rails versions.

There might be other cases like this that we should revisit later, but
this one in particular is causing a test to fail on Rails master.
2013-11-29 21:58:09 -08:00
Régis Hanol 298b54c0e7 add download link in lightbox 2013-11-29 20:03:39 +01:00
Robin Ward 8c8645f158 FIX: Code and Emoticon formatting in HTML emails. 2013-11-28 17:21:14 -05:00
Neil Lalonde 4ec0543362 FIX: emails with embedded posts should always use absolute URLs 2013-11-28 15:57:21 -05:00
Neil Lalonde 1cc72d564f Add specs for topic create with auto_close_time. Just ignore auto_close_time from users who are not authorized to use it instead of raising an error. 2013-11-28 11:06:04 -05:00
Régis Hanol 52160179f8 add a tombstone for extra safety 2013-11-27 22:05:11 +01:00
Neil Lalonde a9ab98ef9e Auto-close time can be entered in 3 ways, so a topic can close at any time 2013-11-27 09:52:35 -05:00
Régis Hanol 6b6c3d05dd FIX stretched thumbnails 2013-11-25 18:36:13 +01:00
Robin Ward d208be14d2 FIX: Ruby 1.9.3 UTF-8 bug 2013-11-25 11:29:58 -05:00
Régis Hanol 82b78ec6ba schemaless avatar urls 2013-11-22 19:18:45 +01:00
Régis Hanol 3cf5a363f7 do not destroy uploads when destroying a user 2013-11-22 18:29:07 +01:00
Sam 49b48e1eb6 ensure we have a bigint id 2013-11-22 17:51:36 +11:00
Régis Hanol f65cde3cda do not bump posts when rebaking 2013-11-22 01:52:26 +01:00
Neil Lalonde bcfbacec16 Don't show category descriptions as suggested topics 2013-11-21 16:43:22 -05:00
Neil Lalonde 69cc1dd689 FIX: don't suggest a username that's already taken, even if hub finds a match 2013-11-20 14:56:21 -05:00
Robin Ward 5055da76e6 Abort triggers for email body processing 2013-11-20 13:30:01 -05:00
Régis Hanol 31fd5b85bc FIX markdown hotlinked images were not properly pulled 2013-11-20 13:10:08 +01:00
Neil Lalonde 981d8f6aea Signup form: prefill username if Discourse Hub has a match for the email address. Also, fix some bad specs in username_checker_service_spec that were passing... 2013-11-19 14:15:28 -05:00
Neil Lalonde ae58a7db95 Add a warning on dashboard if enforce_global_nicknames is checked, but access key is blank. 2013-11-18 13:45:10 -05:00
Robin Ward 4ce81e1b01 Rename "Best Of" to "Summary" 2013-11-18 12:48:26 -05:00
Robin Ward ad3e276b4b Rename TopicSummary -> TopicMap 2013-11-18 12:08:21 -05:00
Robin Ward 639394e38a FIX: Pinned topics within a category weren't working without a refresh 2013-11-18 10:52:01 -05:00
Régis Hanol 482b752046 add edit reason when editing a post 2013-11-15 23:28:49 +01:00
Neil Lalonde fc180ccd71 Site settings: move category into the opts hash so that it's compatibale with existing plugins 2013-11-15 14:32:33 -05:00
railsaholic 34bba737ff Refactor SessionController#create, reduce complexity.
Don't compromise readablity
2013-11-15 22:09:03 +05:30
Régis Hanol 8a83f1a88f add disk space usage failsafe 2013-11-15 16:48:38 +01:00
Robin Ward e03ae73c5d Merge pull request #1653 from ScotterC/uri-addressable
URI adapter should use Addressable
2013-11-15 07:24:57 -08:00
Régis Hanol 16267e4887 add download_remote_images_to_local site setting 2013-11-15 15:22:18 +01:00
Neil Lalonde 1e37abc310 Add site setting category support 2013-11-14 16:02:13 -05:00
Neil Lalonde 791f5ac94e Load site settings from config/site_settings.yml 2013-11-14 16:02:13 -05:00
Robin Ward 968c0672ef Enable column sorting main topic list 2013-11-14 15:50:36 -05:00
Robin Ward 67041d1c6d Support for tracking the count of unique participants in a topic 2013-11-14 14:32:41 -05:00
Scott Carleton 32e414690a Handle ugly url targets 2013-11-14 13:14:02 -05:00
Robin Ward bda5a72c6a Server side support for custom ordering of topics 2013-11-13 14:17:06 -05:00
Robin Ward 7207cef7aa TopicQuery cleanup in advance of custom sorting:
- Move SQL method constants into a module
- Removed unused count methods
- Moved methods that don't return a TopicList into Topic
- Replaced some confusing method signatures
2013-11-13 12:26:32 -05:00
Scott Albertson 77b59b54ce Refactor UsersController#invited
* Add test coverage
* Simplify controller action
* Move finder code to Invite class
2013-11-11 13:23:49 -08:00
Neil Lalonde 2f8866add5 Change admin display-row css so that multiple lines can fit in the control column. Don't hard-code a height on the rows. 2013-11-11 15:03:17 -05:00
Régis Hanol d65cd0f97e Merge pull request #1637 from railsaholic/refactor_users_upload_avatar_action
Refactor Users#upload_avatar method
2013-11-11 09:59:30 -08:00
railsaholic 58f78e9001 Refactor Users#upload_avatar method
Moved avatar file upload to ```AvatarUploadService``` class and
```AvatarUploadPolicy```

Address review comments + require missing file in spec
2013-11-11 23:21:14 +05:30
Sam d1d661f6e1 add logic that auto closes any topics that missed the queued job (due to redis flush or whatever) 2013-11-11 10:52:44 +11:00
Sam a9c5d843f7 remove problem spec that does not work properly in rails 4 mode into application controller and correct it 2013-11-11 10:50:48 +11:00
sirMackk af67284995 User ctrl refactor - breaks up large methods, moves some logic into model
Includes missing methods from backup for travis to pass

fix missing code, failing specs

keep params handling in the controller.
2013-11-09 18:44:13 +05:30
Robin Ward 6e43372e7c Merge pull request #1610 from salbertson/sa-refactor-users-update
Move logic for updating a user to a service class
2013-11-07 12:29:19 -08:00
Neil Lalonde 0c6f794eb0 Used the term suspended instead of banned. 2013-11-07 13:53:49 -05:00
Scott Albertson 72bfa4471f Move logic for updating a user into a service class 2013-11-07 08:39:39 -08:00
Robin Ward 948a545cb1 Category descriptions should not appear in digests 2013-11-06 15:05:06 -05:00
Robin Ward de30af9302 Support for inviting to a forum from a user's invite page. 2013-11-06 12:56:50 -05:00
Régis Hanol 8d47215ea5 Fixed Youtube videos appearing on top of compose panel (props to @hrobertson) 2013-11-06 17:19:02 +01:00
Régis Hanol f8e2ecfa94 keep track of the user who revised a post 2013-11-06 11:43:40 +01:00
Régis Hanol 3992aa971d ninja_edit_window is is seconds, not minutes 2013-11-06 11:08:57 +01:00
Robin Ward 25ef66c60b User invites page now has search, displays first `invites_shown` records 2013-11-05 17:53:26 -05:00
Régis Hanol 37fd7ab574 pull hotlinked images 2013-11-05 19:07:29 +01:00
Sam 415d4df648 work around bust encodings passed in to method 2013-11-05 13:40:39 +11:00
Neil Lalonde bd9b85f076 Screened Urls page shows results for each domain instead of each url 2013-11-04 16:24:48 -05:00
Robin Ward c86b06e3fa Fix for non-english email polling. 2013-11-04 15:30:24 -05:00
Neil Lalonde ede59a4386 FIX: issue 1538. After upgrading and before a new version check request has been made, dashboard might still say that an update is available. 2013-11-04 12:51:09 -05:00
Robin Ward b474babe26 Merge pull request #1602 from salbertson/sa-refactor-users-update-specs
Refactor specs for UsersController#update
2013-11-04 07:16:18 -08:00
Vipul A M 895d801669 Dont call `SiteSetting.uncategorized_category_id` twice 2013-11-03 15:36:59 +05:30
Régis Hanol b56b11d96a add qunit to autospec 2013-11-01 23:57:50 +01:00
Neil Lalonde e679ba97a3 FIX: categories created by users who are deleted cannot be deleted 2013-11-01 16:56:15 -04:00
Scott Albertson c0cffca1e6 Test title updating 2013-11-01 13:43:31 -07:00
Scott Albertson 3cc17ad4cd Add test coverage for #update 2013-11-01 13:43:31 -07:00
Scott Albertson 58f96bdfb5 Remove duplication in test setup 2013-11-01 13:43:31 -07:00
Scott Albertson 2e7696630b Make #update specs consistent
* Use expect syntax
* Avoid lets
* Stub Guardian method used in the controller
2013-11-01 13:43:31 -07:00
Neil Lalonde 92a0729937 When banning a user, a reason can be provided. The user will see this reason when trying to log in. Also log bans and unbans in the staff action logs. 2013-11-01 10:47:26 -04:00
Neil Lalonde 52b0c1c45f When logging the deletion of a user, don't store its id in the target_user_id column. It will never match a user record. 2013-11-01 10:47:26 -04:00
Robin Ward 744cd93f28 FIX: Non-English category name regression 2013-10-31 16:25:26 -04:00
Neil Lalonde ce5ebc3eb5 On sites with login_required enabled, after signup, don't show the /login page again 2013-10-30 16:37:36 -04:00
Robin Ward 704adc00ca FIX: Broken test. No idea why the name randomly changed! 2013-10-30 16:04:26 -04:00
Robin Ward 3d6d7c8abe SiteSetting to hide regular names from users 2013-10-30 15:45:34 -04:00
Neil Lalonde c8d5db38d6 Emails to banned users will be sent for notifications of PMs from staff users 2013-10-30 15:31:16 -04:00
Robin Ward 6063b52d6a Support for choosing a destination category when splitting topics. 2013-10-29 15:30:06 -04:00
Manoj 9650dbb97c Refactor topics controller
Refactor: 1) TopicsController to reduce code climate complexity.
2) Topic model, addressed comments

fix typo
2013-10-28 11:42:07 +05:30
Sam 95e936c299 cleanup API for looking up a user by email or username, add specs, fix invalid auto association in open id provider 2013-10-28 16:29:07 +11:00
Sam 370e961a90 add failing test for AMS upgrade 2013-10-28 15:55:27 +11:00
Robin Ward f4d9bf9181 Merge pull request #1573 from railsaholic/use_existing_find_by_username_or_email
Utilize already existing method 'find_by_username_or_email'
2013-10-25 12:57:18 -07:00
Neil Lalonde 4e46d91b8d Refactor SpamRulesEnforcer so that each spam rule is in its own class 2013-10-25 13:25:02 -04:00
Sam 4929c5db71 FIX: when allow_uncategorized_topics was false, PMs can not be created 2013-10-25 09:33:39 +11:00
Manoj 96ae3cdacc Utilize already existing method 'find_by_username_or_email'
check presence of email using include, dont use =~
2013-10-24 19:26:06 +05:30
Sam cc83b55134 fix incorrect test, that fails if shared test state gets corrupt 2013-10-24 14:55:55 +11:00
Sam 666264879c change it so all topics MUST include a category, we store a special uncategorized category to compensate
this cleans up a bunch of internals and removes some settings
2013-10-24 12:08:02 +11:00
Neil Lalonde 8aab2253d0 Whitelisted ip addresses will not be flagged as spam by flag_sockpuppets 2013-10-23 17:11:35 -04:00
Robin Ward 541620c115 Routes and support for sub-categories 2013-10-23 15:22:49 -04:00
Robin Ward c814fc16a3 Database structure to support sub categories 2013-10-23 15:22:49 -04:00
Robin Ward f73a64982a Raise an error if a `api_username` is supplied and does not match the key 2013-10-23 11:05:49 -04:00
Brian Alexander e2a5415aca fix #1567; nil reference in spam_rules_enforcer.rb 2013-10-22 19:14:31 -06:00
Neil Lalonde c1008f4359 Fixes for postgresql inet columns in Rails 4. They're backed by an IPAddr class now, which breaks sql parameter marker support, and automatically sets the attribute to nil when trying to assign an invalid ip address. 2013-10-22 19:19:32 -04:00
Robin Ward 348e2e3ef2 Support for per-user API keys 2013-10-22 17:34:39 -04:00
Neil Lalonde 7d582fbee3 Screened ip address can be edited, deleted, and changed to allow or block. 2013-10-22 16:30:46 -04:00
Régis Hanol 9b2f821012 Merge pull request #1512 from ScotterC/avatar-from-url
Build out a URI Adapter to allow uploading an avatar via a url
2013-10-21 13:17:37 -07:00
Robin Ward 2308784713 Merge pull request #1543 from railsaholic/small_users_controller_refactoring
refactor UsersController to reduce complexity
2013-10-21 12:21:03 -07:00
Scott Carleton cbef844a57 Build out a URI Adapter to allow uploading an avatar via a url
Currently only really accessible via the API. The UriAdapter creates a
tempfile from a url and gives a ActionDispatch::HTTP::UploadedFile back
to the controller to process as normal.
This will help a lot in being able to transfer avatar urls from another
app without monkey patching a lot of discourse code.
2013-10-21 14:53:03 -04:00
Neil Lalonde 648b11a0eb Add screening by IP address. When deleting a user as a spammer, block all signups from the same IP address. 2013-10-21 14:50:18 -04:00
Régis Hanol fcd85b8a72 allow plugins to be symlinked 2013-10-21 19:59:28 +02:00
Sam 451a1620f9 Merge pull request #1545 from railsaholic/lists_controller_refactor
Remove duplication of action defintion
2013-10-20 22:19:40 -07:00
Sam 31b73171dc correct ordering algorithm 2013-10-21 16:14:09 +11:00
Manoj 7dfa99998f Remove duplication of action defintion, add missing spec for topics_by, extract out URL construction logic 2013-10-21 08:34:18 +05:30
Sam 25723de9c8 no need for the undefine 2013-10-21 09:52:28 +11:00
Manoj 868e4ffe6d refactor UsersController to reduce complexity
Refactored: UsersController#create
2013-10-19 15:18:11 +05:30
Robin Ward d7182d0b14 FIX: Only wrap inline html tags in <p> 2013-10-18 15:21:05 -04:00
Sam 5f74cb6bf9 category is not "positionable" 2013-10-18 18:09:30 +11:00
Sam 1ee49798b2 work in progress wide category list 2013-10-18 11:10:10 +11:00
Sam 7bf96ee690 naive implementation of post_count on categories 2013-10-18 11:10:10 +11:00
Robin Ward 0a4f5af4a8 Merge pull request #1531 from railsaholic/topics_model_refactoring
Refactored Topic#limit_topics_per_day to improve Code Climate Complexity
2013-10-17 06:56:41 -07:00
Sam 1b81f73325 logged in requests were being treated as anon, causing major havoc 2013-10-17 10:37:18 +11:00
Neil Lalonde cabe8f0d2d Clean up ScreenUrl normalization and matching 2013-10-16 16:39:29 -04:00
Robin Ward 2a8db38c7a FIX: Smoke test failure 2013-10-16 16:01:41 -04:00
Robin Ward f27413219e Support for MDTest 2013-10-16 10:28:42 -04:00
Manoj 7c03076c2a Refactored Topic#limit_topics_per_day to reduce code climate complexity
Extracted  1) #apply_per_day_rate_limit_for, method as generic
RateLimiter , 2) #limit_first_day_topics_per_day as a separate method,
3) Added User#added_a_day_ago?, 4) Fixed private methods indentation.
2013-10-16 14:58:18 +05:30
Sam 3d647a4b41 remove rack cache, it has been causing trouble
instead implement an aggressive anonymous cache that is stored in redis
this cache is sitting in the front of the middleware stack enabled only in production
TODO: expire it more intelligently when stuff is created
2013-10-16 16:39:18 +11:00
Robin Ward b62913695c Merge pull request #1528 from JEG2/master
Adding post details in preparation for the API importer code.
2013-10-15 08:19:19 -07:00
Robin Ward 5281b7f80c Upgraded and refactored Sanitizing. Much less crap should get through now!
Conflicts:
	app/assets/javascripts/discourse/components/syntax_highlighting.js
2013-10-15 10:53:11 -04:00
James Edward Gray II 1aa9fc982d Adding post details in preparation for the API importer code. 2013-10-15 09:21:30 -05:00
Régis Hanol 4536b5fe04 added a job to clean up orphan uploads 2013-10-15 11:15:48 +02:00
Régis Hanol d80f4fa3f7 Merge pull request #1523 from dbarbera/avatar_formats_fix
add image authorization on upload_avatar
2013-10-14 05:33:25 -07:00
Sam 7df4e4afb9 security fix, anon should not be treated as though they can create anything 2013-10-13 09:54:48 +11:00
dbarbera 9106596a9a add image authorization on upload_avatar 2013-10-12 14:11:44 +02:00
Régis Hanol 23bf4436f5 FIX: avatar was attached to the user who uploaded it... 2013-10-12 10:55:41 +02:00
Robin Ward af931f0444 Reverting the Sanitizer commit in case we have to do something urgent
before we deploy it early next week. It's in the branch `sanitizer` for
now.

This reverts commit 9e93d8ed52.
2013-10-11 16:44:26 -04:00
Robin Ward 9e93d8ed52 Upgraded and refactored Sanitizing. Much less crap should get through now!
Conflicts:
	app/assets/javascripts/discourse/components/syntax_highlighting.js
2013-10-11 16:25:40 -04:00
Neil Lalonde 3c2c6ab24b Add sockpuppet spammer detection. Automatically flag posts if they are from new users (registered less than 24 hours ago) at the same IP address and one of them started the topic. 2013-10-11 13:34:05 -04:00
Régis Hanol c38ba8acdd add rss links to anonymous homepages 2013-10-11 18:43:29 +02:00
Sam 172a85ae14 prettier twitter links, extracted mini api 2013-10-11 11:46:35 +11:00
Sam b0465c517e (experimental) added framework for filtering all sorts of internals in discourse and consuming by plugins 2013-10-10 18:45:40 +11:00
Sam ad2ed5fe51 rate limits for topics and posts on first day
max_topics_in_first_day and max_replies_in_first_day
2013-10-10 10:32:03 +11:00
Sam 7993845bfa add current_user_provider so people can override current_user bevior cleanly, see
http://meta.discourse.org/t/amending-current-user-logic-in-discourse/10278
2013-10-09 15:11:54 +11:00
Neil Lalonde bccb37b6f3 When creating a topic, don't select a category by default when allow_uncategorized_topics is false. Also, added category validation on the server to enforce allow_uncategorized_topics. 2013-10-08 14:41:20 -04:00
Sam e18b93026a defer view creation on so updates are not performed when people navigate to topics 2013-10-07 15:04:59 +11:00
Sam 5bf26ec34e large refactor, ship a few columns from the user table into user_stats 2013-10-07 15:04:59 +11:00
Robin Ward c8487f6bc7 FIX: Amazon spec 2013-10-04 12:49:39 -04:00
Sam Saffron ad93fc959c security issue, anon and logged in users could see the fact that a user sent another user a pm (but could not see the pm itself or title) 2013-10-03 16:48:03 -07:00
Robin Ward 3562d02905 Adjust smoke test to work with user expansion 2013-10-03 14:17:25 -04:00
Régis Hanol af96ef2994 FIX: deleting a flagged post issue
cf. http://meta.discourse.org/t/deleting-a-flagged-post-issue/10061

The bug was only happening when you were about the delete the first post, which means deleting the entire topic.
2013-10-02 16:59:57 +02:00
Sam f0a122a66c move job files so they live underneath app/ and not in lib/
introduce new setting email_always, that will force emails to send to users regardless of presence on site
2013-10-01 17:04:02 +10:00
Robin Ward 3f0c03a20c FIX: Prevent unauthorized list of private message titles. Also remove some unused code. 2013-09-30 14:35:11 -04:00
Régis Hanol 40c08eab14 do not break oneboxes' favicon after updating favicons 2013-09-30 19:09:57 +02:00
Robin Ward 37304b7eba FIX: Too many new lines in long quotes 2013-09-27 15:08:56 -04:00
Régis Hanol cd4cda5b4c allow users to specify thumbnail size 2013-09-27 10:57:31 +02:00
Discourse application 0c8f6ba9a4 Support single redis DB. 2013-09-24 15:47:35 +03:00
Neil Lalonde 07d08b81c7 Show mobile view as default for nexus 7 tablet 2013-09-23 17:13:29 -07:00
Robin Ward 60abde2253 FIX: Broken spec 2013-09-19 18:40:46 -07:00
Robin Ward 99b6a62fcb New composer message for people dominating a topic 2013-09-17 14:38:39 -04:00
Robin Ward 16dc0a7001 New user education notification was off by one. Also, remove the "basic" restriction on the
"posting too often" message.
2013-09-17 12:12:03 -04:00
Neil Lalonde 0fafe124db Add enable_mobile_theme site setting. Uncheck it to disable the mobile theme. 2013-09-17 11:25:37 -04:00
Robin Ward 2baf5fda8e Merge pull request #1438 from Elegios/composer_use_category_id
Make the composer and TopicCreator use category id instead of category name
2013-09-17 08:03:48 -07:00
Neil Lalonde b15e629f46 Strip trailing slashes from ScreeningUrl records 2013-09-17 10:26:05 -04:00
Viktor Palmkvist 37673e3412 Make the composer and TopicCreator use category id instead of category name
Also fixes #1171
Includes backwards compatibility for topic creation
2013-09-17 12:13:19 +02:00
Neil Lalonde c845071066 Fix an error with mobile custom header 2013-09-16 12:55:44 -04:00
Neil Lalonde 13f17b2a5c Add ability to customize css and header for mobile 2013-09-16 12:28:02 -04:00
Nathan Nontell d95172cb5d Allow TextSentinel#seems_unpretentious? to accept words joined with dashes or forward slashes. (Issue 1133) 2013-09-16 09:45:57 -04:00
Matthieu Guillemot 3ba1f20674 New site settings to enable/disable the possibility of editing user's nickname or email address 2013-09-14 21:34:21 +09:00
Robin Ward b39d39dbb6 FIX: Use `post_count` instead of `topic_reply_count` in education for replies. 2013-09-14 00:32:18 -04:00
Robin Ward c365bd0070 Notify users posting sequential replies that there's a better way to do it. 2013-09-13 13:49:34 -04:00
Robin Ward 7d9a84b496 New User Education goes through a server side ComposerMessages check. Composer message for users
who don't have avatars.
2013-09-13 12:23:53 -04:00
Sam 4599e5d732 oops did not have autospec running 2013-09-12 15:55:18 +10:00
Robin Ward fcff4e80d1 New `user_stats` table to keep track of queried information on a user.
This is information that is not usually needed when representing a user
and is in a separate table with a has one relationship to avoid querying
it all the time.
2013-09-11 14:50:26 -04:00
Neil Lalonde e8ef55c446 Rename StaffActionLog to UserHistory 2013-09-10 22:01:20 -04:00
Neil Lalonde cc2acafc9a Enable mobile view. Use local storage to remember whether you chose mobile or desktop view. Mobile device detection needs to be replaced with a better solution. 2013-09-10 16:44:17 -04:00
Robin Ward 2319924206 Adds a class that can detect whether a user has uploaded a custom avatar 2013-09-10 15:39:11 -04:00
Neil Lalonde 78c15d5810 Move the unique post key storage code into the Post model 2013-09-09 16:17:31 -04:00
Einar Jonsson 724b3aadcf Extracted nickname registration out of the UsersController and into its
own service.
2013-09-09 09:26:50 +00:00
Robin Ward b87a78f7b2 Merge branch 'master' of github.com:discourse/discourse 2013-09-06 18:01:33 -04:00
Robin Ward c8ad977c8a Revert "Merge pull request #1215 from Elegios/composer_use_category_id"
This reverts commit 763859d439, reversing
changes made to b62caf80fb.
2013-09-06 18:00:57 -04:00
Neil Lalonde 10547848f0 Update importer_spec for system user 2013-09-06 16:51:43 -04:00
Robin Ward 763859d439 Merge pull request #1215 from Elegios/composer_use_category_id
Make the composer and TopicCreator use category id instead of category name
2013-09-06 11:55:27 -07:00
Régis Hanol 45b838009c proper content-disposition header when downloading attachments 2013-09-06 19:23:56 +02:00
Neil Lalonde eae7e75611 FIX: recover post by a non-staff user fails because the post is not unique. Uniqueness check shouldn't happen when recovering a deleted post. 2013-09-06 11:50:15 -04:00
Sam 641c51367a fix broken build
hack to allow for PMs with no users for flagging needs
2013-09-06 18:03:30 +10:00
Sam 2ce4468aa5 rename system_username to site_contact_username , system_user is a special user with -1 id that is only used for certain admin tasks
for example system_user will autoclose stuff if needed, it will delete stubs and be the target for flag pms
2013-09-06 17:28:37 +10:00
Sam 41a1b6942d notify moderators now goes to the "community" user, that saves our poor mods from a flood of pms
if any staff respond to a pm they are automatically added to the list of recipients and will start
getting email notifications
2013-09-06 14:07:23 +10:00
Sam ee6882edfb ATTENTION NEIL, comment out a big pile of importer specs, this is code we never use and running a big slug of tests to ensure it keeps working is pointless.
We need to decide what we do with this. Either we get import/export working and used or strip it out till ready.
No point slowing down the test suite and fixing regressions in code this code
2013-09-06 12:56:08 +10:00
Neil Lalonde 341f8c8877 fix application_helper_spec 2013-09-05 17:01:10 -04:00
Neil Lalonde 9b526364ed Merge branch 'mobile' 2013-09-05 16:29:27 -04:00
Neil Lalonde 45d7765936 Merge branch 'master' into mobile 2013-09-05 15:54:22 -04:00
Emili Parreno 4a0f3b3ac2 fix user_controller_spec when testing too long usernames 2013-09-05 17:36:53 +02:00
Neil Lalonde cde631cbd1 Change default of notify_mods_when_user_blocked to false 2013-09-05 11:27:24 -04:00
Robin Ward 71c1b8b9b9 When deleting a post as staff, ask if you want to delete direct replies too 2013-09-05 11:03:34 -04:00
Robin Ward f157ec1f91 Select +Replies for bulk operations 2013-09-05 11:03:29 -04:00
Emili Parreno 9fdabd3b8a refactor spec_helper 2013-09-05 13:22:15 +02:00
Sam 5b08f73561 give god rights of impersonation to developers, must be edited into the production.rb config file 2013-09-05 10:27:34 +10:00
Neil Lalonde d76486a48b Topic can have null user_id when user was nuked 2013-09-04 15:42:24 -04:00
Neil Lalonde 117fc8db58 Change the way nuked users' posts are handled. Allow null in the user_id column of posts. Show these posts in the posts stream. 2013-09-04 15:42:21 -04:00
Neil Lalonde b47eedba00 Add min_trust_to_create_topic setting to require a certain trust level before users can start new topics 2013-09-03 19:12:22 -04:00
Robin Ward 3cec95a2c3 Better API for parsing out blocks in the parser. 2013-08-29 11:47:44 -04:00
Emili Parreno 1dedfb2251 fix user_name_suggester spec 2013-08-29 16:15:02 +02:00
Régis Hanol e15982a476 FIX: convert error in test 2013-08-28 22:06:09 +02:00
Neil Lalonde f611a5d898 If min entropy setting is greater than min post/body length setting, then use a sensible min entropy value instead 2013-08-28 11:04:28 -04:00
Sam 61281a3c81 invite only forums had very wonky logic, invited users were not being activated, invite_only forums were still registering users 2013-08-28 17:18:31 +10:00
Sam 28466eb5b2 group the "suggested topics" by category correctly.
in the past new topics were not prioritizing current category and
new topics in a category were not being inserted before other unread topics
in other categories
2013-08-28 10:52:06 +10:00
Sam c0f610daf6 digest interfaces returning empty objects (except for id) interface needed correction 2013-08-28 10:52:06 +10:00
Neil Lalonde 9efa29e688 Detect whether to use mobile view. Session var mobile_view can override automatic detection. 2013-08-27 14:57:42 -04:00
Sam 83d8bcdc27 revert non queuing of emails 2013-08-27 11:52:28 +10:00
Robin Ward 29385f4898 Merge pull request #1387 from ZogStriP/fix-schemaless-urls-in-emails
FIX: schemaless urls in emails
2013-08-26 15:15:00 -07:00
Régis Hanol 561792a615 FIX: schemaless urls in emails 2013-08-27 00:08:38 +02:00