Commit 6eb1507f authored by Robert Lyon's avatar Robert Lyon Committed by Son Nguyen

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 <robertl@catalyst.net.nz>
parent bd33b9c8
......@@ -221,8 +221,14 @@ function adduser_validate(Pieform $form, $values) {
$form->set_error('firstname', null);
$form->set_error('lastname', null);
$form->set_error('email', null);
if (!$values['leap2afile']) {
if (!$values['leap2afile'] && ($_FILES['leap2afile']['error'] == UPLOAD_ERR_INI_SIZE || $_FILES['leap2afile']['error'] == UPLOAD_ERR_FORM_SIZE)) {
$form->reply(PIEFORM_ERR, array(
'message' => get_string('uploadedfiletoobig'),
'goto' => '/admin/users/add.php'));
$form->set_error('leap2afile', get_string('uploadedfiletoobig'));
return;
}
else if (!$values['leap2afile']) {
$form->set_error('leap2afile', $form->i18n('rule', 'required', 'required'));
return;
}
......
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