Commit Graph

43 Commits

Author SHA1 Message Date
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
JT Olds 9d4a4944b6 allow sis imports to make things sticky or clear stickiness altogether
* adds ui

Change-Id: Id8f3639457879d23125c0fb04ef5038d91826f21
Reviewed-on: https://gerrit.instructure.com/6050
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-10-13 10:54:58 -06:00
Cody Cutrer d2a5328993 drop Pseudonym#sis_source_id closes #5897
Change-Id: I81f2df5324ae7f9747f5d72ac1f8686932c815ff
Reviewed-on: https://gerrit.instructure.com/6093
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-10-12 12:18:37 -06:00
Cody Cutrer 133f2a156a make Pseudonym#unique_id sis sticky refs #5897
Change-Id: If969d8bfd8844a2dcd5263a11c9bc06dcaa47c55
Reviewed-on: https://gerrit.instructure.com/6092
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-10-11 10:16:06 -06:00
JT Olds 96312879f5 plumb sis stickiness override option through to the csv importer
refs #5407

Change-Id: I2532160ac519e9618e95043bd9818cf3a18b78db
Reviewed-on: https://gerrit.instructure.com/5874
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-09-30 10:36:06 -06:00
JT Olds 02e4132107 refactor sticky sis fields
Change-Id: I1cddc633b11b8937f8a3b36c2fa0a00d4d75b513
Reviewed-on: https://gerrit.instructure.com/5745
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-27 16:34:37 -06:00
Brian Palmer 3dc8ecc4df don't drop sis rows if transaction timeout is reached
Change-Id: Ib6744eb6410727afbd8b86f55d379d1c126a96db
Reviewed-on: https://gerrit.instructure.com/5830
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-09-26 23:52:30 -06:00
JT Olds 006cde7157 new generic-format importer classes
notable changes:
 * nothing is processed as a sis-import blocking error now. bad imports now
   result in warnings, while just skipping bad data
 * we no longer check for duplicates before going to the database

Change-Id: Iedc96b29d92caccdc6a71ae1de8100a1c82dd137
Reviewed-on: https://gerrit.instructure.com/5724
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-09-26 11:24:58 -06:00
JT Olds 9016452480 handle nil sis_communication_channels appropriately
refs sis batch id 8860, error report 2538380

Change-Id: I6576ee0a38fc163e88746d753ddd3400b54f21c9
Reviewed-on: https://gerrit.instructure.com/5712
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-17 15:06:43 -06:00
Cody Cutrer 06fe062709 don't log users out when doing a sis import fixes #5583
Change-Id: I3450f1d7369f7710cf5627597f38ea7e9f5fea0a
Reviewed-on: https://gerrit.instructure.com/5659
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-14 15:53:09 -06:00
Cody Cutrer 6238c7a044 more gracefully handle pre-existing communication channels for sis imports
Change-Id: I6b2522d299a51576b3ca85e14f9e702de9f30f14
Reviewed-on: https://gerrit.instructure.com/5474
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-09-08 08:40:29 -06:00
Cody Cutrer 191f9d4998 optimize and fix account associations during user sis import
It wasn't handling removing the association on the transition to deleted state.

Change-Id: Ia9f0714b8eba200531b5e2764c1c4f152f8ff8be
Reviewed-on: https://gerrit.instructure.com/5380
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-09-01 15:14:59 -06:00
Bracken Mosbacker 795d10776f clear whitespace on sis csv imports
Also clear old whitespace that was missed before this fix

closes #5448

Change-Id: I6096685223c43bfec9fd0c669c737af422687e10
Reviewed-on: https://gerrit.instructure.com/5354
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-08-31 18:26:42 -06:00
Cody Cutrer de92627373 optimize course, section, and xlist sis imports
optimize crosslisting itself:

 * use ids where possible to avoid unnecessarily loading up objects
 * Don't worry about keeping track of if we need to save; we're gonna
   save anyway
 * update account associations on any account change, not just root
   account change (if you re-crosslist a section from one sub-account
   to another sub-account, the users may no longer be associated with
   the first sub-account).

optimize sis imports:

 * really batch up update_account_associations

Change-Id: Ic0fbe1601afcbcd3e6540e69febc2e6a1a94157f
Reviewed-on: https://gerrit.instructure.com/5137
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-08-19 10:21:56 -06:00
JT Olds b92427222e allow unchanged passwords to be reset via sis
fixes #5182

Change-Id: I5c7a6705714b3991048b468ad5961875311f1348
Reviewed-on: https://gerrit.instructure.com/4903
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-08-04 10:06:00 -06:00
Brian Palmer b970f4a650 limit sis import transaction time
Change-Id: Ife4425585bf413f8b4c8d26a42dddff2786e7d1e
Reviewed-on: https://gerrit.instructure.com/4847
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-07-29 08:41:55 -06:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
JT Olds bc7a9050f1 make sure users and pseudonyms get added together
Change-Id: I912f39f09a6b59daea9ac04f158a0e94279159dc
Reviewed-on: https://gerrit.instructure.com/4183
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-06-14 10:46:54 -06:00
Cody Cutrer b60e645b0d import and support ssha passwords from sis. fixes #4573
Change-Id: I703730644f0094d7cb85d8def322969267de3ce5
Reviewed-on: https://gerrit.instructure.com/3755
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-23 08:40:35 -06:00
Cody Cutrer 21f636cb0f use transactions for user and enrollment imports
For "small" imports (<5000 users), this improves wall-clock time
only a bit, but is much much nicer to the db.  The larger the
import, though, the more the improvement here.

Be careful that we only use transactions on things that wouldn't
block other imports running in parallel, or even progress updates
running on the same thread.

Also be smarter about how often we update progress, since that
transaction can have a considerable impact on wall clock time.

refs #3752

Change-Id: I8a79bc530f5433858ccf7d62d33b98ba25e98ffa
Reviewed-on: https://gerrit.instructure.com/3613
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-20 10:39:11 -06:00
JT Olds cfae736f5c don't increment successful user counts on failures
Change-Id: I90ea084deeaacb954ebad94e1803460534df92b9
Reviewed-on: https://gerrit.instructure.com/3626
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-16 14:15:47 -06:00
JT Olds 1b900f660e update existing sis communication channel instead of creating new ones. fixes #4538
Change-Id: Idf6e03ee14b2f93e4393a36229305dcdb3da14e8
Reviewed-on: https://gerrit.instructure.com/3585
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:34:08 -06:00
Cody Cutrer 768e217967 user import optimizations refs #3752
* Only save the pseudonym once
 * Avoid saving the user and pseudonym if nothing actually changed
 * Related to that, since we skipped updating sis_batch_id
   individually, we still need to do that, so do it en-masse instead.
   updated_at will *not* get updated now.

These changes make re-importing the same data 3x faster than the
original import (it used to be less then 2x as fast as the original
import).

Change-Id: Ia6ea32cdeb2f4aebe041d8a51b9efe6c89bc819c
Reviewed-on: https://gerrit.instructure.com/3558
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 15:58:43 -06:00
Cody Cutrer a7e646f79c set account object not just id to avoid later lookup in Pseudonym#validate_unique_id
refs #3752

Change-Id: Ice950e03c1b6f226bb24d7b9f23ffb0042dba3eb
Reviewed-on: https://gerrit.instructure.com/3555
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 15:54:27 -06:00
Zach Wily 7beaf4d764 fix update_account_associations job getting created for every imported user
Change-Id: Ia7dc8ca3912510114d88035e264e59ebb54fe086
Reviewed-on: https://gerrit.instructure.com/3446
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-03 14:26:18 -06:00
JT Olds 03fae4c7dd banner does *not* have email addresses we can deterministically figure out for every user
Change-Id: If114f99f577affcc8f33ab743be45479f537cc52
Reviewed-on: https://gerrit.instructure.com/3376
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-29 14:39:24 -06:00
JT Olds 4c6c9056d1 be more paranoid when looking up users for sis
Change-Id: I4129ba2d687ba8d9cb6cdb363711635a6e443955
Reviewed-on: https://gerrit.instructure.com/3353
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-29 09:49:01 -06:00
Zach Wily 06e89cdb6e do default notification policy setup synchronously during SIS import
Change-Id: Ic619952b079d0774bb78fdd8cbb3b930b83bce28
Reviewed-on: https://gerrit.instructure.com/3199
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-22 08:23:51 -06:00
Zach Wily 3911ab3cd3 update account associations while creating users
Change-Id: Ie7eda5d1f27da0ee9da8b723ac151a63e97288c9
Reviewed-on: https://gerrit.instructure.com/3198
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-22 08:23:37 -06:00
Bracken Mosbacker e832bb9af2 set the correct workflow state on sis import
users need to be 'registered' not 'active'

closes #3744

Change-Id: Ia32aa3a32689c98fd17ea19594e3d314f9e3918f
Reviewed-on: https://gerrit.instructure.com/2205
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-02-08 14:31:36 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00