save configs when requesting a config ID. They are empty, but avoid configID collisioning when creating many new configs in the wizard without saving anything directly.

This commit is contained in:
Arthur Schiwon 2015-04-21 13:20:31 +02:00
parent 8593415c12
commit 52025e9839
1 changed files with 2 additions and 2 deletions

View File

@ -35,14 +35,14 @@ $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
$resultData = array('configPrefix' => $nk);
$newConfig = new \OCA\user_ldap\lib\Configuration($nk, false);
if(isset($_POST['copyConfig'])) {
$originalConfig = new \OCA\user_ldap\lib\Configuration($_POST['copyConfig']);
$newConfig = new \OCA\user_ldap\lib\Configuration($nk, false);
$newConfig->setConfiguration($originalConfig->getConfiguration());
$newConfig->saveConfiguration();
} else {
$configuration = new \OCA\user_ldap\lib\Configuration($nk, false);
$resultData['defaults'] = $configuration->getDefaults();
}
$newConfig->saveConfiguration();
OCP\JSON::success($resultData);