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 '
'; + $container = new htmlTable(); + $container->addElement(new htmlSpacer(null, '10px'), true); + $container->addElement(new htmlButton('submit', _('Back'))); + $container->addElement(new htmlHiddenInput('type', $scope)); + for ($i = 0; $i < sizeof($selectedModules); $i++) { + $container->addElement(new htmlHiddenInput($scope . '_' . $selectedModules[$i], 'on')); + } + $tabindex = 1; + parseHtml(null, $container, array(), false, $tabindex, $scope); + echo '
'; +} + ?> \ No newline at end of file