rename the submissions :id param to :user_id

it was brought to my attention that it's really not very clear that :id
is referring to the user id, not some unobtainable submission id.

test plan: specs should still pass. re-generate the api documentation,
and the submissions api docs should refer to :user_id instead of :id in
the show and update actions.

Change-Id: I2edb11f4b94a3ae4b7e960b92b46f0d5a5264140
Reviewed-on: https://gerrit.instructure.com/21607
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
fix FixHiddenWikiFrontPages migration

Change-Id: I6ce491599c3bbd2ebdd330c468ac0e52ba1a47d4
Reviewed-on: https://gerrit.instructure.com/21615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
replacing text 'external tools' with 'apps'

test plan:
-make sure that we are referring to external tools as apps
on the account settings, course settings, and course copy pages

Change-Id: I58a52f26f8c0ff66398fc0650d7e9471859733fc
Reviewed-on: https://gerrit.instructure.com/21591
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
prevent invalid query caused by bad calendar event_id parameter

somewhere there's a bad link to the calendar show page that
isn't properly separating the event_id and include_contexts
parameters.

fixes CNVS-3211

test plan:
 - make sure a link like this still works and brings up the
 indicated calendar event. substitute the appropriate ids for
 the event and user instead of 123:

 http://your_canvas/calendar?event_id=123&include_contexts=user_123

 - make sure a link like this (missing & between parameters)
 does not throw an exception. the calendar should still open,
 but it won't open the event.

http://your_canvas/calendar?event_id=123include_contexts=user_123

 - test this with both calendar 1 and calendar 2.

Change-Id: I82735fd58bd1acc4a7188e4923363da8a27b6c14
Reviewed-on: https://gerrit.instructure.com/21584
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
allows tools to be create with a key a secret

test plan:
 * add a tool with a key/secret from app center
   - ensure that the key/secret is saved on the tool
  * add a tool without a key/secret from app center
   - it should have a key of N/A

Change-Id: I159034a6c00dd120619d73b9bb0f3c4926922778
Reviewed-on: https://gerrit.instructure.com/21618
Reviewed-by: Eric Berry <ericb@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
require logging in for all_menu_courses

fixes CNVS-1414

test plan:
 * log in, and go to the dashboard, but do not hover over the courses menu
 * in developer tools, delete your normandy_session cookie
 * start capturing network requests
 * hover over the courses menu
 * you should see an error
 * you should see a request for all_menu_courses in the network inspector,
   but the error should be a 401 Not Authorized, not a 500 Internal Server
   Error

Change-Id: I977cd6647e2e845cd5359969700197b074818e58
Reviewed-on: https://gerrit.instructure.com/21494
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
proper handling of cross-shard admin visibility

when querying common contexts between user A and messageable user B, "0"
is used as a special course id to indicate user B has at least one
enrollment in an account A admins -- no actual course involved.

to manage common contexts cross shard, they are stored with global ids.
this was "globalizing" 0 to no longer be zero, causing problems. fix
that edge case.

additionally, if there were multiple shards with accounts in which B has
and enrollment and A is an admin, it would overwrite (given corrected
handling of the 0) with the last queried shard's values, rather than
combining them.

fixes CNVS-6303

test-plan:
 - have at least two shards
 - create user A on shard 1, user B on shard 2
 - enroll user B as a teacher in a course under account X on shard 2
 - add user A as an admin of account X
 - on shard 1, reload user B via user A's messageable users, e.g.:
     userB = userA.load_messageable_user(userB)
 - userB's common courses should include a key of 0 with
   'TeacherEnrollment' as the only value
 - repeat on shard 2
 - enroll user B as a student in a course under account Y on shard 1
 - add user A as an admin of account Y
 - on shard 1, reload user B via user A's messageable users (again)
 - userB's common courses should include a key of 0 with both
   'TeacherEnrollment' and 'StudentEnrollment' as values
 - repeat on shard 2

Change-Id: I014d1f0d7793889de512a4a0262e32027ee5702e
Reviewed-on: https://gerrit.instructure.com/21542
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
wordsmithing

closes CNVS-6190

Change-Id: Ie38cbad2ab037c7e001b2e9db64927a6af6ae8dc
Reviewed-on: https://gerrit.instructure.com/21658
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
add metadata to kaltura file upload

**test plan
upload a media file through file upload
validate additional metadata for sis_id, sis_user_id, and context
are available in partner data

fixes PS-322

Change-Id: Ia7c3b3e05ce08e40baf14527f4cbdcea6cd67bb4
Reviewed-on: https://gerrit.instructure.com/21334
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
add custom_time_zone parameter to lti launches

test plan:
* create a external tool with a custom field keys like:

custom_time_zone=$Person.address.timezone
custom_time_zone2=$Canvas.user.timezone
custom_offset=$Canvas.user.timezone.offset

* confirm that the tool launch parameters includes the
custom keys substituted with the current set time zone
or time zone offset (which derives from the user,
or the root account)

fixes #CNVS-6281

Change-Id: I9bf44f7ba10b2c7f68cae65496caba30ff601f15
Reviewed-on: https://gerrit.instructure.com/21621
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>