diff --git a/lam/templates/massBuildAccounts.php b/lam/templates/massBuildAccounts.php
index 2c22014f..9448800c 100644
--- a/lam/templates/massBuildAccounts.php
+++ b/lam/templates/massBuildAccounts.php
@@ -86,8 +86,8 @@ if (isset($_GET['showldif'])) {
include 'main_header.php';
echo '
';
+$selectedModules = explode(',', $_POST['selectedModules']);
if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
- $selectedModules = explode(',', $_POST['selectedModules']);
// check if input file is well formated
$data = array(); // input values without first row
$ids = array(); //
=>
@@ -201,14 +201,37 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
echo "" . _("Show LDIF file") . "";
}
}
+ else {
+ massPrintBackButton($_POST['scope'], $selectedModules);
+ }
}
}
else {
StatusMessage('ERROR', _('Please provide a file to upload.'));
- echo '
' . _('Back') . '';
+ massPrintBackButton($_POST['scope'], $selectedModules);
}
echo ' ';
include 'main_footer.php';
+/**
+ * Prints a back button to the page where the user enters a file to upload.
+ *
+ * @param String $scope account type (e.g. user)
+ * @param array $selectedModules selected modules for upload
+ */
+function massPrintBackButton($scope, $selectedModules) {
+ echo '