Cleaned up orphaned methods in SetupHelper

This commit is contained in:
Prarup Gurung
2023-03-13 13:11:37 +05:45
parent 810b7b5279
commit 68ed280e27
6 changed files with 2 additions and 730 deletions
@@ -845,27 +845,6 @@ trait Provisioning {
}
}
/**
* Sets back old settings
*
* @return void
* @throws Exception
*/
public function resetOldLdapConfig():void {
$toDeleteLdapConfig = $this->getToDeleteLdapConfigs();
foreach ($toDeleteLdapConfig as $configId) {
['code' => '', 'stdOut' => '', 'stdErr' => '' ];
}
foreach ($this->oldLdapConfig as $configId => $settings) {
foreach ($settings as $configKey => $configValue) {
$this->setLdapSetting($configId, $configKey, $configValue);
}
}
foreach ($this->toDeleteDNs as $dn) {
$this->getLdap()->delete($dn, true);
}
}
/**
* Manually add skeleton files for a single user on OCIS and reva systems
*
@@ -3130,20 +3109,6 @@ trait Provisioning {
$user = \trim($user);
$method = \trim(\strtolower($method));
switch ($method) {
case "occ":
$result = SetupHelper::createUser(
$user,
$password,
$this->getStepLineRef(),
$displayName,
$email
);
if ($result["code"] !== "0") {
throw new Exception(
__METHOD__ . " could not create user. {$result['stdOut']} {$result['stdErr']}"
);
}
break;
case "api":
case "ldap":
$settings = [];
@@ -3611,18 +3576,6 @@ trait Provisioning {
$this->pushToLastStatusCodesArrays();
}
break;
case "occ":
$result = SetupHelper::addUserToGroup(
$group,
$user,
$this->getStepLineRef()
);
if ($checkResult && ($result["code"] !== "0")) {
throw new Exception(
"could not add user to group. {$result['stdOut']} {$result['stdErr']}"
);
}
break;
case "ldap":
try {
$this->addUserToLdapGroup(
@@ -3872,19 +3825,6 @@ trait Provisioning {
);
}
break;
case "occ":
$result = SetupHelper::createGroup(
$group,
$this->getStepLineRef()
);
if ($result["code"] == 0) {
$groupCanBeDeleted = true;
} else {
throw new Exception(
"could not create group '$group'. {$result['stdOut']} {$result['stdErr']}"
);
}
break;
case "ldap":
try {
$this->createLdapGroup($group);