You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($this->config->getSystemValue('upgrade.disable-web', false) || $this->getUserCount() > 100) {
92
+
returnfalse;
93
+
}
94
+
returntrue;
80
95
}
81
96
82
97
/**
@@ -107,4 +122,35 @@ public function createCredentials(): DataResponse {
107
122
108
123
returnnewDataResponse($newToken);
109
124
}
125
+
126
+
// Copied from https://github.com/nextcloud/server/blob/a06001e0851abc6073af678b742da3e1aa96eec9/lib/private/Support/Subscription/Registry.php#L187-L214
127
+
privatefunctiongetUserCount(): int {
128
+
$userCount = 0;
129
+
$backends = $this->userManager->getBackends();
130
+
foreach ($backendsas$backend) {
131
+
if ($backend->implementsActions(Backend::COUNT_USERS)) {
132
+
/** @var ICountUsersBackend $backend */
133
+
$backendUsers = $backend->countUsers();
134
+
if ($backendUsers !== false) {
135
+
$userCount += $backendUsers;
136
+
} else {
137
+
// TODO what if the user count can't be determined?
138
+
$this->logger->warning('Can not determine user count for ' . get_class($backend), ['app' => 'updatenotification']);
0 commit comments