Commit 49a71292 authored by Lisa Seeto's avatar Lisa Seeto Committed by Robert Lyon

Bug 1843537: CSV-Upload Users redirecting to invalid url for subdirectory mahara

- added get_config(wwwroot) to redirect url on form success
- changed SESSION msg and redirect to a form reply with error code

behatnotneeded

Change-Id: I5a8a9e3b9450b5c9c44495811948eca1f52e56cd
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent 2896d506
...@@ -495,8 +495,10 @@ function uploadcsv_submit(Pieform $form, $values) { ...@@ -495,8 +495,10 @@ function uploadcsv_submit(Pieform $form, $values) {
SELECT COUNT(*) FROM {usr} u INNER JOIN {usr_institution} i ON u.id = i.usr SELECT COUNT(*) FROM {usr} u INNER JOIN {usr_institution} i ON u.id = i.usr
WHERE i.institution = ? AND u.deleted = 0', array($institution->name)); WHERE i.institution = ? AND u.deleted = 0', array($institution->name));
if ($members + count($CSVDATA) > $maxusers) { if ($members + count($CSVDATA) > $maxusers) {
$SESSION->add_error_msg(get_string('uploadcsvfailedusersexceedmaxallowed', 'admin')); $form->reply(PIEFORM_ERR, array(
redirect('/admin/users/uploadcsv.php'); 'message' => get_string('uploadcsvfailedusersexceedmaxallowed', 'admin'),
'goto' => '/admin/users/uploadcsv.php',
));
} }
} }
...@@ -651,7 +653,7 @@ function uploadcsv_submit(Pieform $form, $values) { ...@@ -651,7 +653,7 @@ function uploadcsv_submit(Pieform $form, $values) {
$form->reply(PIEFORM_OK, array( $form->reply(PIEFORM_OK, array(
'message' => get_string('csvfileprocessedsuccessfully', 'admin'), 'message' => get_string('csvfileprocessedsuccessfully', 'admin'),
'goto' => '/admin/users/uploadcsv.php', 'goto' => get_config('wwwroot').'admin/users/uploadcsv.php',
)); ));
} }
......
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