userSession->getUser(); if ($user === null) { return; } $identifier = 'share-addressbook-or-calendar'; $userLimit = $this->config->getValueInt('dav', 'rateLimitShareAddressbookOrCalendar', 20); $userPeriod = $this->config->getValueInt('dav', 'rateLimitPeriodShareAddressbookOrCalendar', 3600); try { $this->limiter->registerUserRequest($identifier, $userLimit, $userPeriod, $user); } catch (IRateLimitExceededException $e) { throw new TooManyRequests('Too many addressbook or calendar share requests', 0, $e); } } }