When new accounts are created, default storage quota is not applied

Bug #1503103 reported by Teresa Brady
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
1.10
Fix Released
Medium
Unassigned
1.9
Won't Fix
Medium
Unassigned
15.04
Fix Released
Medium
Unassigned
15.10
Fix Released
Medium
Unassigned
16.04
Fix Released
Medium
Unassigned
16.10
Fix Released
Medium
Unassigned

Bug Description

When new accounts are created, default storage quota is not applied.
Our Default quota is 500MB. When new users log in, they get only 200MB. Their accounts immediately get created when they log in with their student/staff credentials.
I can remedy this by going Administration > Institutions > Our Institution > Update user quotas > Submit.
This then updates all users to the correct storage quota.

Mahara 1.9.8 (upgrading to 15.04.0 very soon)

Tags: quota storage
Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Teresa,

There does indeed seem to be a problem with the setting of quota for a new user.

There are a couple of places where the default quota can be set.

One is for the site - under the Administration -> Extensions -> Artefact -> File -> Configuration -> Default user quota setting
The other is for an institution - under the Administration -> Institutions -> Configuration -> Default quota setting

When a new user is made it looks as though only the site default quota is respected.

There needs to be some code added to deal with the institution default quota setting.

I'm thinking that if the Institution default quota is larger than the site default quota then there should be some warning about this on the Institution -> Configuration page and not allow one to set a higher number.

If the Institution default quota is less than the site default quota then it should be respected when making new users for that institution.

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 16.04.0
Revision history for this message
davosmith (8-launchpad-davosmith-co-uk) wrote :

I've been investigating this problem for a customer.

The issue appears to be that the default quota is correctly applied. However, when user->commit() is called, it first calls reload_background_fields(). As the userid is 0 at this point, the specified fields ('active', 'deleted', ... 'quota', 'unread') are loaded from the 'root' user record. This means that the user record will end up with the 'quota' value from 'root' user, rather than the default that was already correctly stored in memory.

I don't understand the 'reload_background_fields' operation quite enough to be confident about this, but my proposed fix would be simply to do nothing in the case where the userid is 0 - I don't think it makes sense to load data from user 0 in the case where the user has yet to be created.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5731
Committed: https://git.mahara.org/mahara/mahara/commit/0a6860a927f7e014343b9dc7ce28e9474f6f3dac
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 0a6860a927f7e014343b9dc7ce28e9474f6f3dac
Author: Robert Lyon <email address hidden>
Date: Tue Nov 17 21:30:17 2015 +1300

Bug 1503103: Making sure the correct quota is set

behatnotneeded

Change-Id: I1aa52a076843ff0dc4dcaf86a01e76b9673885b5
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "16.04_STABLE" branch: https://reviews.mahara.org/6412

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/6413

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/6414

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "1.10_STABLE" branch: https://reviews.mahara.org/6415

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6415
Committed: https://git.mahara.org/mahara/mahara/commit/2a30b1ce4da512c3ba711596cd3cbd990739e2ce
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.10_STABLE

commit 2a30b1ce4da512c3ba711596cd3cbd990739e2ce
Author: Robert Lyon <email address hidden>
Date: Tue Nov 17 21:30:17 2015 +1300

Bug 1503103: Making sure the correct quota is set

behatnotneeded

Change-Id: I1aa52a076843ff0dc4dcaf86a01e76b9673885b5
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 0a6860a927f7e014343b9dc7ce28e9474f6f3dac)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6412
Committed: https://git.mahara.org/mahara/mahara/commit/4bfa3861f923ec178674bc495abdca7dccf77042
Submitter: Aaron Wells (<email address hidden>)
Branch: 16.04_STABLE

commit 4bfa3861f923ec178674bc495abdca7dccf77042
Author: Robert Lyon <email address hidden>
Date: Tue Nov 17 21:30:17 2015 +1300

Bug 1503103: Making sure the correct quota is set

behatnotneeded

Change-Id: I1aa52a076843ff0dc4dcaf86a01e76b9673885b5
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 0a6860a927f7e014343b9dc7ce28e9474f6f3dac)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6413
Committed: https://git.mahara.org/mahara/mahara/commit/ff10db6112861c301fba52c00783fe0c42a0e975
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit ff10db6112861c301fba52c00783fe0c42a0e975
Author: Robert Lyon <email address hidden>
Date: Tue Nov 17 21:30:17 2015 +1300

Bug 1503103: Making sure the correct quota is set

behatnotneeded

Change-Id: I1aa52a076843ff0dc4dcaf86a01e76b9673885b5
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 0a6860a927f7e014343b9dc7ce28e9474f6f3dac)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6414
Committed: https://git.mahara.org/mahara/mahara/commit/ba52fcd5b152e519d1272c635618ce4bb95bef1d
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit ba52fcd5b152e519d1272c635618ce4bb95bef1d
Author: Robert Lyon <email address hidden>
Date: Tue Nov 17 21:30:17 2015 +1300

Bug 1503103: Making sure the correct quota is set

behatnotneeded

Change-Id: I1aa52a076843ff0dc4dcaf86a01e76b9673885b5
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 0a6860a927f7e014343b9dc7ce28e9474f6f3dac)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 15.10.1 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.