Browse Source
fix: Use the new countUsersTotal method where it makes sense
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/50171/head
Côme Chilliet
10 months ago
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
2 changed files with
2 additions and
3 deletions
apps/dav/lib/Migration/Version1027Date20230504122946.php
lib/base.php
@ -33,7 +33,7 @@ class Version1027Date20230504122946 extends SimpleMigrationStep {
* @ param array $options
*/
public function postSchemaChange ( IOutput $output , Closure $schemaClosure , array $options ) : void {
if ( $this -> userManager -> countSeenUsers () > 100 || array_sum ( $this -> userManager -> countUsers ()) > 100 ) {
if ( $this -> userManager -> countSeenUsers () > 100 || $this -> userManager -> countUsersTotal ( 100 ) >= 100 ) {
$this -> config -> setAppValue ( 'dav' , 'needs_system_address_book_sync' , 'yes' );
$output -> info ( 'Could not sync system address books during update - too many user records have been found. Please call occ dav:sync-system-addressbook manually.' );
return ;
@ -279,8 +279,7 @@ class OC {
}
if ( ! $tooBig ) {
// count users
$stats = Server :: get ( \OCP\IUserManager :: class ) -> countUsers ();
$totalUsers = array_sum ( $stats );
$totalUsers = Server :: get ( \OCP\IUserManager :: class ) -> countUsersTotal ( 51 );
$tooBig = ( $totalUsers > 50 );
}
}