Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2dea21a
chore: Get rid of unused user_ldap AJAX endpoints
come-nc Oct 2, 2025
e842874
fix(user_ldap): Add OCS endpoint for testing configurations
come-nc Oct 2, 2025
36475f2
fix(user_ldap): Add OCS endpoint for copying configurations
come-nc Oct 2, 2025
a0e5548
feat(user_ldap): Add a wizard OCS API
come-nc Oct 2, 2025
777c729
feat(user_ldap): Adapt frontend to call new endpoints
artonge Oct 2, 2025
9d41d81
fix(ldap): Fix wizard controller action route
come-nc Oct 6, 2025
ac078b6
chore: Fix typing in WizardResult
come-nc Oct 7, 2025
c414a7b
fix: Fix documentation for controllers and update openapi.json
come-nc Oct 7, 2025
28cef3e
fix(ldap): Add OCS route for clearing mapping without using ajax
come-nc Oct 7, 2025
c621662
chore(user_ldap): Remove ajax endpoints
come-nc Oct 7, 2025
aed0e82
fix(user_ldap): Remove last ajax call from frontend
come-nc Oct 7, 2025
92efa01
chore: Update psalm baseline
come-nc Oct 7, 2025
f9abfe0
fix(tests): Use testing application for testing ajax endpoints, not u…
come-nc Oct 7, 2025
00349e6
chore: npm run lint:fix
come-nc Oct 7, 2025
1afa2a5
chore: remove unused imports
come-nc Oct 7, 2025
687fa0a
fix(user_ldap): Call config API instead of wizard save action
come-nc Oct 7, 2025
3906998
feat(user_ldap): Save base on detect
artonge Nov 21, 2025
f57fb6e
feat(user_ldap): Disable countInBaseDN button when base is empty
artonge Nov 21, 2025
ac690ea
fix(user_ldap): Properly handle new wizard OCS endpoint error
artonge Nov 21, 2025
e9b1e7a
chore: Compile assets
artonge Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(user_ldap): Add OCS endpoint for copying configurations
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Louis Chmn <[email protected]>
  • Loading branch information
come-nc authored and artonge committed Nov 21, 2025
commit 36475f24614c38f3149c203834a19cc93e8cfe85
28 changes: 28 additions & 0 deletions apps/user_ldap/lib/Controller/ConfigAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,34 @@ public function testConfiguration(string $configID) {
}
}

/**
* Copy a configuration
*
* @return DataResponse<Http::STATUS_OK, array{configID:string}, array{}>
* @throws OCSException An unexpected error happened
* @throws OCSNotFoundException Config not found
*
* 200: Test was run and results are returned
*/
#[AuthorizedAdminSetting(settings: Admin::class)]
#[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/copy')]
public function copyConfiguration(string $configID) {
try {
$this->ensureConfigIDExists($configID);
$configPrefix = $this->ldapHelper->getNextServerConfigurationPrefix();
$newConfig = new Configuration($configPrefix, false);
$originalConfig = new Configuration($configID);
$newConfig->setConfiguration($originalConfig->getConfiguration());
$newConfig->saveConfiguration();
return new DataResponse(['configID' => $configPrefix]);
} catch (OCSException $e) {
throw $e;
} catch (\Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e]);
throw new OCSException('An issue occurred when creating the new config.');
}
}

/**
* If the given config ID is not available, an exception is thrown
*
Expand Down