Commit Graph

80 Commits

Author SHA1 Message Date
Landon Wilkins e26843ff95 da licença part 34
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ic6b3be7861a2c91d76889c1740f964e401638e04
Reviewed-on: https://gerrit.instructure.com/110061
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 22:00:30 +00:00
Nick Houle d93475bf18 SIS vs Canvas ID on SIS Import Page
Fixes: CNVS-36268

Test plan:
- Sync a PowerSchool Agent you have previously synced to Canvas
  before
- In your Canvas instance navigate to the SIS Imports page
- Upon the import completing comfirm the warning messages have a
  more descriptive message as:
  "An existing Canvas user with the SIS ID"
  OR
  "An existing Canvas user with the Canvas ID"

Change-Id: I3fc86e5d0de77862cfcb0741625c872dd580f882
Reviewed-on: https://gerrit.instructure.com/108368
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-04-26 22:44:40 +00:00
Rob Orton 7051f7704a use the sis user model exclusively
refs CNVS-35716

test plan
 - specs should pass

Change-Id: I7ff08532efc94bc08f58a61d3ce4afc330b701d2
Reviewed-on: https://gerrit.instructure.com/107525
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-04-18 14:25:37 +00:00
Rob Orton 9c7db33dad add sis_batch_id to SIS::Models::User object
this is needed for sis plugins

refs CNVS-35708

test plan
 - specs should pass

Change-Id: Id24acc1253b8d9f70c744e5e175a0fb47ce518e4
Reviewed-on: https://gerrit.instructure.com/107526
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-04-05 21:32:42 +00:00
Rob Orton 57642b7c54 make an sis user model
fixes CNVS-35716

test plan
 - sis import of users should work

Change-Id: I06a8ff352c7b780cec4edda81820af53937ea16b
Reviewed-on: https://gerrit.instructure.com/107507
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-04-05 21:30:12 +00:00
Cody Cutrer ce21af8ecf rails 5: find and fix lots of deprecation warnings [ci verbose]
refs CNVS-34843

Change-Id: Idd523c2a7c37325381d590f1ee70c406ace2a459
Reviewed-on: https://gerrit.instructure.com/105033
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-16 16:03:51 +00:00
Rob Orton 9425b8091e update the updated_at on update_alls in sis importers
fixes CNVS-33458

test plan
 - specs should pass

Change-Id: Ia63bc50ae91e5742a3a3684e500f470a7ba672fe
Reviewed-on: https://gerrit.instructure.com/95770
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2016-11-23 22:18:37 +00:00
Rob Orton 7a85894c4b stop giving developer errors to users
fixes CNVS-32336

test plan
 - run an invalid sis import with invalid login_id
 - it should display warnings and not an error on
   /sis_imports page

Change-Id: I708ee42c359a154bad6574417daac44839317177
Reviewed-on: https://gerrit.instructure.com/91767
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-10-04 20:04:57 +00:00
James Williams 0c64db0688 fix more enrollment state mismatches
caused by sis user deletion and course state changes

also DRY up the enrollment recalculation a little

closes #CNVS-31060

Change-Id: Ife8b2a95223c423f2faec79f3f9d5af5377ce51e
Reviewed-on: https://gerrit.instructure.com/88307
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-22 16:08:28 +00:00
Jeremy Stanley ff2051a5ab delete account memberships when deleting a user by SIS
test plan:
 - create a user with a SIS ID
 - add this user as an admin in an account
 - delete the user via SIS import
 - ensure the user is no longer an admin in the account
 - also test when the user is a subaccount admin
   and ensure the subaccount membership is deleted
   when the user is deleted
 - ensure that an admin in multiple root accounts/shards
   is only deleted from one of these accounts via a
   SIS import (the domain the SIS import was run from)

fixes CNVS-30275

Change-Id: I288e10219fe39905fd271d02df1dc0aeb9814e76
Reviewed-on: https://gerrit.instructure.com/84852
Tested-by: Jenkins
Reviewed-by: Alex Boyd <aboyd@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-07-27 16:51:28 +00:00
Rob Orton 7d6ebbffaf use take instead of first on importers
refs CNVS-29352

test plan
 - specs should pass

Change-Id: Iab31482ef892a0a8fd08cec5143197adb05635fb
Reviewed-on: https://gerrit.instructure.com/79682
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2016-05-16 18:54:06 +00:00
Ken Romney 5ad7cd9a56 Improve invalid unique_id message for user imports in
Test Plan:
  Create a user.csv file to import via SIS Imports with a row
  containing an invalid login_id.

  Note that the message is not "unique_id is invalid"

  Note that the message contains contextual login_id and
  sis_id / user_id information

Fixes: SIS-1732

Change-Id: I16f47d57f4dbe2550d979e6f6552d164a8709631
Reviewed-on: https://gerrit.instructure.com/71056
Product-Review: Linda Feng <lfeng@instructure.com>
Tested-by: Jenkins
Reviewed-by: Max Stahl <mstahl@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
QA-Review: Kausty Saxena <kausty@instructure.com>
2016-02-06 00:09:09 +00:00
Cody Cutrer 34b8f46ba5 several qualified names fixes in raw SQL
refs CNVS-21900

Change-Id: I54afb7f5b35109f4cc78ab2f285e5bc9cb01190f
Reviewed-on: https://gerrit.instructure.com/67243
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-11-18 22:01:23 +00:00
James Williams 15a53801db reflect correct user counts in sis import
test plan:
* run a sis import that changes a user but does not
 update their email address
* the imported items count should include a User

closes #CNVS-14648

Change-Id: I67dfdf167c8eed77d3b4839fed5dbf905bcf513a
Reviewed-on: https://gerrit.instructure.com/65222
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-10-20 16:38:15 +00:00
Tyler Pickett 8a1be5f3d2 Speed up pathological email handling in user importer
In testing SIS integrations we encountered a situation where seed data
from a partner had 1771 users with the same email address. Near the end
of the import process this lead to executing 5310 separate queries (3 x
1770) to determine how to handle the seemingly duplicated
CommunicationChannels.

The first query, existence of a user for a communication channel is
redundant because database constraints enforce that the user record
exist and that the CommunicationChannel user_id field not be NULL. This
check was removed.

The second query, existence of active pseudonyms for the other
communication channel's user, can be combined for all relevant users
into a single count query with a grouping by the user_id.

The third query, similar to the second with the addition of checking
the root account and presence of a SIS id, is similarly combined.

These three changes yield a 10x performance improvement in the mentioned
pathological case.

Test Plan:
- Run a user import with a repeated email address and ensure the system
  ends with all communication channels in the correct state.

Change-Id: I5695cdf342249780d37780f61d56f8257f3f8452
Reviewed-on: https://gerrit.instructure.com/65262
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Kausty Saxena <kausty@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
Tested-by: Tyler Pickett <tpickett@instructure.com>
2015-10-19 21:43:33 +00:00
Andrew Butterfield 008c9fd2be SIS Import validates email address
refs CNVS-22801

Test plan:
* Create a csv file with the following contents

user_id,login_id,first_name,last_name,email,status
user_1,user1,User,Uno,BAD_EMAIL_ADDRESS,active

* Try to import this csv file
* Ensure that the import succeeds (i.e. the user is created)
* Ensure there is an import warning due to "BAD_EMAIL_ADDRESS"
  not being a valid email address

Change-Id: Iac85a894bbbbdd69cd4f88f6f893975f6c6436c5
Reviewed-on: https://gerrit.instructure.com/63990
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Linda Feng <lfeng@instructure.com>
2015-10-13 14:51:50 +00:00
Rob Orton f1c10202cd when deleting a user through sis also delete group memberships
fixes CNVS-12892

test plan
 - enroll a user in a course
 - add them in a group in the course
 - delete user through sis
 - the group_membership should also be deleted

Change-Id: I86065eaaebb271594f16f3b60a586f42c897158c
Reviewed-on: https://gerrit.instructure.com/64854
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2015-10-10 05:15:38 +00:00
Cody Cutrer d32e72c569 allow setting auth providers on sis import
test plan:
 * create an auth provider
 * do an sis import without auth provider; it should still work
 * specify the auth provider by name in the import; it should work
 * specify the auth provider by id in the import; it should work

Change-Id: I71f381a1bc140c3992cac6eb45bb077e5bd26baa
Reviewed-on: https://gerrit.instructure.com/59558
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-07 20:23:45 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Cody Cutrer 5d42d023d2 no more dynamic finders (lib)
refs CNVS-15126

Change-Id: I4087b1c2442c5b8f70ce2138bf4aeef6ef7e59cd
Reviewed-on: https://gerrit.instructure.com/41259
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-23 16:53:56 +00:00
Brian Palmer fdefc984ae remove the new teacher registration email
This email only went to site admins, and isn't useful.

This commit stops new notifications being created, a subsequent commit
will remove the no longer used code and data.

refs CNVS-15219

Change-Id: Ibd8c88c7310cf3dcfb06cf0c782f2b3cf571d843
Reviewed-on: https://gerrit.instructure.com/40375
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-09-03 22:05:46 +00:00
Cody Cutrer 4777aac2df Merge pull request #445 from sfu/feature-sis-user-names
Add full & sortable name fields to SIS User Import

Change-Id: Ib8617572802ca69913b422d22301299ab75c211f
Reviewed-on: https://gerrit.instructure.com/34548
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-13 14:26:23 -06:00
Cody Cutrer c6090faa0a allow enrolling users via sis from another root account
fixes CNVS-12963

test plan:
 * set up a trust from account A to account B
 * enable sis imports for account A and account B
 * add a user to account B with an SIS ID
 * add a course to account A with an SIS ID
 * do an sis import to account A for enrollments as user
   that is an admin in both account A and account B;
   specify the course from account A as the target,
   the user from account B, and add another column
   root_account with account B's domain
 * it should succeed, and enroll the user from account B
 * unenroll the user manually
 * do the import as a user that's an admin in account A,
   but not account B - it should fail citing permissions
 * remove the trust link from A to B
 * do the import as the user that's an admin in both;
   it should fail citing no usable login

Change-Id: Ie5b7b71bfe563da9c49d3aa2321586994634ccb5
Reviewed-on: https://gerrit.instructure.com/32133
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-13 17:19:48 +00:00
Andrew Leung ab78550748 Add full & sortable name fields to SIS User Import
Both fields are optional. If absent, the user's name and sortable_name
will be set in the same manner as before.

The full_name field takes precedence over first_name and last_name. The
sortable_name field takes precedence over the inferred value.
2014-05-02 14:09:26 -07:00
Andrew Leung d495a3223b Rearrange add_user args to maintain compatibility 2014-04-25 14:23:45 -07:00
Andrew Leung 1b6e4a6ba3 Remove error for setting short_name w/o first+last names 2014-04-24 14:02:31 -07:00
Andrew Leung ba3a347533 Add display name field to SIS User Import
The display name (short_name) field is optional. If absent, short_name
will behave as before. If present, it will explicitly set short_name to
the given value, unless it's a stuck SIS field of course.

Previously, if first and last names were not given, the user's name will
be a single space. The behavior is the same now, except when short_name
is present. In that case, an error will be thrown.
2014-04-22 11:50:18 -07:00
Rob Orton bf630b91a6 fix user sis imports on mysql
refs CNVS-11680

test plan
 - on mysql run user import
 - should not fail

Change-Id: I3c6ccc99aae493ba87fc5c2ebaf8e789dfca0338
Reviewed-on: https://gerrit.instructure.com/31543
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-03-08 01:00:29 +00:00
Rob Orton d11df046c3 compare login id using the db on sis user import
fixes CNVS-11680

test plan
 - import user.csv with a different case than
   existing user's unique_id
 - no import warning errors should be shown

Change-Id: I64a3a84f6874ec88c4f28bc046f80cad9219fc43
Reviewed-on: https://gerrit.instructure.com/31453
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-03-07 07:02:34 +00:00
Eric Adams 72fb2879dc do not show warnings when unique_id different case for same user
fixes SIS-162

TestPlan
----------
  - import user.csv with a different case than existing user' unique_id
  - no import warning errors should be shown

Change-Id: I653bcc7c2ace9953fe74ada0c0ab7da32c65662c
Reviewed-on: https://gerrit.instructure.com/30151
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>
Reviewed-by: Eric Adams <eadams@instructure.com>
2014-02-18 21:10:46 +00:00
Duane Johnson db12e5e7b1 Add integration_id to CSV import
Test Plan:
- Import a CSV with integration_id column in any
  of: account, course, section, term, user
- The integration_id should be available in the
  console for objects imported in this way (e.g.
  user = User.find(123); user.integration_id)

Fixes SIS-108

Change-Id: Ie7f0765c2ec7222d8c7ba7dfbf78c858812e62d3
Reviewed-on: https://gerrit.instructure.com/27672
Tested-by: Jenkins <jenkins@instructure.com>
Tested-by: Ken Romney <kromney@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
QA-Review: Ken Romney <kromney@instructure.com>
Product-Review: Ken Romney <kromney@instructure.com>
2013-12-27 16:06:13 +00:00
Cody Cutrer a4bf708d33 batch up some massive updates at end of SIS import
fixes CNVS-7981

test plan:
 * run some SIS imports
 * they should succeed

Change-Id: Ia81981b04b3454d115ae607e9babed4c2548a906
Reviewed-on: https://gerrit.instructure.com/24092
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-09-10 17:35:52 +00:00
Cody Cutrer ca90299806 fix uniqueness validation of login ids
fixes CNVS-7266

test plan:
 * create an SIS user with a login id, then delete them
 * create a non-SIS user with the same login id
 * use an SIS import to resurrect the original user
 * the SIS import should succeed, but warn that it skipped the user
   cause someone else had his login information

Change-Id: I2102107fefb1d20fae6046ebe3a7e0c03416dcc9
Reviewed-on: https://gerrit.instructure.com/22867
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-08-01 20:32:14 +00:00
Cody Cutrer 5ffbcbeb05 arel-ify lib
excluding api_find, which needs more work

refs CNVS-4706

Change-Id: I013d0660ff2b8dbe2abf6a5c973bd1203f432f99
Reviewed-on: https://gerrit.instructure.com/18921
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 19:12:22 +00:00
Duane Johnson 0f3c5bed6b raise ImportError for invalid sis import data
When unhandled ActiveRecord validation errors occur during SIS import
for a single record, it can prevent an entire batch from importing.
This change catches validation errors in Enrollment and
GroupMembership objects and re-raises them as ImportErrors so that
batch imports can continue.

Test Plan:
  - create a batch import in which a user is enrolled in a class,
    and is also in a group within that enrollment
  - add something else to the batch (to test that the rest of the
    batch is imported even when the error, below, occurs)
  - import the batch
  - mark the enrollment as deleted
  - re-import the batch
  - rather than failing to import the batch, there should be an
    error message indicating the group user had a validation error

fixes CNVS-4226

Change-Id: I87078bd263f2b2487c5a8d41ff41c0ff71cbed95
Reviewed-on: https://gerrit.instructure.com/18271
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-07 15:51:08 -07:00
Ethan Vizitei c6c34f11dc prevent bad sis_user_id queries
fixes #CNVS-2172

found every place I could in the codebase
that passed some kind of input into a finder
that looked up a pseudonym with an sis_user_id.
Then wrote specs to pass in integers (which in 
all cases turned up the error described
in the ticket), and 
made sure to do explicit casts on the inputs
until the specs didn't break anymore.

TEST PLAN (unsure of how to trigger from UI):

1) Take a pseudonym that already exists and has
an sis_user_id that could be an integer (is
made up of all numeric characters).

2) In the console, try to create a new 
pseudonym with the same sis_user_id, but use
an integer instead of a string.

3) you SHOULD NOT get a postgres error
telling you that you need to do an
explicit type cast

4) you SHOULD get a validation error telling
you that 2 pseudonyms cannot have the same
sis_user_id.

Change-Id: Ic69da6a40609a50234a5388af02dd1fbeb021214
Reviewed-on: https://gerrit.instructure.com/16925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-22 14:59:43 -07:00
Brian Palmer eaa27eeb92 touch the user if only the sis communication channel changed
refs #11188

test plan: sis import a user with an email. then do another sis import
that only changes the user's email. the change should show up
immediately in the ui and in sis csv export reports.

Change-Id: I14efdf052ea7d2688ef07fff6ce25f76c6deb034
Reviewed-on: https://gerrit.instructure.com/15479
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-19 08:25:07 -07:00
Cody Cutrer af39561e13 fix sis import of email addresses that match active and retired addresses
fixes #8402

test plan:
 * create a user via SIS with no e-mail
 * add an e-mail address and remove it from the user's profile
 * add the same e-mail address, and confirm it this time
 * re-import the user via SIS, with the e-mail address this time,
   but differing in case
 * it should succeed, and the e-mail address should be update to
   the new case

Change-Id: Id54f413bdf6b3c066530c53715141c7507d18f9b
Reviewed-on: https://gerrit.instructure.com/10552
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-05-04 16:14:36 -06:00
Cody Cutrer 503e0eb7ec don't send merge notifications to same-account sis users
fixes #7159

test plan:
 * import two users with the same e-mail into the same account
 * the user should not get a merge notification e-mail

Change-Id: Ic9f3a3948df1e2a877fcd8e79f3d05d86a2d1e5b
Reviewed-on: https://gerrit.instructure.com/8774
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-02-21 09:43:22 -07:00
Cody Cutrer f49f2f0ae1 only search active pseudonyms when finding an implicit sis pseudonym
test plan:
 * create a user via the UI
 * add another pseudonym
 * delete the extra pseudonym
 * import a new user via SIS import with the login of the pseudonym
   you deleted
 * it should create a separate user for the SIS user, instead of
   resurrected the deleted pseudonym onto the original user

Change-Id: Ia1ff1490bae82fc4daef3f91b05293d7c79cc50b
Reviewed-on: https://gerrit.instructure.com/7975
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-12 12:38:00 -07:00
Cody Cutrer f491308163 drop unused user.creation_* columns
test plan: run the migration

Change-Id: I75184edd64ddee384de485c443d4c7eee45cc26f
Reviewed-on: https://gerrit.instructure.com/7895
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-10 10:49:49 -07:00
Cody Cutrer b9fee70ee6 use Pseudonym.custom_find_by_unique_id instead of find_by_unique_id
so that it's case insensitive

also fix some latent CommunicationChannel.find_or_initialize_by_path
discovered by specs for this

test plan:
 * run the specs
 * use forgot password with a username that differs in case
 * self-register a new user multiple times (without confirming)
   with e-mail addresses that differ in case

Change-Id: I476325f591c997fc8d50d5f38480177f732f07a7
Reviewed-on: https://gerrit.instructure.com/7724
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-04 15:58:40 -07:00
Cody Cutrer f13e7ea2fa fix sis communication channels inadvertently switching users fixes #6707
test plan:
 * import a user via SIS
 * do another SIS import that lists the same user, and a new user
 * the e-mail addresses for each user should be correct

Change-Id: I0a95804056e38bdfd36f24c0c78187d601940451
Reviewed-on: https://gerrit.instructure.com/7833
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-03 17:05:30 -07:00
Cody Cutrer 2b2f49d66f search for communication channels case insensitively fixes #6750
test plan:
 * create a user via SIS import with an e-mail address
 * add a different e-mail address to the user
 * re-import the user via SIS, and set their e-mail address
   to the second e-mail you added, but with a different case
 * the user should have a single e-mail address, the one set
   in the second SIS import

Change-Id: Iab6b16e0b37cfb8caac3faa453be570b99621a9e
Reviewed-on: https://gerrit.instructure.com/7784
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2011-12-30 19:36:29 -07:00
Cody Cutrer f259d610bd don't send merge notifications to users that can't login
refs #5833

Change-Id: Ibf9ca8188510ba0aa5e722dc2f64d87293686c4f
Reviewed-on: https://gerrit.instructure.com/6597
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-01 09:36:09 -06:00
Cody Cutrer 3f3f72637a expose sortable name to user, fixes #5317
* expose sortable name directly to the user
 * don't downcase it
 * use a LOWER(sortable_name) index for postgres
 * set sortable name as "last_name, first_name" explicitly for SIS imports
 * populate sortable name intelligently in the UI

Change-Id: I476641f4817e27a11b573d91f102c5a74d3eba26
Reviewed-on: https://gerrit.instructure.com/6512
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-10-31 12:22:08 -06:00
JT Olds 6403cdf705 don't actually delete users, just pseudonyms. fixes #6117
Change-Id: I560a9de442b75c07eca204ad63be5f3c76f1d5bc
Reviewed-on: https://gerrit.instructure.com/6564
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-10-31 11:48:18 -06:00
Cody Cutrer f99abb4e56 Revert "add distinct name part fields refs #5317"
This reverts commit 995110f555.

Change-Id: Ic00e7ced20ca9d912587e3440862ceb50e601d15
Reviewed-on: https://gerrit.instructure.com/6511
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-10-27 10:17:29 -06:00
Cody Cutrer c59c0f593f refactor user creation/invitations closes #5833
fixes #5573, #5572, #5753

 * communication channels are now only unique within a single user
 * UserList changes
   * Always resolve pseudonym#unique_ids
   * Support looking up by SMS CCs
   * Option to either require e-mails match an existing CC,
     or e-mails that don't match a Pseudonym will always be
     returned unattached (relying on better merging behavior
     to not have a gazillion accounts created)
   * Method to return users, creating new ones (*without* a
     Pseudonym) if necessary. (can't create with a pseudonym,
     since Pseudonym#unique_id is still unique, I can't have
     multiple outstanding users with the same unique_id)
 * EnrollmentsFromUserList is mostly gutted, now using UserList's
   functionality directy.
 * Use UserList for adding account admins, removing the now
   unused Account#add_admin => User#find_by_email/User#assert_by_email
   codepath
 * Update UsersController#create to not worry about duplicate
   communication channels
 * Remove AccountsController#add_user, and just use
   UsersController#create
 * Change SIS::UserImporter to send out a merge opportunity
   e-mail if a conflicting CC is found (but still create the CC)
 * In /profile, don't worry about conflicting CCs (the CC confirmation
   process will now allow merging)
   * Remove CommunicationChannelsController#try_merge and #merge
 * For the non-simple case of CoursesController#enrollment_invitation
   redirect to /register (CommunicationsChannelController#confirm)
   * Remove CoursesController#transfer_enrollment
 * Move PseudonymsController#registration_confirmation to
   CommunicationChannelsController#confirm (have to be able to
   register an account without a Pseudonym yet)
   * Fold the old direct confirm functionality in, if there are
     no available merge opportunities
   * Allow merging the new account with the currently logged in user
   * Allow changing the Pseudonym#unique_id when registering a new
     account (since there might be conflicts)
   * Display a list of merge opportunities based on conflicting
     communication channels
     * Provide link(s) to log in as the other user,
       redirecting back to the registration page after login is
       complete (to complete the merge as the current user)
   * Remove several assert_* methods that are no longer needed
 * Update PseudonymSessionsController a bit to deal with the new
   way of dealing with conflicting CCs (especially CCs from LDAP),
   and to redirect back to the registration/confirmation page when
   attempting to do a merge
 * Expose the open_registration setting; use it to control if
   inviting users to a course is able to create new users

Change-Id: If2f38818a71af656854d3bf8431ddbf5dcb84691
Reviewed-on: https://gerrit.instructure.com/6149
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-10-24 12:07:08 -06:00
Cody Cutrer 995110f555 add distinct name part fields refs #5317
Change-Id: I0d11c51d4e0e9be093b65cca2ea85ba18e99bce9
Reviewed-on: https://gerrit.instructure.com/6314
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-10-24 12:06:59 -06:00