diff options
author | Joas Schilling <coding@schilljs.com> | 2024-07-17 15:25:51 +0200 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-07-19 16:28:03 +0200 |
commit | 047479ccf9ff332cc249cd08d5c315394f3e48da (patch) | |
tree | 1001b114f3857338bba5e520e941fca4914a2be4 /lib/private/Group | |
parent | 202e5b1e957a7692165a313710e38406ca4f6ff3 (diff) | |
download | nextcloud-server-047479ccf9ff332cc249cd08d5c315394f3e48da.tar.gz nextcloud-server-047479ccf9ff332cc249cd08d5c315394f3e48da.zip |
feat(security): Add public API to allow validating IP Ranges and checking for "in range"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'lib/private/Group')
-rw-r--r-- | lib/private/Group/Manager.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 67d6f8cbe9c..092c56fe00a 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -8,7 +8,6 @@ namespace OC\Group; use OC\Hooks\PublicEmitter; -use OC\Security\RemoteIpAddress; use OCP\EventDispatcher\IEventDispatcher; use OCP\Group\Backend\IBatchMethodsBackend; use OCP\Group\Backend\ICreateNamedGroupBackend; @@ -20,6 +19,7 @@ use OCP\ICacheFactory; use OCP\IGroup; use OCP\IGroupManager; use OCP\IUser; +use OCP\Security\Ip\IRemoteAddress; use Psr\Log\LoggerInterface; use function is_string; @@ -60,7 +60,7 @@ class Manager extends PublicEmitter implements IGroupManager { private IEventDispatcher $dispatcher, private LoggerInterface $logger, ICacheFactory $cacheFactory, - private RemoteIpAddress $remoteIpAddress, + private IRemoteAddress $remoteAddress, ) { $this->displayNameCache = new DisplayNameCache($cacheFactory, $this); @@ -321,7 +321,7 @@ class Manager extends PublicEmitter implements IGroupManager { * @return bool if admin */ public function isAdmin($userId) { - if (!$this->remoteIpAddress->allowsAdminActions()) { + if (!$this->remoteAddress->allowsAdminActions()) { return false; } |