summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/Helper.php')
-rw-r--r--apps/user_ldap/lib/Helper.php26
1 files changed, 3 insertions, 23 deletions
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index a8d66998148..86712534f40 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -76,7 +76,7 @@ class Helper {
* except the default (first) server shall be connected to.
*
*/
- public function getServerConfigurationPrefixes($activeConfigurations = false) {
+ public function getServerConfigurationPrefixes($activeConfigurations = false): array {
$referenceConfigkey = 'ldap_configuration_active';
$keys = $this->getServersConfig($referenceConfigkey);
@@ -188,18 +188,11 @@ class Helper {
/**
* checks whether there is one or more disabled LDAP configurations
- *
- * @return bool
- * @throws \Exception
*/
- public function haveDisabledConfigurations() {
+ public function haveDisabledConfigurations(): bool {
$all = $this->getServerConfigurationPrefixes(false);
$active = $this->getServerConfigurationPrefixes(true);
- if (!is_array($all) || !is_array($active)) {
- throw new \Exception('Unexpected Return Value');
- }
-
return count($all) !== count($active) || count($all) === 0;
}
@@ -312,20 +305,7 @@ class Helper {
throw new \Exception('key uid is expected to be set in $param');
}
- //ain't it ironic?
- $helper = new Helper(\OC::$server->getConfig());
-
- $configPrefixes = $helper->getServerConfigurationPrefixes(true);
- $ldapWrapper = new LDAP();
- $ocConfig = \OC::$server->getConfig();
- $notificationManager = \OC::$server->getNotificationManager();
-
- $userSession = \OC::$server->getUserSession();
- $userPluginManager = \OC::$server->query(UserPluginManager::class);
-
- $userBackend = new User_Proxy(
- $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager, $userSession, $userPluginManager
- );
+ $userBackend = \OC::$server->get(User_Proxy::class);
$uid = $userBackend->loginName2UserName($param['uid']);
if ($uid !== false) {
$param['uid'] = $uid;