reduced upload code

This commit is contained in:
Roland Gruber 2014-04-13 16:59:56 +00:00
parent 65d47fee7c
commit 5ece0c8391
2 changed files with 8 additions and 30 deletions

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2013 Roland Gruber Copyright (C) 2013 - 2014 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -467,25 +467,11 @@ class kolabSharedFolder extends baseModule { // TODO folder type
// cn // cn
$partialAccounts[$i]['cn'] = $rawAccounts[$i][$ids['kolabSharedFolder_cn']]; $partialAccounts[$i]['cn'] = $rawAccounts[$i][$ids['kolabSharedFolder_cn']];
// mail // mail
if (!get_preg($rawAccounts[$i][$ids['kolabSharedFolder_mail']], 'email')) { $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'kolabSharedFolder_mail', 'mail',
$errMsg = $this->messages['mail'][1]; 'email', $this->messages['mail'][1], $messages);
array_push($errMsg, array($i));
$messages[] = $errMsg;
}
else {
$partialAccounts[$i]['mail'] = $rawAccounts[$i][$ids['kolabSharedFolder_mail']];
}
// mailbox server // mailbox server
if (!empty($rawAccounts[$i][$ids['kolabSharedFolder_mailHost']])) { $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'kolabSharedFolder_mailHost', 'mailHost',
if (get_preg($rawAccounts[$i][$ids['kolabSharedFolder_mailHost']], 'DNSname')) { 'DNSname', $this->messages['mailHost'][1], $messages);
$partialAccounts[$i]['mailHost'] = $rawAccounts[$i][$ids['kolabSharedFolder_mailHost']];
}
else {
$errMsg = $this->messages['mailHost'][1];
array_push($errMsg, array($i));
$messages[] = $errMsg;
}
}
// target folder // target folder
$partialAccounts[$i]['kolabTargetFolder'] = $rawAccounts[$i][$ids['kolabSharedFolder_kolabTargetFolder']]; $partialAccounts[$i]['kolabTargetFolder'] = $rawAccounts[$i][$ids['kolabSharedFolder_kolabTargetFolder']];
// folder type // folder type

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2004 - 2013 Roland Gruber Copyright (C) 2004 - 2014 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -610,16 +610,8 @@ class kolabUser extends baseModule {
$partialAccounts[$i]['objectClass'][] = "mailrecipient"; $partialAccounts[$i]['objectClass'][] = "mailrecipient";
} }
// mailbox server // mailbox server
if ($rawAccounts[$i][$ids['kolabUser_mailHost']] != "") { $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'kolabUser_mailHost', 'mailHost',
if (get_preg($rawAccounts[$i][$ids['kolabUser_mailHost']], 'DNSname')) { 'DNSname', $this->messages['mailHost'][1], $messages);
$partialAccounts[$i]['mailHost'] = $rawAccounts[$i][$ids['kolabUser_mailHost']];
}
else {
$errMsg = $this->messages['mailHost'][1];
array_push($errMsg, array($i));
$messages[] = $errMsg;
}
}
// mailbox quota // mailbox quota
if (!empty($rawAccounts[$i][$ids['kolabUser_mailQuota']])) { if (!empty($rawAccounts[$i][$ids['kolabUser_mailQuota']])) {
if (get_preg($rawAccounts[$i][$ids['kolabUser_mailQuota']], 'digit')) { if (get_preg($rawAccounts[$i][$ids['kolabUser_mailQuota']], 'digit')) {