use extended upload function

This commit is contained in:
Roland Gruber 2015-07-13 16:33:56 +00:00
parent 224c4ede8d
commit 435604544b
4 changed files with 24 additions and 43 deletions

View File

@ -286,14 +286,7 @@ class account extends baseModule {
} }
if (!in_array('posixAccount', $selectedModules)) { if (!in_array('posixAccount', $selectedModules)) {
// user name // user name
if (get_preg($rawAccounts[$i][$ids['account_uid']], 'username')) { $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'account_uid', 'uid', 'username', $this->messages['uid'][1], $messages);
$partialAccounts[$i]['uid'] = $rawAccounts[$i][$ids['account_uid']];
}
else {
$errMsg = $this->messages['uid'][1];
array_push($errMsg, array($i));
$messages[] = $errMsg;
}
} }
} }
return $messages; return $messages;

View File

@ -860,7 +860,7 @@ class asteriskExtension extends baseModule {
if (!in_array("groupOfNames", $partialAccounts[$i]['objectClass'])) if (!in_array("groupOfNames", $partialAccounts[$i]['objectClass']))
$partialAccounts[$i]['objectClass'][] = "groupOfNames"; $partialAccounts[$i]['objectClass'][] = "groupOfNames";
// attributes // attributes
$partialAccounts[$i]['AstExtension'] = $rawAccounts[$i][$ids['asteriskExtension_AstExtension']]; $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskExtension_AstExtension', 'AstExtension');
$extensionName = $partialAccounts[$i]['AstExtension']; $extensionName = $partialAccounts[$i]['AstExtension'];
$astPriorityTmp = 0; $astPriorityTmp = 0;

View File

@ -421,7 +421,7 @@ class asteriskVoicemail extends baseModule implements passwordService {
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskVoicemail_AstVoicemailContext', 'AstVoicemailContext', $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskVoicemail_AstVoicemailContext', 'AstVoicemailContext',
'realname', $this->messages['AstVoicemailContext'][1], $messages); 'realname', $this->messages['AstVoicemailContext'][1], $messages);
$partialAccounts[$i]['AstVoicemailPassword'] = $rawAccounts[$i][$ids['asteriskVoicemail_AstVoicemailPassword']]; $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskVoicemail_AstVoicemailPassword', 'AstVoicemailPassword');
} }
return $messages; return $messages;
} }

View File

@ -215,19 +215,7 @@ class authorizedServiceObject extends baseModule {
// add object class // add object class
if (!in_array("authorizedServiceObject", $partialAccounts[$i]['objectClass'])) $partialAccounts[$i]['objectClass'][] = "authorizedServiceObject"; if (!in_array("authorizedServiceObject", $partialAccounts[$i]['objectClass'])) $partialAccounts[$i]['objectClass'][] = "authorizedServiceObject";
// add ASs // add ASs
if ($rawAccounts[$i][$ids['authorizedService']] != "") { $this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'authorizedService', 'authorizedService', 'ascii', $this->messages['authorizedService'][1], $messages, '/,[ ]*/');
$services = explode(', ', $rawAccounts[$i][$ids['authorizedService']]);
for ($m = 0; $m < sizeof($services); $m++) {
if (get_preg($services[$m], 'ascii')) {
$partialAccounts[$i]['authorizedService'][] = $services[$m];
}
else {
$errMsg = $this->messages['authorizedService'][1];
array_push($errMsg, array($i));
$messages[] = $errMsg;
}
}
}
} }
return $messages; return $messages;
} }