appConfig->hasAppKey(ConfigLexicon::SYSTEM_ADDRESSBOOK_EXPOSED) === true) { $output->info('Skipping repair step system address book exposed was previously set'); return; } // We use count seen because getting a user count from the backend can be very slow $limit = $this->appConfig->getAppValueInt('system_addressbook_limit', 5000); if ($this->userManager->countSeenUsers() <= $limit) { $output->info("Skipping repair step system address book has less then the threshold $limit of contacts no need to disable"); return; } $this->appConfig->setAppValueBool(ConfigLexicon::SYSTEM_ADDRESSBOOK_EXPOSED, false); $output->warning("System address book disabled because it has more then the threshold of $limit contacts this can be re-enabled later"); // Notify all admin users about the system address book being disabled foreach ($this->groupManager->get('admin')->getUsers() as $user) { $notification = $this->notificationManager->createNotification(); $notification->setApp(Application::APP_ID) ->setUser($user->getUID()) ->setDateTime(new \DateTime()) ->setSubject('SystemSystemAddressBookDisabled', []); $this->notificationManager->notify($notification); } } }