new type API

This commit is contained in:
Roland Gruber 2017-05-20 11:46:49 +02:00
parent b57cdea3fc
commit 851f8b5bb7
39 changed files with 150 additions and 321 deletions

View File

@ -20,6 +20,7 @@
@ -70,9 +71,11 @@ This is a list of API changes for all LAM releases.
<li>getManagedAttributes()</li> <li>getManagedAttributes()</li>
<li>getLDAPAliases() <br> <li>getLDAPAliases() <br>
</li> </li>
<li>get_uploadColumns()<br> <li>get_uploadColumns()</li>
<li>build_uploadAccounts()<br>
</li> </li>
</ul> </ul>
<li>baseType-&gt;doUploadPostActions(): new parameter $selectedModules<br> <li>baseType-&gt;doUploadPostActions(): new parameter $selectedModules<br>
</li> </li>

View File

@ -894,9 +894,10 @@ abstract class baseModule {
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5) * @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP * @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules * @param array $selectedModules list of selected account modules
* @param ConfiguredType $type account type
* @return array list of error messages if any * @return array list of error messages if any
*/ */
public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
// must be implemented in sub modules // must be implemented in sub modules
return array(); return array();
} }

View File

@ -465,20 +465,20 @@ function getUploadColumns(&$type, $selectedModules) {
* *
* If there are problems status messages will be printed automatically. * If there are problems status messages will be printed automatically.
* *
* @param string $scope account type * @param ConfiguredType $type account type
* @param array $data array containing one account in each element * @param array $data array containing one account in each element
* @param array $ids array(<column_name> => <column number>) * @param array $ids array(<column_name> => <column number>)
* @param array $selectedModules selected account modules * @param array $selectedModules selected account modules
* @return mixed array including accounts or false if there were errors * @return mixed array including accounts or false if there were errors
*/ */
function buildUploadAccounts($scope, $data, $ids, $selectedModules) { function buildUploadAccounts($type, $data, $ids, $selectedModules) {
// build module order // build module order
$unOrdered = $selectedModules; $unOrdered = $selectedModules;
$ordered = array(); $ordered = array();
$predepends = array(); $predepends = array();
// get dependencies // get dependencies
for ($i = 0; $i < sizeof($unOrdered); $i++) { for ($i = 0; $i < sizeof($unOrdered); $i++) {
$mod = moduleCache::getModule($unOrdered[$i], $scope); $mod = moduleCache::getModule($unOrdered[$i], $type->getScope());
$predepends[$unOrdered[$i]] = $mod->get_uploadPreDepends(); $predepends[$unOrdered[$i]] = $mod->get_uploadPreDepends();
} }
// first all modules without predepends can be ordered // first all modules without predepends can be ordered
@ -523,8 +523,8 @@ function buildUploadAccounts($scope, $data, $ids, $selectedModules) {
$partialAccounts[$i]['objectClass'] = array(); $partialAccounts[$i]['objectClass'] = array();
} }
for ($i = 0; $i < sizeof($ordered); $i++) { for ($i = 0; $i < sizeof($ordered); $i++) {
$module = new $ordered[$i]($scope); $module = new $ordered[$i]($type->getScope());
$errors = $module->build_uploadAccounts($data, $ids, $partialAccounts, $selectedModules); $errors = $module->build_uploadAccounts($data, $ids, $partialAccounts, $selectedModules, $type);
if (sizeof($errors) > 0) { if (sizeof($errors) > 0) {
array_unshift($errors, array("INFO", _("Displayed account numbers start at \"0\". Add 2 to get the row in your spreadsheet."), "")); array_unshift($errors, array("INFO", _("Displayed account numbers start at \"0\". Add 2 to get the row in your spreadsheet."), ""));
$errors[] = array("ERROR", _("Upload was stopped after errors in %s module!"), "", array($module->get_alias())); $errors[] = array("ERROR", _("Upload was stopped after errors in %s module!"), "", array($module->get_alias()));

View File

@ -265,15 +265,10 @@ class account extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -1017,15 +1017,10 @@ class asteriskAccount extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -841,15 +841,10 @@ class asteriskExtension extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
//hash to strore extension_name => priority. For new extensoin priority will be 1 //hash to strore extension_name => priority. For new extensoin priority will be 1
$extensionNamePriorityMap = array(); $extensionNamePriorityMap = array();

View File

@ -378,15 +378,10 @@ class asteriskVoicemail extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -201,15 +201,10 @@ class authorizedServiceObject extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -646,15 +646,10 @@ class ddns extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
if (!$this->check_if_ddns_is_enable()) { if (!$this->check_if_ddns_is_enable()) {
return $messages; return $messages;

View File

@ -846,15 +846,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -462,15 +462,10 @@ class eduPerson extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -624,15 +624,10 @@ class freeRadius extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -175,15 +175,10 @@ class hostObject extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -133,15 +133,10 @@ class ieee802device extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -318,15 +318,10 @@ class inetLocalMailRecipient extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -2168,15 +2168,10 @@ class inetOrgPerson extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
// get list of existing users // get list of existing users
$existingUsers = searchLDAPByAttribute('uid', '*', 'inetOrgPerson', array('uid'), array('user')); $existingUsers = searchLDAPByAttribute('uid', '*', 'inetOrgPerson', array('uid'), array('user'));

View File

@ -347,15 +347,10 @@ class kolabGroup extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// check if extension should be added // check if extension should be added

View File

@ -447,15 +447,10 @@ class kolabSharedFolder extends baseModule { // TODO folder type
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', array('mail'), array('user')); $delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', array('mail'), array('user'));
for ($d = 0; $d < sizeof($delegates); $d++) { for ($d = 0; $d < sizeof($delegates); $d++) {

View File

@ -595,15 +595,10 @@ class kolabUser extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
$delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', array('mail'), array('user')); $delegates = searchLDAPByAttribute(null, null, 'inetOrgPerson', array('mail'), array('user'));
for ($d = 0; $d < sizeof($delegates); $d++) { for ($d = 0; $d < sizeof($delegates); $d++) {

View File

@ -262,15 +262,10 @@ class ldapPublicKey extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -429,15 +429,10 @@ class nisMailAlias extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -495,15 +495,10 @@ class nisNetGroupUser extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
// get list of existing group of names // get list of existing group of names
$groups = $this->findGroups(); $groups = $this->findGroups();

View File

@ -518,15 +518,10 @@ class nisnetgroup extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
// get list of existing groups // get list of existing groups
$existingGroups = $this->getGroupList(); $existingGroups = $this->getGroupList();

View File

@ -2120,15 +2120,10 @@ class posixAccount extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
$pwdAttrName = $this->getPasswordAttrName($selectedModules); $pwdAttrName = $this->getPasswordAttrName($selectedModules);
$homedirAttrName = $this->getHomedirAttrName($selectedModules); $homedirAttrName = $this->getHomedirAttrName($selectedModules);

View File

@ -81,15 +81,10 @@ class posixGroup extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$error_messages = array(); $error_messages = array();
$needAutoGID = array(); $needAutoGID = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {

View File

@ -351,15 +351,10 @@ class puppetClient extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -208,15 +208,10 @@ class pykotaBillingCode extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
$this->loadCodeCache(); $this->loadCodeCache();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {

View File

@ -400,15 +400,10 @@ class pykotaGroup extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object classes // add object classes

View File

@ -450,15 +450,10 @@ class pykotaPrinter extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
$this->loadPrinterNameCache(); $this->loadPrinterNameCache();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {

View File

@ -765,15 +765,10 @@ class pykotaUser extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object classes // add object classes

View File

@ -553,15 +553,10 @@ class sambaDomain extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -233,15 +233,10 @@ class sambaGroupMapping extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
// search existing Samba 3 domains // search existing Samba 3 domains
$domains = $this->getDomains(); $domains = $this->getDomains();
$nameToSID = array(); $nameToSID = array();

View File

@ -1997,15 +1997,10 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
// get list of Samba 3 domains // get list of Samba 3 domains
$domains = $this->getDomains(); $domains = $this->getDomains();

View File

@ -573,15 +573,10 @@ class shadowAccount extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -346,15 +346,10 @@ class systemQuotas extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$messages = array(); $messages = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -811,15 +811,10 @@ class windowsGroup extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -243,15 +243,10 @@ class windowsHost extends baseModule {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
for ($i = 0; $i < sizeof($rawAccounts); $i++) { for ($i = 0; $i < sizeof($rawAccounts); $i++) {
// add object class // add object class

View File

@ -1944,15 +1944,10 @@ class windowsUser extends baseModule implements passwordService {
} }
/** /**
* In this function the LDAP account is built up. * {@inheritDoc}
* * @see baseModule::build_uploadAccounts()
* @param array $rawAccounts list of hash arrays (name => value) from user input
* @param array $ids list of IDs for column position (e.g. "posixAccount_uid" => 5)
* @param array $partialAccounts list of hash arrays (name => value) which are later added to LDAP
* @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/ */
public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules) { public function build_uploadAccounts($rawAccounts, $ids, &$partialAccounts, $selectedModules, &$type) {
$errors = array(); $errors = array();
// get list of existing groups // get list of existing groups
$groupList = $this->findGroups(); $groupList = $this->findGroups();

View File

@ -200,7 +200,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
// let modules build accounts // let modules build accounts
else { else {
$accounts = buildUploadAccounts($type->getScope(), $data, $ids, $selectedModules); $accounts = buildUploadAccounts($type, $data, $ids, $selectedModules);
if ($accounts != false) { if ($accounts != false) {
$rdnList = getRDNAttributes($type->getId(), $selectedModules); $rdnList = getRDNAttributes($type->getId(), $selectedModules);
$suffix = $type->getSuffix(); $suffix = $type->getSuffix();