Correct authorization for join_request actions
Views and controllers to restore join requests behavior
Refactor and add some join_requests tests
Some tests and pending tests for join requests
More tests for join_requests controller and some fixes
Tests for join requests invite and create?invite=true and correct some failures
Slight refactor join requests controller refs bug #1252
Send email after join_requests are created with some tests refs #1252
Merge branch 'branch-v2' into bug1252
Improve the view join_requests/show, make it simpler

It should only be displayed for users that received an invitation, so I could
simplify the page a lot, to show a simple text and buttons to accept/deny.

refs #1252, refs #838
Tests for join_requests#show and improvements based on feedback on the pull request
Merge branch 'branch-v2' into bug1252
Show the comment written by the introducer in join_requests/show

refs #1252
Restrict access to private attachments

Attachments are now stored out of the public directory and served via
AttachmentsController#show, so we can control who can access them and who
cannot.
The files were moved from public/uploads/ to private/uploads/.

refs #1272
Show in space's sidebar when a user was invited to join the space

Added a button at the top of the sidebar in spaces to join when the current
user was already invited to join the space and improved the button that was
already shown when the user already asked to join the space.

refs #1067
Small fix in SpacesHelper#space_join_button after 5ae7b41c0

refs #1067
Better redirects when a user has pending join requests

When a user tries to access a space and gets a 403:
* If he already asked to join the space, show the new join request page with
  a warning that he already sent a join request
* If the was already invited to join the space, redirect to the page to accept
  or decline the join request
* No join request pending, send him to create a new join request
* No user logged in, show the 403 error

refs #1067
Disable new join request form if the user already has an invitation

Was already being disabled if the user had a request, but not for an
invitation.

refs #1067
Notify space admins in the sidebar when there are pending join requests

refs #1067
Add link for users to cancel a pending join request they sent

rs #fe1067