fixed homedir creation on file upload
This commit is contained in:
parent
cb4f1308e3
commit
cea3fdd67b
|
@ -1,10 +1,11 @@
|
|||
December 2010 3.3.0
|
||||
January 2011 3.3.0
|
||||
- additional usability enhancements
|
||||
- new IMAP module ("Mailbox (imapAccess)") allows to create/delete user mailboxes
|
||||
- PDF export: higher resolution for logos
|
||||
- reduced number of LDAP queries
|
||||
- fixed bugs:
|
||||
-> ignore comment lines in shells file (3107124)
|
||||
-> home directory creation on file upload
|
||||
|
||||
|
||||
28.10.2010 3.2.0
|
||||
|
|
|
@ -989,6 +989,7 @@ abstract class baseModule {
|
|||
* @param array $ids maps the column names to keys for the sub arrays (array(<column_name> => <column number>))
|
||||
* @param array $failed list of account numbers which could not be successfully uploaded to LDAP
|
||||
* @param array $temp variable to store temporary data between two post actions
|
||||
* @param array $accounts list of LDAP entries
|
||||
* @return array current status
|
||||
* <br> array (
|
||||
* <br> 'status' => 'finished' | 'inProgress' // defines if all operations are complete
|
||||
|
@ -996,7 +997,7 @@ abstract class baseModule {
|
|||
* <br> 'errors' => array // list of arrays which are used to generate StatusMessages
|
||||
* <br> )
|
||||
*/
|
||||
public function doUploadPostActions($data, $ids, $failed, &$temp) {
|
||||
public function doUploadPostActions(&$data, $ids, $failed, &$temp, &$accounts) {
|
||||
return array(
|
||||
'status' => 'finished',
|
||||
'progress' => 100,
|
||||
|
|
|
@ -492,6 +492,7 @@ function buildUploadAccounts($scope, $data, $ids, $selectedModules) {
|
|||
* @param array $ids array(<column_name> => <column number>)
|
||||
* @param array $failed list of accounts which were not created successfully
|
||||
* @param array $selectedModules list of selected account modules
|
||||
* @param array $accounts list of LDAP entries
|
||||
* @return array current status
|
||||
* <br> array (
|
||||
* <br> 'status' => 'finished' | 'inProgress'
|
||||
|
@ -500,7 +501,7 @@ function buildUploadAccounts($scope, $data, $ids, $selectedModules) {
|
|||
* <br> 'errors' => array (<array of parameters for StatusMessage>)
|
||||
* <br> )
|
||||
*/
|
||||
function doUploadPostActions($scope, $data, $ids, $failed, $selectedModules) {
|
||||
function doUploadPostActions($scope, &$data, $ids, $failed, $selectedModules, &$accounts) {
|
||||
// check if function is called the first time
|
||||
if (! isset($_SESSION['mass_postActions']['remainingModules'])) {
|
||||
// make list of remaining modules
|
||||
|
@ -514,7 +515,7 @@ function doUploadPostActions($scope, $data, $ids, $failed, $selectedModules) {
|
|||
}
|
||||
// let first module do one post action
|
||||
$module = new $activeModule($scope);
|
||||
$return = $module->doUploadPostActions($data, $ids, $failed, $_SESSION['mass_postActions'][$activeModule]);
|
||||
$return = $module->doUploadPostActions($data, $ids, $failed, $_SESSION['mass_postActions'][$activeModule], $accounts);
|
||||
// remove active module from list if already finished
|
||||
if ($return['status'] == 'finished') {
|
||||
unset($_SESSION['mass_postActions']['remainingModules'][0]);
|
||||
|
|
|
@ -1468,6 +1468,7 @@ class posixAccount extends baseModule implements passwordService {
|
|||
* @param array $ids array(<column_name> => <column number>)
|
||||
* @param array $failed list of accounts which were not created successfully
|
||||
* @param array $temp variable to store temporary data between two post actions
|
||||
* @param array $accounts list of LDAP entries
|
||||
* @return array current status
|
||||
* <br> array (
|
||||
* <br> 'status' => 'finished' | 'inProgress'
|
||||
|
@ -1475,7 +1476,7 @@ class posixAccount extends baseModule implements passwordService {
|
|||
* <br> 'errors' => array (<array of parameters for StatusMessage>)
|
||||
* <br> )
|
||||
*/
|
||||
function doUploadPostActions($data, $ids, $failed, &$temp) {
|
||||
function doUploadPostActions(&$data, $ids, $failed, &$temp, &$accounts) {
|
||||
if (!checkIfWriteAccessIsAllowed()) {
|
||||
die();
|
||||
}
|
||||
|
@ -1569,7 +1570,19 @@ class posixAccount extends baseModule implements passwordService {
|
|||
// create home directories
|
||||
elseif ($temp['counter'] < (sizeof($temp['groups']) + sizeof($temp['createHomes']))) {
|
||||
$pos = $temp['createHomes'][$temp['counter'] - sizeof($temp['groups'])];
|
||||
$result = lamdaemon(implode(posixAccount::$SPLIT_DELIMITER, array($data[$pos][$ids['posixAccount_userName']], "home", "add", "0".$_SESSION['config']->get_scriptRights())),
|
||||
$result = lamdaemon(
|
||||
implode(
|
||||
posixAccount::$SPLIT_DELIMITER,
|
||||
array(
|
||||
$data[$pos][$ids['posixAccount_userName']],
|
||||
"home",
|
||||
"add",
|
||||
$accounts[$pos]['homeDirectory'],
|
||||
"0".$_SESSION['config']->get_scriptRights(),
|
||||
$accounts[$pos]['uidNumber'],
|
||||
$accounts[$pos]['gidNumber'],
|
||||
)
|
||||
),
|
||||
$data[$pos][$ids['posixAccount_createHomeDir']]);
|
||||
$errors = array();
|
||||
if (($result != false) && (sizeof($result) == 1)) {
|
||||
|
|
|
@ -688,6 +688,7 @@ class quota extends baseModule {
|
|||
* @param array $ids array(<column_name> => <column number>)
|
||||
* @param array $failed list of accounts which were not created successfully
|
||||
* @param array $temp variable to store temporary data between two post actions
|
||||
* @param array $accounts list of LDAP entries
|
||||
* @return array current status
|
||||
* <br> array (
|
||||
* <br> 'status' => 'finished' | 'inProgress'
|
||||
|
@ -695,7 +696,7 @@ class quota extends baseModule {
|
|||
* <br> 'errors' => array (<array of parameters for StatusMessage>)
|
||||
* <br> )
|
||||
*/
|
||||
function doUploadPostActions($data, $ids, $failed, &$temp) {
|
||||
function doUploadPostActions(&$data, $ids, $failed, &$temp, &$accounts) {
|
||||
$errors = array();
|
||||
// first call, get list of user names and quota values
|
||||
if (!isset($temp['counter'])) {
|
||||
|
|
|
@ -95,7 +95,7 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
|
|||
// do post upload actions
|
||||
if ($_SESSION['mass_counter'] >= sizeof($accounts)) {
|
||||
$data = unserialize($_SESSION['ldap']->decrypt($_SESSION['mass_data']));
|
||||
$return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules']);
|
||||
$return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules'], $accounts);
|
||||
if ($return['status'] == 'finished') {
|
||||
$_SESSION['mass_postActions']['finished'] = true;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
|
|||
echo "</table>";
|
||||
flush();
|
||||
while (!isset($_SESSION['mass_postActions']['finished']) && (($startTime + $maxTime) > time())) {
|
||||
$return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules']);
|
||||
$return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules'], $accounts);
|
||||
if ($return['status'] == 'finished') {
|
||||
$_SESSION['mass_postActions']['finished'] = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue