Commit Graph

574 Commits

Author SHA1 Message Date
Neil Lalonde
5ff7e570ac Add support for enum site settings that render as a dropdown; use a dropdown for default_locale 2013-06-11 11:40:14 -04:00
Jeff Atwood
b4a4774165 extend consumer email warning to yahoo & outlook 2013-06-10 00:08:06 -07:00
Vipul A M
4f606ffd8e Some minor cleanups
1. Change map to keys
2. Remove overshadow
3. Remove var
2013-06-10 10:38:10 +05:30
Sam
6a6496eedf Merge pull request #995 from novemberkilo/master
Refactoring Post model
2013-06-09 16:19:06 -07:00
Sam
2d14b54096 Merge pull request #988 from chrishunt/add-dynamic-favicon
Add 'dynamic favicon' setting
2013-06-09 16:13:54 -07:00
Navin
3fdba0019b Extract callbacks and validations for Post
Move Post create callbacks to PostCreate
Extract Post validations
Move stripped_length_validator to lib/validators
2013-06-09 20:47:04 +02:00
Sam
1756f713d6 SECURITY HOLE, upgrade right away if you are using Secure Groups. 2013-06-08 23:52:06 +10:00
Chris Hunt
af1c14939e Add 'dynamic favicon' setting 2013-06-07 17:15:49 -07:00
Robin Ward
463be6fadf Merge pull request #982 from jd-erreape/add_scopes_to_roleable
Added role scopes to roleable
2013-06-07 12:08:26 -07:00
Neil Lalonde
169125e96d Fix a case where a random topic with null slug will be rendered instead of 404 2013-06-07 14:30:26 -04:00
Juan de Dios Herrero
36fe8fbc6d Added role scopes to roleable 2013-06-07 18:26:06 +02:00
Juan de Dios Herrero
1b92d9d7f8 Added roleable module for User model 2013-06-07 12:33:48 +02:00
Chris Hunt
f6ce985121 Send activation email after user approved 2013-06-06 18:37:25 -07:00
Sam
1eed1e240b Merge pull request #977 from chrishunt/add-apple-touch-icon
Add 'apple touch icon url' site setting
2013-06-06 17:40:12 -07:00
Chris Hunt
268a5debbf Add 'apple touch icon url' site setting 2013-06-06 14:43:05 -07:00
Neil Lalonde
a151bfc7ec Store when a topic was first set to auto-close and report that amount of time when it closes. And do some refactoring. 2013-06-06 17:04:21 -04:00
Robin Ward
f268b882fd The posts rebake task should regenerate links too. 2013-06-06 13:52:30 -04:00
Robin Ward
bac03a3369 Merge pull request #975 from jd-erreape/username_refactor
[WIP] Refactored user_name suggestion methods into a module
2013-06-06 08:12:29 -07:00
Juan de Dios Herrero
96d23ddd8d Refactored user_name suggestion methods into a module to reduce the complexity of User model 2013-06-06 16:40:10 +02:00
Ian Christian Myers
0d01c33482 Enabled strong_parameters across all models/controllers.
All models are now using ActiveModel::ForbiddenAttributesProtection, which shifts the responsibility for parameter whitelisting for mass-assignments from the model to the controller. attr_accessible has been disabled and removed as this functionality replaces that.

The require_parameters method in the ApplicationController has been removed in favor of strong_parameters' #require method.

It is important to note that there is still some refactoring required to get all parameters to pass through #require and #permit so that we can guarantee that parameter values are scalar. Currently strong_parameters, in most cases, is only being utilized to require parameters and to whitelist the few places that do mass-assignments.
2013-06-06 00:30:59 -07:00
Sam
2ca734c118 Merge pull request #964 from chrishunt/exclusive-club
Add 'invite only' site setting
2013-06-05 16:38:47 -07:00
Robin Ward
0b97ea6345 Better HTML emails, smarter email digests, new email section in admin with digest preview 2013-06-05 17:47:25 -04:00
Neil Lalonde
f030d9b420 Make default_logo_check more smarter 2013-06-05 16:59:19 -04:00
Neil Lalonde
4e8ff74b99 Show dashboard warning when favicon and/or logo urls contain the same filename as the shipped defaults 2013-06-05 16:43:39 -04:00
Neil Lalonde
b55182b983 Use PostDestroyer when deleting all of a user's posts; deleting a post removes its flags and resets its flag counts 2013-06-05 16:05:13 -04:00
Robin Ward
dfba2b6e0a FIX: Strip links from google indexed bios when the users are new. 2013-06-05 15:28:10 -04:00
Chris Hunt
24da1ab07e Add 'invite only' site setting 2013-06-05 11:06:05 -07:00
Ian Christian Myers
41528f5d11 Implemented strong_parameters for Upload/UploadsController.
The topic_id param is now required using strong_parameters' #require method. If the parameter is missing ActionController::ParameterMissing will be raised instead of Discourse::InvalidParameters.
2013-06-05 00:55:55 -07:00
Ian Christian Myers
f50b648844 Implemented strong_parameters for PostAction/PostActionsController.
PostActionsController now uses strong_parameters' #require to require certain parameters. ActionController::ParameterMissing is now thrown when a reqired parameter is missing, rather than Discourse::InvalidParameters.
2013-06-05 00:23:51 -07:00
Ian Christian Myers
3b245031a4 Implemented strong_parameters for Invite/InvitesController.
The email parameter is now required using strong parameters and will throw ActionController::ParameterMissing if it is missing. If the email address is incorrect or invalid, Discourse::InvalidParameters will still be thrown.
2013-06-05 00:04:03 -07:00
Ian Christian Myers
130d837952 Implemented strong_parameters for Category/CategoriesController.
Category now requires parameters to be permitted by strong_parameters using #require or #permit for mass-assignment. Missing required parameters now throw a ActionController::ParameterMissing execption instead of the Discourse::InvalidParameters execption.
2013-06-04 23:45:25 -07:00
Sam
870e59883b secure the links on the topic pages, eliminated deleted topics as well. 2013-06-05 16:10:26 +10:00
Sam
2509d0f4fa Merge pull request #959 from chrishunt/chrishunt/login-required-fixes
'login required' site setting improvements
2013-06-04 19:09:40 -07:00
Chris Hunt
3074300f76 Allow customization of 'login required' message 2013-06-04 18:53:36 -07:00
Sam
9a57aaaaa9 fix encoding for category excerpt
fix missing secure category topics in categories page
2013-06-05 11:22:47 +10:00
Sam
21b3359ea4 Merge pull request #957 from chrishunt/chrishunt/lock-down-the-base
Add 'login required' site setting
2013-06-04 17:22:08 -07:00
Chris Hunt
85ceb5efa7 Add 'login required' site setting 2013-06-04 16:10:10 -07:00
Régis Hanol
e3e55d4dad fix image uploads on s3/imgur 2013-06-05 00:35:42 +02:00
Neil Lalonde
2465c9c724 Add min_private_message_title_length site setting so private messages can have short titles 2013-06-04 17:59:23 -04:00
Robin Ward
4392a17b54 Strip out links when displaying a new user's bio 2013-06-04 12:06:25 -04:00
Neil Lalonde
2259e97d42 Add a count of blocked users on the dashboard 2013-06-04 11:53:19 -04:00
Neil Lalonde
c4904aacc0 Automatically flag someone as a spammer if their posts get at least X spam flags from N users while their trust level is 'new user'. Staff can clear and set this status from the user record in admin. 2013-06-03 16:37:40 -04:00
Robin Ward
33d0a6a876 FIX: Safety checks for categories index 2013-06-02 11:20:08 -04:00
Navin
cab3502c15 Replace PostAnalyser module with a class
Encapsulate Post#cooked_document as well
Include specs for PostAnalyzer class
2013-06-01 14:59:27 +02:00
Robin Ward
545dbfc07e New Feature: Staff can choose to "Take Action" when flagging to immediately reach hiding
thresholds.
2013-05-31 17:39:32 -04:00
Robin Ward
d23ef1d090 FIX: You could update a topic to have a title that's too short if the TextCleaner
removed extra characters. Additionally, updating the title will not return an error
message to the client app if the operation fails (rather than failing silently.)
2013-05-31 15:24:13 -04:00
Robin Ward
0af0a214b2 Refactor: Back all modals by controllers 2013-05-31 12:29:38 -04:00
Robin Ward
830b7805e9 Merge pull request #927 from bplexico/extract_invite_redeemer
Extract InviteRedeemer from Invite
2013-05-31 08:30:42 -07:00
Sam
d2c1eb090e Merge pull request #921 from nirnanaaa/postgres-truefalse
removed t's and f's from models
2013-05-30 21:38:26 -07:00
Sam
41187a5de1 Merge pull request #931 from ZogStriP/more-file-upload-test-coverage
added more file uploads test for better coverage
2013-05-30 21:36:33 -07:00
Régis Hanol
6cc0f8f2d4 added more file uploads test for better coverage 2013-05-31 03:13:37 +02:00
Juan de Dios Herrero
807f763fb0 Merge remote-tracking branch 'upstream/master' 2013-05-30 21:42:26 +02:00
DI2uNk
24e32092e7 Refactored two class methods into scopes (to achieve a better 'rails way')
Also added some tests to the methods
2013-05-30 21:21:31 +02:00
Neil Lalonde
b82a5dfd56 Move logic to reject slugs that are just numbers into the slug module 2013-05-30 11:54:02 -04:00
Brian Plexico
0591d5be11 Extract InviteRedeemer from Invite 2013-05-30 11:49:11 -04:00
Neil Lalonde
7d5c313456 Don't allow category slugs that are numbers 2013-05-30 11:09:09 -04:00
Sam
6ad86aa305 read state is now published 2013-05-30 16:49:58 +10:00
Sam
e93b7a3b20 more progress towards live unread and new counts, unread message implemented, still to implement delete messages 2013-05-30 16:49:57 +10:00
Sam
73834370a5 work in progress, live unread and new counts 2013-05-30 16:49:57 +10:00
Sam
33ff87bf44 work in progress, live unread / new counters 2013-05-30 16:49:57 +10:00
Robin Ward
830b93a16b Reduced complexity of admin flags controller, split up into methods, moved reports into model. 2013-05-29 16:49:34 -04:00
nirnanaaa
364113a4d5 removed t and f 's from group model
removed t and f 's from user model as mentioned in #919

removed t's and f's from category model
2013-05-29 22:10:43 +02:00
Neil Lalonde
6abd9ddd2d Add warning on admin dashboard if production env is configured to send email through gmail 2013-05-29 14:00:35 -04:00
Robin Ward
92dc59fba9 Properly assign draft keys to Categories List view. 2013-05-28 21:16:24 -04:00
Sam
46389754d6 Merge pull request #892 from eriko/cas_support
Cas support
2013-05-28 16:13:29 -07:00
Robin Ward
ee319ea7f7 FIX: Issues that didn't show up originally 2013-05-28 15:57:11 -04:00
Robin Ward
560fb15d8a Include pinned topics in category list.
- removes an (n+1) query for user data
- supports the preload store for the data to avoid a second request
- fix a bug where uncategorizes was reporting (0, 0, 0) for topics by week, month, year
2013-05-28 15:36:16 -04:00
Robin Ward
320b35bf90 Merge pull request #910 from novemberkilo/master
WIP - Reduce complexity of Post#raw_links
2013-05-28 10:07:41 -07:00
Chris Hunt
21a54567ff Extract TopicStatusUpdate from Topic 2013-05-28 09:01:04 -07:00
Erik Ordway
9a409d9440 fix comment and remove url setting as it is not used. 2013-05-28 08:06:18 -07:00
Navin
1d5952a92f Extract analysis type methods to a module and refactor Post#raw_links 2013-05-28 16:41:18 +02:00
Chris Hunt
54a798eb12 Add Topic#age_in_days for determining age of topic 2013-05-27 18:02:15 -07:00
Sam
d2f2a8e218 refactoring 2013-05-28 09:13:53 +10:00
Robin Ward
62a20f5655 FIX: Couldn't access "Uncategorized" category from category list. 2013-05-27 14:15:52 -04:00
Neil Lalonde
b1ef2ea1e1 Fix TopicPostersSummary when a suggested topic includes a user who has been deleted 2013-05-27 14:12:15 -04:00
Robin Ward
197909246c Weigh staff likes higher when calculating scores. New site setting: staff_like_weight
can set the factor (default is 3)
2013-05-27 12:46:08 -04:00
Robin Ward
e1781240a6 Merge branch 'refactoring' of git://github.com/mattvanhorn/discourse
Conflicts:
	lib/text_sentinel.rb
2013-05-27 10:42:20 -04:00
Robin Ward
a15910ad1e Merge pull request #899 from chrishunt/chrishunt/extract-topic-posters-summary
Extract topic posters summary
2013-05-27 06:30:58 -07:00
Sam
bf16b4f381 Merge pull request #903 from chrishunt/chrishunt/extract-post-move
Extract post move
2013-05-26 19:10:50 -07:00
Chris Hunt
6024529f81 Extract PostMover from Topic into its own class 2013-05-26 18:42:04 -07:00
Sam
d84ae80074 Simplify user action make it more idiomatic 2013-05-27 10:22:37 +10:00
Janis Miezitis
f58bcf7fe3 Refactored duplication in user action 2013-05-26 16:07:20 +03:00
Chris Hunt
b8fbac582e Add Topic#url for determining url for a Topic 2013-05-25 17:44:32 -07:00
Chris Hunt
f2b5e20840 Add Topic#max_post_number to find max post number 2013-05-25 17:44:32 -07:00
Chris Hunt
c4cce68613 Add Post#is_first_post?
We should be able to ask a post if it's the first in a topic
2013-05-25 17:44:32 -07:00
Chris Hunt
63c63c2939 Remove unused parameters from posters_summary 2013-05-24 15:33:50 -07:00
Chris Hunt
c1841a6c89 Extract Topic#posters_summary 2013-05-24 15:33:45 -07:00
Robin Ward
e2774cc2df Merge pull request #896 from xtream/master
Removed unnecesary method
2013-05-24 14:09:44 -07:00
Neil Lalonde
d26b87bd3c Add Site Setting allow_uncategorized_topics. Uncheck it to force people to choose a category for all new topics. 2013-05-24 16:56:43 -04:00
Matt Van Horn
e5e904aa4e minor refactorings 2013-05-24 13:36:33 -07:00
Matt Van Horn
d7817cf314 extract TopicNotifier class from topic 2013-05-24 13:36:33 -07:00
Robin Ward
d1fdc66ca4 FIX: For spam detection, don't count total occurances of links of the same host, but
post count including that host.
2013-05-24 15:20:58 -04:00
Victor Cruz Dueñas
bca006feca removed unnecesary method 2013-05-24 18:03:02 +02:00
Robin Ward
c0c97487d8 Merge pull request #888 from novemberkilo/master
Refactor to reduce complexity of Post#save_reply_relationships
2013-05-24 07:04:28 -07:00
Sam
ca2dee52db moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
Sam
2cd95bc649 lets try out annotations 2013-05-24 12:35:14 +10:00
Sam
fc3c93d237 almost fixed the regression of not allowing top level filters 2013-05-24 09:54:39 +10:00
Erik Ordway
0bdee973a0 allow disabling of local logins. In the instance where an .edu is using cas they may not want a user to be able to log in once the users credentials have been revoked in the system that feeds the CAS authentication server. This is very optional 2013-05-23 13:44:14 -07:00
Erik Ordway
1575ce7b10 add cas support with a few tests 2013-05-23 13:40:50 -07:00
Navin
9aacde2f2d Refactor Post#save_reply_relationships 2013-05-23 18:09:06 +02:00
Navin
ba4eaa0297 Helper to create reply relationship with post 2013-05-23 18:08:24 +02:00
Navin
d7219a6fbc Helper to add a number to quoted_post_numbers 2013-05-23 18:07:45 +02:00
Neil Lalonde
4492d06a9f Don't send notifications for moderator action posts 2013-05-23 11:42:52 -04:00
Robin Ward
0bd61df34c Merge pull request #884 from mattvanhorn/refactor_topic
Refactor topic
2013-05-23 07:26:22 -07:00
Matt Van Horn
c4b5821ef8 Revert annotation and non-English I18n changes 2013-05-23 06:44:47 -07:00
Sam
3dfc034e8d Merge pull request #881 from novemberkilo/master
Improve flog metric for Post#extract_quoted_post_numbers
2013-05-23 00:21:27 -07:00
Matt Van Horn
7271b90655 annotate topic model 2013-05-22 22:36:01 -07:00
Matt Van Horn
806255b3c4 refactor Topic validation
introduce a couple of custom validators
fix minor discrepancies in tests
copy I18n error message keys to default location
clean up validation invocation
move some responsibilities out of validator into class
2013-05-22 22:31:52 -07:00
Sam
fcc7192fd2 User tracking state implementation progress for live unread / new counts 2013-05-23 15:22:06 +10:00
Robin Ward
7a31630837 Search Refactor: Remove some manual SQL, make search data tables more idomatic Rails/AR 2013-05-22 16:31:13 -04:00
Navin
4754216369 Simplify branching 2013-05-22 21:45:31 +02:00
Navin
ef93512de8 Extract quote parsing into a method 2013-05-22 21:38:45 +02:00
Matt Van Horn
872995db57 refactor guardian class for clarity & correctness
introduce NullUser to avoid type-checking
DRY up code
reduce number of multiple returns
remove some redundant/impossible logic branches
add pending test for possible bug
add test & fix for ability to flag archived posts
add #secure_category? method to topic class
Fix bug that prevented flagging of archived topics
Rename NullUser to AnonymousUser
DRY up can_<action>? methods
Fix some ownership logic, and a test, for Guardian
2013-05-22 01:09:34 -07:00
Chris Hunt
d0bc8c95d3 Trigger UserActionObserver when tracking visit 2013-05-21 20:45:03 -07:00
Chris Hunt
685f4960f1 Trigger UserActionObserver when updating TopicUser 2013-05-21 20:43:43 -07:00
Robin Ward
27828c5ec2 Merge pull request #871 from avdi/refactoring-with-josh-and-avdi
Various refactorings towards Ruby/Rails idiom from Josh Susser and Avdi Grimm
2013-05-21 07:18:50 -07:00
Sam
b5eff93a9d update message bus to support per client filtering
start work on user_tracking_state
fix can_ban? in guardian
expose protected scopes on topic_query we need
move guardian spec to use build as opposed to creating topics / posts / users
start work on user tracking spec
2013-05-21 16:39:51 +10:00
Sam
e91ed83586 the private message stream is different to normal streams, improving the ui a bit and collapsing conversations 2013-05-20 16:44:06 +10:00
Sam
18b00d01d0 Merge pull request #859 from lengarvey/user_refactoring
Light refactoring of the User model
2013-05-19 16:41:20 -07:00
Neil Lalonde
5f7f87437c Fix for topic excerpt being from the wrong post 2013-05-18 13:35:21 -04:00
Leonard Garvey
b16705be0d Clean up update_visit_record!
update_visit_record! appears to add user_visit record if one
doesn't exist and days_visited is simply a counter for the number
of visit records.
2013-05-18 16:02:06 +10:00
Leonard Garvey
32f4dfd2fb DRY up the user model slightly
regular? is just the inverse of staff?
2013-05-18 16:00:35 +10:00
Sam
25105082d5 Merge pull request #850 from bplexico/refactor_post_rb
Refactored post model to reduce duplication in validator methods
2013-05-17 15:56:53 -07:00
Josh Susser and Avdi Grimm
2acc80d192 Various idiomatic User refactorings. 2013-05-17 15:44:35 -04:00
Josh Susser and Avdi Grimm
5659b66729 Refactor select().map() to use pluck.
Remove a method already provided by ActiveRecord.
2013-05-17 15:11:37 -04:00
Neil Lalonde
191d454589 Show Inbox before Sent Items 2013-05-17 14:11:33 -04:00
Josh Susser and Avdi Grimm
d30330441a Refactored conditional to an || to be more idiomatic. 2013-05-17 14:06:58 -04:00
Brian Plexico
a86646312b Refactored post model to reduce duplication in validator methods 2013-05-17 12:15:21 -04:00
Neil Lalonde
f3282e33a3 Add tabs to category create/edit modal. Categories can have a default auto-close setting that applies to all new topics created in the category. Add rspec-given and write some integration tests. Tests for topic auto-close with category default 2013-05-17 11:05:35 -04:00
Sam
8f46653345 refactor 2013-05-17 09:03:52 +10:00
Robin Ward
d554a59102 Support for a new site setting: newuser_spam_host_threshold. If a new user posts a link
to the same host enough tiles, they will not be able to post the same link again.

Additionally, the site will flag all their previous posts with links as spam and they will
be instantly hidden via the auto hide workflow.
2013-05-16 12:19:50 -04:00
Sam
04b8cd5c95 consistency check, need to also ensure delete cleans stuff up, maybe make notifications trashable 2013-05-16 17:50:14 +10:00
Sam
eb71e9de24 opening move, don't get rid of green notification till the pm is read
TODO a way to list all unread PMs
2013-05-16 16:37:47 +10:00
Sam
e9ebadb414 Nuke message_bus_observer move to service class and classes
Secure all messages triggered by post creation and all user actions so they don't leak
(meaning, if you have a browser open and secure topics are created you will only get them if you are allowed to see them)
2013-05-16 15:03:16 +10:00
Lee Machin
dadb7eaa23 fix crash caused by incorrect query in scope
setting all categories to be secured led to a blank screen on all pages

use stabby lambda for consistency in class

make the test a little more concise

- move the local assignments into let blocks for
reusability

- remove calls to `to_a`, which aren't needed

- use 'be_empty' instead of '[]' to be consistent
with the other matchers in the test

add a test for the `secured` scope with multiple
secured categories
2013-05-15 22:26:52 +01:00
Neil Lalonde
18634ad00d Don't cache the problems list with the rest of the dashboard data 2013-05-15 11:09:12 -04:00
Neil Lalonde
21b4b8d5d5 Expire dashboard data when you upgrade to a new discourse version. Version check data was being cached and causing confusion to people who upgraded. 2013-05-14 16:17:25 -04:00
Robin Ward
be234ce9b9 You can now 'move' the first post of a topic to another topic as a merge. In that
case, the first post is cloned instead of being deleted from the original topic.
2013-05-13 14:07:31 -04:00
Neil Lalonde
9828c87525 Topic Auto-Close: admins and mods can set a topic to automatically close after a number of days 2013-05-13 12:53:52 -04:00
Sam
670b66ade3 better add some tests here tomorrow 2013-05-13 18:47:32 +10:00
Sam
b6bf95e741 speed up startup (avoid loading some gems on startup)
correct group permission leaks
add Discourse.cache for richer caching support
2013-05-13 18:04:03 +10:00
Sam
9b33e826f2 clear flags on reply to notify moderators 2013-05-13 11:48:01 +10:00
Robin Ward
cf01c98d81 Experimental: Interface to Move Posts to an Existing Topic 2013-05-10 14:55:51 -04:00
Sam
942f168ab6 UI still a tad rough, but we have a first pass of secure categories 2013-05-10 16:47:47 +10:00
Sam
5280b3a01b more group progress, UI getting there, controller mostly done
changed it so notify moderators goes to the moderators group
allow admins to grant self moderation and revoke self moderation
2013-05-09 17:37:34 +10:00
Sam
4f328e3e45 +x on files makes no sense unless they really are executable
rails in the script dir makes no sense, use binstubs or bundler instead
2013-05-09 17:35:15 +10:00
Sam
0f0fd281a8 group progress, never email banned users 2013-05-09 11:34:58 +10:00
Neil Lalonde
f35a44aeae Add ability for admins and mods to send another activation email to a user, to activate an account, and deactivate an account 2013-05-08 10:10:47 -04:00
Sam
6b536dcde5 work in progress ... groups 2013-05-08 15:20:38 +10:00
Sam
7571152d1d fix issue adding users to groups 2013-05-08 10:32:29 +10:00