Commit 661ba1ad authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Leap2a file being bigger than upload_max_filesize bad error (bug #525632)

- when the importing of a too big leap2a file the form error message
was wrong

- have got it to give the 'file too big' message

Change-Id: Ied2770b057a4fd7c51cc71db98e43808139b5985
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent fb15e4d8
...@@ -221,8 +221,14 @@ function adduser_validate(Pieform $form, $values) { ...@@ -221,8 +221,14 @@ function adduser_validate(Pieform $form, $values) {
$form->set_error('firstname', null); $form->set_error('firstname', null);
$form->set_error('lastname', null); $form->set_error('lastname', null);
$form->set_error('email', null); $form->set_error('email', null);
if (!$values['leap2afile'] && ($_FILES['leap2afile']['error'] == UPLOAD_ERR_INI_SIZE || $_FILES['leap2afile']['error'] == UPLOAD_ERR_FORM_SIZE)) {
if (!$values['leap2afile']) { $form->reply(PIEFORM_ERR, array(
'message' => get_string('uploadedfiletoobig'),
'goto' => '/admin/users/add.php'));
$form->set_error('leap2afile', get_string('uploadedfiletoobig'));
else if (!$values['leap2afile']) {
$form->set_error('leap2afile', $form->i18n('rule', 'required', 'required')); $form->set_error('leap2afile', $form->i18n('rule', 'required', 'required'));
return; return;
} }
Supports Markdown
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