diff --git a/lam/lib/account.inc b/lam/lib/account.inc index cb0c02b8..0f459075 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -1686,9 +1686,9 @@ function creategroup($values) { // Will create the LDAP-Group $attr['gidNumber'] = $values->general_uidNumber; $attr['description'] = $values->general_gecos; if ($values->general_memeberUid) $attr['memberUid'] = $values->general_memberUid; - if ($_SESSION['config']->samba3 =='yes') { - $attr['objectClass'][1] = 'sambaGroupMapping'; + if ($_SESSION['config']->samba3 =='yes' && (isset($values->smb_mapgroup))) { $attr['sambaSID'] = $values->smb_mapgroup; + $attr['objectClass'][1] = 'sambaGroupMapping'; $attr['sambaGroupType'] = '2'; if ($values->general_gecos) $attr['displayName'] = $values->general_gecos; } diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index c97c7a96..178a1462 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -35,285 +35,331 @@ session_save_path('../sess'); setlanguage(); $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'; -if ($_POST['pdf']) { - createUserPDF($_SESSION['accounts']); - $select='pdf'; +if (count($_POST)==0) { + if (isset($_GET['list2'])) $select = 'list2'; + else if (isset($_GET['create'])) $select='create'; + else $select='main'; + } +else { + if ($_POST['tolist'] && ($_FILES['userfile']['size']>0)) $select = 'list'; + else if ($_POST['list2']) $select = 'list2'; + else if ($_POST['back']) $select = 'main'; + else if ($_POST['cancel']) $select = 'cancel'; + else if ($_POST['create']) $select = 'create'; + else if ($_POST['pdf']) { + createUserPDF($_SESSION['accounts']); + $select='pdf'; + } } -if (!$select && !$_SESSION['pointer']) $select='main'; -if (!$select && $_SESSION['pointer']) $select='create'; - if ($select!='pdf') { // Write HTML-Header and part of Table echo $_SESSION['header']; echo ''; echo _('Create new Accounts'); - echo ''. - ''. - ''. - ''; - } - -switch ($select) { - case 'cancel': - if ( isset($_SESSION['accounts'])) unset($_SESSION['accounts']); - if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); - if ( isset($_SESSION['errors'])) unset($_SESSION['errors']); - echo ''; - break; - case 'create': - if ($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) { - $refresh = get_cfg_var('max_execution_time')-5; - echo ''; - } - break; - } - -if ($select!='pdf') { - echo ''. - '
'; - echo ''. - ''; - } - -switch ($select) { - case 'main': - if ( isset($_SESSION['accounts'])) unset($_SESSION['accounts']); - if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); - if ( isset($_SESSION['errors'])) unset($_SESSION['errors']); - $_SESSION['pointer']=0; - $profilelist = getUserProfiles(); - echo ''."\n".''. - ''; - break; - case 'list': - if (!is_array($accounts)) $accounts = array(); - $groups = array(); - echo ''; - if ($_FILES['userfile']['size']>0) { - $handle = fopen($_FILES['userfile']['tmp_name'], 'r'); - $profile = loadUserProfile($_POST['f_selectprofile']) ; - for ($row=0; $line_array=fgetcsv($handle,2048); $row++) { // loops for every row - $iv = base64_decode($_COOKIE["IV"]); - $key = base64_decode($_COOKIE["Key"]); - $_SESSION['accounts'][$row] = $profile; - $_SESSION['accounts'][$row]->general_dn = $_POST['f_general_suffix']; - if ($line_array[0]) $_SESSION['accounts'][$row]->general_surname = $line_array[0]; - if ($line_array[1]) $_SESSION['accounts'][$row]->general_givenname = $line_array[1]; - if ($line_array[2]) $_SESSION['accounts'][$row]->general_username = $line_array[2]; - if ($line_array[3]) $_SESSION['accounts'][$row]->general_group = $line_array[3]; - if ($line_array[4]) $_SESSION['accounts'][$row]->personal_title = $line_array[4]; - if ($line_array[5]) $_SESSION['accounts'][$row]->personal_mail = $line_array[5]; - if ($line_array[6]) $_SESSION['accounts'][$row]->personal_telephoneNumber = $line_array[6]; - if ($line_array[7]) $_SESSION['accounts'][$row]->personal_mobileTelephoneNumber = $line_array[7]; - if ($line_array[8]) $_SESSION['accounts'][$row]->personal_facsimileTelephoneNumber = $line_array[8]; - if ($line_array[9]) $_SESSION['accounts'][$row]->personal_street = $line_array[9]; - if ($line_array[10]) $_SESSION['accounts'][$row]->personal_postalCode = $line_array[10]; - if ($line_array[11]) $_SESSION['accounts'][$row]->personal_postalAddress = $line_array[11]; - if ($line_array[12]) $_SESSION['accounts'][$row]->personal_employeeType = $line_array[12]; - $_SESSION['accounts'][$row]->unix_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, - $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); - $_SESSION['accounts'][$row]->smb_password=$_SESSION['accounts'][$row]->unix_password; - } - } - for ($row=0; $row$key = $val; - $_SESSION['accounts'][$row]->general_uidNumber=""; - } - $error = checkunix($_SESSION['accounts'][$row], 'user'); // account.inc - $_SESSION['errors'][$row] = array_merge($_SESSION['errors'][$row], $error); - list($values, $error) = checksamba($_SESSION['accounts'][$row], 'user'); // account.inc - if (is_object($values)) { - while (list($key, $val) = each($values)) // Set only defined values - if ($val) $_SESSION['accounts'][$row]->$key = $val; - } - $_SESSION['errors'][$row] = array_merge($_SESSION['errors'][$row], $error); - list($values, $error) = checkquota($_SESSION['accounts'][$row], 'user'); // account.inc - if (is_object($values)) { - while (list($key, $val) = each($values)) // Set only defined values - if ($val) $_SESSION['accounts'][$row]->$key = $val; - } - $_SESSION['errors'][$row] = array_merge($_SESSION['errors'][$row], $error); - list($values, $error) = checkpersonal($_SESSION['accounts'][$row], 'user'); // account.inc - if (is_object($values)) { - while (list($key, $val) = each($values)) // Set only defined values - if ($val) $_SESSION['accounts'][$row]->$key = $val; - } - $_SESSION['errors'][$row] = array_merge($_SESSION['errors'][$row], $error); - } - for ($i=0; $igeneral_group!='') - StatusMessage('INFO', _('Group').' '. - $_SESSION['accounts'][$i]->general_group.' '._('not found!'), _('It will be created.')); - if ($_FILES['userfile']['size']>0) { - fclose($handle); - unlink($_FILES['userfile']['tmp_name']); - } - echo ''; - for ($row=0; $row'; - - } - $noerrors=true; - for ($i=0; $i'; - if (!$noerrors) { echo ''; } - if (!$nowarn) { echo ''; } - echo '
'; - echo _('Mass Creation'); - echo '
'; - echo _('Please provide a csv-file with the following syntax. Values with * are required:'); - echo '
'; - echo _('Surname*,Givenname*,Username*,PrimaryGroup,Title,Mail,telephonenumber,'); - echo '
'; - echo _('mobileTelephoneNumber,facsimileNumber,street,postalCode,postalAddress,'); - echo '
'; - echo _('employeeType. If Primary group is not given it\'ll used from profile.'); - echo '
'; - echo _('If PrimaryGroup does not exist it will be created.'); - echo '
'; - echo _('Select Profile:'); - echo ''; - echo '
'; - echo _('Suffix'); echo ''._('Help').''. - '
'. - ''; - echo _('Select file:'); - echo '
'; - echo '
'; - echo _('Confirm List'); - echo '
'._('row').''. _('Surname'). ''. _('Given name'). ''. _('User name'). ''. _('Primary group'). ''. - _('Details'). '' . _('Warnings'). '' . _('Errors') . '
'.$row.''. - $_SESSION['accounts'][$row]->general_surname.''. - $_SESSION['accounts'][$row]->general_givenname.''. - $_SESSION['accounts'][$row]->general_username.''. - $_SESSION['accounts'][$row]->general_group.''. - ''._('Show Details.').''; - for ($i=$row+1; $igeneral_username == $_SESSION['accounts'][$i]->general_username) { // Found user with same name - // Set Info - $_SESSION['errors'][$i][] = array('INFO', _('Warning'), _('Username in use. Selected next free username')); - // get last character of username - $lastchar = substr($_SESSION['accounts'][$i]->general_username, strlen($_SESSION['accounts'][$i]->general_username)-1, 1); - // Last character is no number - if ( !ereg('^([0-9])+$', $lastchar)) - $_SESSION['accounts'][$i]->general_username = $_SESSION['accounts'][$i]->general_username . '2'; - else { - $j=strlen($_SESSION['accounts'][$i]->general_username)-1; - $mark = false; - while (!$mark) { - if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$i]->general_username, $j, strlen($_SESSION['accounts'][$i]->general_username)-$j))) $j--; - else $mark=true; - } - // increase last number with one - $firstchars = substr($_SESSION['accounts'][$i]->general_username, 0, $j+1); - $lastchars = substr($_SESSION['accounts'][$i]->general_username, $j+1, strlen($_SESSION['accounts'][$i]->general_username)-$j); - $_SESSION['accounts'][$i]->general_username = $firstchars . (intval($lastchars)+1); - } - while ($temp = ldapexists($_SESSION['accounts'][$i], 'user')) { - // get last character of username - $lastchar = substr($_SESSION['accounts'][$i]->general_username, strlen($_SESSION['accounts'][$i]->general_username)-1, 1); - // Last character is no number - if ( !ereg('^([0-9])+$', $lastchar)) - $_SESSION['accounts'][$i]->general_username = $_SESSION['accounts'][$i]->general_username . '2'; - else { - $j=strlen($_SESSION['accounts'][$i]->general_username)-1; - $mark = false; - while (!$mark) { - if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$i]->general_username, $j, strlen($_SESSION['accounts'][$i]->general_username)-$j))) $i--; - else $mark=true; - } - // increase last number with one - $firstchars = substr($_SESSION['accounts'][$i]->general_username, 0, $j+1); - $lastchars = substr($_SESSION['accounts'][$i]->general_username, $j+1, strlen($_SESSION['accounts'][$i]->general_username)-$j); - $_SESSION['accounts'][$i]->general_username = $firstchars . (intval($lastchars)+1); - } - } - } - } - if ($values->general_username != $return->general_username) $errors[] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); - $found=false; - for ($i=0; $i'._('Show Warnings.').''; - echo ''; - $found=false; - for ($i=0; $i'._('Show Errors.').''; - echo '
'. _('There are some errors.') . '
'. _('There are some warnings.') . '

'. - ''; - break; - case 'create': - $stay=true; - while (($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) && $stay) { - if (getgid($_SESSION['accounts'][$_SESSION['pointer']]->general_group)==-1) { - $group = new account(); - $group->general_username=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; - $group->general_uidNumber=checkid($_SESSION['accounts'][$_SESSION['pointer']], 'group'); - $group->general_gecos=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; - creategroup($group); - } - $_SESSION['accounts'][$_SESSION['pointer']]->general_uidNumber = checkid($_SESSION['accounts'][$_SESSION['pointer']], 'user'); - $iv = base64_decode($_COOKIE["IV"]); - $key = base64_decode($_COOKIE["Key"]); - $_SESSION['accounts'][$_SESSION['pointer']]->unix_password = base64_encode(mcrypt_encrypt( - MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); - $_SESSION['accounts'][$_SESSION['pointer']]->smb_password = $_SESSION['accounts'][$_SESSION['pointer']]->unix_password; - if ( (time()-$time)<(get_cfg_var('max_execution_time')-10)) { - $error = createuser($_SESSION['accounts'][$_SESSION['pointer']]); - if ($error==1) $_SESSION['pointer']++; - else { - $stay = false; - StatusMessage('ERROR', _('Could not create user!'), sprintf (_('Was unable to create %s.'), $_SESSION['accounts'][$row]->general_username)); - } - } - else $stay=false; - } - if (!$stay) { echo ''; } - else { - echo ''; + echo ''."\n". + ''."\n". + ''."\n". + ''."\n"; + switch ($select) { + case 'cancel': + if ( isset($_SESSION['accounts'])) unset($_SESSION['accounts']); if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); if ( isset($_SESSION['errors'])) unset($_SESSION['errors']); - } - break; + echo ''."\n". + ''."\n". + ''."\n". + '
'; - echo ''; - echo ''; - if ($noerrors) { echo ''; } - echo '
'. - ''._('Please wait until all users are created if no error is shown.').'
'; - echo _('All Users have been created'); - echo '
'; - echo '
'; - echo ''; - echo '
'. + ''."\n"; + break; + case 'create': + if ($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) { + $refresh = get_cfg_var('max_execution_time')-5; + echo ''."\n"; + } + echo ''."\n". + ''."\n". + '
'. + ''."\n"; + echo ''."\n"; + $stay=true; + while (($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) && $stay) { + if ($_SESSION['accounts'][$_SESSION['pointer']]->general_username!='') { + if (getgid($_SESSION['accounts'][$_SESSION['pointer']]->general_group)==-1) { + $group = new account(); + $group->general_username=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; + $group->general_uidNumber=checkid($_SESSION['accounts'][$_SESSION['pointer']], 'group'); + $group->general_gecos=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; + $group->general_dn=$_SESSION['config']->get_GroupSuffix(); + creategroup($group); + } + $_SESSION['accounts'][$_SESSION['pointer']]->general_uidNumber = checkid($_SESSION['accounts'][$_SESSION['pointer']], 'user'); + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $_SESSION['accounts'][$_SESSION['pointer']]->unix_password = base64_encode(mcrypt_encrypt( + MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_password = $_SESSION['accounts'][$_SESSION['pointer']]->unix_password; + if ( (time()-$time)<(get_cfg_var('max_execution_time')-10)) { + $error = createuser($_SESSION['accounts'][$_SESSION['pointer']]); + if ($error==1) { + $_SESSION['pointer']++; + echo ''."\n"; + } + else { + $stay = false; + StatusMessage('ERROR', _('Could not create user!'), sprintf (_('Was unable to create %s.'), $_SESSION['accounts'][$row]->general_username)); + } + } + else $stay=false; + } + else $_SESSION['pointer']++; + } + if (!$stay) { + echo ''."\n"; + echo ''; + } + else { + echo ''."\n".''."\n"; + if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); + if ( isset($_SESSION['errors'])) unset($_SESSION['errors']); + } + break; + case 'list': + if (!is_array($accounts)) $accounts = array(); + $groups = array(); + if (loadfile()) { + echo ''."\n". + ''."\n". + ''."\n". + '
'; + echo _('Creating users. Please stand by.'); + echo '
'; + sprintf (_('Created user %s.'), $_SESSION['accounts'][$_SESSION['pointer']]->general_username); + echo '
'; + echo _('Please press here if meta-refresh didn\'t work.'); + echo '
'; + echo _('All Users have been created'); + echo '
'; + echo '
'; + echo ''; + echo '
'. + '\n"; + } + else { + //echo ''."\n". + echo ''."\n". + ''."\n". + '
'; + echo _('Please press here if meta-refresh didn\'t work.'); + echo "
'. + ''."\n"; + echo '\n"; + } + break; + case 'list2': + echo ''."\n". + ''."\n". + '
'; + echo _('Max 400 users allowed. Ignored additional users.'); + echo '
'; + echo _('Cancel'); + echo ''; + echo _('Contiune'); + echo "
'. + ''."\n". + ''."\n"; + for ($i=0; $igeneral_group!='') + StatusMessage('INFO', _('Group').' '. + $_SESSION['accounts'][$i]->general_group.' '._('not found!'), _('It will be created.')); + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + if (!isset($_SESSION['rowstart'])) $_SESSION['rowstart'] = 0; + //if (sizeof($_SESSION['accounts'])<($_SESSION['rowstart']+10)) $end = sizeof($_SESSION['accounts']); + // else $end = $_SESSION['rowstart']+10; + $end = sizeof($_SESSION['accounts']); + for ($row=0; $row<$end; $row++) { // loops for every row + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + } + $noerrors=true; + for ($i=0; $i'; + if (!$noerrors) { echo ''."\n"; } + if (!$nowarn) { echo ''."\n"; } + echo '
'; + echo _('Confirm List'); + echo '
'._('row').''. _('Surname'). ''. _('Given name'). ''. _('User name'). ''. _('Primary group'). ''. + _('Details'). '' . _('Infos'). '' . _('Warnings'). '' . _('Errors') . '
'.$row.''. + $_SESSION['accounts'][$row]->general_surname.''. + $_SESSION['accounts'][$row]->general_givenname.''. + $_SESSION['accounts'][$row]->general_username.''. + $_SESSION['accounts'][$row]->general_group.''. + ''._('Show Details.').''; + $found=false; + for ($i=0; $i'._('Show Infos.').''; + echo ''; + $found=false; + for ($i=0; $i'._('Show Warnings.').''; + echo ''; + $found=false; + for ($i=0; $i'._('Show Errors.').''; + echo '
'. _('There are some errors.') . '
'. _('There are some warnings.') . '

'. + ''."\n"; + break; + case 'main': + if ( isset($_SESSION['accounts'])) unset($_SESSION['accounts']); + if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); + if ( isset($_SESSION['errors'])) unset($_SESSION['errors']); + $_SESSION['pointer']=0; + $profilelist = getUserProfiles(); + echo ''."\n". + ''."\n". + '
'; + if ($noerrors) { echo ''; } + echo '
'. + ''."\n". + ''."\n".''."\n".''."\n". + ''."\n"; + break; + } + echo '
'; + echo _('Mass Creation'); + echo '
'."\n"; + echo _('Please provide a csv-file with the following syntax. Values with * are required:'); + echo '
'."\n"; + echo _('Surname*,Givenname*,Username*,PrimaryGroup,Title,Mail,telephonenumber,'); + echo '
'."\n"; + echo _('mobileTelephoneNumber,facsimileNumber,street,postalCode,postalAddress,'); + echo '
'."\n"; + echo _('employeeType. If Primary group is not given it\'ll used from profile.'); + echo '
'."\n"; + echo _('If PrimaryGroup does not exist it will be created.'); + echo '
'."\n"; + echo _('Select Profile:'); + echo ''. + '
'; + echo _('Suffix'); echo ''._('Help').''. + '
'."\n". + ''; + echo _('Select file:'); + echo '
'."\n". + '
'; + } + + + +function loadfile() { + if ($_FILES['userfile']['size']>0) { + $handle = fopen($_FILES['userfile']['tmp_name'], 'r'); + $profile = loadUserProfile($_POST['f_selectprofile']) ; + for ($row=0; $line_array=fgetcsv($handle,2048); $row++) { // loops for every row + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $_SESSION['accounts'][$row] = $profile; + $_SESSION['accounts'][$row]->general_dn = $_POST['f_general_suffix']; + if ($line_array[0]) $_SESSION['accounts'][$row]->general_surname = $line_array[0]; + if ($line_array[1]) $_SESSION['accounts'][$row]->general_givenname = $line_array[1]; + if ($line_array[2]) $_SESSION['accounts'][$row]->general_username = $line_array[2]; + if ($line_array[3]) $_SESSION['accounts'][$row]->general_group = $line_array[3]; + if ($line_array[4]) $_SESSION['accounts'][$row]->personal_title = $line_array[4]; + if ($line_array[5]) $_SESSION['accounts'][$row]->personal_mail = $line_array[5]; + if ($line_array[6]) $_SESSION['accounts'][$row]->personal_telephoneNumber = $line_array[6]; + if ($line_array[7]) $_SESSION['accounts'][$row]->personal_mobileTelephoneNumber = $line_array[7]; + if ($line_array[8]) $_SESSION['accounts'][$row]->personal_facsimileTelephoneNumber = $line_array[8]; + if ($line_array[9]) $_SESSION['accounts'][$row]->personal_street = $line_array[9]; + if ($line_array[10]) $_SESSION['accounts'][$row]->personal_postalCode = $line_array[10]; + if ($line_array[11]) $_SESSION['accounts'][$row]->personal_postalAddress = $line_array[11]; + if ($line_array[12]) $_SESSION['accounts'][$row]->personal_employeeType = $line_array[12]; + $_SESSION['accounts'][$row]->unix_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, + $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); + $_SESSION['accounts'][$row]->smb_password=$_SESSION['accounts'][$row]->unix_password; + } + } + for ($row2=0; $row2general_username == $_SESSION['accounts'][$i]->general_username) { // Found user with same name + // get last character of username + if (!is_numeric($_SESSION['accounts'][$i]->general_username{strlen($_SESSION['accounts'][$i]->general_username)-1})) + $_SESSION['accounts'][$i]->general_username = $_SESSION['accounts'][$i]->general_username . '2'; + else { + // Get interger-end of string hello456 -> hello + 456 + $start = strlen($_SESSION['accounts'][$i]->general_username)-1; + while (is_numeric(substr($_SESSION['accounts'][$i]->general_username, $start))) $start--; + // Increse rusultung number + $first = substr($_SESSION['accounts'][$i]->general_username, 0, $start+1); + $second = intval(substr($_SESSION['accounts'][$i]->general_username, $start+1))+1; + $_SESSION['accounts'][$i]->general_username = $first . $second; + } + while ($temp = ldapexists($_SESSION['accounts'][$i], 'user')) { + // Get interger-end of string hello456 -> hello + 456 + $start = strlen($_SESSION['accounts'][$i]->general_username)-1; + while (is_numeric(substr($_SESSION['accounts'][$i]->general_username, $start))) $start--; + // Increse rusultung number + $first = substr($_SESSION['accounts'][$i]->general_username, 0, $start+1); + $second = intval(substr($_SESSION['accounts'][$i]->general_username, $start+1))+1; + $_SESSION['accounts'][$i]->general_username = $first . $second; + } + } + } + if ($values->general_username != $return->general_username) $error[] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + list($values, $error) = checkglobal($_SESSION['accounts'][$row2], 'user'); // account.inc + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if ($val) $_SESSION['accounts'][$row2]->$key = $val; + $_SESSION['accounts'][$row2]->general_uidNumber=""; + } + $error = checkunix($_SESSION['accounts'][$row2], 'user'); // account.inc + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + list($values, $error) = checksamba($_SESSION['accounts'][$row2], 'user'); // account.inc + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if ($val) $_SESSION['accounts'][$row2]->$key = $val; + } + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + list($values, $error) = checkquota($_SESSION['accounts'][$row2], 'user'); // account.inc + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if ($val) $_SESSION['accounts'][$row2]->$key = $val; + } + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + list($values, $error) = checkpersonal($_SESSION['accounts'][$row2], 'user'); // account.inc + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if ($val) $_SESSION['accounts'][$row2]->$key = $val; + } + $_SESSION['errors'][$row2] = array_merge($_SESSION['errors'][$row2], $error); + } + } + if ($_FILES['userfile']['size']>0) { + fclose($handle); + unlink($_FILES['userfile']['tmp_name']); + } + if ($row2>400) return false; + else return true; } -if ($select!='pdf') echo ''; ?> diff --git a/lam/templates/massdetail.php b/lam/templates/massdetail.php index 912f39b2..b60e40e9 100644 --- a/lam/templates/massdetail.php +++ b/lam/templates/massdetail.php @@ -87,11 +87,16 @@ switch ($select) { if ($_SESSION['errors'][$row][$i][0] == 'ERROR') StatusMessage('ERROR', _('Invalid Value!'), $_SESSION['errors'][$row][$i][2]); break; - case 'warn': + case 'info': for ($i=0; $i'; echo _('Surname').'*';