Commit be35290d authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Enforce max quota when adding users

Bug #783695

Change-Id: I233e4e15e14f5673bd183c4602f1380219628ab8
Signed-off-by: default avatarHugh Davenport <>
parent bdb9fe83
......@@ -175,6 +175,12 @@ function adduser_validate(Pieform $form, $values) {
$email = $values['email'];
$password = $values['password'];
$maxquotaenabled = get_config_plugin('artefact', 'file', 'maxquotaenabled');
$maxquota = get_config_plugin('artefact', 'file', 'maxquota');
if ($maxquotaenabled && $values['quota'] > $maxquota) {
$form->set_error('quota', get_string('maxquotaexceededform', 'artefact.file', display_size($maxquota)));
if (method_exists($authobj, 'is_username_valid_admin')) {
if (!$authobj->is_username_valid_admin($username)) {
$form->set_error('username', get_string('usernameinvalidadminform', 'auth.internal'));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment