diff --git a/lam/templates/account.php b/lam/templates/account.php index 2ae2dfa0..c11ac661 100644 --- a/lam/templates/account.php +++ b/lam/templates/account.php @@ -479,7 +479,9 @@ switch ($select_local) { echo '>'; break; case 'host' : - echo ''; + echo ''; echo ''; echo _('Password'); echo ''; diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index fd4aac9f..23bebaf0 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -45,14 +45,18 @@ echo ' echo ''; +if ($_POST['tolist']) $select = 'list'; +if ($_POST['back']) $select = 'main'; +if ($_POST['cancel']) $select = 'cancel'; +if ($_POST['create']) $select = 'create'; +if ($_POST['pdf']) createpdf($_SESSION['accounts']); if (!$select) $select='main'; + switch ($select) { case 'main': // if session was started previos, the existing session will be continued $profilelist = getUserProfiles(); - if ( !session_is_registered("accounts")) session_register("accounts"); - if (!is_object($accounts)) $accounts = array(); echo ''; echo ' - '; break; case 'list': + if ( session_is_registered("accounts")) session_unregister("accounts"); + session_register("accounts"); + if (!is_array($accounts)) $accounts = array(); $handler = fopen($_FILES['userfile']->tmp_name, 'r'); $error=false; - echo ''; echo ''; @@ -154,21 +160,32 @@ switch ($select) { echo '
'; echo _('Mass Creation'); @@ -75,13 +79,15 @@ switch ($select) { '; echo _('Select file:'); echo '
'; +
'; echo '
'; echo _('Confirm List'); echo '
'; break; case 'cancel': - echo ''; - + echo ''; break; case 'create': - echo ''; - - break; - case 'finish': - echo ''; - - break; - case 'pdf': - echo ''; - - break; + $row=0; + while ($row < sizeof($_SESSION['accounts'] $row!=-1) { + if (getgid($_SESSION['accounts'][$row]->general_group)==-1) { + $group = new account(); + $group->general_username=$_SESSION['accounts'][$row]->general_group; + $group->general_uidNumber=checkid($_SESSION['accounts'][$row], 'group'); + $group->general_gecos=$_SESSION['accounts'][$row]->general_group; + creategroup($_SESSION['accounts'][$row]); + } + $error = createuser($_SESSION['accounts'][$row]); + if ($error==1) $row++; + else { + $row = -1; + StatusMessage('ERROR', _('Could not create user'), _('Was unable to create ').$_SESSION['accounts'][$row]->general_username); + } + if ($row=-1) echo '
'; + else { + echo '
'; + echo _('All Users have been created'); + echo '
'; + echo '
'; + echo '
'; + break; }