2020-11-27 01:46:19 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2020-12-16 08:54:15 -05:00
|
|
|
/**
|
2024-05-29 05:32:54 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-11-27 01:46:19 -05:00
|
|
|
*/
|
|
|
|
|
namespace OCA\User_LDAP\Migration;
|
|
|
|
|
|
|
|
|
|
use OCA\User_LDAP\Helper;
|
|
|
|
|
use OCA\User_LDAP\LDAPProviderFactory;
|
|
|
|
|
use OCP\IConfig;
|
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
|
use OCP\Migration\IRepairStep;
|
|
|
|
|
|
|
|
|
|
class SetDefaultProvider implements IRepairStep {
|
|
|
|
|
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private IConfig $config,
|
|
|
|
|
private Helper $helper,
|
|
|
|
|
) {
|
2020-11-27 01:46:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getName(): string {
|
|
|
|
|
return 'Set default LDAP provider';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function run(IOutput $output): void {
|
|
|
|
|
$current = $this->config->getSystemValue('ldapProviderFactory', null);
|
|
|
|
|
if ($current === null) {
|
|
|
|
|
$this->config->setSystemValue('ldapProviderFactory', LDAPProviderFactory::class);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|