aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-02-08 15:47:39 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-02-13 17:32:30 +0100
commitc0ce272e9c3a94ff98081c4f90a31ca611d28323 (patch)
treee92ba163d28ac3eb888a95718a85a78909cdc7c7 /apps/user_ldap/lib
parent8822b16d37de1d1a3cec959d184261152c42ae41 (diff)
downloadnextcloud-server-c0ce272e9c3a94ff98081c4f90a31ca611d28323.tar.gz
nextcloud-server-c0ce272e9c3a94ff98081c4f90a31ca611d28323.zip
chore: Migrate away from OC::$server->getLogger
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Configuration.php4
-rw-r--r--apps/user_ldap/lib/GroupPluginManager.php3
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php3
-rw-r--r--apps/user_ldap/lib/UserPluginManager.php5
4 files changed, 10 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index b009ba3f480..2791324be5b 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -35,6 +35,8 @@
*/
namespace OCA\User_LDAP;
+use Psr\Log\LoggerInterface;
+
/**
* @property int ldapPagingSize holds an integer
* @property string ldapUserAvatarRule
@@ -598,7 +600,7 @@ class Configuration {
return [strtolower($attribute)];
}
if ($value !== self::AVATAR_PREFIX_DEFAULT) {
- \OC::$server->getLogger()->warning('Invalid config value to ldapUserAvatarRule; falling back to default.');
+ \OCP\Server::get(LoggerInterface::class)->warning('Invalid config value to ldapUserAvatarRule; falling back to default.');
}
return $defaultAttributes;
}
diff --git a/apps/user_ldap/lib/GroupPluginManager.php b/apps/user_ldap/lib/GroupPluginManager.php
index d99e17d7673..92bf0cb8888 100644
--- a/apps/user_ldap/lib/GroupPluginManager.php
+++ b/apps/user_ldap/lib/GroupPluginManager.php
@@ -24,6 +24,7 @@
namespace OCA\User_LDAP;
use OCP\GroupInterface;
+use Psr\Log\LoggerInterface;
class GroupPluginManager {
private int $respondToActions = 0;
@@ -58,7 +59,7 @@ class GroupPluginManager {
foreach ($this->which as $action => $v) {
if ((bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
}
}
}
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 3f05091a537..40bc8624c3c 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -30,6 +30,7 @@ use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use OCP\DB\IPreparedStatement;
use OCP\DB\QueryBuilder\IQueryBuilder;
+use Psr\Log\LoggerInterface;
/**
* Class AbstractMapping
@@ -351,7 +352,7 @@ abstract class AbstractMapping {
*/
public function map($fdn, $name, $uuid) {
if (mb_strlen($fdn) > 4000) {
- \OC::$server->getLogger()->error(
+ \OCP\Server::get(LoggerInterface::class)->error(
'Cannot map, because the DN exceeds 4000 characters: {dn}',
[
'app' => 'user_ldap',
diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php
index 516338f006b..527c6684103 100644
--- a/apps/user_ldap/lib/UserPluginManager.php
+++ b/apps/user_ldap/lib/UserPluginManager.php
@@ -26,6 +26,7 @@
namespace OCA\User_LDAP;
use OC\User\Backend;
+use Psr\Log\LoggerInterface;
class UserPluginManager {
private int $respondToActions = 0;
@@ -62,12 +63,12 @@ class UserPluginManager {
foreach ($this->which as $action => $v) {
if (is_int($action) && (bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OC::$server->getLogger()->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
}
}
if (method_exists($plugin, 'deleteUser')) {
$this->which['deleteUser'] = $plugin;
- \OC::$server->getLogger()->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']);
}
}