diff --git a/lam/lib/account.inc b/lam/lib/account.inc index db59ffc4..bfc4c785 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -181,6 +181,7 @@ function checkglobal($values, $type, $values_old=false) { // This functions chec $return->general_gecos = $values->general_givenname . " " . $values->general_surname ; $errors[] = array('INFO', _('Gecos'), _('Inserted sur- and givenname in gecos-field.')); } + if ($values->general_group=='') $errors[] = array('ERROR', _('Primary Group'), _('No primary Group defined!')); // Check if Username contents only valid characters if ( !ereg('^([a-z]|[0-9]|[.]|[-]|[_])*$', $values->general_username)) $errors[] = array('ERROR', _('Username'), _('Username contents invalid characters. Valid characters are: a-z, 0-9 and .-_ !')); @@ -290,7 +291,7 @@ function checkglobal($values, $type, $values_old=false) { // This functions chec if ( !ereg('^[a-z].*$', $values->general_username)) $errors[] = array('ERROR', _('Name'), _('Name contents invalid characters. First character must be a letter')); // Return values and errors - if (!$errors) return array($return, ''); + if (!$errors) return array($return); else return array($return, $errors); } @@ -374,7 +375,7 @@ function checksamba($values, $type) { // This function checks all samba account } else $return->smb_password = ""; // Return values and errors - if (!$errors) return array($return, ''); + if (!$errors) return array($return); else return array($return, $errors); } @@ -401,7 +402,7 @@ function checkquota($values) { // This function checks all quota paramters $i++; } // Return values and errors - if (!$errors) return array($return, ''); + if (!$errors) return array($return); else return array($return, $errors); } diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index ff2b011c..7d857bfc 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -35,6 +35,7 @@ session_save_path('../sess'); $time=time(); if ($_POST['tolist'] && ($_FILES['userfile']['size']>0)) $select = 'list'; +if ($_POST['list']) $select = 'list'; if ($_POST['back']) $select = 'main'; if ($_POST['cancel']) $select = 'cancel'; if ($_POST['create']) $select = 'create'; @@ -84,8 +85,10 @@ switch ($select) { case 'main': if ( session_is_registered("accounts")) session_unregister("accounts"); if ( session_is_registered("pointer")) session_unregister("pointer"); + if ( session_is_registered("errors")) session_unregister("errors"); session_register("accounts"); session_register("pointer"); + session_register("errors"); $_SESSION['pointer']=0; $profilelist = getUserProfiles(); echo '
'; echo ' | '; - echo ' | '; + echo ' | '; + if ($noerrors) { echo ' | '; } + echo ' |