diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 1 | ||||
-rw-r--r-- | lib/l10n/bg.js | 1 | ||||
-rw-r--r-- | lib/l10n/bg.json | 1 | ||||
-rw-r--r-- | lib/l10n/eu.js | 2 | ||||
-rw-r--r-- | lib/l10n/eu.json | 2 | ||||
-rw-r--r-- | lib/l10n/fi.js | 5 | ||||
-rw-r--r-- | lib/l10n/fi.json | 5 | ||||
-rw-r--r-- | lib/l10n/fr.js | 1 | ||||
-rw-r--r-- | lib/l10n/fr.json | 1 | ||||
-rw-r--r-- | lib/l10n/ko.js | 1 | ||||
-rw-r--r-- | lib/l10n/ko.json | 1 | ||||
-rw-r--r-- | lib/l10n/nb.js | 16 | ||||
-rw-r--r-- | lib/l10n/nb.json | 16 | ||||
-rw-r--r-- | lib/l10n/tr.js | 2 | ||||
-rw-r--r-- | lib/l10n/tr.json | 2 | ||||
-rw-r--r-- | lib/private/Files/Cache/Scanner.php | 13 | ||||
-rw-r--r-- | lib/private/Files/Cache/SearchBuilder.php | 2 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/NoopScanner.php | 2 | ||||
-rw-r--r-- | lib/private/Files/View.php | 7 | ||||
-rw-r--r-- | lib/private/Metadata/Provider/ExifProvider.php | 2 | ||||
-rw-r--r-- | lib/private/Server.php | 5 | ||||
-rw-r--r-- | lib/private/Setup/MySQL.php | 21 | ||||
-rw-r--r-- | lib/private/User/DisplayNameCache.php | 4 | ||||
-rw-r--r-- | lib/private/User/LazyUser.php | 6 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 11 | ||||
-rw-r--r-- | lib/public/IUserManager.php | 9 |
26 files changed, 113 insertions, 26 deletions
diff --git a/lib/base.php b/lib/base.php index be2567cfd33..54b7a5e3629 100644 --- a/lib/base.php +++ b/lib/base.php @@ -295,6 +295,7 @@ class OC { if (((bool) $systemConfig->getValue('maintenance', false)) && OC::$SUBURI != '/core/ajax/update.php') { // send http status 503 http_response_code(503); + header('X-Nextcloud-Maintenance-Mode: 1'); header('Retry-After: 120'); // render error page diff --git a/lib/l10n/bg.js b/lib/l10n/bg.js index 172493809dd..1f31e9e0504 100644 --- a/lib/l10n/bg.js +++ b/lib/l10n/bg.js @@ -207,6 +207,7 @@ OC.L10N.register( "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "Приложението „%1$s“ не може да бъде инсталирано, защото следните зависимости не са изпълнени: %2$s", "a safe home for all your data" : "безопасен дом за всички ваши данни", "File is currently busy, please try again later" : "Файлът в момента е зает, моля, опитайте отново по-късно", + "Cannot download file" : "Файлът не можа да бъде изтеглен", "Application is not enabled" : "Приложението не е включено", "Authentication error" : "Грешка при удостоверяването", "Token expired. Please reload page." : "Изтекла сесия. Моля, презареди страницата.", diff --git a/lib/l10n/bg.json b/lib/l10n/bg.json index 954c27b98eb..41507e49a44 100644 --- a/lib/l10n/bg.json +++ b/lib/l10n/bg.json @@ -205,6 +205,7 @@ "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "Приложението „%1$s“ не може да бъде инсталирано, защото следните зависимости не са изпълнени: %2$s", "a safe home for all your data" : "безопасен дом за всички ваши данни", "File is currently busy, please try again later" : "Файлът в момента е зает, моля, опитайте отново по-късно", + "Cannot download file" : "Файлът не можа да бъде изтеглен", "Application is not enabled" : "Приложението не е включено", "Authentication error" : "Грешка при удостоверяването", "Token expired. Please reload page." : "Изтекла сесия. Моля, презареди страницата.", diff --git a/lib/l10n/eu.js b/lib/l10n/eu.js index f1b057aaeaf..94244be5607 100644 --- a/lib/l10n/eu.js +++ b/lib/l10n/eu.js @@ -207,7 +207,7 @@ OC.L10N.register( "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "\"%1$s\" aplikazioa ezin da instalatu, menpekotasun hauek betetzen ez direlako:%2$s", "a safe home for all your data" : "zure datu guztientzako toki segurua", "File is currently busy, please try again later" : "Fitxategia lanpetuta dago, saiatu berriro geroago", - "Cannot download file" : "Ezin da fitxategia jaitsi", + "Cannot download file" : "Ezin da fitxategia deskargatu", "Application is not enabled" : "Aplikazioa ez dago gaituta", "Authentication error" : "Autentifikazio errorea", "Token expired. Please reload page." : "Tokena iraungitu da. Mesedez birkargatu orria.", diff --git a/lib/l10n/eu.json b/lib/l10n/eu.json index 42923cf5599..0eac90e1da9 100644 --- a/lib/l10n/eu.json +++ b/lib/l10n/eu.json @@ -205,7 +205,7 @@ "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "\"%1$s\" aplikazioa ezin da instalatu, menpekotasun hauek betetzen ez direlako:%2$s", "a safe home for all your data" : "zure datu guztientzako toki segurua", "File is currently busy, please try again later" : "Fitxategia lanpetuta dago, saiatu berriro geroago", - "Cannot download file" : "Ezin da fitxategia jaitsi", + "Cannot download file" : "Ezin da fitxategia deskargatu", "Application is not enabled" : "Aplikazioa ez dago gaituta", "Authentication error" : "Autentifikazio errorea", "Token expired. Please reload page." : "Tokena iraungitu da. Mesedez birkargatu orria.", diff --git a/lib/l10n/fi.js b/lib/l10n/fi.js index 62ac7751f43..13ebcfcffeb 100644 --- a/lib/l10n/fi.js +++ b/lib/l10n/fi.js @@ -116,7 +116,11 @@ OC.L10N.register( "Set an admin password." : "Aseta ylläpitäjän salasana.", "Sharing backend %s not found" : "Jakamisen taustaosaa %s ei löytynyt", "Sharing backend for %s not found" : "Jakamisen taustaosaa kohteelle %s ei löytynyt", + "%1$s shared »%2$s« with you and wants to add:" : "%1$s jakoi kohteen »%2$s« kanssasi ja haluaa lisätä:", + "%1$s shared »%2$s« with you and wants to add" : "%1$s jakoi kohteen »%2$s« kanssasi ja haluaa lisätä", + "»%s« added a note to a file shared with you" : "»%s« lisäsi huomion jakamaasi tiedostoon", "Open »%s«" : "Avaa »%s«", + "%1$s via %2$s" : "%1$s palvelun %2$s kautta", "You are not allowed to share %s" : "Oikeutesi eivät riitä kohteen %s jakamiseen.", "Cannot increase permissions of %s" : "Kohteen %s käyttöoikeuksien lisääminen ei onnistu", "Files cannot be shared with delete permissions" : "Tiedostoja ei voi jakaa poistamisoikeuksilla", @@ -189,6 +193,7 @@ OC.L10N.register( "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "Sovellusta \"%1$s\" ei voi asentaa, koska seuraavat riippuvuudet eivät täyty: %2$s", "a safe home for all your data" : "turvallinen koti kaikille tiedostoillesi", "File is currently busy, please try again later" : "Tiedosto on parhaillaan käytössä, yritä myöhemmin uudelleen", + "Cannot download file" : "Tiedostoa ei voi ladata", "Application is not enabled" : "Sovellusta ei ole otettu käyttöön", "Authentication error" : "Tunnistautumisvirhe", "Token expired. Please reload page." : "Valtuutus vanheni. Lataa sivu uudelleen.", diff --git a/lib/l10n/fi.json b/lib/l10n/fi.json index 975213c6cdc..2aa4fdcd0d5 100644 --- a/lib/l10n/fi.json +++ b/lib/l10n/fi.json @@ -114,7 +114,11 @@ "Set an admin password." : "Aseta ylläpitäjän salasana.", "Sharing backend %s not found" : "Jakamisen taustaosaa %s ei löytynyt", "Sharing backend for %s not found" : "Jakamisen taustaosaa kohteelle %s ei löytynyt", + "%1$s shared »%2$s« with you and wants to add:" : "%1$s jakoi kohteen »%2$s« kanssasi ja haluaa lisätä:", + "%1$s shared »%2$s« with you and wants to add" : "%1$s jakoi kohteen »%2$s« kanssasi ja haluaa lisätä", + "»%s« added a note to a file shared with you" : "»%s« lisäsi huomion jakamaasi tiedostoon", "Open »%s«" : "Avaa »%s«", + "%1$s via %2$s" : "%1$s palvelun %2$s kautta", "You are not allowed to share %s" : "Oikeutesi eivät riitä kohteen %s jakamiseen.", "Cannot increase permissions of %s" : "Kohteen %s käyttöoikeuksien lisääminen ei onnistu", "Files cannot be shared with delete permissions" : "Tiedostoja ei voi jakaa poistamisoikeuksilla", @@ -187,6 +191,7 @@ "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "Sovellusta \"%1$s\" ei voi asentaa, koska seuraavat riippuvuudet eivät täyty: %2$s", "a safe home for all your data" : "turvallinen koti kaikille tiedostoillesi", "File is currently busy, please try again later" : "Tiedosto on parhaillaan käytössä, yritä myöhemmin uudelleen", + "Cannot download file" : "Tiedostoa ei voi ladata", "Application is not enabled" : "Sovellusta ei ole otettu käyttöön", "Authentication error" : "Tunnistautumisvirhe", "Token expired. Please reload page." : "Valtuutus vanheni. Lataa sivu uudelleen.", diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js index 86f56e69a85..fce71090c61 100644 --- a/lib/l10n/fr.js +++ b/lib/l10n/fr.js @@ -207,6 +207,7 @@ OC.L10N.register( "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "L'application \"%1$s\" ne peut pas être installée à cause des dépendances suivantes non satisfaites : %2$s", "a safe home for all your data" : "un lieu sûr pour toutes vos données", "File is currently busy, please try again later" : "Le fichier est actuellement utilisé, veuillez réessayer plus tard", + "Cannot download file" : "Impossible de télécharger le fichier", "Application is not enabled" : "L'application n'est pas activée", "Authentication error" : "Erreur d'authentification", "Token expired. Please reload page." : "La session a expiré. Veuillez recharger la page.", diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json index f3b85ba4ac2..f9ff67188b0 100644 --- a/lib/l10n/fr.json +++ b/lib/l10n/fr.json @@ -205,6 +205,7 @@ "App \"%1$s\" cannot be installed because the following dependencies are not fulfilled: %2$s" : "L'application \"%1$s\" ne peut pas être installée à cause des dépendances suivantes non satisfaites : %2$s", "a safe home for all your data" : "un lieu sûr pour toutes vos données", "File is currently busy, please try again later" : "Le fichier est actuellement utilisé, veuillez réessayer plus tard", + "Cannot download file" : "Impossible de télécharger le fichier", "Application is not enabled" : "L'application n'est pas activée", "Authentication error" : "Erreur d'authentification", "Token expired. Please reload page." : "La session a expiré. Veuillez recharger la page.", diff --git a/lib/l10n/ko.js b/lib/l10n/ko.js index a2329ec6590..039f738edd9 100644 --- a/lib/l10n/ko.js +++ b/lib/l10n/ko.js @@ -79,6 +79,7 @@ OC.L10N.register( "About" : "정보", "Full name" : "전체 이름", "Headline" : "표제", + "Organisation" : "조직", "Role" : "직책", "Unknown user" : "알려지지 않은 사용자", "Additional settings" : "고급 설정", diff --git a/lib/l10n/ko.json b/lib/l10n/ko.json index c431ac654b9..81f384b4c3a 100644 --- a/lib/l10n/ko.json +++ b/lib/l10n/ko.json @@ -77,6 +77,7 @@ "About" : "정보", "Full name" : "전체 이름", "Headline" : "표제", + "Organisation" : "조직", "Role" : "직책", "Unknown user" : "알려지지 않은 사용자", "Additional settings" : "고급 설정", diff --git a/lib/l10n/nb.js b/lib/l10n/nb.js index cd3822384e6..023f43b136c 100644 --- a/lib/l10n/nb.js +++ b/lib/l10n/nb.js @@ -5,6 +5,11 @@ OC.L10N.register( "See %s" : "Se %s", "Sample configuration detected" : "Eksempeloppsett oppdaget", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Det ble oppdaget at eksempeloppsettet er blitt kopiert. Dette kan ødelegge installasjonen din og støttes ikke. Les dokumentasjonen før du gjør endringer i config.php", + "%s email verification" : "%s e-postbekreftelse", + "Email verification" : "E-postbekreftelse", + "Click the following button to confirm your email." : "Klikk på følgende knapp for å bekrefte e-posten din.", + "Click the following link to confirm your email." : "Klikk på følgende lenke for å bekrefte e-posten din.", + "Confirm your email" : "Bekreft din e-post", "%1$s and %2$s" : "%1$s og %2$s", "%1$s, %2$s and %3$s" : "%1$s, %2$s og %3$s", "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s og %4$s", @@ -45,8 +50,10 @@ OC.L10N.register( "_%n minute ago_::_%n minutes ago_" : ["for %n minutt siden","for %n minutter siden"], "in a few seconds" : "om noen sekunder", "seconds ago" : "for få sekunder siden", + "Empty file" : "Tom fil", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul med ID: %s finnes ikke. Skru den på i app-innstillingene eller kontakt en administrator.", "File already exists" : "Filen finnes allerede", + "Invalid path" : "Ugyldig filbane", "File name is a reserved word" : "Filnavnet er et reservert ord", "File name contains at least one invalid character" : "Filnavnet inneholder minst ett ulovlig tegn", "File name is too long" : "Filnavnet er for langt", @@ -62,13 +69,20 @@ OC.L10N.register( "Log out" : "Logg ut", "Users" : "Brukere", "Email" : "E-post", + "Mail %s" : "E-post til %s", "Phone" : "Telefon", + "Call %s" : "Ring %s", "Twitter" : "Twitter", + "View %s on Twitter" : "Se %s på Twitter", "Website" : "Nettsted", + "Visit %s" : "Besøk %s", "Address" : "Adresse", "Profile picture" : "Profilbilde", "About" : "Om", "Full name" : "Fullt nav", + "Headline" : "Overskrift", + "Organisation" : "Organisasion", + "Role" : "Rolle", "Unknown user" : "Ukjent bruker", "Additional settings" : "Flere innstillinger", "%s enter the database username and name." : "%s legg inn database brukernavn og navn.", @@ -158,6 +172,7 @@ OC.L10N.register( "Login canceled by app" : "Innlogging avbrutt av app", "a safe home for all your data" : "et sikkert hjem for alle dine data", "File is currently busy, please try again later" : "Filen er opptatt for øyeblikket, prøv igjen senere", + "Cannot download file" : "Kan ikke laste ned fil", "Application is not enabled" : "Appen er ikke aktivert", "Authentication error" : "Autentikasjonsfeil", "Token expired. Please reload page." : "Symbol utløpt. Last inn siden på nytt.", @@ -180,6 +195,7 @@ OC.L10N.register( "Storage connection error. %s" : "Tilkoblingsfeil for lager. %s", "Storage is temporarily not available" : "Lagring er midlertidig utilgjengelig", "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s", + "Cannot read file" : "Kan ikke lese fil", "Cannot write into \"config\" directory" : "Kan ikke skrive i \"config\"-mappen", "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Dette kan vanligvis ordnes ved å gi webserveren skrivetilgang til config-mappen. Se %s", "Cannot write into \"apps\" directory" : "Kan ikke skrive i \"apps\"-mappen", diff --git a/lib/l10n/nb.json b/lib/l10n/nb.json index ee405c25723..1f0f6b629c7 100644 --- a/lib/l10n/nb.json +++ b/lib/l10n/nb.json @@ -3,6 +3,11 @@ "See %s" : "Se %s", "Sample configuration detected" : "Eksempeloppsett oppdaget", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Det ble oppdaget at eksempeloppsettet er blitt kopiert. Dette kan ødelegge installasjonen din og støttes ikke. Les dokumentasjonen før du gjør endringer i config.php", + "%s email verification" : "%s e-postbekreftelse", + "Email verification" : "E-postbekreftelse", + "Click the following button to confirm your email." : "Klikk på følgende knapp for å bekrefte e-posten din.", + "Click the following link to confirm your email." : "Klikk på følgende lenke for å bekrefte e-posten din.", + "Confirm your email" : "Bekreft din e-post", "%1$s and %2$s" : "%1$s og %2$s", "%1$s, %2$s and %3$s" : "%1$s, %2$s og %3$s", "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s og %4$s", @@ -43,8 +48,10 @@ "_%n minute ago_::_%n minutes ago_" : ["for %n minutt siden","for %n minutter siden"], "in a few seconds" : "om noen sekunder", "seconds ago" : "for få sekunder siden", + "Empty file" : "Tom fil", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul med ID: %s finnes ikke. Skru den på i app-innstillingene eller kontakt en administrator.", "File already exists" : "Filen finnes allerede", + "Invalid path" : "Ugyldig filbane", "File name is a reserved word" : "Filnavnet er et reservert ord", "File name contains at least one invalid character" : "Filnavnet inneholder minst ett ulovlig tegn", "File name is too long" : "Filnavnet er for langt", @@ -60,13 +67,20 @@ "Log out" : "Logg ut", "Users" : "Brukere", "Email" : "E-post", + "Mail %s" : "E-post til %s", "Phone" : "Telefon", + "Call %s" : "Ring %s", "Twitter" : "Twitter", + "View %s on Twitter" : "Se %s på Twitter", "Website" : "Nettsted", + "Visit %s" : "Besøk %s", "Address" : "Adresse", "Profile picture" : "Profilbilde", "About" : "Om", "Full name" : "Fullt nav", + "Headline" : "Overskrift", + "Organisation" : "Organisasion", + "Role" : "Rolle", "Unknown user" : "Ukjent bruker", "Additional settings" : "Flere innstillinger", "%s enter the database username and name." : "%s legg inn database brukernavn og navn.", @@ -156,6 +170,7 @@ "Login canceled by app" : "Innlogging avbrutt av app", "a safe home for all your data" : "et sikkert hjem for alle dine data", "File is currently busy, please try again later" : "Filen er opptatt for øyeblikket, prøv igjen senere", + "Cannot download file" : "Kan ikke laste ned fil", "Application is not enabled" : "Appen er ikke aktivert", "Authentication error" : "Autentikasjonsfeil", "Token expired. Please reload page." : "Symbol utløpt. Last inn siden på nytt.", @@ -178,6 +193,7 @@ "Storage connection error. %s" : "Tilkoblingsfeil for lager. %s", "Storage is temporarily not available" : "Lagring er midlertidig utilgjengelig", "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s", + "Cannot read file" : "Kan ikke lese fil", "Cannot write into \"config\" directory" : "Kan ikke skrive i \"config\"-mappen", "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Dette kan vanligvis ordnes ved å gi webserveren skrivetilgang til config-mappen. Se %s", "Cannot write into \"apps\" directory" : "Kan ikke skrive i \"apps\"-mappen", diff --git a/lib/l10n/tr.js b/lib/l10n/tr.js index 1093853236e..53de08e4f73 100644 --- a/lib/l10n/tr.js +++ b/lib/l10n/tr.js @@ -210,7 +210,7 @@ OC.L10N.register( "Cannot download file" : "Dosya indirilemedi", "Application is not enabled" : "Uygulama etkinleştirilmemiş", "Authentication error" : "Kimlik doğrulama sorunu", - "Token expired. Please reload page." : "Kodun süresi dolmuş. Lütfen sayfayı yenileyin.", + "Token expired. Please reload page." : "Kodun geçerlilik süresi dolmuş. Lütfen sayfayı yenileyin.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Herhangi bir veritabanı sürücüsü (sqlite, mysql ya da postgresql) kurulmamış.", "Cannot write into \"config\" directory." : "\"config\" klasörüne yazılamadı.", "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Bu sorun genellikle, web sunucusuna config klasörüne yazma izni verilerek çözülebilir. %s bölümüne bakın", diff --git a/lib/l10n/tr.json b/lib/l10n/tr.json index 36bf1d804a1..eb666c3b364 100644 --- a/lib/l10n/tr.json +++ b/lib/l10n/tr.json @@ -208,7 +208,7 @@ "Cannot download file" : "Dosya indirilemedi", "Application is not enabled" : "Uygulama etkinleştirilmemiş", "Authentication error" : "Kimlik doğrulama sorunu", - "Token expired. Please reload page." : "Kodun süresi dolmuş. Lütfen sayfayı yenileyin.", + "Token expired. Please reload page." : "Kodun geçerlilik süresi dolmuş. Lütfen sayfayı yenileyin.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Herhangi bir veritabanı sürücüsü (sqlite, mysql ya da postgresql) kurulmamış.", "Cannot write into \"config\" directory." : "\"config\" klasörüne yazılamadı.", "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Bu sorun genellikle, web sunucusuna config klasörüne yazma izni verilerek çözülebilir. %s bölümüne bakın", diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index fb32b64c012..4799c3bff7d 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -339,7 +339,7 @@ class Scanner extends BasicEmitter implements IScanner { try { $data = $this->scanFile($path, $reuse, -1, null, $lock); if ($data and $data['mimetype'] === 'httpd/unix-directory') { - $size = $this->scanChildren($path, $recursive, $reuse, $data['fileid'], $lock); + $size = $this->scanChildren($path, $recursive, $reuse, $data['fileid'], $lock, $data); $data['size'] = $size; } } finally { @@ -376,9 +376,10 @@ class Scanner extends BasicEmitter implements IScanner { * @param int $reuse * @param int $folderId id for the folder to be scanned * @param bool $lock set to false to disable getting an additional read lock during scanning + * @param array $data the data of the folder before (re)scanning the children * @return int the size of the scanned folder or -1 if the size is unknown at this stage */ - protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $folderId = null, $lock = true) { + protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $folderId = null, $lock = true, array $data = []) { if ($reuse === -1) { $reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG; } @@ -397,7 +398,8 @@ class Scanner extends BasicEmitter implements IScanner { $size += $childSize; } } - if ($this->cacheActive) { + $oldSize = $data['size'] ?? null; + if ($this->cacheActive && $oldSize !== $size) { $this->cache->update($folderId, ['size' => $size]); } $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', [$path, $this->storageId]); @@ -409,6 +411,11 @@ class Scanner extends BasicEmitter implements IScanner { $existingChildren = $this->getExistingChildren($folderId); $newChildren = iterator_to_array($this->storage->getDirectoryContent($path)); + if (count($existingChildren) === 0 && count($newChildren) === 0) { + // no need to do a transaction + return []; + } + if ($this->useTransactions) { \OC::$server->getDatabaseConnection()->beginTransaction(); } diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index b5f548dd563..1a8c3637063 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -54,7 +54,7 @@ class SearchBuilder { ISearchComparison::COMPARE_GREATER_THAN => 'lte', ISearchComparison::COMPARE_GREATER_THAN_EQUAL => 'lt', ISearchComparison::COMPARE_LESS_THAN => 'gte', - ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'lt', + ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'gt', ]; public const TAG_FAVORITE = '_$!<Favorite>!$_'; diff --git a/lib/private/Files/ObjectStore/NoopScanner.php b/lib/private/Files/ObjectStore/NoopScanner.php index 3b8cbdb18bb..bdfc93758d4 100644 --- a/lib/private/Files/ObjectStore/NoopScanner.php +++ b/lib/private/Files/ObjectStore/NoopScanner.php @@ -68,7 +68,7 @@ class NoopScanner extends Scanner { * @param array $folderData existing cache data for the folder to be scanned * @return int the size of the scanned folder or -1 if the size is unknown at this stage */ - protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $folderId = null, $lock = true) { + protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $folderId = null, $lock = true, array $data = []) { return 0; } diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index d12869fbdaa..e5394e72ffe 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -49,9 +49,7 @@ namespace OC\Files; use Icewind\Streams\CallbackWrapper; use OC\Files\Mount\MoveableMount; use OC\Files\Storage\Storage; -use OC\User\DisplayNameCache; use OC\User\LazyUser; -use OC\User\User; use OCA\Files_Sharing\SharedMount; use OCP\Constants; use OCP\Files\Cache\ICacheEntry; @@ -103,8 +101,6 @@ class View { private LoggerInterface $logger; - private DisplayNameCache $displayNameCache; - /** * @param string $root * @throws \Exception If $root contains an invalid path @@ -121,7 +117,6 @@ class View { $this->lockingProvider = \OC::$server->getLockingProvider(); $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); $this->userManager = \OC::$server->getUserManager(); - $this->displayNameCache = \OC::$server->get(DisplayNameCache::class); $this->logger = \OC::$server->get(LoggerInterface::class); } @@ -1319,7 +1314,7 @@ class View { * @return IUser */ private function getUserObjectForOwner(string $ownerId) { - return new LazyUser($ownerId, $this->displayNameCache, $this->userManager); + return new LazyUser($ownerId, $this->userManager); } /** diff --git a/lib/private/Metadata/Provider/ExifProvider.php b/lib/private/Metadata/Provider/ExifProvider.php index 2e1eb1d4208..892671556b3 100644 --- a/lib/private/Metadata/Provider/ExifProvider.php +++ b/lib/private/Metadata/Provider/ExifProvider.php @@ -17,7 +17,7 @@ class ExifProvider implements IMetadataProvider { public function execute(File $file): array { $fileDescriptor = $file->fopen('rb'); - $data = @exif_read_data($fileDescriptor, 'ANY_TAG', true); + $data = exif_read_data($fileDescriptor, 'COMPUTED', true); $size = new FileMetadata(); $size->setGroupName('size'); diff --git a/lib/private/Server.php b/lib/private/Server.php index b473f4e75c0..7223c3b8ae3 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -151,6 +151,7 @@ use OC\SystemTag\ManagerFactory as SystemTagManagerFactory; use OC\Tagging\TagMapper; use OC\Talk\Broker; use OC\Template\JSCombiner; +use OC\User\DisplayNameCache; use OC\User\Listeners\UserChangedListener; use OC\User\Listeners\UserDeletedListener; use OCA\Theming\ImageManager; @@ -474,6 +475,10 @@ class Server extends ServerContainer implements IServerContainer { $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); + $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) { + return $c->get(\OC\User\Manager::class)->getDisplayNameCache(); + }); + $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) { $groupManager = new \OC\Group\Manager( $this->get(IUserManager::class), diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index e878ed4d9aa..e3004c269bc 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -129,6 +129,7 @@ class MySQL extends AbstractDatabase { 'exception' => $ex, 'app' => 'mysql.setup', ]); + throw $ex; } } @@ -137,6 +138,19 @@ class MySQL extends AbstractDatabase { * @param IDBConnection $connection */ private function createSpecificUser($username, $connection): void { + $rootUser = $this->dbUser; + $rootPassword = $this->dbPassword; + + //create a random password so we don't need to store the admin password in the config file + $saveSymbols = str_replace(['\"', '\\', '\'', '`'], '', ISecureRandom::CHAR_SYMBOLS); + $password = $this->random->generate(22, ISecureRandom::CHAR_ALPHANUMERIC . $saveSymbols) + . $this->random->generate(2, ISecureRandom::CHAR_UPPER) + . $this->random->generate(2, ISecureRandom::CHAR_LOWER) + . $this->random->generate(2, ISecureRandom::CHAR_DIGITS) + . $this->random->generate(2, $saveSymbols) + ; + $this->dbPassword = str_shuffle($password); + try { //user already specified in config $oldUser = $this->config->getValue('dbuser', false); @@ -159,10 +173,6 @@ class MySQL extends AbstractDatabase { if (count($data) === 0) { //use the admin login data for the new database user $this->dbUser = $adminUser; - - //create a random password so we don't need to store the admin password in the config file - $this->dbPassword = $this->random->generate(30, ISecureRandom::CHAR_ALPHANUMERIC); - $this->createDBUser($connection); break; @@ -179,6 +189,9 @@ class MySQL extends AbstractDatabase { 'exception' => $ex, 'app' => 'mysql.setup', ]); + // Restore the original credentials + $this->dbUser = $rootUser; + $this->dbPassword = $rootPassword; } $this->config->setValues([ diff --git a/lib/private/User/DisplayNameCache.php b/lib/private/User/DisplayNameCache.php index 22a79863e49..5d1cc8940d7 100644 --- a/lib/private/User/DisplayNameCache.php +++ b/lib/private/User/DisplayNameCache.php @@ -47,7 +47,7 @@ class DisplayNameCache implements IEventListener { $this->userManager = $userManager; } - public function getDisplayName(string $userId) { + public function getDisplayName(string $userId): ?string { if (isset($this->cache[$userId])) { return $this->cache[$userId]; } @@ -61,7 +61,7 @@ class DisplayNameCache implements IEventListener { if ($user) { $displayName = $user->getDisplayName(); } else { - $displayName = $userId; + $displayName = null; } $this->cache[$userId] = $displayName; $this->memCache->set($userId, $displayName, 60 * 10); // 10 minutes diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php index 8e93d6481ab..096578b8f37 100644 --- a/lib/private/User/LazyUser.php +++ b/lib/private/User/LazyUser.php @@ -29,12 +29,10 @@ use OCP\UserInterface; class LazyUser implements IUser { private ?IUser $user = null; - private DisplayNameCache $displayNameCache; private string $uid; private IUserManager $userManager; - public function __construct(string $uid, DisplayNameCache $displayNameCache, IUserManager $userManager) { - $this->displayNameCache = $displayNameCache; + public function __construct(string $uid, IUserManager $userManager) { $this->uid = $uid; $this->userManager = $userManager; } @@ -53,7 +51,7 @@ class LazyUser implements IUser { } public function getDisplayName() { - return $this->displayNameCache->getDisplayName($this->uid); + return $this->userManager->getDisplayName($this->uid) ?? $this->uid; } public function setDisplayName($displayName) { diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index a6f56585325..be5151313c4 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -95,6 +95,8 @@ class Manager extends PublicEmitter implements IUserManager { /** @var IEventDispatcher */ private $eventDispatcher; + private DisplayNameCache $displayNameCache; + public function __construct(IConfig $config, EventDispatcherInterface $oldDispatcher, ICacheFactory $cacheFactory, @@ -108,6 +110,7 @@ class Manager extends PublicEmitter implements IUserManager { unset($cachedUsers[$user->getUID()]); }); $this->eventDispatcher = $eventDispatcher; + $this->displayNameCache = new DisplayNameCache($cacheFactory, $this); } /** @@ -185,6 +188,10 @@ class Manager extends PublicEmitter implements IUserManager { return null; } + public function getDisplayName(string $uid): ?string { + return $this->displayNameCache->getDisplayName($uid); + } + /** * get or construct the user object * @@ -742,4 +749,8 @@ class Manager extends PublicEmitter implements IUserManager { return !file_exists(rtrim($dataDirectory, '/') . '/' . $uid); } + + public function getDisplayNameCache(): DisplayNameCache { + return $this->displayNameCache; + } } diff --git a/lib/public/IUserManager.php b/lib/public/IUserManager.php index 77e2fc21a22..af0d5f08809 100644 --- a/lib/public/IUserManager.php +++ b/lib/public/IUserManager.php @@ -85,6 +85,15 @@ interface IUserManager { public function get($uid); /** + * Get the display name of a user + * + * @param string $uid + * @return string|null + * @since 25.0.0 + */ + public function getDisplayName(string $uid): ?string; + + /** * check if a user exists * * @param string $uid |