Remove IE browser warning from the help menu.

Test Plan:
* Click the "Help" link in canvas (whether logged in or not)
* Click the "Report a Problem" option
* Check that the IE warning does not exist

Fixes #10569

Change-Id: I3739cc2105ebc56a327b278127a76a2da97f2ff8
Reviewed-on: https://gerrit.instructure.com/14198
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Fix where Upcoming Events that show due on "Tomorrow" when it should be "Today". Fixes #10931

There was a caching problem where 2 assignments can have the same
due date but one can display "Tomorrow" and the other "Today". Both
assignments were due at 11:59pm on the same day.

The issue was related to caching the display with no expiration. The
cache is linked to the assignment and the user's permissions. The
cache key was updated to use Date.today so it will get recomputed
after crossing midnight and the key now also uses the Time.zone.name
instead of the Time.zone.utc_offset as that can create incorrect matches
when two users cross date boundaries.

Testing Notes:
==========
Testing locally may not be possible without having caching enabled
and then changing the machine date/time. The timezone offset is
stored as part of the cache, so changing timezone won't enable
it to be reproduced either.

I don't think a reproducible situation can be created easily unfortunately.

Change-Id: I5cdb12795de23a3e121aadd32c17ccb3a3016bd3
Reviewed-on: https://gerrit.instructure.com/14243
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix development fallback images for gravatar

gravatar has started proxying fallback images, which breaks things if the
host is localhost or something not publicly accessible. set fallback host
to canvas.instructure.com in dev and selenium environments (w/ a
mechanism to override it).

test plan:
1. run canvas locally
2. gravatar fallback images should work again
3. run canvas in beta/production
4. gravatar fallback images should still work, and the url should have the
   current hostname in the proxy path (e.g.
   https://i1.wp.com/foobar.instructure.com/images/.. )

Change-Id: Idfd2129e0d78026b2bcfd57e8c7399e0b29f8a3a
Reviewed-on: https://gerrit.instructure.com/14245
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
spec: don't violate foreign key constraints

Change-Id: I6de9a33e1cf7422bc54a1259c8b096544355fb25
Reviewed-on: https://gerrit.instructure.com/14266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
update canvas branding. fixes #10965

this change updates (1) the favicon; (2) the logo in the
canvas header; (3) the "powered by instructure" text in
the footer; (4) the logo on the login page; and (5) the
header logo on the user registration page.

test plan:

navigate to the following urls and verify that the new canvas
logo is displayed:

  * login page;
  * home page (check header);
  * home page (check footer);
  * home page (check favicon);
  * /register_from_website (check header)

Change-Id: If0b232f0cf00c59577ee55a351536d57c3103280
Reviewed-on: https://gerrit.instructure.com/14230
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
include comment created_at in speed grader json

fixes #11034

test-plan:
 - load a speed grader page that has submission comments on it
 - the comment bylines should include the comment post datetime

Change-Id: Id563f5e9226756de99b030521e0f5f807424df38
Reviewed-on: https://gerrit.instructure.com/14268
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
upgrade underscore.js

this gives us stable sortBy, and lets us get rid of our invert
implementation

test plan:
 * run specs and use canvas
 * it should all work

Change-Id: I87cbcbadf6beb407c025c52e35add4b2b210da70
Reviewed-on: https://gerrit.instructure.com/14270
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
remove the account.* statsd logging

the verbosity outweighs the usefulness

Change-Id: If70730a104b077d6c207f70da62ee52bcae44d03
Reviewed-on: https://gerrit.instructure.com/14272
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ben Chobot <bench@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
retry failed crocodoc uploads

fixes #11100

Test plan:
  * prevent crocodoc submits from working
  * upload a crocodocable assignment submission
  * make sure a job retries the upload once

Change-Id: I1c4b79e64bf94bcf98ba9915c6eaa00548354035
Reviewed-on: https://gerrit.instructure.com/14141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fix IE file upload regression, fixes #11161

fix regression in refactor from a59a4e71 ... some broken code got moved/
consolidated, overriding the previously working code

test plan:
1. do file uploads in IE8/9 (submit assignment, send message attachment,
   etc.)
2. it should work and you should not get a strange download prompt

Change-Id: I5c48eaea6c3216408e167301ed5c16981d1179bf
Reviewed-on: https://gerrit.instructure.com/14282
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
allow students to use LTI buttons in RTE. fixes #10350

students attempting to use an LTI tool via a button in TinyMCE
now see the tool as expected and not an unauthorized error.

test plan:
  * create a course and configure an external tool that has an
    icon in TinyMCE (e.g. the YouTube or TedEd tools available
    at https://lti-examples.heroku.com for examples);
  * as a student, use TinyMCE somewhere in the course and click
    the LTI tool button inside the editor;
  * verify that the tool loads as expected and that you don't
    receive a 401 error.

Change-Id: I61243466dba15d39e33d57f60cef1c3ab7f9ad10
Reviewed-on: https://gerrit.instructure.com/14279
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
factor in progress tracker when calculating height, fixes #11116

ensure that the message pane doesn't take up too much height

test plan:
1. go to conversations
2. find or create a conversation with a lot of messages (sufficient for a
   vertical scrollbar)
3. scroll to the bottom
4. the last message should be completely visible

Change-Id: If1fdaa6180a4884666bdcfe0e7c2108d22066071
Reviewed-on: https://gerrit.instructure.com/14291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
secure facebook integration hole

Change-Id: I3ee51aefbcaff577d2fc78014bbe5623e29bafc8
test-plan:
 - requires production (yay), unless you can get your dev environment
   registered with facebook
 - create a user Adam that has facebook integration enabled but not yet
   configured (such that they have a UserService with
   service='facebook', but don't yet have a service_user_id)
 - go to https://apps.facebook.com/instructure while logged into
   facebook with a user that has not integrated canvas with facebook
 - you should not see a message welcoming Adam and encouraging him to
   setup facebook notifications
Reviewed-on: https://gerrit.instructure.com/14306
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
stabilize paginated calendar event urls

both the server and the javascript were adding extra copies of the bulk of
the query parameters for each subsequent page of events. stop it. now,
the request for the second page should only differ from the first in the
presence of a page=2 parameter, and the remaining page requests should
differ from the second only in the value of the page parameter.

this was particularly bad, because for a student with even a minor
number of courses, it would quickly bloat the url length to where apache
would barf.

fixes #11023

test-plan:
 - create a user
 - create 51 assignments (or events, but not "assignments or events") in
   that user's calendar for the current month in order to trigger
   pagination
 - view the user's calendar2 page for the current month, watching the
   xhr requests generated
 - the url for the request for the second page of events should only
   differ from that of the first page by the page parameter (other
   parameters may end up reordered, but should retain presence and
   value)

Change-Id: Ia2fb7511db83eed964b1d05ca13e0ab49e71b9ac
Reviewed-on: https://gerrit.instructure.com/14289
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
put back User#assignments_needing_grading_total_count

we use this after all.  fixes #11187

test plan:
 * have a course with 9 or more assignments needing submissions
 * as a student, make a submission to each (so 9 need grading)
 * as a teacher, try to view the front Canvas page; you should
   not see a page error

Change-Id: If865eed8fd69b85154dd1a38d2637fd14f43f984
Reviewed-on: https://gerrit.instructure.com/14287
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
don't show Make a New Set of Groups button if no students are in the course

fixes #11120

test plan:
  1. login as a teacher
  2. create a new course
  3. click on the People link in the left nav
  4. Click View User Groups on the right side
  5. Make sure the Make a New Set of Groups button
     isn't displayed
  6. Add a student to the course
  7. go back to that page and make sure the
     Make a New Set of Groups button is displayed

Change-Id: Id4c439bc3500fd233d541eab19c3d0dd964579a2
Reviewed-on: https://gerrit.instructure.com/14191
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
spec: discussions intermittent failure

Change-Id: I2cdf078d4b50e2d4fab6ce69188004cfb56d62df
Reviewed-on: https://gerrit.instructure.com/14309
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
don't include future enrollments in current enrollments list.

fixes #10840

test plan:
  * create and publish a future course with the "users can only
    participate in the course between these dates" option selected;
  * enroll a student;
  * log in as the student and navigate to /courses. verify that the
    course displays in the future enrollments list but not in the
    current enrollments list.

Change-Id: I0c14b9d10df5e221f9e5e0ca53ce4c31a9054e0a
Reviewed-on: https://gerrit.instructure.com/14257
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
disallow students from seeing others' email addresses in api.

fixes #11129.

users api was allowing any user to return email addresses
for users they had permissions to view. now, email addresses
are only displayed if the requesting user has permissions to
view statistics about the requested user.

test plan:
  * as a student, navigate to the "people" page of a course that
    you're enrolled in;
  * verify that when the student and teacher lists populate,
    email addresses are not displayed;
  * visit the same course as a teacher or site admin and verify
    that email addresses are displayed as expected.

Change-Id: I5e1264a881a7d9de106b2133f30d9b354833273e
Reviewed-on: https://gerrit.instructure.com/14203
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
fix PseudonymsController to work cross-shard fixes #6902

test plan:
 * on a user's own shard, go to their user page (/users/self
   is probably easiest)
   * create a login
   * refresh
   * update the login
   * refresh
   * delete the login
   * refresh
 * repeat for the same user, from a different shard
   * for this case, all logins for the user from any shard should
     display

Change-Id: I7d60a6a70e0f5166db05abcafd498bbe754cffb7
Reviewed-on: https://gerrit.instructure.com/14262
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>