Create users by CSV - allow specification of end date

Bug #1271618 reported by Mike Kelly on 2014-01-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Wishlist
Lisa Seeto

Bug Description

Could we please allow the setting of an end date for the lifecycle of the users' accounts when creating users by CSV.

Aaron Wells (u-aaronw) wrote :

So filling in the "Account expires" field for the users, via the CSV? That sounds like it should be pretty easy.

Changed in mahara:
importance: Undecided → Wishlist
status: New → Confirmed
tags: added: bite-sized
Aaron Wells (u-aaronw) wrote :

The one tricky thing about this is formatting. Probably on the CSV upload page, where we list the allowed fields, it should say "expirydate (YYYY-MM-DD)" to tell people what format to put the date in. Then, we'll need to validate the dates during the validation step and throw an error if there are any invalid ones.

And lastly, and most importantly, an empty value in the expirydate column should be accepted as valid, and meaning that the account has no expiry date.

tags: added: csvupload
removed: creation csv date end user
Mike Kelly (m-f-kelly) wrote :

That sounds like it would do the job.
This would be useful because manually created accounts in particular often have a requirement for an account expiry date.

tags: added: academy
peter (peterh-k) on 2015-02-11
Changed in mahara:
assignee: nobody → peter (peterh-k)
peter (peterh-k) wrote :

Which should take precedence, the default expiry date set in site options in the mahara configuration, or the date put in the csv file?

Mike Kelly (m-f-kelly) wrote :

I would suggest that the CSV data should take precedence. It could be left out if the user wants to use the site defaults.

Changed in mahara:
status: Confirmed → In Progress
Changed in mahara:
assignee: peter (peterh-k) → nobody
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/9606

Lisa Seeto (lisaseeto) wrote :

I have added an expiry field for CSV uploads. This is in the date format YYYY-MM-DD and can be left blank. The date uploaded via CSV will take precedence over the site "account expires" setting.

Changed in mahara:
assignee: nobody → Lisa Seeto (lisaseeto)
milestone: none → 19.04.0
Steven (stevens-q) wrote :

Environment tested: Master
Browser tested: Chrome

PRECONDITIONS:
------------------------
1) CSV contains the following expiry dates
a) date in the past
b) today's date
c) date in the wrong format (07/03/2019)
d) invalid date (2019-03-32)
e) date in the future but not more than 7 days
f) date in the future greater than 7 days

TEST STEPS:
------------------------
1) Log in as Site admin
2) Browse to the Add users by CSV page (Admin menu > Users > Add users by CSV
3) Upload a file that contains the above data
4) Confirm the following error messages are displayed
a) Error on line 2: The expiry "2018-02-01" cannot be in the past. ✔
b) Error on line 4: The expiry "03-04-2019" is invalid. Please use YYYY-MM-DD. ✔
c) Error on line 5: The expiry "2019-03-32" is invalid. Please use YYYY-MM-DD. ✔
5) Fix the above errors in the CSV by setting the date to date in the future but not more than 7 days
6) Confirm the upload is successful with no errors displayed ✔
7) Confirm that emails are sent to users that have an expiry date that is within 7 days of todays date ✔
8) Browse to the User search page and select a user that was in the CSV upload
9) Browse to the users Account settings page
10) Confirm that the Account expires date is displayed and is the same as what was in the CSV ✔
11) Log out and log in as a user that has an account that has expired
12) Confirm that user cannot log in

*** NOTES: ***
1) emails are not sent right away the cron must be run first - add the following to the base URL to run the cron /lib/cron.php
2) There is another patch that must be used with this patch so that the date will display in the "Account expires" field located in the Accounts page for a user

Catalyst QA Approved ✔

Steven (stevens-q) wrote :

Bug - Error message displayed when using today's date

PRECONDITIONS:
------------------------
1) CSV contains an expiry date of today's date (ie 2019-03-12)

TEST STEPS:
------------------------
1) Log in as Site admin
2) Browse to the Add users by CSV page (Admin menu > Users > Add users by CSV
3) Upload a file that contains the above data

Expected result - no error message is displayed

Actual result - Error message displayed when using today's date - Error on line 3: The expiry "2019-03-12" cannot be in the past.

Steven (stevens-q) wrote :

Bug Fixed - using today's date as an expiry date in the CSV does not throw an error message ✔

Catalyst QA Approved ✔

Steven (stevens-q) wrote :

Environment tested: Master
Browser tested: Chrome

PRECONDITIONS:
------------------------
1) CSV contains the following expiry dates
a) date in the past
b) todays date
c) date in the wrong format (ie 07/03/2019)
d) invalid date (ie 2020-07-32)
e) date in the future but not more than 7 days
f) date in the future greater than 7 days
2) Mahara system contains users that has an expired account and can no longer log in

TEST STEPS:
------------------------
1) Log in as Site admin
2) Browse to the Add users by CSV page (Admin menu > Users > Add users by CSV
3) Upload a file that contains the above data
4) Confirm the following error messages are displayed
  a) Error on line 2: The expiry "2018-02-01" cannot be in the past. ✔ (date in the past)
  b) Error on line 4: The expiry "03-04-2019" is invalid. Please use YYYY-MM-DD. ✔ (date in the wrong format (ie 07/03/2019))
  c) Error on line 5: The expiry "2019-03-32" is invalid. Please use YYYY-MM-DD. ✔ (invalid date (ie 2020-07-32))
5) Fix the above errors in the CSV by setting the date to date in the future but not more than 7 days
6) Confirm the upload is successful with no errors displayed ✔
7) Confirm that emails are sent to users that have an expiry date that is within 7 days of todays date ✔
8) Browse to the User search page and select a user that was in the CSV upload
9) Browse to the users Account settings page
10) Confirm that the Account expires date is displayed and is the same as what was in the CSV ✔
11) Log out and log in as a user that has an account that has expired
12) Confirm that user cannot log in ✔
13) Log out and log in as a user that has an account that has expired and has had their wxpiry date updated to the future
14) Confirm that the user is now able to log into their Mahara account ✔

* NOTES: *
1) If the CSV contains details of an existing user - ensure that the Update users switch is set to Yes
2) emails are not sent right away the cron must be run first - add the following to the base URL to run the cron /lib/cron.php
3) There is another patch that must be used with this patch so that the date will display in the "Account expires" field located in the Accounts page for a user

Catalyst QA Approved ✔

Robert Lyon (robertl-9) on 2019-03-21
Changed in mahara:
status: In Progress → Fix Committed

Reviewed: https://reviews.mahara.org/9606
Committed: https://git.mahara.org/mahara/mahara/commit/944db49e8ddff1b7ab964a1293b92c1bddb5f961
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 944db49e8ddff1b7ab964a1293b92c1bddb5f961
Author: Lisa Seeto <email address hidden>
Date: Thu Feb 28 11:46:01 2019 +1300

Bug 1271618: Create users by CSV - allow specification of end date

Add expiry field to csv upload for account end date.

behatnotneeded

Change-Id: I08c7388f53120377a1d2f1fcdf6bf0b315f02189
Signed-off-by: Lisa Seeto <email address hidden>

tags: added: nominatedfeature
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers