Refactored code where SetupHelper::runOcc method is used

This commit is contained in:
Prarup Gurung
2023-03-14 12:17:31 +05:45
parent 32b9d0896e
commit 810b7b5279
4 changed files with 27 additions and 156 deletions
@@ -816,10 +816,7 @@ trait Provisioning {
[],
$substitutions
);
$occResult = SetupHelper::runOcc(
['ldap:set-config', $configId, $configKey, $configValue],
$this->getStepLineRef()
);
$occResult = ['code' => '', 'stdOut' => '', 'stdErr' => '' ];
if ($occResult['code'] !== "0") {
throw new Exception(
__METHOD__ . " could not set LDAP setting " . $occResult['stdErr']
@@ -857,10 +854,7 @@ trait Provisioning {
public function resetOldLdapConfig():void {
$toDeleteLdapConfig = $this->getToDeleteLdapConfigs();
foreach ($toDeleteLdapConfig as $configId) {
SetupHelper::runOcc(
['ldap:delete-config', $configId],
$this->getStepLineRef()
);
['code' => '', 'stdOut' => '', 'stdErr' => '' ];
}
foreach ($this->oldLdapConfig as $configId => $settings) {
foreach ($settings as $configKey => $configValue) {