diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 2ef8d403..20073003 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -769,7 +769,7 @@ function createuser($values) { // Will create the LDAP-Account addhomedir($values->general_username); } // Add User to Additional Groups - if ($values->general_groupadd) + if ($values->general_groupadd[0]) foreach ($values->general_groupadd as $group2) { $result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup"); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); @@ -1013,7 +1013,7 @@ function createhost($values) { // Will create the LDAP-Account $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); if (!$success) return 4; // Add Host to Additional Groups - if ($values->general_groupadd) + if ($values->general_groupadd[0]) foreach ($values->general_groupadd as $group2) { $result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup"); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); diff --git a/lam/templates/account.php b/lam/templates/account.php index 7e4edff2..ae96a069 100644 --- a/lam/templates/account.php +++ b/lam/templates/account.php @@ -239,7 +239,10 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch break; case 'finish': // Check if pdf-file should be created - if ($_POST['outputpdf']) createpdf($_SESSION['account']); + if ($_POST['outputpdf']) { + createpdf($_SESSION['account']); + $select_local = 'pdf'; + } break; } @@ -284,16 +287,18 @@ if ($_POST['load']) $select_local='load'; if ($_POST['save']) $select_local='save'; -// Write HTML-Header and part of Table -echo "\n"; -echo ""; -echo _("Create new Account"); -echo "\n - \n - \n - \n - "; +if ($select_local != 'pdf') { + // Write HTML-Header and part of Table + echo "\n"; + echo ""; + echo _("Create new Account"); + echo "\n + \n + \n + \n + "; + } switch ($select_local) { // backmain = back to lists @@ -353,10 +358,13 @@ switch ($select_local) { break; } + +if ($select_local != 'pdf') { echo "\n"; echo "
\n"; if ($error != "0") StatusMessage("ERROR", _("Invalid Value!"), $error); echo "\n"; + } switch ($select_local) { // Select which part of page will be loaded @@ -1009,5 +1017,5 @@ switch ($select_local) { // Select which part of page will be loaded } // Print end of HTML-Page -echo '
'; +if ($select_local != 'pdf') echo ''; ?> diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index 80f9eb3c..330e9952 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -38,21 +38,26 @@ if ($_POST['tolist'] && ($_FILES['userfile']['size']>0)) $select = 'list'; if ($_POST['back']) $select = 'main'; if ($_POST['cancel']) $select = 'cancel'; if ($_POST['create']) $select = 'create'; -if ($_POST['pdf']) createpdf($_SESSION['accounts']); +if ($_POST['pdf']) { + createpdf($_SESSION['accounts']); + $select='pdf'; + } if (!$select && !$_SESSION['pointer']) $select='main'; if (!$select && $_SESSION['pointer']) $select='create'; -// Write HTML-Header and part of Table -echo ''; -echo ''; -echo _('Create new Accounts'); -echo ' - - - - '; +if ($select!='pdf') { + // Write HTML-Header and part of Table + echo ''; + echo ''; + echo _('Create new Accounts'); + echo ' + + + + '; + } switch ($select) { case 'cancel': @@ -68,10 +73,12 @@ switch ($select) { break; } -echo ' -
'; +if ($select!='pdf') { + echo ' + '; echo ' - '; + '; + } switch ($select) { case 'main': @@ -228,5 +235,5 @@ switch ($select) { } -echo '
'; +if ($select!='pdf') echo ''; ?>