diff options
299 files changed, 5197 insertions, 2330 deletions
diff --git a/3rdparty b/3rdparty -Subproject 2e896dfaa036d60362e314a30b7f55dcc91a109 +Subproject 77dc3920c3e9f4d36dc72e8a3aa6ac67ff5cffc diff --git a/README.md b/README.md index 36e7bb59892..a705074d6be 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Depencencies: [](https://www.versioneye.com/user/projects/54d1f76f3ca0840b190000c0) ### Installation instructions -https://doc.owncloud.org/server/8.0/developer_manual/app/index.html +https://doc.owncloud.org/server/8.2/developer_manual/app/index.html ### Contribution Guidelines https://owncloud.org/contribute/ @@ -35,4 +35,4 @@ https://www.transifex.com/projects/p/owncloud/ [](https://www.transifex.com/projects/p/owncloud/) For more detailed information about translations: -http://doc.owncloud.org/server/8.0/developer_manual/core/translation.html +http://doc.owncloud.org/server/8.2/developer_manual/core/translation.html diff --git a/apps/encryption/l10n/id.js b/apps/encryption/l10n/id.js index 7117924864c..e1de33fe156 100644 --- a/apps/encryption/l10n/id.js +++ b/apps/encryption/l10n/id.js @@ -21,9 +21,12 @@ OC.L10N.register( "The old password was not correct, please try again." : "Sandi lama salah, mohon coba lagi.", "The current log-in password was not correct, please try again." : "Sandi masuk saat ini salah, mohon coba lagi.", "Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Anda perlu mengganti kunci enkripsi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon jalankan 'occ encryption:migrate' atau hubungi administrator Anda", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk Aplikasi Enskripsi. Silakan perbarui sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienskripsi.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi Enskripsi telah diaktifkan tetapi kunci tidak diinisialisasi, silakan log-out dan log-in lagi", + "Encryption App is enabled and ready" : "Apl Enkripsi telah diaktifkan dan siap", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.", + "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat membaca berkas ini, kemungkinan merupakan berkas berbagi. Silakan minta pemilik berkas untuk membagikan ulang kepada Anda.", "Enable recovery key" : "Aktifkan kunci pemulihan", "Disable recovery key" : "Nonaktifkan kunci pemulihan", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan sandi mereka.", diff --git a/apps/encryption/l10n/id.json b/apps/encryption/l10n/id.json index 5a0466c5f2a..66d7f6c8991 100644 --- a/apps/encryption/l10n/id.json +++ b/apps/encryption/l10n/id.json @@ -19,9 +19,12 @@ "The old password was not correct, please try again." : "Sandi lama salah, mohon coba lagi.", "The current log-in password was not correct, please try again." : "Sandi masuk saat ini salah, mohon coba lagi.", "Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Anda perlu mengganti kunci enkripsi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon jalankan 'occ encryption:migrate' atau hubungi administrator Anda", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk Aplikasi Enskripsi. Silakan perbarui sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienskripsi.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi Enskripsi telah diaktifkan tetapi kunci tidak diinisialisasi, silakan log-out dan log-in lagi", + "Encryption App is enabled and ready" : "Apl Enkripsi telah diaktifkan dan siap", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.", + "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat membaca berkas ini, kemungkinan merupakan berkas berbagi. Silakan minta pemilik berkas untuk membagikan ulang kepada Anda.", "Enable recovery key" : "Aktifkan kunci pemulihan", "Disable recovery key" : "Nonaktifkan kunci pemulihan", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan sandi mereka.", diff --git a/apps/files/l10n/es.js b/apps/files/l10n/es.js index 281c0bba516..c7409a25df4 100644 --- a/apps/files/l10n/es.js +++ b/apps/files/l10n/es.js @@ -42,7 +42,7 @@ OC.L10N.register( "Delete" : "Eliminar", "Disconnect storage" : "Desconectar almacenamiento", "Unshare" : "Dejar de compartir", - "No permission to delete" : "Ninguna autorización que borrar", + "No permission to delete" : "Permisos insuficientes para borrar", "Download" : "Descargar", "Select" : "Seleccionar", "Pending" : "Pendiente", @@ -64,13 +64,13 @@ OC.L10N.register( "_Uploading %n file_::_Uploading %n files_" : ["Subiendo %n archivo","Subiendo %n archivos"], "\"{name}\" is an invalid file name." : "\"{name}\" es un nombre de archivo inválido.", "File name cannot be empty." : "El nombre de archivo no puede estar vacío.", - "Storage of {owner} is full, files can not be updated or synced anymore!" : "El almacen de {owner} está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "El almacén de {owner} está repleto, ¡los archivos no se actualizarán ni sincronizarán más!", "Your storage is full, files can not be updated or synced anymore!" : "Su almacenamiento está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", - "Storage of {owner} is almost full ({usedSpacePercent}%)" : "El almacen de {owner} está casi lleno en un ({usedSpacePercent}%)", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "El almacén de {owner} está casi lleno en un ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Su almacenamiento está casi lleno ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["coincidencias '{filter}'","coincidencia '{filter}'"], "{dirs} and {files}" : "{dirs} y {files}", - "Favorited" : "Agregado a favoritos", + "Favorited" : "Agregado a Favoritos", "Favorite" : "Favorito", "An error occurred while trying to update the tags" : "Se produjo un error al tratar de actualizar las etiquetas", "A new file or folder has been <strong>created</strong>" : "Se ha <strong>creado</strong> un nuevo archivo o carpeta", diff --git a/apps/files/l10n/es.json b/apps/files/l10n/es.json index 40f11037293..fc7a12fdf04 100644 --- a/apps/files/l10n/es.json +++ b/apps/files/l10n/es.json @@ -40,7 +40,7 @@ "Delete" : "Eliminar", "Disconnect storage" : "Desconectar almacenamiento", "Unshare" : "Dejar de compartir", - "No permission to delete" : "Ninguna autorización que borrar", + "No permission to delete" : "Permisos insuficientes para borrar", "Download" : "Descargar", "Select" : "Seleccionar", "Pending" : "Pendiente", @@ -62,13 +62,13 @@ "_Uploading %n file_::_Uploading %n files_" : ["Subiendo %n archivo","Subiendo %n archivos"], "\"{name}\" is an invalid file name." : "\"{name}\" es un nombre de archivo inválido.", "File name cannot be empty." : "El nombre de archivo no puede estar vacío.", - "Storage of {owner} is full, files can not be updated or synced anymore!" : "El almacen de {owner} está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "El almacén de {owner} está repleto, ¡los archivos no se actualizarán ni sincronizarán más!", "Your storage is full, files can not be updated or synced anymore!" : "Su almacenamiento está lleno, ¡los archivos no se actualizarán ni sincronizarán más!", - "Storage of {owner} is almost full ({usedSpacePercent}%)" : "El almacen de {owner} está casi lleno en un ({usedSpacePercent}%)", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "El almacén de {owner} está casi lleno en un ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Su almacenamiento está casi lleno ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["coincidencias '{filter}'","coincidencia '{filter}'"], "{dirs} and {files}" : "{dirs} y {files}", - "Favorited" : "Agregado a favoritos", + "Favorited" : "Agregado a Favoritos", "Favorite" : "Favorito", "An error occurred while trying to update the tags" : "Se produjo un error al tratar de actualizar las etiquetas", "A new file or folder has been <strong>created</strong>" : "Se ha <strong>creado</strong> un nuevo archivo o carpeta", diff --git a/apps/files/l10n/id.js b/apps/files/l10n/id.js index 97190ddf47a..d11e9b7a4f6 100644 --- a/apps/files/l10n/id.js +++ b/apps/files/l10n/id.js @@ -42,10 +42,13 @@ OC.L10N.register( "Delete" : "Hapus", "Disconnect storage" : "Memutuskan penyimpaan", "Unshare" : "Batalkan berbagi", + "No permission to delete" : "Tidak memiliki hak untuk menghapus", "Download" : "Unduh", "Select" : "Pilih", - "Pending" : "Menunggu", + "Pending" : "Tertunda", "Unable to determine date" : "Tidak dapat menentukan tanggal", + "This operation is forbidden" : "Operasi ini dilarang", + "This directory is unavailable, please check the logs or contact the administrator" : "Direktori ini tidak tersedia, silakan periksa log atau hubungi kontak", "Error moving file." : "Kesalahan saat memindahkan berkas.", "Error moving file" : "Kesalahan saat memindahkan berkas", "Error" : "Kesalahan ", @@ -61,7 +64,9 @@ OC.L10N.register( "_Uploading %n file_::_Uploading %n files_" : ["Mengunggah %n berkas"], "\"{name}\" is an invalid file name." : "\"{name}\" adalah nama berkas yang tidak sah.", "File name cannot be empty." : "Nama berkas tidak boleh kosong.", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "Penyimpanan {owner} penuh, berkas tidak dapat diperbarui atau disinkronisasikan lagi!", "Your storage is full, files can not be updated or synced anymore!" : "Ruang penyimpanan Anda penuh, berkas tidak dapat diperbarui atau disinkronkan lagi!", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "Penyimpanan {owner} hampir penuh ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Ruang penyimpanan hampir penuh ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["cocok dengan '{filter}'"], "{dirs} and {files}" : "{dirs} dan {files}", diff --git a/apps/files/l10n/id.json b/apps/files/l10n/id.json index c3906da3c3d..f2b557205b7 100644 --- a/apps/files/l10n/id.json +++ b/apps/files/l10n/id.json @@ -40,10 +40,13 @@ "Delete" : "Hapus", "Disconnect storage" : "Memutuskan penyimpaan", "Unshare" : "Batalkan berbagi", + "No permission to delete" : "Tidak memiliki hak untuk menghapus", "Download" : "Unduh", "Select" : "Pilih", - "Pending" : "Menunggu", + "Pending" : "Tertunda", "Unable to determine date" : "Tidak dapat menentukan tanggal", + "This operation is forbidden" : "Operasi ini dilarang", + "This directory is unavailable, please check the logs or contact the administrator" : "Direktori ini tidak tersedia, silakan periksa log atau hubungi kontak", "Error moving file." : "Kesalahan saat memindahkan berkas.", "Error moving file" : "Kesalahan saat memindahkan berkas", "Error" : "Kesalahan ", @@ -59,7 +62,9 @@ "_Uploading %n file_::_Uploading %n files_" : ["Mengunggah %n berkas"], "\"{name}\" is an invalid file name." : "\"{name}\" adalah nama berkas yang tidak sah.", "File name cannot be empty." : "Nama berkas tidak boleh kosong.", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "Penyimpanan {owner} penuh, berkas tidak dapat diperbarui atau disinkronisasikan lagi!", "Your storage is full, files can not be updated or synced anymore!" : "Ruang penyimpanan Anda penuh, berkas tidak dapat diperbarui atau disinkronkan lagi!", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "Penyimpanan {owner} hampir penuh ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Ruang penyimpanan hampir penuh ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["cocok dengan '{filter}'"], "{dirs} and {files}" : "{dirs} dan {files}", diff --git a/apps/files_external/l10n/id.js b/apps/files_external/l10n/id.js index ff582a863e9..7f153b9f49a 100644 --- a/apps/files_external/l10n/id.js +++ b/apps/files_external/l10n/id.js @@ -43,6 +43,7 @@ OC.L10N.register( "Username as share" : "Nama pengguna berbagi", "URL" : "URL", "Secure https://" : "Secure https://", + "SFTP with secret key login" : "SFTP dengan kunci rahasia masuk", "Public key" : "Kunci Public", "Storage with id \"%i\" not found" : "Penyimpanan dengan id \"%i\" tidak ditemukan", "Invalid mount point" : "Mount point salah", @@ -54,6 +55,11 @@ OC.L10N.register( "Personal" : "Pribadi", "System" : "Sistem", "Enable encryption" : "Aktifkan enkripsi", + "Enable previews" : "Aktifkan pratinjau", + "Check for changes" : "Periksa perubahan", + "Never" : "Jangan pernah", + "Once every direct access" : "Setiap kali akses langsung", + "Every time the filesystem is used" : "Setiap kali sistem berkas digunakan", "All users. Type to select user or group." : "Semua pengguna. Ketik untuk memilih pengguna atau grup.", "(group)" : "(grup)", "Saved" : "Disimpan", diff --git a/apps/files_external/l10n/id.json b/apps/files_external/l10n/id.json index 2c1c450e9af..205ac8b210b 100644 --- a/apps/files_external/l10n/id.json +++ b/apps/files_external/l10n/id.json @@ -41,6 +41,7 @@ "Username as share" : "Nama pengguna berbagi", "URL" : "URL", "Secure https://" : "Secure https://", + "SFTP with secret key login" : "SFTP dengan kunci rahasia masuk", "Public key" : "Kunci Public", "Storage with id \"%i\" not found" : "Penyimpanan dengan id \"%i\" tidak ditemukan", "Invalid mount point" : "Mount point salah", @@ -52,6 +53,11 @@ "Personal" : "Pribadi", "System" : "Sistem", "Enable encryption" : "Aktifkan enkripsi", + "Enable previews" : "Aktifkan pratinjau", + "Check for changes" : "Periksa perubahan", + "Never" : "Jangan pernah", + "Once every direct access" : "Setiap kali akses langsung", + "Every time the filesystem is used" : "Setiap kali sistem berkas digunakan", "All users. Type to select user or group." : "Semua pengguna. Ketik untuk memilih pengguna atau grup.", "(group)" : "(grup)", "Saved" : "Disimpan", diff --git a/apps/files_external/l10n/lb.js b/apps/files_external/l10n/lb.js index eb46704c970..4f18f5b6e39 100644 --- a/apps/files_external/l10n/lb.js +++ b/apps/files_external/l10n/lb.js @@ -2,6 +2,7 @@ OC.L10N.register( "files_external", { "Location" : "Uert", + "Port" : "Port", "Region" : "Regioun", "Host" : "Host", "Username" : "Benotzernumm", diff --git a/apps/files_external/l10n/lb.json b/apps/files_external/l10n/lb.json index a1e3e397636..a9acd181800 100644 --- a/apps/files_external/l10n/lb.json +++ b/apps/files_external/l10n/lb.json @@ -1,5 +1,6 @@ { "translations": { "Location" : "Uert", + "Port" : "Port", "Region" : "Regioun", "Host" : "Host", "Username" : "Benotzernumm", diff --git a/apps/files_external/l10n/nb_NO.js b/apps/files_external/l10n/nb_NO.js index 1cb5f7a52da..8faf9719fe7 100644 --- a/apps/files_external/l10n/nb_NO.js +++ b/apps/files_external/l10n/nb_NO.js @@ -2,7 +2,7 @@ OC.L10N.register( "files_external", { "Fetching request tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting av henvendelsessymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", - "Fetching access tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting adgangssymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", + "Fetching access tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting av adgangssymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", "Please provide a valid Dropbox app key and secret." : "Vær vennlig å oppgi gyldig Dropbox appnøkkel og hemmelighet.", "Step 1 failed. Exception: %s" : "Steg 1 feilet. Unntak: %s", "Step 2 failed. Exception: %s" : "Steg 2 feilet. Unntak: %s", diff --git a/apps/files_external/l10n/nb_NO.json b/apps/files_external/l10n/nb_NO.json index 7855bc36279..c6d566b057a 100644 --- a/apps/files_external/l10n/nb_NO.json +++ b/apps/files_external/l10n/nb_NO.json @@ -1,6 +1,6 @@ { "translations": { "Fetching request tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting av henvendelsessymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", - "Fetching access tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting adgangssymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", + "Fetching access tokens failed. Verify that your Dropbox app key and secret are correct." : "Henting av adgangssymboler feilet. Sjekk at app-nøkkelen og hemmeligheten din for Dropbox stemmer.", "Please provide a valid Dropbox app key and secret." : "Vær vennlig å oppgi gyldig Dropbox appnøkkel og hemmelighet.", "Step 1 failed. Exception: %s" : "Steg 1 feilet. Unntak: %s", "Step 2 failed. Exception: %s" : "Steg 2 feilet. Unntak: %s", diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index 7bef0c3197a..d26a64d3aec 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -56,71 +56,76 @@ $externalManager = new \OCA\Files_Sharing\External\Manager( ); // check for ssl cert -if (substr($remote, 0, 5) === 'https' and !OC_Util::getUrlContent($remote)) { - \OCP\JSON::error(array('data' => array('message' => $l->t('Invalid or untrusted SSL certificate')))); - exit; -} else { - $mount = $externalManager->addShare($remote, $token, $password, $name, $owner, true); +if (substr($remote, 0, 5) === 'https') { + try { + \OC::$server->getHTTPClientService()->newClient()->get($remote)->getBody(); + } catch (\Exception $e) { + \OCP\JSON::error(array('data' => array('message' => $l->t('Invalid or untrusted SSL certificate')))); + exit; + } +} + +$mount = $externalManager->addShare($remote, $token, $password, $name, $owner, true); - /** - * @var \OCA\Files_Sharing\External\Storage $storage - */ - $storage = $mount->getStorage(); +/** + * @var \OCA\Files_Sharing\External\Storage $storage + */ +$storage = $mount->getStorage(); +try { + // check if storage exists + $storage->checkStorageAvailability(); +} catch (\OCP\Files\StorageInvalidException $e) { + // note: checkStorageAvailability will already remove the invalid share + \OCP\Util::writeLog( + 'files_sharing', + 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), + \OCP\Util::DEBUG + ); + \OCP\JSON::error( + array( + 'data' => array( + 'message' => $l->t('Could not authenticate to remote share, password might be wrong') + ) + ) + ); + exit(); +} catch (\Exception $e) { + \OCP\Util::writeLog( + 'files_sharing', + 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), + \OCP\Util::DEBUG + ); + $externalManager->removeShare($mount->getMountPoint()); + \OCP\JSON::error(array('data' => array('message' => $l->t('Storage not valid')))); + exit(); +} +$result = $storage->file_exists(''); +if ($result) { try { - // check if storage exists - $storage->checkStorageAvailability(); + $storage->getScanner()->scanAll(); + \OCP\JSON::success(); } catch (\OCP\Files\StorageInvalidException $e) { - // note: checkStorageAvailability will already remove the invalid share \OCP\Util::writeLog( 'files_sharing', 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), \OCP\Util::DEBUG ); - \OCP\JSON::error( - array( - 'data' => array( - 'message' => $l->t('Could not authenticate to remote share, password might be wrong') - ) - ) - ); - exit(); + \OCP\JSON::error(array('data' => array('message' => $l->t('Storage not valid')))); } catch (\Exception $e) { \OCP\Util::writeLog( 'files_sharing', 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), \OCP\Util::DEBUG ); - $externalManager->removeShare($mount->getMountPoint()); - \OCP\JSON::error(array('data' => array('message' => $l->t('Storage not valid')))); - exit(); - } - $result = $storage->file_exists(''); - if ($result) { - try { - $storage->getScanner()->scanAll(); - \OCP\JSON::success(); - } catch (\OCP\Files\StorageInvalidException $e) { - \OCP\Util::writeLog( - 'files_sharing', - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), - \OCP\Util::DEBUG - ); - \OCP\JSON::error(array('data' => array('message' => $l->t('Storage not valid')))); - } catch (\Exception $e) { - \OCP\Util::writeLog( - 'files_sharing', - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), - \OCP\Util::DEBUG - ); - \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t add remote share')))); - } - } else { - $externalManager->removeShare($mount->getMountPoint()); - \OCP\Util::writeLog( - 'files_sharing', - 'Couldn\'t add remote share', - \OCP\Util::DEBUG - ); \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t add remote share')))); } +} else { + $externalManager->removeShare($mount->getMountPoint()); + \OCP\Util::writeLog( + 'files_sharing', + 'Couldn\'t add remote share', + \OCP\Util::DEBUG + ); + \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t add remote share')))); } + diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index d09b61fd4ae..9185e508e67 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -71,6 +71,9 @@ foreach ($files as $file) { unset($entry['directory']); // do not disclose share owner unset($entry['shareOwner']); + // do not disclose if something is a remote shares + unset($entry['mountType']); + unset($entry['icon']); $entry['permissions'] = \OCP\Constants::PERMISSION_READ; $formattedFiles[] = $entry; } diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 99a5bdaa859..6ddd4786c2a 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -66,7 +66,7 @@ $path = $view->getPath($pathId); if($path === null) { \OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND); - \OC_Log::write('core-preview', 'Could not resolve file for shared item', OC_Log::WARN); + \OCP\Util::writeLog('core-preview', 'Could not resolve file for shared item', \OCP\Util::WARN); exit; } diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php index 3ea0fae8522..db6194d3f05 100644 --- a/apps/files_sharing/ajax/shareinfo.php +++ b/apps/files_sharing/ajax/shareinfo.php @@ -55,7 +55,7 @@ $path = $data['realPath']; $isWritable = $linkItem['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE); if (!$isWritable) { \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) { - return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage)); + return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE)); }); } diff --git a/apps/files_sharing/api/local.php b/apps/files_sharing/api/local.php index 84a789f26e4..2b2b475466f 100644 --- a/apps/files_sharing/api/local.php +++ b/apps/files_sharing/api/local.php @@ -69,7 +69,6 @@ class Local { if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) { $share['isPreviewAvailable'] = true; } - $share['icon'] = substr(\OC_Helper::mimetypeIcon($share['mimetype']), 0, -3) . 'svg'; } if (!is_null($share['token'])) { @@ -260,6 +259,7 @@ class Local { return new \OC_OCS_Result(null, 400, "please specify a file or folder path"); } $itemSource = self::getFileId($path); + $itemSourceName = $itemSource; $itemType = self::getItemType($path); if($itemSource === null) { @@ -270,9 +270,10 @@ class Local { $shareType = isset($_POST['shareType']) ? (int)$_POST['shareType'] : null; switch($shareType) { + case \OCP\Share::SHARE_TYPE_REMOTE: + $shareWith = rtrim($shareWith, '/'); + $itemSourceName = basename($path); case \OCP\Share::SHARE_TYPE_USER: - $permissions = isset($_POST['permissions']) ? (int)$_POST['permissions'] : 31; - break; case \OCP\Share::SHARE_TYPE_GROUP: $permissions = isset($_POST['permissions']) ? (int)$_POST['permissions'] : 31; break; @@ -303,7 +304,8 @@ class Local { $itemSource, $shareType, $shareWith, - $permissions + $permissions, + $itemSourceName ); } catch (HintException $e) { return new \OC_OCS_Result(null, 400, $e->getHint()); diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/api/remote.php new file mode 100644 index 00000000000..f6cb0a29d8b --- /dev/null +++ b/apps/files_sharing/api/remote.php @@ -0,0 +1,91 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\Files_Sharing\API; + +use OC\Files\Filesystem; +use OCA\Files_Sharing\External\Manager; + +class Remote { + + /** + * Accept a remote share + * + * @param array $params contains the shareID 'id' which should be accepted + * @return \OC_OCS_Result + */ + public static function getOpenShares($params) { + $externalManager = new Manager( + \OC::$server->getDatabaseConnection(), + Filesystem::getMountManager(), + Filesystem::getLoader(), + \OC::$server->getHTTPHelper(), + \OC_User::getUser() + ); + + return new \OC_OCS_Result($externalManager->getOpenShares()); + } + + /** + * Accept a remote share + * + * @param array $params contains the shareID 'id' which should be accepted + * @return \OC_OCS_Result + */ + public static function acceptShare($params) { + $externalManager = new Manager( + \OC::$server->getDatabaseConnection(), + Filesystem::getMountManager(), + Filesystem::getLoader(), + \OC::$server->getHTTPHelper(), + \OC_User::getUser() + ); + + if ($externalManager->acceptShare($params['id'])) { + return new \OC_OCS_Result(); + } + + return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); + } + + /** + * Decline a remote share + * + * @param array $params contains the shareID 'id' which should be declined + * @return \OC_OCS_Result + */ + public static function declineShare($params) { + $externalManager = new Manager( + \OC::$server->getDatabaseConnection(), + Filesystem::getMountManager(), + Filesystem::getLoader(), + \OC::$server->getHTTPHelper(), + \OC_User::getUser() + ); + + if ($externalManager->declineShare($params['id'])) { + return new \OC_OCS_Result(); + } + + return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); + } + +} diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index 3ecdf65dc74..8bda0bb8749 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -22,6 +22,8 @@ namespace OCA\Files_Sharing\API; +use OCA\Files_Sharing\Activity; + class Server2Server { /** @@ -69,8 +71,8 @@ class Server2Server { $user = $owner . '@' . $this->cleanupRemote($remote); \OC::$server->getActivityManager()->publishActivity( - 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_RECEIVED, array($user), '', array(), - '', '', $shareWith, \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW); + Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_RECEIVED, array($user, trim($name, '/')), '', array(), + '', '', $shareWith, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW); return new \OC_OCS_Result(); } catch (\Exception $e) { @@ -102,8 +104,8 @@ class Server2Server { list($file, $link) = self::getFile($share['uid_owner'], $share['file_source']); \OC::$server->getActivityManager()->publishActivity( - 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, array($share['share_with'], basename($file)), '', array(), - $file, $link, $share['uid_owner'], \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW); + Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, array($share['share_with'], basename($file)), '', array(), + $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW); } return new \OC_OCS_Result(); @@ -133,8 +135,8 @@ class Server2Server { list($file, $link) = $this->getFile($share['uid_owner'], $share['file_source']); \OC::$server->getActivityManager()->publishActivity( - 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_DECLINED, array($share['share_with'], basename($file)), '', array(), - $file, $link, $share['uid_owner'], \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW); + Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_DECLINED, array($share['share_with'], basename($file)), '', array(), + $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW); } return new \OC_OCS_Result(); @@ -170,9 +172,15 @@ class Server2Server { $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share_external` WHERE `remote_id` = ? AND `share_token` = ?'); $query->execute(array($id, $token)); + if ($share['accepted']) { + $path = trim($mountpoint, '/'); + } else { + $path = trim($share['name'], '/'); + } + \OC::$server->getActivityManager()->publishActivity( - 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $mountpoint), '', array(), - '', '', $user, \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_MEDIUM); + Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $path), '', array(), + '', '', $user, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_MEDIUM); } return new \OC_OCS_Result(); diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index 2686abed0ae..21d21a83441 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -82,6 +82,21 @@ API::register('delete', array('\OCA\Files_Sharing\API\Local', 'deleteShare'), 'files_sharing'); +API::register('get', + '/apps/files_sharing/api/v1/remote_shares', + array('\OCA\Files_Sharing\API\Remote', 'getOpenShares'), + 'files_sharing'); + +API::register('post', + '/apps/files_sharing/api/v1/remote_shares/{id}', + array('\OCA\Files_Sharing\API\Remote', 'acceptShare'), + 'files_sharing'); + +API::register('delete', + '/apps/files_sharing/api/v1/remote_shares/{id}', + array('\OCA\Files_Sharing\API\Remote', 'declineShare'), + 'files_sharing'); + // Register with the capabilities API API::register('get', '/cloud/capabilities', diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index a649ecfe885..a5cf57d0ac5 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -72,7 +72,7 @@ thead { } /* keep long file names in one line to not overflow download button on mobile */ -.directDownload #download { +.directDownload #downloadFile { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index c754ebdbae9..e7823454c53 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -155,7 +155,7 @@ var permissions = $tr.data('permissions'); var hasLink = !!(shareStatus && shareStatus.link); OC.Share.markFileAsShared($tr, true, hasLink); - if ((permissions & OC.PERMISSION_SHARE) === 0) { + if ((permissions & OC.PERMISSION_SHARE) === 0 && $tr.attr('data-share-owner')) { // if no share action exists because the admin disabled sharing for this user // we create a share notification action to inform the user about files // shared with him otherwise we just update the existing share action. diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index ca187940a08..98dbd4c6702 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -176,7 +176,7 @@ .map(function(share) { var file = { id: share.file_source, - icon: share.icon, + icon: OC.MimeType.getIconUrl(share.mimetype), mimetype: share.mimetype }; if (share.item_type === 'folder') { diff --git a/apps/files_sharing/l10n/da.js b/apps/files_sharing/l10n/da.js index d066f010f53..a7cfb0a652d 100644 --- a/apps/files_sharing/l10n/da.js +++ b/apps/files_sharing/l10n/da.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "En fil eller mappe er blevet <strong>delt</strong>", "A file or folder was shared from <strong>another server</strong>" : "En fil eller mappe blev delt fra <strong>en anden server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "En offentligt delt fil eller mappe blev <strong>hentet</strong>", + "You received a new remote share %2$s from %1$s" : "Du modtog en ny ekstern deling %2$s fra %1$s", "You received a new remote share from %s" : "Du modtog en ny ekstern deling fra %s", "%1$s accepted remote share %2$s" : "%1$s accepterede den ekstern deling %2$s", "%1$s declined remote share %2$s" : "%1$s afviste den eksterne deling %2$s", diff --git a/apps/files_sharing/l10n/da.json b/apps/files_sharing/l10n/da.json index 7f4ac9290d0..d18cf792757 100644 --- a/apps/files_sharing/l10n/da.json +++ b/apps/files_sharing/l10n/da.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "En fil eller mappe er blevet <strong>delt</strong>", "A file or folder was shared from <strong>another server</strong>" : "En fil eller mappe blev delt fra <strong>en anden server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "En offentligt delt fil eller mappe blev <strong>hentet</strong>", + "You received a new remote share %2$s from %1$s" : "Du modtog en ny ekstern deling %2$s fra %1$s", "You received a new remote share from %s" : "Du modtog en ny ekstern deling fra %s", "%1$s accepted remote share %2$s" : "%1$s accepterede den ekstern deling %2$s", "%1$s declined remote share %2$s" : "%1$s afviste den eksterne deling %2$s", diff --git a/apps/files_sharing/l10n/es.js b/apps/files_sharing/l10n/es.js index e6f7c5e6caf..a7dd3ca5705 100644 --- a/apps/files_sharing/l10n/es.js +++ b/apps/files_sharing/l10n/es.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "Se ha <strong>compartido</strong> un archivo o carpeta", "A file or folder was shared from <strong>another server</strong>" : "Se ha compartido un archivo o carpeta desde <strong>otro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Ha sido <strong>descargado</strong> un archivo (o carpeta) compartido públicamente", + "You received a new remote share %2$s from %1$s" : "Recibió un nuevo recurso compartido remoto %2$s de %1$s", "You received a new remote share from %s" : "Ha recibido un nuevo recurso compartido remoto de %s", "%1$s accepted remote share %2$s" : "%1$s aceptó el recurso compartido remoto %2$s", "%1$s declined remote share %2$s" : "%1$s ha rechazado el recurso compartido remoto %2$s", diff --git a/apps/files_sharing/l10n/es.json b/apps/files_sharing/l10n/es.json index ece130edb0e..b79640abc08 100644 --- a/apps/files_sharing/l10n/es.json +++ b/apps/files_sharing/l10n/es.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "Se ha <strong>compartido</strong> un archivo o carpeta", "A file or folder was shared from <strong>another server</strong>" : "Se ha compartido un archivo o carpeta desde <strong>otro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Ha sido <strong>descargado</strong> un archivo (o carpeta) compartido públicamente", + "You received a new remote share %2$s from %1$s" : "Recibió un nuevo recurso compartido remoto %2$s de %1$s", "You received a new remote share from %s" : "Ha recibido un nuevo recurso compartido remoto de %s", "%1$s accepted remote share %2$s" : "%1$s aceptó el recurso compartido remoto %2$s", "%1$s declined remote share %2$s" : "%1$s ha rechazado el recurso compartido remoto %2$s", diff --git a/apps/files_sharing/l10n/fi_FI.js b/apps/files_sharing/l10n/fi_FI.js index 223660dec0c..0e1beda5afa 100644 --- a/apps/files_sharing/l10n/fi_FI.js +++ b/apps/files_sharing/l10n/fi_FI.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "Tiedosto tai kansio on <strong>jaettu</strong>", "A file or folder was shared from <strong>another server</strong>" : "Tiedosto tai kansio jaettiin <strong>toiselta palvelimelta</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Julkisesti jaettu tiedosto tai kansio <strong>ladattiin</strong>", + "You received a new remote share %2$s from %1$s" : "Vastaanotit uuden etäjaon %2$s käyttäjältä %1$s", "You received a new remote share from %s" : "Vastaanotit uuden etäjaon käyttäjältä %s", "%1$s accepted remote share %2$s" : "%1$s hyväksyi etäjaon %2$s", "%1$s declined remote share %2$s" : "%1$s kieltäytyi etäjaosta %2$s", diff --git a/apps/files_sharing/l10n/fi_FI.json b/apps/files_sharing/l10n/fi_FI.json index b70098d049e..5f87c38f32e 100644 --- a/apps/files_sharing/l10n/fi_FI.json +++ b/apps/files_sharing/l10n/fi_FI.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "Tiedosto tai kansio on <strong>jaettu</strong>", "A file or folder was shared from <strong>another server</strong>" : "Tiedosto tai kansio jaettiin <strong>toiselta palvelimelta</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Julkisesti jaettu tiedosto tai kansio <strong>ladattiin</strong>", + "You received a new remote share %2$s from %1$s" : "Vastaanotit uuden etäjaon %2$s käyttäjältä %1$s", "You received a new remote share from %s" : "Vastaanotit uuden etäjaon käyttäjältä %s", "%1$s accepted remote share %2$s" : "%1$s hyväksyi etäjaon %2$s", "%1$s declined remote share %2$s" : "%1$s kieltäytyi etäjaosta %2$s", diff --git a/apps/files_sharing/l10n/fr.js b/apps/files_sharing/l10n/fr.js index b866739e148..ca10ca211d1 100644 --- a/apps/files_sharing/l10n/fr.js +++ b/apps/files_sharing/l10n/fr.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "Un fichier ou un répertoire a été <strong>partagé</strong>", "A file or folder was shared from <strong>another server</strong>" : "Un fichier ou un répertoire a été partagé depuis <strong>un autre serveur</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Un fichier ou un répertoire partagé publiquement a été <strong>téléchargé</strong>", + "You received a new remote share %2$s from %1$s" : "L'utilisateur %1$s a partagé la ressource %2$s avec vous.", "You received a new remote share from %s" : "Vous avez reçu un partage distant de %s", "%1$s accepted remote share %2$s" : "%1$s a accepté le partage distant %2$s", "%1$s declined remote share %2$s" : "%1$s a refusé le partage distant %2$s", diff --git a/apps/files_sharing/l10n/fr.json b/apps/files_sharing/l10n/fr.json index b4592edcdcc..ed8b166729a 100644 --- a/apps/files_sharing/l10n/fr.json +++ b/apps/files_sharing/l10n/fr.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "Un fichier ou un répertoire a été <strong>partagé</strong>", "A file or folder was shared from <strong>another server</strong>" : "Un fichier ou un répertoire a été partagé depuis <strong>un autre serveur</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Un fichier ou un répertoire partagé publiquement a été <strong>téléchargé</strong>", + "You received a new remote share %2$s from %1$s" : "L'utilisateur %1$s a partagé la ressource %2$s avec vous.", "You received a new remote share from %s" : "Vous avez reçu un partage distant de %s", "%1$s accepted remote share %2$s" : "%1$s a accepté le partage distant %2$s", "%1$s declined remote share %2$s" : "%1$s a refusé le partage distant %2$s", diff --git a/apps/files_sharing/l10n/gl.js b/apps/files_sharing/l10n/gl.js index 1a5e1d10e77..390befe6ffe 100644 --- a/apps/files_sharing/l10n/gl.js +++ b/apps/files_sharing/l10n/gl.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "<strong>Compartiuse</strong> un ficheiro ou cartafol", "A file or folder was shared from <strong>another server</strong>" : "Compartiuse un ficheiro ou cartafol desde <strong>outro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Foi <strong>descargado</strong> un ficheiro ou cartafol público", + "You received a new remote share %2$s from %1$s" : "Recibiu unha compartición remota %2$s de %1$s", "You received a new remote share from %s" : "Recibiu unha compartición remota de %s", "%1$s accepted remote share %2$s" : "%1$s comparticións remotas aceptadas %2$s", "%1$s declined remote share %2$s" : "%1$s comparticións remotas declinadas %2$s", diff --git a/apps/files_sharing/l10n/gl.json b/apps/files_sharing/l10n/gl.json index 25532580e78..b00e3d621b0 100644 --- a/apps/files_sharing/l10n/gl.json +++ b/apps/files_sharing/l10n/gl.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "<strong>Compartiuse</strong> un ficheiro ou cartafol", "A file or folder was shared from <strong>another server</strong>" : "Compartiuse un ficheiro ou cartafol desde <strong>outro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Foi <strong>descargado</strong> un ficheiro ou cartafol público", + "You received a new remote share %2$s from %1$s" : "Recibiu unha compartición remota %2$s de %1$s", "You received a new remote share from %s" : "Recibiu unha compartición remota de %s", "%1$s accepted remote share %2$s" : "%1$s comparticións remotas aceptadas %2$s", "%1$s declined remote share %2$s" : "%1$s comparticións remotas declinadas %2$s", diff --git a/apps/files_sharing/l10n/id.js b/apps/files_sharing/l10n/id.js index fd8b3dd810e..6322747c9c1 100644 --- a/apps/files_sharing/l10n/id.js +++ b/apps/files_sharing/l10n/id.js @@ -21,6 +21,7 @@ OC.L10N.register( "Remote share password" : "Sandi berbagi remote", "Cancel" : "Batal", "Add remote share" : "Tambah berbagi remote", + "You can upload into this folder" : "Anda dapat mengunggah kedalam folder ini", "No ownCloud installation (7 or higher) found at {remote}" : "Tidak ditemukan instalasi ownCloud (7 atau lebih tinggi) pada {remote}", "Invalid ownCloud url" : "URL ownCloud tidak sah", "Share" : "Bagikan", @@ -39,6 +40,8 @@ OC.L10N.register( "%2$s shared %1$s with you" : "%2$s membagikan %1$s dengan Anda", "You shared %1$s via link" : "Anda membagikan %1$s via tautan", "Shares" : "Dibagikan", + "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Dibagikan pada saya melalui #ownCloud Federated Cloud ID saya, lihat %s", + "Share with me through my #ownCloud Federated Cloud ID" : "Dibagikan pada saya melalui #ownCloud Federated Cloud ID saya", "This share is password-protected" : "Berbagi ini dilindungi sandi", "The password is wrong. Try again." : "Sandi salah. Coba lagi", "Password" : "Sandi", @@ -58,6 +61,12 @@ OC.L10N.register( "Federated Cloud Sharing" : "Federated Cloud Sharing", "Open documentation" : "Buka dokumentasi", "Allow users on this server to send shares to other servers" : "Izinkan para pengguna di server ini untuk mengirimkan berbagi ke server lainnya.", - "Allow users on this server to receive shares from other servers" : "Izinkan para pengguna di server ini untuk menerima berbagi ke server lainnya." + "Allow users on this server to receive shares from other servers" : "Izinkan para pengguna di server ini untuk menerima berbagi ke server lainnya.", + "Federated Cloud" : "Federated Cloud", + "Your Federated Cloud ID:" : "Federated Cloud ID Anda:", + "Share it:" : "Bagikan:", + "Add it to your website:" : "Tambahkan ke situs web Anda:", + "Share with me via ownCloud" : "Dibagikan pada saya via ownCloud", + "HTML Code:" : "Kode HTML:" }, "nplurals=1; plural=0;"); diff --git a/apps/files_sharing/l10n/id.json b/apps/files_sharing/l10n/id.json index e82b6966d24..ed1a6fb7bca 100644 --- a/apps/files_sharing/l10n/id.json +++ b/apps/files_sharing/l10n/id.json @@ -19,6 +19,7 @@ "Remote share password" : "Sandi berbagi remote", "Cancel" : "Batal", "Add remote share" : "Tambah berbagi remote", + "You can upload into this folder" : "Anda dapat mengunggah kedalam folder ini", "No ownCloud installation (7 or higher) found at {remote}" : "Tidak ditemukan instalasi ownCloud (7 atau lebih tinggi) pada {remote}", "Invalid ownCloud url" : "URL ownCloud tidak sah", "Share" : "Bagikan", @@ -37,6 +38,8 @@ "%2$s shared %1$s with you" : "%2$s membagikan %1$s dengan Anda", "You shared %1$s via link" : "Anda membagikan %1$s via tautan", "Shares" : "Dibagikan", + "Share with me through my #ownCloud Federated Cloud ID, see %s" : "Dibagikan pada saya melalui #ownCloud Federated Cloud ID saya, lihat %s", + "Share with me through my #ownCloud Federated Cloud ID" : "Dibagikan pada saya melalui #ownCloud Federated Cloud ID saya", "This share is password-protected" : "Berbagi ini dilindungi sandi", "The password is wrong. Try again." : "Sandi salah. Coba lagi", "Password" : "Sandi", @@ -56,6 +59,12 @@ "Federated Cloud Sharing" : "Federated Cloud Sharing", "Open documentation" : "Buka dokumentasi", "Allow users on this server to send shares to other servers" : "Izinkan para pengguna di server ini untuk mengirimkan berbagi ke server lainnya.", - "Allow users on this server to receive shares from other servers" : "Izinkan para pengguna di server ini untuk menerima berbagi ke server lainnya." + "Allow users on this server to receive shares from other servers" : "Izinkan para pengguna di server ini untuk menerima berbagi ke server lainnya.", + "Federated Cloud" : "Federated Cloud", + "Your Federated Cloud ID:" : "Federated Cloud ID Anda:", + "Share it:" : "Bagikan:", + "Add it to your website:" : "Tambahkan ke situs web Anda:", + "Share with me via ownCloud" : "Dibagikan pada saya via ownCloud", + "HTML Code:" : "Kode HTML:" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/files_sharing/l10n/ja.js b/apps/files_sharing/l10n/ja.js index 2e82cc5f403..bc81dc8dbd4 100644 --- a/apps/files_sharing/l10n/ja.js +++ b/apps/files_sharing/l10n/ja.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "ファイルまたはフォルダーを<strong>共有</strong>したとき", "A file or folder was shared from <strong>another server</strong>" : "ファイルまたはフォルダーが<strong>他のサーバー</strong>から共有されたとき", "A public shared file or folder was <strong>downloaded</strong>" : "公開共有ファイルまたはフォルダーが<strong>ダウンロードされた</strong>とき", + "You received a new remote share %2$s from %1$s" : "%1$s から新しいリモート共有のリクエスト %2$s を受け取りました。", "You received a new remote share from %s" : "%sからリモート共有のリクエストは\n届きました。", "%1$s accepted remote share %2$s" : "%1$s は %2$s のリモート共有を承認しました。", "%1$s declined remote share %2$s" : "%1$s は %2$s のリモート共有を拒否しました。", diff --git a/apps/files_sharing/l10n/ja.json b/apps/files_sharing/l10n/ja.json index 33583797263..9e9018b0ca5 100644 --- a/apps/files_sharing/l10n/ja.json +++ b/apps/files_sharing/l10n/ja.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "ファイルまたはフォルダーを<strong>共有</strong>したとき", "A file or folder was shared from <strong>another server</strong>" : "ファイルまたはフォルダーが<strong>他のサーバー</strong>から共有されたとき", "A public shared file or folder was <strong>downloaded</strong>" : "公開共有ファイルまたはフォルダーが<strong>ダウンロードされた</strong>とき", + "You received a new remote share %2$s from %1$s" : "%1$s から新しいリモート共有のリクエスト %2$s を受け取りました。", "You received a new remote share from %s" : "%sからリモート共有のリクエストは\n届きました。", "%1$s accepted remote share %2$s" : "%1$s は %2$s のリモート共有を承認しました。", "%1$s declined remote share %2$s" : "%1$s は %2$s のリモート共有を拒否しました。", diff --git a/apps/files_sharing/l10n/nb_NO.js b/apps/files_sharing/l10n/nb_NO.js index b7e2dfc9b07..c6c7fb0b445 100644 --- a/apps/files_sharing/l10n/nb_NO.js +++ b/apps/files_sharing/l10n/nb_NO.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "En fil eller mappe ble <strong>delt</strong>", "A file or folder was shared from <strong>another server</strong>" : "En fil eller mappe ble delt fra <strong>en annen server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "En offentlig delt fil eller mappe ble <strong>lastet ned</strong>", + "You received a new remote share %2$s from %1$s" : "Du mottok en ny ekstern deling %2$s fra %1$s", "You received a new remote share from %s" : "Du mottok en ny ekstern deling fra %s", "%1$s accepted remote share %2$s" : "%1$s aksepterte ekstern deling %2$s", "%1$s declined remote share %2$s" : "%1$s avviste ekstern deling %2$s", diff --git a/apps/files_sharing/l10n/nb_NO.json b/apps/files_sharing/l10n/nb_NO.json index 2e490bbcde7..43435faa5ac 100644 --- a/apps/files_sharing/l10n/nb_NO.json +++ b/apps/files_sharing/l10n/nb_NO.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "En fil eller mappe ble <strong>delt</strong>", "A file or folder was shared from <strong>another server</strong>" : "En fil eller mappe ble delt fra <strong>en annen server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "En offentlig delt fil eller mappe ble <strong>lastet ned</strong>", + "You received a new remote share %2$s from %1$s" : "Du mottok en ny ekstern deling %2$s fra %1$s", "You received a new remote share from %s" : "Du mottok en ny ekstern deling fra %s", "%1$s accepted remote share %2$s" : "%1$s aksepterte ekstern deling %2$s", "%1$s declined remote share %2$s" : "%1$s avviste ekstern deling %2$s", diff --git a/apps/files_sharing/l10n/nl.js b/apps/files_sharing/l10n/nl.js index 91329d6236f..b2dc1f1deab 100644 --- a/apps/files_sharing/l10n/nl.js +++ b/apps/files_sharing/l10n/nl.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "Een bestand of map is <strong>gedeeld</strong>", "A file or folder was shared from <strong>another server</strong>" : "Een bestand of map werd gedeeld vanaf <strong>een andere server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Een openbaar gedeeld bestand of map werd <strong>gedownloaded</strong>", + "You received a new remote share %2$s from %1$s" : "U ontving een nieuwe externe share %2$s van %1$s", "You received a new remote share from %s" : "U ontving een nieuwe externe share van %s", "%1$s accepted remote share %2$s" : "%1$s accepteerde externe share %2$s", "%1$s declined remote share %2$s" : "%1$s weigerde externe share %2$s", diff --git a/apps/files_sharing/l10n/nl.json b/apps/files_sharing/l10n/nl.json index 298d0b24380..e4cf032aad2 100644 --- a/apps/files_sharing/l10n/nl.json +++ b/apps/files_sharing/l10n/nl.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "Een bestand of map is <strong>gedeeld</strong>", "A file or folder was shared from <strong>another server</strong>" : "Een bestand of map werd gedeeld vanaf <strong>een andere server</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Een openbaar gedeeld bestand of map werd <strong>gedownloaded</strong>", + "You received a new remote share %2$s from %1$s" : "U ontving een nieuwe externe share %2$s van %1$s", "You received a new remote share from %s" : "U ontving een nieuwe externe share van %s", "%1$s accepted remote share %2$s" : "%1$s accepteerde externe share %2$s", "%1$s declined remote share %2$s" : "%1$s weigerde externe share %2$s", diff --git a/apps/files_sharing/l10n/pt_BR.js b/apps/files_sharing/l10n/pt_BR.js index af80d4b380c..06ab247fc34 100644 --- a/apps/files_sharing/l10n/pt_BR.js +++ b/apps/files_sharing/l10n/pt_BR.js @@ -29,6 +29,7 @@ OC.L10N.register( "A file or folder has been <strong>shared</strong>" : "Um arquivo ou pasta foi <strong>compartilhado</strong> ", "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhada a partir de <strong>outro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhada publicamente foi <strong>baixado</strong>", + "You received a new remote share %2$s from %1$s" : "Você recebeu um novo conpartilhamento remoto %2$s de %1$s", "You received a new remote share from %s" : "Você recebeu um novo compartilhamento remoto de %s", "%1$s accepted remote share %2$s" : "%1$s aceitou o compartilhamento remoto %2$s", "%1$s declined remote share %2$s" : "%1$s declinou o compartilhamento remoto %2$s", diff --git a/apps/files_sharing/l10n/pt_BR.json b/apps/files_sharing/l10n/pt_BR.json index cd6e4492f51..76865b34188 100644 --- a/apps/files_sharing/l10n/pt_BR.json +++ b/apps/files_sharing/l10n/pt_BR.json @@ -27,6 +27,7 @@ "A file or folder has been <strong>shared</strong>" : "Um arquivo ou pasta foi <strong>compartilhado</strong> ", "A file or folder was shared from <strong>another server</strong>" : "Um arquivo ou pasta foi compartilhada a partir de <strong>outro servidor</strong>", "A public shared file or folder was <strong>downloaded</strong>" : "Um arquivo ou pasta compartilhada publicamente foi <strong>baixado</strong>", + "You received a new remote share %2$s from %1$s" : "Você recebeu um novo conpartilhamento remoto %2$s de %1$s", "You received a new remote share from %s" : "Você recebeu um novo compartilhamento remoto de %s", "%1$s accepted remote share %2$s" : "%1$s aceitou o compartilhamento remoto %2$s", "%1$s declined remote share %2$s" : "%1$s declinou o compartilhamento remoto %2$s", diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php index a21f57235c9..e531674ddc2 100644 --- a/apps/files_sharing/lib/activity.php +++ b/apps/files_sharing/lib/activity.php @@ -150,6 +150,10 @@ class Activity implements IExtension { if ($app === self::FILES_SHARING_APP) { switch ($text) { case self::SUBJECT_REMOTE_SHARE_RECEIVED: + if (sizeof($params) === 2) { + // New activity ownCloud 8.2+ + return (string) $l->t('You received a new remote share %2$s from %1$s', $params); + } return (string) $l->t('You received a new remote share from %s', $params); case self::SUBJECT_REMOTE_SHARE_ACCEPTED: return (string) $l->t('%1$s accepted remote share %2$s', $params); @@ -190,14 +194,15 @@ class Activity implements IExtension { if ($app === self::FILES_SHARING_APP) { switch ($text) { case self::SUBJECT_REMOTE_SHARE_RECEIVED: + case self::SUBJECT_REMOTE_SHARE_UNSHARED: return array( - 0 => '',// We can not use 'username' since the user is in a different ownCloud + 0 => 'federated_cloud_id', + //1 => 'file', in theory its a file, but it does not exist yet/anymore ); case self::SUBJECT_REMOTE_SHARE_ACCEPTED: case self::SUBJECT_REMOTE_SHARE_DECLINED: - case self::SUBJECT_REMOTE_SHARE_UNSHARED: return array( - 0 => '',// We can not use 'username' since the user is in a different ownCloud + 0 => 'federated_cloud_id', 1 => 'file', ); case self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED: @@ -214,7 +219,7 @@ class Activity implements IExtension { case self::SUBJECT_SHARED_GROUP_SELF: return [ 0 => 'file', - //1 => 'group', Group does not exist yet + 1 => 'group', ]; } } @@ -230,7 +235,7 @@ class Activity implements IExtension { * @return integer|false */ public function getGroupParameter($activity) { - if ($activity['app'] === 'files') { + if ($activity['app'] === self::FILES_SHARING_APP) { switch ($activity['subject']) { case self::SUBJECT_SHARED_LINK_SELF: case self::SUBJECT_SHARED_WITH_BY: diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 0246e2d9c80..67a26c096c2 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -186,6 +186,7 @@ class Manager { * accept server-to-server share * * @param int $id + * @return bool True if the share could be accepted, false otherwise */ public function acceptShare($id) { @@ -204,13 +205,18 @@ class Manager { WHERE `id` = ? AND `user` = ?'); $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid)); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept'); + + return true; } + + return false; } /** * decline server-to-server share * * @param int $id + * @return bool True if the share could be declined, false otherwise */ public function declineShare($id) { @@ -221,7 +227,11 @@ class Manager { DELETE FROM `*PREFIX*share_external` WHERE `id` = ? AND `user` = ?'); $removeShare->execute(array($id, $this->uid)); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); + + return true; } + + return false; } /** diff --git a/apps/files_sharing/lib/readonlywrapper.php b/apps/files_sharing/lib/readonlywrapper.php deleted file mode 100644 index a5d84f7f5a2..00000000000 --- a/apps/files_sharing/lib/readonlywrapper.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OCA\Files_Sharing; - -use OC\Files\Cache\Wrapper\CachePermissionsMask; -use OC\Files\Storage\Wrapper\Wrapper; -use OCP\Constants; - -class ReadOnlyWrapper extends Wrapper { - public function isUpdatable($path) { - return false; - } - - public function isCreatable($path) { - return false; - } - - public function isDeletable($path) { - return false; - } - - public function getPermissions($path) { - return $this->storage->getPermissions($path) & (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE); - } - - public function rename($path1, $path2) { - return false; - } - - public function touch($path, $mtime = null) { - return false; - } - - public function mkdir($path) { - return false; - } - - public function rmdir($path) { - return false; - } - - public function unlink($path) { - return false; - } - - public function getCache($path = '', $storage = null) { - if (!$storage) { - $storage = $this; - } - $sourceCache = $this->storage->getCache($path, $storage); - return new CachePermissionsMask($sourceCache, Constants::PERMISSION_READ | Constants::PERMISSION_SHARE); - } -} diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php index be7530897f6..c0a9dc328d1 100644 --- a/apps/files_sharing/publicwebdav.php +++ b/apps/files_sharing/publicwebdav.php @@ -64,7 +64,7 @@ $server->on('beforeMethod', function () use ($server, $objectTree, $authBackend) if (!$isWritable) { \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) { - return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage)); + return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE)); }); } diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 1b1e363b792..1bbf4ffca09 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -206,6 +206,23 @@ describe('OCA.Sharing.Util tests', function() { expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg'); expect($action.find('img').length).toEqual(1); }); + it('do not show static share text when share exists but neither permission nor owner is available', function() { + var $action, $tr; + fileList.setFiles([{ + id: 1, + type: 'dir', + name: 'One', + path: '/subdir', + mimetype: 'text/plain', + size: 12, + permissions: OC.PERMISSION_CREATE, + etag: 'abc' + }]); + $tr = fileList.$el.find('tbody tr:first'); + expect($tr.find('.action-share').length).toEqual(0); + $action = $tr.find('.action-share-notification'); + expect($action.length).toEqual(0); + }); }); describe('Share action', function() { var showDropDownStub; diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php index 0759d0015bd..ed21e20f751 100644 --- a/apps/files_sharing/tests/share.php +++ b/apps/files_sharing/tests/share.php @@ -65,7 +65,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { parent::tearDown(); } - function testUnshareFromSelf() { + public function testUnshareFromSelf() { \OC_Group::createGroup('testGroup'); \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, 'testGroup'); @@ -103,7 +103,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { /** * if a file was shared as group share and as individual share they should be grouped */ - function testGroupingOfShares() { + public function testGroupingOfShares() { $fileinfo = $this->view->getFileInfo($this->filename); @@ -171,7 +171,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { * single user share to user2. If he re-shares the file to user2 the same target * then the group share should be used to group the item */ - function testShareAndUnshareFromSelf() { + public function testShareAndUnshareFromSelf() { $fileinfo = $this->view->getFileInfo($this->filename); // share the file to group1 (user2 is a member of this group) and explicitely to user2 @@ -217,7 +217,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { } - function verifyDirContent($content, $expected) { + public function verifyDirContent($content, $expected) { foreach ($content as $c) { if (!in_array($c['name'], $expected)) { $this->assertTrue(false, "folder should only contain '" . implode(',', $expected) . "', found: " .$c['name']); @@ -225,7 +225,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { } } - function testShareWithDifferentShareFolder() { + public function testShareWithDifferentShareFolder() { $fileinfo = $this->view->getFileInfo($this->filename); $folderinfo = $this->view->getFileInfo($this->folder); @@ -249,7 +249,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { \OC::$server->getConfig()->deleteSystemValue('share_folder'); } - function testShareWithGroupUniqueName() { + public function testShareWithGroupUniqueName() { $this->loginHelper(self::TEST_FILES_SHARING_API_USER1); \OC\Files\Filesystem::file_put_contents('test.txt', 'test'); @@ -283,9 +283,9 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { /** * shared files should never have delete permissions - * @dataProvider DataProviderTestFileSharePermissions + * @dataProvider dataProviderTestFileSharePermissions */ - function testFileSharePermissions($permission, $expectedPermissions) { + public function testFileSharePermissions($permission, $expectedPermissions) { $fileinfo = $this->view->getFileInfo($this->filename); @@ -305,7 +305,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { $this->assertSame($expectedPermissions, $share['permissions']); } - function DataProviderTestFileSharePermissions() { + public function dataProviderTestFileSharePermissions() { $permission1 = \OCP\Constants::PERMISSION_ALL; $permission3 = \OCP\Constants::PERMISSION_READ; $permission4 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE; @@ -321,4 +321,134 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { ); } + /** + * @dataProvider dataProviderGetUsersSharingFile + * + * @param string $groupName name of group to share with + * @param bool $includeOwner whether to include the owner in the result + * @param bool $includePaths whether to include paths in the result + * @param array $expectedResult expected result of the API call + */ + public function testGetUsersSharingFile($groupName, $includeOwner, $includePaths, $expectedResult) { + + $fileinfo = $this->view->getFileInfo($this->folder); + + $result = \OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, + $groupName, \OCP\Constants::PERMISSION_READ); + $this->assertTrue($result); + + // public share + $result = \OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, + null, \OCP\Constants::PERMISSION_READ); + $this->assertNotNull($result); // returns the token! + + // owner renames after sharing + $this->view->rename($this->folder, $this->folder . '_owner_renamed'); + + self::loginHelper(self::TEST_FILES_SHARING_API_USER2); + + $user2View = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); + $user2View->rename($this->folder, $this->folder . '_renamed'); + + $ownerPath = $this->folder . '_owner_renamed'; + $owner = self::TEST_FILES_SHARING_API_USER1; + + $result = \OCP\Share::getUsersSharingFile($ownerPath, $owner, $includeOwner, $includePaths); + + // sort users to make sure it matches + if ($includePaths) { + ksort($result); + } else { + sort($result['users']); + } + + $this->assertEquals( + $expectedResult, + $result + ); + } + + public function dataProviderGetUsersSharingFile() { + // note: "group" contains user1 (the owner), user2 and user3 + // and self::TEST_FILES_SHARING_API_GROUP1 contains only user2 + return [ + // share with group that contains owner + [ + 'group', + false, + false, + [ + 'users' => + [ + // because user1 was in group + self::TEST_FILES_SHARING_API_USER1, + self::TEST_FILES_SHARING_API_USER2, + self::TEST_FILES_SHARING_API_USER3, + ], + 'public' => true, + 'remote' => false, + ], + ], + // share with group that does not contain owner + [ + self::TEST_FILES_SHARING_API_GROUP1, + false, + false, + [ + 'users' => + [ + self::TEST_FILES_SHARING_API_USER2, + ], + 'public' => true, + 'remote' => false, + ], + ], + // share with group that does not contain owner, include owner + [ + self::TEST_FILES_SHARING_API_GROUP1, + true, + false, + [ + 'users' => + [ + self::TEST_FILES_SHARING_API_USER1, + self::TEST_FILES_SHARING_API_USER2, + ], + 'public' => true, + 'remote' => false, + ], + ], + // include paths, with owner + [ + 'group', + true, + true, + [ + self::TEST_FILES_SHARING_API_USER1 => self::TEST_FOLDER_NAME . '_owner_renamed', + self::TEST_FILES_SHARING_API_USER2 => self::TEST_FOLDER_NAME . '_renamed', + self::TEST_FILES_SHARING_API_USER3 => self::TEST_FOLDER_NAME, + ], + ], + // include paths, group without owner + [ + self::TEST_FILES_SHARING_API_GROUP1, + false, + true, + [ + self::TEST_FILES_SHARING_API_USER2 => self::TEST_FOLDER_NAME. '_renamed', + ], + ], + // include paths, include owner, group without owner + [ + self::TEST_FILES_SHARING_API_GROUP1, + true, + true, + [ + self::TEST_FILES_SHARING_API_USER1 => self::TEST_FOLDER_NAME . '_owner_renamed', + self::TEST_FILES_SHARING_API_USER2 => self::TEST_FOLDER_NAME . '_renamed', + ], + ], + ]; + } + } diff --git a/lib/private/legacy/search/provider.php b/apps/files_trashbin/appinfo/register_command.php index e411673fe0e..ae4196dd506 100644 --- a/lib/private/legacy/search/provider.php +++ b/apps/files_trashbin/appinfo/register_command.php @@ -1,8 +1,6 @@ <?php /** - * @author Andrew Brown <andrew@casabrown.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> + * @author Björn Schießle <schiessle@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 @@ -21,11 +19,11 @@ * */ -/** - * Class OC_Search_Provider - * - * @deprecated use \OCP\Search\Provider instead - */ -abstract class OC_Search_Provider extends \OCP\Search\Provider { -} +use OCA\Files_Trashbin\Command\CleanUp; + +$userManager = OC::$server->getUserManager(); +$rootFolder = \OC::$server->getRootFolder(); +$dbConnection = \OC::$server->getDatabaseConnection(); +/** @var Symfony\Component\Console\Application $application */ +$application->add(new CleanUp($rootFolder, $userManager, $dbConnection)); diff --git a/apps/files_trashbin/command/cleanup.php b/apps/files_trashbin/command/cleanup.php new file mode 100644 index 00000000000..961f72763ea --- /dev/null +++ b/apps/files_trashbin/command/cleanup.php @@ -0,0 +1,118 @@ +<?php +/** + * @author Björn Schießle <schiessle@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\Files_Trashbin\Command; + +use OCP\Files\IRootFolder; +use OCP\IDBConnection; +use OCP\IUserBackend; +use OCP\IUserManager; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class CleanUp extends Command { + + /** @var IUserManager */ + protected $userManager; + + /** @var IRootFolder */ + protected $rootFolder; + + /** @var \OC\DB\Connection */ + protected $dbConnection; + + /** + * @param IRootFolder $rootFolder + * @param IUserManager $userManager + * @param IDBConnection $dbConnection + */ + function __construct(IRootFolder $rootFolder, IUserManager $userManager, IDBConnection $dbConnection) { + parent::__construct(); + $this->userManager = $userManager; + $this->rootFolder = $rootFolder; + $this->dbConnection = $dbConnection; + } + + protected function configure() { + $this + ->setName('trashbin:cleanup') + ->setDescription('Remove deleted files') + ->addArgument( + 'user_id', + InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + 'remove deleted files of the given user(s), if no user is given all deleted files will be removed' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $users = $input->getArgument('user_id'); + if (!empty($users)) { + foreach ($users as $user) { + if ($this->userManager->userExists($user)) { + $output->writeln("Remove deleted files of <info>$user</info>"); + $this->removeDeletedFiles($user); + } else { + $output->writeln("<error>Unknown user $user</error>"); + } + } + } else { + $output->writeln('Remove all deleted files'); + foreach ($this->userManager->getBackends() as $backend) { + $name = get_class($backend); + if ($backend instanceof IUserBackend) { + $name = $backend->getBackendName(); + } + $output->writeln("Remove deleted files for users on backend <info>$name</info>"); + $limit = 500; + $offset = 0; + do { + $users = $backend->getUsers('', $limit, $offset); + foreach ($users as $user) { + $output->writeln(" <info>$user</info>"); + $this->removeDeletedFiles($user); + } + $offset += $limit; + } while (count($users) >= $limit); + } + } + } + + /** + * remove deleted files for the given user + * + * @param string $uid + */ + protected function removeDeletedFiles($uid) { + \OC_Util::tearDownFS(); + \OC_Util::setupFS($uid); + if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { + $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); + $query = $this->dbConnection->createQueryBuilder(); + $query->delete('`*PREFIX*files_trash`') + ->where($query->expr()->eq('`user`', ':uid')) + ->setParameter('uid', $uid); + $query->execute(); + } + } + +} diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 2d4ea7adc13..8b666c56c66 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -160,7 +160,7 @@ class Trashbin { $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)"); $result = $query->execute(array($ownerFilename, $timestamp, $ownerLocation, $owner)); if (!$result) { - \OCP\Util::writeLog('files_trashbin', 'trash bin database couldn\'t be updated for the files owner', \OC_log::ERROR); + \OCP\Util::writeLog('files_trashbin', 'trash bin database couldn\'t be updated for the files owner', \OCP\Util::ERROR); } } } @@ -216,7 +216,7 @@ class Trashbin { if ($trashStorage->file_exists($trashInternalPath)) { $trashStorage->unlink($trashInternalPath); } - \OCP\Util::writeLog('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OC_log::ERROR); + \OCP\Util::writeLog('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OCP\Util::ERROR); } if ($sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort @@ -231,7 +231,7 @@ class Trashbin { $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)"); $result = $query->execute(array($filename, $timestamp, $location, $user)); if (!$result) { - \OCP\Util::writeLog('files_trashbin', 'trash bin database couldn\'t be updated', \OC_log::ERROR); + \OCP\Util::writeLog('files_trashbin', 'trash bin database couldn\'t be updated', \OCP\Util::ERROR); } \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', array('filePath' => \OC\Files\Filesystem::normalizePath($file_path), 'trashPath' => \OC\Files\Filesystem::normalizePath($filename . '.d' . $timestamp))); @@ -675,7 +675,7 @@ class Trashbin { foreach ($files as $file) { if ($availableSpace < 0) { $tmp = self::delete($file['name'], $user, $file['mtime']); - \OCP\Util::writeLog('files_trashbin', 'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota)', \OC_log::INFO); + \OCP\Util::writeLog('files_trashbin', 'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota)', \OCP\Util::INFO); $availableSpace += $tmp; $size += $tmp; } else { diff --git a/apps/files_trashbin/tests/command/cleanuptest.php b/apps/files_trashbin/tests/command/cleanuptest.php new file mode 100644 index 00000000000..6e2f78093e0 --- /dev/null +++ b/apps/files_trashbin/tests/command/cleanuptest.php @@ -0,0 +1,192 @@ +<?php +/** + * @author Björn Schießle <schiessle@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + + +namespace OCA\Files_Trashbin\Tests\Command; + + +use OCA\Files_Trashbin\Command\CleanUp; +use Test\TestCase; +use OC\User\Manager; +use OCP\Files\IRootFolder; + +class CleanUpTest extends TestCase { + + /** @var CleanUp */ + protected $cleanup; + + /** @var \PHPUnit_Framework_MockObject_MockObject | Manager */ + protected $userManager; + + /** @var \PHPUnit_Framework_MockObject_MockObject | IRootFolder */ + protected $rootFolder; + + /** @var \OC\DB\Connection */ + protected $dbConnection; + + /** @var string */ + protected $trashTable = '`*PREFIX*files_trash`'; + + /** @var string */ + protected $user0 = 'user0'; + + public function setUp() { + parent::setUp(); + $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder') + ->disableOriginalConstructor()->getMock(); + $this->userManager = $this->getMockBuilder('OC\User\Manager') + ->disableOriginalConstructor()->getMock(); + + $this->dbConnection = \OC::$server->getDatabaseConnection(); + + $this->cleanup = new CleanUp($this->rootFolder, $this->userManager, $this->dbConnection); + } + + /** + * populate files_trash table with 10 dummy values + */ + public function initTable() { + $query = $this->dbConnection->createQueryBuilder(); + $query->delete($this->trashTable)->execute(); + for ($i = 0; $i < 10; $i++) { + $query->insert($this->trashTable) + ->values(array( + '`id`' => $query->expr()->literal('file'.$i), + '`timestamp`' => $query->expr()->literal($i), + '`location`' => $query->expr()->literal('.'), + '`user`' => $query->expr()->literal('user'.$i%2) + ))->execute(); + } + $getAllQuery = $this->dbConnection->createQueryBuilder(); + $result = $getAllQuery->select('`id`')->from($this->trashTable)->execute()->fetchAll(); + $this->assertSame(10, count($result)); + } + + /** + * @dataProvider dataTestRemoveDeletedFiles + * @param boolean $nodeExists + */ + public function testRemoveDeletedFiles($nodeExists) { + $this->initTable(); + $this->rootFolder->expects($this->once()) + ->method('nodeExists') + ->with('/' . $this->user0 . '/files_trashbin') + ->willReturn($nodeExists); + if($nodeExists) { + $this->rootFolder->expects($this->once()) + ->method('get') + ->with('/' . $this->user0 . '/files_trashbin') + ->willReturn($this->rootFolder); + $this->rootFolder->expects($this->once()) + ->method('delete'); + } else { + $this->rootFolder->expects($this->never())->method('get'); + $this->rootFolder->expects($this->never())->method('delete'); + } + $this->invokePrivate($this->cleanup, 'removeDeletedFiles', [$this->user0]); + + if ($nodeExists) { + // if the delete operation was execute only files from user1 + // should be left. + $query = $this->dbConnection->createQueryBuilder(); + $result = $query->select('`user`') + ->from($this->trashTable) + ->execute()->fetchAll(); + $this->assertSame(5, count($result)); + foreach ($result as $r) { + $this->assertSame('user1', $r['user']); + } + } else { + // if no delete operation was execute we should still have all 10 + // database entries + $getAllQuery = $this->dbConnection->createQueryBuilder(); + $result = $getAllQuery->select('`id`')->from($this->trashTable)->execute()->fetchAll(); + $this->assertSame(10, count($result)); + } + + } + public function dataTestRemoveDeletedFiles() { + return array( + array(true), + array(false) + ); + } + + /** + * test remove deleted files from users given as parameter + */ + public function testExecuteDeleteListOfUsers() { + $userIds = ['user1', 'user2', 'user3']; + $instance = $this->getMockBuilder('OCA\Files_Trashbin\Command\CleanUp') + ->setMethods(['removeDeletedFiles']) + ->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection]) + ->getMock(); + $instance->expects($this->exactly(count($userIds))) + ->method('removeDeletedFiles') + ->willReturnCallback(function ($user) use ($userIds) { + $this->assertTrue(in_array($user, $userIds)); + }); + $this->userManager->expects($this->exactly(count($userIds))) + ->method('userExists')->willReturn(true); + $inputInterface = $this->getMockBuilder('\Symfony\Component\Console\Input\InputInterface') + ->disableOriginalConstructor()->getMock(); + $inputInterface->expects($this->once())->method('getArgument') + ->with('user_id') + ->willReturn($userIds); + $outputInterface = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface') + ->disableOriginalConstructor()->getMock(); + $this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]); + } + + /** + * test remove deleted files of all users + */ + public function testExecuteAllUsers() { + $userIds = []; + $backendUsers = ['user1', 'user2']; + $instance = $this->getMockBuilder('OCA\Files_Trashbin\Command\CleanUp') + ->setMethods(['removeDeletedFiles']) + ->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection]) + ->getMock(); + $backend = $this->getMockBuilder('OC_User_Interface') + ->disableOriginalConstructor()->getMock(); + $backend->expects($this->once())->method('getUsers') + ->with('', 500, 0) + ->willReturn($backendUsers); + $instance->expects($this->exactly(count($backendUsers))) + ->method('removeDeletedFiles') + ->willReturnCallback(function ($user) use ($backendUsers) { + $this->assertTrue(in_array($user, $backendUsers)); + }); + $inputInterface = $this->getMockBuilder('\Symfony\Component\Console\Input\InputInterface') + ->disableOriginalConstructor()->getMock(); + $inputInterface->expects($this->once())->method('getArgument') + ->with('user_id') + ->willReturn($userIds); + $outputInterface = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface') + ->disableOriginalConstructor()->getMock(); + $this->userManager->expects($this->once()) + ->method('getBackends') + ->willReturn([$backend]); + $this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]); + } + +} diff --git a/lib/private/legacy/search/provider/file.php b/apps/files_versions/appinfo/register_command.php index f895ce8e07e..49efdbe6190 100644 --- a/lib/private/legacy/search/provider/file.php +++ b/apps/files_versions/appinfo/register_command.php @@ -1,8 +1,6 @@ <?php /** - * @author Andrew Brown <andrew@casabrown.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> + * @author Björn Schießle <schiessle@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 @@ -21,9 +19,10 @@ * */ -/** - * @deprecated use \OC\Search\Provider\File instead - */ -class OC_Search_Provider_File extends \OC\Search\Provider\File { -} +use OCA\Files_Versions\Command\CleanUp; + +$userManager = OC::$server->getUserManager(); +$rootFolder = \OC::$server->getRootFolder(); +/** @var Symfony\Component\Console\Application $application */ +$application->add(new CleanUp($rootFolder, $userManager)); diff --git a/apps/files_versions/command/cleanup.php b/apps/files_versions/command/cleanup.php new file mode 100644 index 00000000000..bed6dd01773 --- /dev/null +++ b/apps/files_versions/command/cleanup.php @@ -0,0 +1,114 @@ +<?php +/** + * @author Björn Schießle <schiessle@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\Files_Versions\Command; + + +use OCP\Files\IRootFolder; +use OCP\IUserBackend; +use OCP\IUserManager; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class CleanUp extends Command { + + /** @var IUserManager */ + protected $userManager; + + /** @var IRootFolder */ + protected $rootFolder; + + /** + * @param IRootFolder $rootFolder + * @param IUserManager $userManager + */ + function __construct(IRootFolder $rootFolder, IUserManager $userManager) { + parent::__construct(); + $this->userManager = $userManager; + $this->rootFolder = $rootFolder; + } + + protected function configure() { + $this + ->setName('versions:cleanup') + ->setDescription('Delete versions') + ->addArgument( + 'user_id', + InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + 'delete versions of the given user(s), if no user is given all versions will be deleted' + ); + } + + + protected function execute(InputInterface $input, OutputInterface $output) { + + $users = $input->getArgument('user_id'); + if (!empty($users)) { + foreach ($users as $user) { + if ($this->userManager->userExists($user)) { + $output->writeln("Delete versions of <info>$user</info>"); + $this->deleteVersions($user); + } else { + $output->writeln("<error>Unknown user $user</error>"); + } + } + } else { + $output->writeln('Delete all versions'); + foreach ($this->userManager->getBackends() as $backend) { + $name = get_class($backend); + + if ($backend instanceof IUserBackend) { + $name = $backend->getBackendName(); + } + + $output->writeln("Delete versions for users on backend <info>$name</info>"); + + $limit = 500; + $offset = 0; + do { + $users = $backend->getUsers('', $limit, $offset); + foreach ($users as $user) { + $output->writeln(" <info>$user</info>"); + $this->deleteVersions($user); + } + $offset += $limit; + } while (count($users) >= $limit); + } + } + } + + + /** + * delete versions for the given user + * + * @param string $user + */ + protected function deleteVersions($user) { + \OC_Util::tearDownFS(); + \OC_Util::setupFS($user); + if ($this->rootFolder->nodeExists('/' . $user . '/files_versions')) { + $this->rootFolder->get('/' . $user . '/files_versions')->delete(); + } + } + +} diff --git a/apps/files_versions/tests/command/cleanuptest.php b/apps/files_versions/tests/command/cleanuptest.php new file mode 100644 index 00000000000..bfde25d75ce --- /dev/null +++ b/apps/files_versions/tests/command/cleanuptest.php @@ -0,0 +1,162 @@ +<?php +/** + * @author Björn Schießle <schiessle@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + + +namespace OCA\Files_Versions\Tests\Command; + + +use OCA\Files_Versions\Command\CleanUp; +use Test\TestCase; +use OC\User\Manager; +use OCP\Files\IRootFolder; + +class CleanupTest extends TestCase { + + /** @var CleanUp */ + protected $cleanup; + + /** @var \PHPUnit_Framework_MockObject_MockObject | Manager */ + protected $userManager; + + /** @var \PHPUnit_Framework_MockObject_MockObject | IRootFolder */ + protected $rootFolder; + + public function setUp() { + parent::setUp(); + + $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder') + ->disableOriginalConstructor()->getMock(); + $this->userManager = $this->getMockBuilder('OC\User\Manager') + ->disableOriginalConstructor()->getMock(); + + + $this->cleanup = new CleanUp($this->rootFolder, $this->userManager); + } + + /** + * @dataProvider dataTestDeleteVersions + * @param boolean $nodeExists + */ + public function testDeleteVersions($nodeExists) { + + $this->rootFolder->expects($this->once()) + ->method('nodeExists') + ->with('/testUser/files_versions') + ->willReturn($nodeExists); + + + if($nodeExists) { + $this->rootFolder->expects($this->once()) + ->method('get') + ->with('/testUser/files_versions') + ->willReturn($this->rootFolder); + $this->rootFolder->expects($this->once()) + ->method('delete'); + } else { + $this->rootFolder->expects($this->never()) + ->method('get'); + $this->rootFolder->expects($this->never()) + ->method('delete'); + } + + $this->invokePrivate($this->cleanup, 'deleteVersions', ['testUser']); + } + + public function dataTestDeleteVersions() { + return array( + array(true), + array(false) + ); + } + + + /** + * test delete versions from users given as parameter + */ + public function testExecuteDeleteListOfUsers() { + $userIds = ['user1', 'user2', 'user3']; + + $instance = $this->getMockBuilder('OCA\Files_Versions\Command\CleanUp') + ->setMethods(['deleteVersions']) + ->setConstructorArgs([$this->rootFolder, $this->userManager]) + ->getMock(); + $instance->expects($this->exactly(count($userIds))) + ->method('deleteVersions') + ->willReturnCallback(function ($user) use ($userIds) { + $this->assertTrue(in_array($user, $userIds)); + }); + + $this->userManager->expects($this->exactly(count($userIds))) + ->method('userExists')->willReturn(true); + + $inputInterface = $this->getMockBuilder('\Symfony\Component\Console\Input\InputInterface') + ->disableOriginalConstructor()->getMock(); + $inputInterface->expects($this->once())->method('getArgument') + ->with('user_id') + ->willReturn($userIds); + + $outputInterface = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface') + ->disableOriginalConstructor()->getMock(); + + $this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]); + } + + /** + * test delete versions of all users + */ + public function testExecuteAllUsers() { + $userIds = []; + $backendUsers = ['user1', 'user2']; + + $instance = $this->getMockBuilder('OCA\Files_Versions\Command\CleanUp') + ->setMethods(['deleteVersions']) + ->setConstructorArgs([$this->rootFolder, $this->userManager]) + ->getMock(); + + $backend = $this->getMockBuilder('OC_User_Interface') + ->disableOriginalConstructor()->getMock(); + $backend->expects($this->once())->method('getUsers') + ->with('', 500, 0) + ->willReturn($backendUsers); + + $instance->expects($this->exactly(count($backendUsers))) + ->method('deleteVersions') + ->willReturnCallback(function ($user) use ($backendUsers) { + $this->assertTrue(in_array($user, $backendUsers)); + }); + + $inputInterface = $this->getMockBuilder('\Symfony\Component\Console\Input\InputInterface') + ->disableOriginalConstructor()->getMock(); + $inputInterface->expects($this->once())->method('getArgument') + ->with('user_id') + ->willReturn($userIds); + + $outputInterface = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface') + ->disableOriginalConstructor()->getMock(); + + $this->userManager->expects($this->once()) + ->method('getBackends') + ->willReturn([$backend]); + + $this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]); + } + +} diff --git a/apps/user_ldap/l10n/fr.js b/apps/user_ldap/l10n/fr.js index 9b0e871c9f0..0dfba342d31 100644 --- a/apps/user_ldap/l10n/fr.js +++ b/apps/user_ldap/l10n/fr.js @@ -78,6 +78,7 @@ OC.L10N.register( "Verify settings" : "Tester les paramètres", "1. Server" : "1. Serveur", "%s. Server:" : "%s. Serveur :", + "Add a new and blank configuration" : "Ajouter une nouvelle configuration vierge", "Copy current configuration into new directory binding" : "Copier la configuration actuelle vers une nouvelle", "Delete the current configuration" : "Supprimer la configuration actuelle", "Host" : "Hôte", diff --git a/apps/user_ldap/l10n/fr.json b/apps/user_ldap/l10n/fr.json index 6fb93d618e1..32df29372a2 100644 --- a/apps/user_ldap/l10n/fr.json +++ b/apps/user_ldap/l10n/fr.json @@ -76,6 +76,7 @@ "Verify settings" : "Tester les paramètres", "1. Server" : "1. Serveur", "%s. Server:" : "%s. Serveur :", + "Add a new and blank configuration" : "Ajouter une nouvelle configuration vierge", "Copy current configuration into new directory binding" : "Copier la configuration actuelle vers une nouvelle", "Delete the current configuration" : "Supprimer la configuration actuelle", "Host" : "Hôte", diff --git a/apps/user_ldap/l10n/id.js b/apps/user_ldap/l10n/id.js index 23170f99864..5daf846dc04 100644 --- a/apps/user_ldap/l10n/id.js +++ b/apps/user_ldap/l10n/id.js @@ -3,14 +3,16 @@ OC.L10N.register( { "Failed to clear the mappings." : "Gagal membersihkan pemetaan.", "Failed to delete the server configuration" : "Gagal menghapus konfigurasi server", + "The configuration is invalid: anonymous bind is not allowed." : "Konfigurasi tidak sah: bind anonim tidak diizinkan", "The configuration is valid and the connection could be established!" : "Konfigurasi valid dan koneksi dapat dilakukan!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." : "Konfigurasi valid, tetapi Bind gagal. Silakan periksa pengaturan server dan kredensial.", - "The configuration is invalid. Please have a look at the logs for further details." : "Konfigurasi tidak sah. Silakan lihat log untuk rincian lebh lanjut.", + "The configuration is invalid. Please have a look at the logs for further details." : "Konfigurasi tidak sah. Silakan lihat log untuk rincian lebih lanjut.", "No action specified" : "Tidak ada tindakan yang ditetapkan", "No configuration specified" : "Tidak ada konfigurasi yang ditetapkan", "No data specified" : "Tidak ada data yang ditetapkan", " Could not set configuration %s" : "Tidak dapat menyetel konfigurasi %s", "Action does not exist" : "Tidak ada tindakan", + "The Base DN appears to be wrong" : "Base DN tampaknya salah", "Configuration incorrect" : "Konfigurasi salah", "Configuration incomplete" : "Konfigurasi tidak lengkap", "Configuration OK" : "Konfigurasi Oke", @@ -29,16 +31,21 @@ OC.L10N.register( "Confirm Deletion" : "Konfirmasi Penghapusan", "Mappings cleared successfully!" : "Pemetaan berhasil dibersihkan!", "Error while clearing the mappings." : "Kesalahan saat membersihkan pemetaan.", + "Anonymous bind is not allowed. Please provide a User DN and Password." : "Bind anonim tidak diizinkan. Mohon berikan sebuah User DN dan Password.", + "LDAP Operations error. Anonymous bind might not be allowed." : "Kesalahan Operasi LDAP. Bind anonim tidak diizinkan.", "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "Menyimpan gagal. Mohon pastikan basis data di Operasi. Muat Ulang sebelum melanjutkan.", - "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Beralih modus akan mengaktifkan kueri LDAP. Hal ini memerlukan beberapa saat tergantung pada ukuran LDAP Anda. Apakah Anda tetap ingin beralih modus?", + "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Beralih modus akan mengaktifkan kueri LDAP secara otomatis. Hal ini memerlukan beberapa saat tergantung pada ukuran LDAP Anda. Apakah Anda tetap ingin beralih modus?", "Mode switch" : "Beralih modus", "Select attributes" : "Pilih atribut", "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Pengguna tidak ditemukan. Mohon periksa atribut login dan nama pengguna Anda. Penyaring efektif (salin dan tempel berikut untuk validasi baris perintah):\n<br/>", "User found and settings verified." : "Pengguna ditemukan dan pengaturan terverifikasi.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Setelan terverifikasi, tapi ditemukan satu pengguna. Hanya yang pertama yang dapat login. Pertimbangkan dengan penyaringan yang lebih sempit.", "An unspecified error occurred. Please check the settings and the log." : "Terjadi kesalahan yang tidak disebutkan. Mohon periksa pengaturan dan log.", "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Penyaring pencarian tidak sah, kemungkinan karena masalah sintaks seperti jumlah kurung buka dan tutup tidak sama. Mohon diperiksa.", "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Terjadi kesalahan sambungan ke LDAP / AD, mohon periksa host, port dan kredensial.", - "The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah diaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.", + "The %uid placeholder is missing. It will be replaced with the login name when querying LDAP / AD." : "Placeholder %uid tidak ada. Placeholder akan digantikan dengan nama login saat melakukan kueri LDAP / AD.", + "Please provide a login name to test against" : "Mohon berikan nama login untuk mengujinya kembali", + "The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah dinonaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.", "_%s group found_::_%s groups found_" : ["%s grup ditemukan"], "_%s user found_::_%s users found_" : ["%s pengguna ditemukan"], "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Tidak mendeteksi atribut nama tampilan pengguna. Silakan menentukannya sendiri di pengaturan ldap lanjutan.", @@ -50,7 +57,7 @@ OC.L10N.register( "Groups" : "Grup", "Test Configuration" : "Uji Konfigurasi", "Help" : "Bantuan", - "Groups meeting these criteria are available in %s:" : "Grup memenuhi kriteria ini tersedia di %s:", + "Groups meeting these criteria are available in %s:" : "Grup yang memenuhi kriteria ini tersedia di %s:", "Only these object classes:" : "Hanya kelas obyek berikut:", "Only from these groups:" : "Hanya dari grup berikut:", "Search groups" : "Pencarian grup", @@ -58,57 +65,83 @@ OC.L10N.register( "Selected groups" : "Grup terpilih", "Edit LDAP Query" : "Sunting Kueri LDAP", "LDAP Filter:" : "Penyaring LDAP:", + "The filter specifies which LDAP groups shall have access to the %s instance." : "Penyaring menentukan grup LDAP mana yang memiliki akses ke %s.", + "Verify settings and count groups" : "Verifikasi setelan dan hitung grup", + "When logging in, %s will find the user based on the following attributes:" : "Pada saat login, %s akan menemukan pengguna berdasarkan atribut berikut:", "LDAP / AD Username:" : "Nama pengguna LDAP / AD:", + "Allows login against the LDAP / AD username, which is either uid or samaccountname and will be detected." : "Izinkan login dengan nama pengguna LDAP / AD, baik berupa uid atau samaccountname, mereka akan terdeteksi.", "LDAP / AD Email Address:" : "Alamat Email LDAP / AD:", + "Allows login against an email attribute. Mail and mailPrimaryAddress will be allowed." : "Izinkan login dengan atribut email. Mail dan mailPrimaryAddress diperbolehkan.", "Other Attributes:" : "Atribut Lain:", + "Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" : "Tetapkan penyaring yang akan diterapkan saat mencoba login. %%uid akan mengganti nama pengguna saat melakukan login. Contoh: \"uid=%%uid\"", + "Test Loginname" : "Test Loginname", + "Verify settings" : "Verifikasi setelan", "1. Server" : "1. Server", "%s. Server:" : "%s. Server:", + "Add a new and blank configuration" : "Tambah konfigurasi kosong yang baru", + "Copy current configuration into new directory binding" : "Salin konfigurasi saat ini kedalam direktori baru", + "Delete the current configuration" : "Hapus konfigurasi saat ini", "Host" : "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" : "Protokol dapat tidak ditulis, kecuali Anda menggunakan SSL. Lalu jalankan dengan ldaps://", "Port" : "Port", + "Detect Port" : "Deteksi Port", "User DN" : "Pengguna DN", "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.", "Password" : "Sandi", "For anonymous access, leave DN and Password empty." : "Untuk akses anonim, biarkan DN dan Kata sandi kosong.", "One Base DN per line" : "Satu Base DN per baris", "You can specify Base DN for users and groups in the Advanced tab" : "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan", + "Detect Base DN" : "Deteksi Base DN", + "Test Base DN" : "Uji Base DN", + "Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge." : "Mencegah permintaan LDAP otomatis. Berguna untuk setelan yang lebih besar, tapi memerlukan beberapa pengetahuan LDAP.", "Manually enter LDAP filters (recommended for large directories)" : "Masukkan penyaring LDAP secara manual (direkomendasikan untuk direktori yang besar)", "Limit %s access to users meeting these criteria:" : "Batasi akses %s untuk pengguna yang sesuai dengan kriteria berikut:", + "The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "Kelas obyek yang umum untuk pengguna adalah organizationalPerson, person, user, dan inetOrgPerson. Jika Anda tidak yakin kelas obyek mana yang akan dipilih, silakan konsultasi dengan admin direktori Anda.", + "The filter specifies which LDAP users shall have access to the %s instance." : "Penyaring menentukan pengguna LDAP mana yang memiliki akses ke %s.", + "Verify settings and count users" : "Verifikasi setelan dan jumlah pengguna", "Saving" : "Menyimpan", "Back" : "Kembali", "Continue" : "Lanjutkan", "LDAP" : "LDAP", "Expert" : "Lanjutan", "Advanced" : "Lanjutan", + "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." : "<b>Peringatan:</b> Aplikasi user_ldap dan user_webdavauth tidak kompatibel. Anda mungkin akan mengalami perilaku yang tidak terduga. Silakan minta administrator Anda untuk menonaktifkan salah satunya.", "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." : "<b>Peringatan:</b> Modul LDAP PHP tidak terpasang, perangkat tidak akan bekerja. Silakan minta administrator sistem untuk memasangnya.", "Connection Settings" : "Pengaturan Koneksi", "Configuration Active" : "Konfigurasi Aktif", - "When unchecked, this configuration will be skipped." : "Jika tidak dicentang, konfigurasi ini dilewati.", - "Backup (Replica) Host" : "Host Cadangan (Replika)", + "When unchecked, this configuration will be skipped." : "Jika tidak dicentang, konfigurasi ini akan dilewati.", + "Backup (Replica) Host" : "Cadangkan (Replika) Host", "Give an optional backup host. It must be a replica of the main LDAP/AD server." : "Berikan pilihan host cadangan. Harus merupakan replika dari server LDAP/AD utama.", - "Backup (Replica) Port" : "Port Cadangan (Replika)", + "Backup (Replica) Port" : "Cadangkan (Replika) Port", "Disable Main Server" : "Nonaktifkan Server Utama", - "Turn off SSL certificate validation." : "matikan validasi sertivikat SSL", - "Cache Time-To-Live" : "Gunakan Tembolok untuk Time-To-Live", + "Only connect to the replica server." : "Hanya terhubung ke server replika.", + "Case insensitive LDAP server (Windows)" : "Server LDAP tidak sensitif kata (Windows)", + "Turn off SSL certificate validation." : "Matikan validasi sertifikat SSL.", + "Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." : "Tidak dianjurkan, gunakan ini hanya untuk percobaan! Jika koneksi hanya bekerja dengan opsi ini, impor sertifikat SSL milik server LDAP kedalam server %s Anda.", + "Cache Time-To-Live" : "Cache Time-To-Live", "in seconds. A change empties the cache." : "dalam detik. perubahan mengosongkan cache", "Directory Settings" : "Pengaturan Direktori", "User Display Name Field" : "Bidang Tampilan Nama Pengguna", "The LDAP attribute to use to generate the user's display name." : "Atribut LDAP digunakan untuk menghasilkan nama tampilan pengguna.", - "Base User Tree" : "Pohon Pengguna Dasar", + "Base User Tree" : "Base User Tree", "One User Base DN per line" : "Satu Pengguna Base DN per baris", "User Search Attributes" : "Atribut Pencarian Pengguna", "Optional; one attribute per line" : "Pilihan; satu atribut per baris", "Group Display Name Field" : "Bidang Tampilan Nama Grup", "The LDAP attribute to use to generate the groups's display name." : "Atribut LDAP digunakan untuk menghasilkan nama tampilan grup.", - "Base Group Tree" : "Pohon Grup Dasar", + "Base Group Tree" : "Base Group Tree", "One Group Base DN per line" : "Satu Grup Base DN per baris", "Group Search Attributes" : "Atribut Pencarian Grup", - "Group-Member association" : "asosiasi Anggota-Grup", + "Group-Member association" : "Asosiasi Anggota-Grup", + "Nested Groups" : "Grup Bersarang", + "When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Ketika dihidupkan, grup yang berisi grup akan didukung. (Hanya bekerja jika atribut anggota grup berisi DN.)", + "Paging chunksize" : "Paging chunksize", + "Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" : "Chunksize digunakan untuk pencarian paged LDAP yang mengembalikan hasil secara massal seperti enumerasi pengguna dan grup. (Atur dengan nilai 0 untuk menonaktifkan pencarian paged LDAP dalam situasi tersebut.)", "Special Attributes" : "Atribut Khusus", - "Quota Field" : "Bidang Kuota", + "Quota Field" : "Kolom Kuota", "Quota Default" : "Kuota Baku", "in bytes" : "dalam bytes", - "Email Field" : "Bidang Email", + "Email Field" : "Kolom Email", "User Home Folder Naming Rule" : "Aturan Penamaan Folder Home Pengguna", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." : "Biarkan nama pengguna kosong (default). Atau tetapkan atribut LDAP/AD.", "Internal Username" : "Nama Pengguna Internal", diff --git a/apps/user_ldap/l10n/id.json b/apps/user_ldap/l10n/id.json index fa0a0a7be20..a0f8c05c430 100644 --- a/apps/user_ldap/l10n/id.json +++ b/apps/user_ldap/l10n/id.json @@ -1,14 +1,16 @@ { "translations": { "Failed to clear the mappings." : "Gagal membersihkan pemetaan.", "Failed to delete the server configuration" : "Gagal menghapus konfigurasi server", + "The configuration is invalid: anonymous bind is not allowed." : "Konfigurasi tidak sah: bind anonim tidak diizinkan", "The configuration is valid and the connection could be established!" : "Konfigurasi valid dan koneksi dapat dilakukan!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." : "Konfigurasi valid, tetapi Bind gagal. Silakan periksa pengaturan server dan kredensial.", - "The configuration is invalid. Please have a look at the logs for further details." : "Konfigurasi tidak sah. Silakan lihat log untuk rincian lebh lanjut.", + "The configuration is invalid. Please have a look at the logs for further details." : "Konfigurasi tidak sah. Silakan lihat log untuk rincian lebih lanjut.", "No action specified" : "Tidak ada tindakan yang ditetapkan", "No configuration specified" : "Tidak ada konfigurasi yang ditetapkan", "No data specified" : "Tidak ada data yang ditetapkan", " Could not set configuration %s" : "Tidak dapat menyetel konfigurasi %s", "Action does not exist" : "Tidak ada tindakan", + "The Base DN appears to be wrong" : "Base DN tampaknya salah", "Configuration incorrect" : "Konfigurasi salah", "Configuration incomplete" : "Konfigurasi tidak lengkap", "Configuration OK" : "Konfigurasi Oke", @@ -27,16 +29,21 @@ "Confirm Deletion" : "Konfirmasi Penghapusan", "Mappings cleared successfully!" : "Pemetaan berhasil dibersihkan!", "Error while clearing the mappings." : "Kesalahan saat membersihkan pemetaan.", + "Anonymous bind is not allowed. Please provide a User DN and Password." : "Bind anonim tidak diizinkan. Mohon berikan sebuah User DN dan Password.", + "LDAP Operations error. Anonymous bind might not be allowed." : "Kesalahan Operasi LDAP. Bind anonim tidak diizinkan.", "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "Menyimpan gagal. Mohon pastikan basis data di Operasi. Muat Ulang sebelum melanjutkan.", - "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Beralih modus akan mengaktifkan kueri LDAP. Hal ini memerlukan beberapa saat tergantung pada ukuran LDAP Anda. Apakah Anda tetap ingin beralih modus?", + "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Beralih modus akan mengaktifkan kueri LDAP secara otomatis. Hal ini memerlukan beberapa saat tergantung pada ukuran LDAP Anda. Apakah Anda tetap ingin beralih modus?", "Mode switch" : "Beralih modus", "Select attributes" : "Pilih atribut", "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Pengguna tidak ditemukan. Mohon periksa atribut login dan nama pengguna Anda. Penyaring efektif (salin dan tempel berikut untuk validasi baris perintah):\n<br/>", "User found and settings verified." : "Pengguna ditemukan dan pengaturan terverifikasi.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Setelan terverifikasi, tapi ditemukan satu pengguna. Hanya yang pertama yang dapat login. Pertimbangkan dengan penyaringan yang lebih sempit.", "An unspecified error occurred. Please check the settings and the log." : "Terjadi kesalahan yang tidak disebutkan. Mohon periksa pengaturan dan log.", "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Penyaring pencarian tidak sah, kemungkinan karena masalah sintaks seperti jumlah kurung buka dan tutup tidak sama. Mohon diperiksa.", "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Terjadi kesalahan sambungan ke LDAP / AD, mohon periksa host, port dan kredensial.", - "The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah diaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.", + "The %uid placeholder is missing. It will be replaced with the login name when querying LDAP / AD." : "Placeholder %uid tidak ada. Placeholder akan digantikan dengan nama login saat melakukan kueri LDAP / AD.", + "Please provide a login name to test against" : "Mohon berikan nama login untuk mengujinya kembali", + "The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah dinonaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.", "_%s group found_::_%s groups found_" : ["%s grup ditemukan"], "_%s user found_::_%s users found_" : ["%s pengguna ditemukan"], "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Tidak mendeteksi atribut nama tampilan pengguna. Silakan menentukannya sendiri di pengaturan ldap lanjutan.", @@ -48,7 +55,7 @@ "Groups" : "Grup", "Test Configuration" : "Uji Konfigurasi", "Help" : "Bantuan", - "Groups meeting these criteria are available in %s:" : "Grup memenuhi kriteria ini tersedia di %s:", + "Groups meeting these criteria are available in %s:" : "Grup yang memenuhi kriteria ini tersedia di %s:", "Only these object classes:" : "Hanya kelas obyek berikut:", "Only from these groups:" : "Hanya dari grup berikut:", "Search groups" : "Pencarian grup", @@ -56,57 +63,83 @@ "Selected groups" : "Grup terpilih", "Edit LDAP Query" : "Sunting Kueri LDAP", "LDAP Filter:" : "Penyaring LDAP:", + "The filter specifies which LDAP groups shall have access to the %s instance." : "Penyaring menentukan grup LDAP mana yang memiliki akses ke %s.", + "Verify settings and count groups" : "Verifikasi setelan dan hitung grup", + "When logging in, %s will find the user based on the following attributes:" : "Pada saat login, %s akan menemukan pengguna berdasarkan atribut berikut:", "LDAP / AD Username:" : "Nama pengguna LDAP / AD:", + "Allows login against the LDAP / AD username, which is either uid or samaccountname and will be detected." : "Izinkan login dengan nama pengguna LDAP / AD, baik berupa uid atau samaccountname, mereka akan terdeteksi.", "LDAP / AD Email Address:" : "Alamat Email LDAP / AD:", + "Allows login against an email attribute. Mail and mailPrimaryAddress will be allowed." : "Izinkan login dengan atribut email. Mail dan mailPrimaryAddress diperbolehkan.", "Other Attributes:" : "Atribut Lain:", + "Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" : "Tetapkan penyaring yang akan diterapkan saat mencoba login. %%uid akan mengganti nama pengguna saat melakukan login. Contoh: \"uid=%%uid\"", + "Test Loginname" : "Test Loginname", + "Verify settings" : "Verifikasi setelan", "1. Server" : "1. Server", "%s. Server:" : "%s. Server:", + "Add a new and blank configuration" : "Tambah konfigurasi kosong yang baru", + "Copy current configuration into new directory binding" : "Salin konfigurasi saat ini kedalam direktori baru", + "Delete the current configuration" : "Hapus konfigurasi saat ini", "Host" : "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" : "Protokol dapat tidak ditulis, kecuali Anda menggunakan SSL. Lalu jalankan dengan ldaps://", "Port" : "Port", + "Detect Port" : "Deteksi Port", "User DN" : "Pengguna DN", "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.", "Password" : "Sandi", "For anonymous access, leave DN and Password empty." : "Untuk akses anonim, biarkan DN dan Kata sandi kosong.", "One Base DN per line" : "Satu Base DN per baris", "You can specify Base DN for users and groups in the Advanced tab" : "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan", + "Detect Base DN" : "Deteksi Base DN", + "Test Base DN" : "Uji Base DN", + "Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge." : "Mencegah permintaan LDAP otomatis. Berguna untuk setelan yang lebih besar, tapi memerlukan beberapa pengetahuan LDAP.", "Manually enter LDAP filters (recommended for large directories)" : "Masukkan penyaring LDAP secara manual (direkomendasikan untuk direktori yang besar)", "Limit %s access to users meeting these criteria:" : "Batasi akses %s untuk pengguna yang sesuai dengan kriteria berikut:", + "The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "Kelas obyek yang umum untuk pengguna adalah organizationalPerson, person, user, dan inetOrgPerson. Jika Anda tidak yakin kelas obyek mana yang akan dipilih, silakan konsultasi dengan admin direktori Anda.", + "The filter specifies which LDAP users shall have access to the %s instance." : "Penyaring menentukan pengguna LDAP mana yang memiliki akses ke %s.", + "Verify settings and count users" : "Verifikasi setelan dan jumlah pengguna", "Saving" : "Menyimpan", "Back" : "Kembali", "Continue" : "Lanjutkan", "LDAP" : "LDAP", "Expert" : "Lanjutan", "Advanced" : "Lanjutan", + "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." : "<b>Peringatan:</b> Aplikasi user_ldap dan user_webdavauth tidak kompatibel. Anda mungkin akan mengalami perilaku yang tidak terduga. Silakan minta administrator Anda untuk menonaktifkan salah satunya.", "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." : "<b>Peringatan:</b> Modul LDAP PHP tidak terpasang, perangkat tidak akan bekerja. Silakan minta administrator sistem untuk memasangnya.", "Connection Settings" : "Pengaturan Koneksi", "Configuration Active" : "Konfigurasi Aktif", - "When unchecked, this configuration will be skipped." : "Jika tidak dicentang, konfigurasi ini dilewati.", - "Backup (Replica) Host" : "Host Cadangan (Replika)", + "When unchecked, this configuration will be skipped." : "Jika tidak dicentang, konfigurasi ini akan dilewati.", + "Backup (Replica) Host" : "Cadangkan (Replika) Host", "Give an optional backup host. It must be a replica of the main LDAP/AD server." : "Berikan pilihan host cadangan. Harus merupakan replika dari server LDAP/AD utama.", - "Backup (Replica) Port" : "Port Cadangan (Replika)", + "Backup (Replica) Port" : "Cadangkan (Replika) Port", "Disable Main Server" : "Nonaktifkan Server Utama", - "Turn off SSL certificate validation." : "matikan validasi sertivikat SSL", - "Cache Time-To-Live" : "Gunakan Tembolok untuk Time-To-Live", + "Only connect to the replica server." : "Hanya terhubung ke server replika.", + "Case insensitive LDAP server (Windows)" : "Server LDAP tidak sensitif kata (Windows)", + "Turn off SSL certificate validation." : "Matikan validasi sertifikat SSL.", + "Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." : "Tidak dianjurkan, gunakan ini hanya untuk percobaan! Jika koneksi hanya bekerja dengan opsi ini, impor sertifikat SSL milik server LDAP kedalam server %s Anda.", + "Cache Time-To-Live" : "Cache Time-To-Live", "in seconds. A change empties the cache." : "dalam detik. perubahan mengosongkan cache", "Directory Settings" : "Pengaturan Direktori", "User Display Name Field" : "Bidang Tampilan Nama Pengguna", "The LDAP attribute to use to generate the user's display name." : "Atribut LDAP digunakan untuk menghasilkan nama tampilan pengguna.", - "Base User Tree" : "Pohon Pengguna Dasar", + "Base User Tree" : "Base User Tree", "One User Base DN per line" : "Satu Pengguna Base DN per baris", "User Search Attributes" : "Atribut Pencarian Pengguna", "Optional; one attribute per line" : "Pilihan; satu atribut per baris", "Group Display Name Field" : "Bidang Tampilan Nama Grup", "The LDAP attribute to use to generate the groups's display name." : "Atribut LDAP digunakan untuk menghasilkan nama tampilan grup.", - "Base Group Tree" : "Pohon Grup Dasar", + "Base Group Tree" : "Base Group Tree", "One Group Base DN per line" : "Satu Grup Base DN per baris", "Group Search Attributes" : "Atribut Pencarian Grup", - "Group-Member association" : "asosiasi Anggota-Grup", + "Group-Member association" : "Asosiasi Anggota-Grup", + "Nested Groups" : "Grup Bersarang", + "When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Ketika dihidupkan, grup yang berisi grup akan didukung. (Hanya bekerja jika atribut anggota grup berisi DN.)", + "Paging chunksize" : "Paging chunksize", + "Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" : "Chunksize digunakan untuk pencarian paged LDAP yang mengembalikan hasil secara massal seperti enumerasi pengguna dan grup. (Atur dengan nilai 0 untuk menonaktifkan pencarian paged LDAP dalam situasi tersebut.)", "Special Attributes" : "Atribut Khusus", - "Quota Field" : "Bidang Kuota", + "Quota Field" : "Kolom Kuota", "Quota Default" : "Kuota Baku", "in bytes" : "dalam bytes", - "Email Field" : "Bidang Email", + "Email Field" : "Kolom Email", "User Home Folder Naming Rule" : "Aturan Penamaan Folder Home Pengguna", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." : "Biarkan nama pengguna kosong (default). Atau tetapkan atribut LDAP/AD.", "Internal Username" : "Nama Pengguna Internal", diff --git a/apps/user_ldap/l10n/lb.js b/apps/user_ldap/l10n/lb.js index 78e8ca45c38..b340887548e 100644 --- a/apps/user_ldap/l10n/lb.js +++ b/apps/user_ldap/l10n/lb.js @@ -5,6 +5,7 @@ OC.L10N.register( "Groups" : "Gruppen", "Help" : "Hëllef", "Host" : "Host", + "Port" : "Port", "Password" : "Passwuert", "Back" : "Zeréck", "Continue" : "Weider", diff --git a/apps/user_ldap/l10n/lb.json b/apps/user_ldap/l10n/lb.json index 7776bf5e76a..4b4d46427b8 100644 --- a/apps/user_ldap/l10n/lb.json +++ b/apps/user_ldap/l10n/lb.json @@ -3,6 +3,7 @@ "Groups" : "Gruppen", "Help" : "Hëllef", "Host" : "Host", + "Port" : "Port", "Password" : "Passwuert", "Back" : "Zeréck", "Continue" : "Weider", diff --git a/autotest.sh b/autotest.sh index 46c55edef19..4fa51e2d071 100755 --- a/autotest.sh +++ b/autotest.sh @@ -145,7 +145,20 @@ function execute_tests { mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true fi if [ "$1" == "pgsql" ] ; then - dropdb -U "$DATABASEUSER" "$DATABASENAME" || true + if [ ! -z "$USEDOCKER" ] ; then + echo "Fire up the postgres docker" + DOCKER_CONTAINER_ID=$(docker run -e POSTGRES_USER="$DATABASEUSER" -e POSTGRES_PASSWORD=owncloud -d postgres) + DATABASEHOST=$(docker inspect "$DOCKER_CONTAINER_ID" | grep IPAddress | cut -d '"' -f 4) + + echo "Waiting for Postgres initialisation ..." + + # grep exits on the first match and then the script continues + docker logs -f "$DOCKER_CONTAINER_ID" 2>&1 | grep -q "database system is ready to accept connections" + + echo "Postgres is up." + else + dropdb -U "$DATABASEUSER" "$DATABASENAME" || true + fi fi if [ "$1" == "oci" ] ; then echo "Fire up the oracle docker" @@ -177,6 +190,12 @@ function execute_tests { "${PHPUNIT[@]}" --configuration phpunit-autotest.xml --log-junit "autotest-results-$1.xml" "$2" "$3" RESULT=$? fi + + if [ ! -z "$DOCKER_CONTAINER_ID" ] ; then + echo "Kill the docker $DOCKER_CONTAINER_ID" + docker rm -f $DOCKER_CONTAINER_ID + unset DOCKER_CONTAINER_ID + fi } # diff --git a/bower.json b/bower.json index e039b5f223b..87e9c016fce 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ownCloud", - "version": "8.0 pre alpha", + "version": "8.2 pre alpha", "homepage": "https://www.owncloud.org", "license": "AGPL", "private": true, diff --git a/config/config.sample.php b/config/config.sample.php index 19e7843d6c9..deecbec1ecb 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -81,7 +81,7 @@ $CONFIG = array( /** * Where user files are stored; this defaults to ``data/`` in the ownCloud * directory. The SQLite database is also stored here, when you use SQLite. - * (SQLite is available only in ownCloud Community Edition) + * (SQLite is not available in ownCloud Enterprise Edition) */ 'datadirectory' => '/var/www/owncloud/data', @@ -96,7 +96,7 @@ $CONFIG = array( * ``supportedDatabases`` * * Available: - * - sqlite (SQLite3 - Community Edition Only) + * - sqlite (SQLite3 - Not in Enterprise Edition) * - mysql (MySQL/MariaDB) * - pgsql (PostgreSQL) * - oci (Oracle - Enterprise Edition Only) @@ -587,7 +587,6 @@ $CONFIG = array( /** * When enabled, admins may install apps from the ownCloud app store. - * The app store is disabled by default for ownCloud Enterprise Edition */ 'appstoreenabled' => true, @@ -790,69 +789,38 @@ $CONFIG = array( 'config' => '/absolute/location/of/openssl.cnf', ), - -/** - * Miscellaneous - */ - -/** - * Blacklist a specific file or files and disallow the upload of files - * with this name. ``.htaccess`` is blocked by default. - * WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. - */ -'blacklisted_files' => array('.htaccess'), - -/** - * Define a default folder for shared files and folders other than root. - */ -'share_folder' => '/', - -/** - * If you are applying a theme to ownCloud, enter the name of the theme here. - * The default location for themes is ``owncloud/themes/``. - */ -'theme' => '', - -/** - * The default cipher for encrypting files. Currently AES-128-CFB and - * AES-256-CFB are supported. - */ -'cipher' => 'AES-256-CFB', - -/** - * The minimum ownCloud desktop client version that will be allowed to sync with - * this server instance. All connections made from earlier clients will be denied - * by the server. Defaults to the minimum officially supported ownCloud version at - * the time of release of this server version. - * - * When changing this, note that older unsupported versions of the ownCloud desktop - * client may not function as expected, and could lead to permanent data loss for - * clients or other unexpected results. - */ -'minimum.supported.desktop.version' => '1.7.0', - /** * Memory caching backend configuration * * Available cache backends: - * - \OC\Memcache\APC Alternative PHP Cache backend - * - \OC\Memcache\APCu APC user backend - * - \OC\Memcache\ArrayCache In-memory array-based backend (not recommended) - * - \OC\Memcache\Memcached Memcached backend - * - \OC\Memcache\Redis Redis backend - * - \OC\Memcache\XCache XCache backend + * + * * ``\OC\Memcache\APC`` Alternative PHP Cache backend + * * ``\OC\Memcache\APCu`` APC user backend + * * ``\OC\Memcache\ArrayCache`` In-memory array-based backend (not recommended) + * * ``\OC\Memcache\Memcached`` Memcached backend + * * ``\OC\Memcache\Redis`` Redis backend + * * ``\OC\Memcache\XCache`` XCache backend + * + * Advice on choosing between the various backends: + * + * * APCu should be easiest to install. Almost all distributions have packages. + * Use this for single user environment for all caches. + * * Use Redis or Memcached for distributed environments. + * For the local cache (you can configure two) take APCu. */ /** * Memory caching backend for locally stored data - * Used for host-specific data, e.g. file paths + * + * * Used for host-specific data, e.g. file paths */ 'memcache.local' => '\OC\Memcache\APCu', /** * Memory caching backend for distributed data - * Used for installation-specific data, e.g. database caching - * If unset, defaults to the value of memcache.local + * + * * Used for installation-specific data, e.g. database caching + * * If unset, defaults to the value of memcache.local */ 'memcache.distributed' => '\OC\Memcache\Memcached', @@ -887,56 +855,11 @@ $CONFIG = array( 'cache_path' => '', /** - * EXPERIMENTAL: option whether to include external storage in quota - * calculation, defaults to false. - */ -'quota_include_external_storage' => false, - -/** - * Specifies how often the filesystem is checked for changes made outside - * ownCloud. - * - * 0 -> Never check the filesystem for outside changes, provides a performance - * increase when it's certain that no changes are made directly to the - * filesystem - * - * 1 -> Check each file or folder at most once per request, recommended for - * general use if outside changes might happen. - * - * 2 -> Check every time the filesystem is used, causes a performance hit when - * using external storages, not recommended for regular use. - */ -'filesystem_check_changes' => 1, - -/** - * All css and js files will be served by the web server statically in one js - * file and one css file if this is set to ``true``. - */ -'asset-pipeline.enabled' => false, - -/** - * The parent of the directory where css and js assets will be stored if - * piplelining is enabled; this defaults to the ownCloud directory. The assets - * will be stored in a subdirectory of this directory named 'assets'. The - * server *must* be configured to serve that directory as $WEBROOT/assets. - * You will only likely need to change this if the main ownCloud directory - * is not writeable by the web server in your configuration. + * Using Object Store with ownCloud */ -'assetdirectory' => '/var/www/owncloud', - -/** - * Where ``mount.json`` file should be stored, defaults to ``data/mount.json`` - */ -'mount_file' => 'data/mount.json', /** - * When ``true``, prevent ownCloud from changing the cache due to changes in the - * filesystem for all storage. - */ -'filesystem_cache_readonly' => false, - -/** - * The example below shows how to configure ownCloud to store all files in a + * This example shows how to configure ownCloud to store all files in a * swift object storage. * * It is important to note that ownCloud in object store mode will expect @@ -980,7 +903,7 @@ $CONFIG = array( * Database types that are supported for installation. * * Available: - * - sqlite (SQLite3 - Community Edition Only) + * - sqlite (SQLite3 - Not in Enterprise Edition) * - mysql (MySQL) * - pgsql (PostgreSQL) * - oci (Oracle - Enterprise Edition Only) @@ -997,6 +920,91 @@ $CONFIG = array( */ /** + * Blacklist a specific file or files and disallow the upload of files + * with this name. ``.htaccess`` is blocked by default. + * WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. + */ +'blacklisted_files' => array('.htaccess'), + +/** + * Define a default folder for shared files and folders other than root. + */ +'share_folder' => '/', + +/** + * If you are applying a theme to ownCloud, enter the name of the theme here. + * The default location for themes is ``owncloud/themes/``. + */ +'theme' => '', + +/** + * The default cipher for encrypting files. Currently AES-128-CFB and + * AES-256-CFB are supported. + */ +'cipher' => 'AES-256-CFB', + +/** + * The minimum ownCloud desktop client version that will be allowed to sync with + * this server instance. All connections made from earlier clients will be denied + * by the server. Defaults to the minimum officially supported ownCloud version at + * the time of release of this server version. + * + * When changing this, note that older unsupported versions of the ownCloud desktop + * client may not function as expected, and could lead to permanent data loss for + * clients or other unexpected results. + */ +'minimum.supported.desktop.version' => '1.7.0', + +/** + * EXPERIMENTAL: option whether to include external storage in quota + * calculation, defaults to false. + */ +'quota_include_external_storage' => false, + +/** + * Specifies how often the filesystem is checked for changes made outside + * ownCloud. + * + * 0 -> Never check the filesystem for outside changes, provides a performance + * increase when it's certain that no changes are made directly to the + * filesystem + * + * 1 -> Check each file or folder at most once per request, recommended for + * general use if outside changes might happen. + * + * 2 -> Check every time the filesystem is used, causes a performance hit when + * using external storages, not recommended for regular use. + */ +'filesystem_check_changes' => 1, + +/** + * All css and js files will be served by the web server statically in one js + * file and one css file if this is set to ``true``. This improves performance. + */ +'asset-pipeline.enabled' => false, + +/** + * The parent of the directory where css and js assets will be stored if + * piplelining is enabled; this defaults to the ownCloud directory. The assets + * will be stored in a subdirectory of this directory named 'assets'. The + * server *must* be configured to serve that directory as $WEBROOT/assets. + * You will only likely need to change this if the main ownCloud directory + * is not writeable by the web server in your configuration. + */ +'assetdirectory' => '/var/www/owncloud', + +/** + * Where ``mount.json`` file should be stored, defaults to ``data/mount.json`` + */ +'mount_file' => 'data/mount.json', + +/** + * When ``true``, prevent ownCloud from changing the cache due to changes in the + * filesystem for all storage. + */ +'filesystem_cache_readonly' => false, + +/** * Secret used by ownCloud for various purposes, e.g. to encrypt data. If you * lose this string there will be data corruption. */ @@ -1017,9 +1025,8 @@ $CONFIG = array( * max file size for animating gifs on public-sharing-site. * If the gif is bigger, it'll show a static preview * - * Value represents the maximum filesize in megabytes - * Default is 10 - * Set to -1 for no limit + * Value represents the maximum filesize in megabytes. Default is ``10``. Set to + * ``-1`` for no limit. */ 'max_filesize_animated_gifs_public_sharing' => 10, @@ -1030,7 +1037,9 @@ $CONFIG = array( * * Prevents concurrent processes to access the same files * at the same time. Can help prevent side effects that would - * be caused by concurrent operations. + * be caused by concurrent operations. Mainly relevant for + * very large installations with many users working with + * shared files. * * WARNING: BETA quality */ @@ -1038,7 +1047,9 @@ $CONFIG = array( /** * Memory caching backend for file locking - * Because most memcache backends can clean values without warning using redis is recommended + * + * Because most memcache backends can clean values without warning using redis + * is highly recommended to *avoid data loss*. */ 'memcache.locking' => '\\OC\\Memcache\\Redis', diff --git a/config/mimetypealiases.json b/config/mimetypealiases.json new file mode 100644 index 00000000000..d1684460eff --- /dev/null +++ b/config/mimetypealiases.json @@ -0,0 +1,68 @@ +{ + "_comment" : "When this file is changed make sure to run", + "_comment2": "./occ maintenance:mimetypesjs", + "_comment3": "Otherwise your update won't propagate through the system", + + + "application/coreldraw": "image", + "application/font-sfnt": "font", + "application/font-woff": "font", + "application/illustrator": "image/vector", + "application/json": "text/code", + "application/msaccess": "database", + "application/msexcel": "x-office/spreadsheet", + "application/mspowerpoint": "x-office/presentation", + "application/msword": "x-office/document", + "application/octet-stream": "file", + "application/postscript": "image/vector", + "application/vnd.android.package-archive": "package/x-generic", + "application/vnd.ms-excel": "x-office/spreadsheet", + "application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.sheet.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.template.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-fontobject": "font", + "application/vnd.ms-powerpoint": "x-office/presentation", + "application/vnd.ms-powerpoint.addin.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.presentation.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.slideshow.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.template.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-word.document.macroEnabled.12": "x-office/document", + "application/vnd.ms-word.template.macroEnabled.12": "x-office/document", + "application/vnd.oasis.opendocument.presentation": "x-office/presentation", + "application/vnd.oasis.opendocument.presentation-template": "x-office/presentation", + "application/vnd.oasis.opendocument.spreadsheet": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.spreadsheet-template": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.text": "x-office/document", + "application/vnd.oasis.opendocument.text-master": "x-office/document", + "application/vnd.oasis.opendocument.text-template": "x-office/document", + "application/vnd.oasis.opendocument.text-web": "x-office/document", + "application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "x-office/spreadsheet", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document", + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document", + "application/x-7z-compressed": "package/x-generic", + "application/x-compressed": "package/x-generic", + "application/x-dcraw": "image", + "application/x-deb": "package/x-generic", + "application/x-font": "font", + "application/x-gimp": "image", + "application/x-gzip": "package/x-generic", + "application/x-perl": "text/code", + "application/x-photoshop": "image", + "application/x-php": "text/code", + "application/x-rar-compressed": "package/x-generic", + "application/x-tar": "package/x-generic", + "application/x-tex": "text", + "application/xml": "text/html", + "application/yaml": "text/code", + "application/zip": "package/x-generic", + "image/svg+xml": "image/vector", + "text/css": "text/code", + "text/csv": "x-office/spreadsheet", + "text/x-shellscript": "text/code" +} + diff --git a/core/ajax/preview.php b/core/ajax/preview.php index c5714396409..fc98d80eb0e 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -35,14 +35,14 @@ $always = array_key_exists('forceIcon', $_GET) ? (bool)$_GET['forceIcon'] : true if ($file === '') { //400 Bad Request \OC_Response::setStatus(400); - \OC_Log::write('core-preview', 'No file parameter was passed', \OC_Log::DEBUG); + \OCP\Util::writeLog('core-preview', 'No file parameter was passed', \OCP\Util::DEBUG); exit; } if ($maxX === 0 || $maxY === 0) { //400 Bad Request \OC_Response::setStatus(400); - \OC_Log::write('core-preview', 'x and/or y set to 0', \OC_Log::DEBUG); + \OCP\Util::writeLog('core-preview', 'x and/or y set to 0', \OCP\Util::DEBUG); exit; } diff --git a/core/ajax/update.php b/core/ajax/update.php index 2f34708faea..14b4f913f76 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -37,10 +37,11 @@ if (OC::checkUpgrade(false)) { $l = new \OC_L10N('core'); $eventSource = \OC::$server->createEventSource(); + $logger = \OC::$server->getLogger(); $updater = new \OC\Updater( \OC::$server->getHTTPHelper(), \OC::$server->getConfig(), - \OC_Log::$object + $logger ); $incompatibleApps = []; $disabledThirdPartyApps = []; @@ -92,7 +93,7 @@ if (OC::checkUpgrade(false)) { } if (!empty($disabledThirdPartyApps)) { $eventSource->send('notice', - (string)$l->t('Following 3rd party apps have been disabled: %s', implode(', ', $disabledThirdPartyApps))); + (string)$l->t('Following apps have been disabled: %s', implode(', ', $disabledThirdPartyApps))); } $eventSource->send('done', ''); diff --git a/core/command/base.php b/core/command/base.php index f84dcb1aeaf..7e61c0cb9ab 100644 --- a/core/command/base.php +++ b/core/command/base.php @@ -43,8 +43,9 @@ class Base extends Command { * @param InputInterface $input * @param OutputInterface $output * @param array $items + * @param string $prefix */ - protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, $items) { + protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, $items, $prefix = ' - ') { switch ($input->getOption('output')) { case 'json': $output->writeln(json_encode($items)); @@ -54,28 +55,57 @@ class Base extends Command { break; default: foreach ($items as $key => $item) { + if (is_array($item)) { + $output->writeln($prefix . $key . ':'); + $this->writeArrayInOutputFormat($input, $output, $item, ' ' . $prefix); + continue; + } if (!is_int($key)) { $value = $this->valueToString($item); if (!is_null($value)) { - $output->writeln(' - ' . $key . ': ' . $value); + $output->writeln($prefix . $key . ': ' . $value); } else { - $output->writeln(' - ' . $key); + $output->writeln($prefix . $key); } } else { - $output->writeln(' - ' . $this->valueToString($item)); + $output->writeln($prefix . $this->valueToString($item)); } } break; } } - protected function valueToString($value) { + /** + * @param InputInterface $input + * @param OutputInterface $output + * @param mixed $item + */ + protected function writeMixedInOutputFormat(InputInterface $input, OutputInterface $output, $item) { + if (is_array($item)) { + $this->writeArrayInOutputFormat($input, $output, $item, ''); + return; + } + + switch ($input->getOption('output')) { + case 'json': + $output->writeln(json_encode($item)); + break; + case 'json_pretty': + $output->writeln(json_encode($item, JSON_PRETTY_PRINT)); + break; + default: + $output->writeln($this->valueToString($item, false)); + break; + } + } + + protected function valueToString($value, $returnNull = true) { if ($value === false) { return 'false'; } else if ($value === true) { return 'true'; } else if ($value === null) { - null; + return ($returnNull) ? null : 'null'; } else { return $value; } diff --git a/core/command/config/app/deleteconfig.php b/core/command/config/app/deleteconfig.php new file mode 100644 index 00000000000..0031142358e --- /dev/null +++ b/core/command/config/app/deleteconfig.php @@ -0,0 +1,81 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\App; + +use OC\Core\Command\Base; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class DeleteConfig extends Base { + /** * @var IConfig */ + protected $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + parent::__construct(); + $this->config = $config; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:app:delete') + ->setDescription('Delete an app config value') + ->addArgument( + 'app', + InputArgument::REQUIRED, + 'Name of the app' + ) + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to delete' + ) + ->addOption( + 'error-if-not-exists', + null, + InputOption::VALUE_NONE, + 'Checks whether the config exists before deleting it' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $appName = $input->getArgument('app'); + $configName = $input->getArgument('name'); + + if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->config->getAppKeys($appName))) { + $output->writeln('<error>Config ' . $configName . ' could not be deleted because it did not exist</error>'); + return 1; + } + + $this->config->deleteAppValue($appName, $configName); + $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); + return 0; + } +} diff --git a/core/command/config/app/getconfig.php b/core/command/config/app/getconfig.php new file mode 100644 index 00000000000..186ed46999f --- /dev/null +++ b/core/command/config/app/getconfig.php @@ -0,0 +1,93 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\App; + +use OC\Core\Command\Base; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class GetConfig extends Base { + /** * @var IConfig */ + protected $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + parent::__construct(); + $this->config = $config; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:app:get') + ->setDescription('Get an app config value') + ->addArgument( + 'app', + InputArgument::REQUIRED, + 'Name of the app' + ) + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to get' + ) + ->addOption( + 'default-value', + null, + InputOption::VALUE_OPTIONAL, + 'If no default value is set and the config does not exist, the command will exit with 1' + ) + ; + } + + /** + * Executes the current command. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * @return null|int null or 0 if everything went fine, or an error code + */ + protected function execute(InputInterface $input, OutputInterface $output) { + $appName = $input->getArgument('app'); + $configName = $input->getArgument('name'); + $defaultValue = $input->getOption('default-value'); + + if (!in_array($configName, $this->config->getAppKeys($appName)) && !$input->hasParameterOption('--default-value')) { + return 1; + } + + if (!in_array($configName, $this->config->getAppKeys($appName))) { + $configValue = $defaultValue; + } else { + $configValue = $this->config->getAppValue($appName, $configName); + } + + $this->writeMixedInOutputFormat($input, $output, $configValue); + return 0; + } +} diff --git a/core/command/config/app/setconfig.php b/core/command/config/app/setconfig.php new file mode 100644 index 00000000000..91775094fdd --- /dev/null +++ b/core/command/config/app/setconfig.php @@ -0,0 +1,89 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\App; + +use OC\Core\Command\Base; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class SetConfig extends Base { + /** * @var IConfig */ + protected $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + parent::__construct(); + $this->config = $config; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:app:set') + ->setDescription('Set an app config value') + ->addArgument( + 'app', + InputArgument::REQUIRED, + 'Name of the app' + ) + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to set' + ) + ->addOption( + 'value', + null, + InputOption::VALUE_REQUIRED, + 'The new value of the config' + ) + ->addOption( + 'update-only', + null, + InputOption::VALUE_NONE, + 'Only updates the value, if it is not set before, it is not being added' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $appName = $input->getArgument('app'); + $configName = $input->getArgument('name'); + + if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { + $output->writeln('<comment>Value not updated, as it has not been set before.</comment>'); + return 1; + } + + $configValue = $input->getOption('value'); + $this->config->setAppValue($appName, $configName, $configValue); + + $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); + return 0; + } +} diff --git a/core/command/config/import.php b/core/command/config/import.php new file mode 100644 index 00000000000..c53fd7255f9 --- /dev/null +++ b/core/command/config/import.php @@ -0,0 +1,195 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config; + +use OCP\IConfig; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class Import extends Command { + protected $validRootKeys = ['system', 'apps']; + + /** @var IConfig */ + protected $config; + + /** + * @param IConfig $config + */ + public function __construct(IConfig $config) { + parent::__construct(); + $this->config = $config; + } + + protected function configure() { + $this + ->setName('config:import') + ->setDescription('Import a list of configs') + ->addArgument( + 'file', + InputArgument::OPTIONAL, + 'File with the json array to import' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $importFile = $input->getArgument('file'); + if ($importFile !== null) { + $content = $this->getArrayFromFile($importFile); + } else { + $content = $this->getArrayFromStdin(); + } + + try { + $configs = $this->validateFileContent($content); + } catch (\UnexpectedValueException $e) { + $output->writeln('<error>' . $e->getMessage(). '</error>'); + return; + } + + if (!empty($configs['system'])) { + $this->config->setSystemValues($configs['system']); + } + + if (!empty($configs['apps'])) { + foreach ($configs['apps'] as $app => $appConfigs) { + foreach ($appConfigs as $key => $value) { + if ($value === null) { + $this->config->deleteAppValue($app, $key); + } else { + $this->config->setAppValue($app, $key, $value); + } + } + } + } + + $output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>'); + } + + /** + * Get the content from stdin ("config:import < file.json") + * + * @return string + */ + protected function getArrayFromStdin() { + // Read from stdin. stream_set_blocking is used to prevent blocking + // when nothing is passed via stdin. + stream_set_blocking(STDIN, 0); + $content = file_get_contents('php://stdin'); + stream_set_blocking(STDIN, 1); + return $content; + } + + /** + * Get the content of the specified file ("config:import file.json") + * + * @param string $importFile + * @return string + */ + protected function getArrayFromFile($importFile) { + $content = file_get_contents($importFile); + return $content; + } + + /** + * @param string $content + * @return array + * @throws \UnexpectedValueException when the array is invalid + */ + protected function validateFileContent($content) { + $decodedContent = json_decode($content, true); + if (!is_array($decodedContent) || empty($decodedContent)) { + throw new \UnexpectedValueException('The file must contain a valid json array'); + } + + $this->validateArray($decodedContent); + + return $decodedContent; + } + + /** + * Validates that the array only contains `system` and `apps` + * + * @param array $array + */ + protected function validateArray($array) { + $arrayKeys = array_keys($array); + $additionalKeys = array_diff($arrayKeys, $this->validRootKeys); + $commonKeys = array_intersect($arrayKeys, $this->validRootKeys); + if (!empty($additionalKeys)) { + throw new \UnexpectedValueException('Found invalid entries in root: ' . implode(', ', $additionalKeys)); + } + if (empty($commonKeys)) { + throw new \UnexpectedValueException('At least one key of the following is expected: ' . implode(', ', $this->validRootKeys)); + } + + if (isset($array['system'])) { + if (is_array($array['system'])) { + foreach ($array['system'] as $name => $value) { + $this->checkTypeRecursively($value, $name); + } + } else { + throw new \UnexpectedValueException('The system config array is not an array'); + } + } + + if (isset($array['apps'])) { + if (is_array($array['apps'])) { + $this->validateAppsArray($array['apps']); + } else { + throw new \UnexpectedValueException('The apps config array is not an array'); + } + } + } + + /** + * @param mixed $configValue + * @param string $configName + */ + protected function checkTypeRecursively($configValue, $configName) { + if (!is_array($configValue) && !is_bool($configValue) && !is_int($configValue) && !is_string($configValue) && !is_null($configValue)) { + throw new \UnexpectedValueException('Invalid system config value for "' . $configName . '". Only arrays, bools, integers, strings and null (delete) are allowed.'); + } + if (is_array($configValue)) { + foreach ($configValue as $key => $value) { + $this->checkTypeRecursively($value, $configName); + } + } + } + + /** + * Validates that app configs are only integers and strings + * + * @param array $array + */ + protected function validateAppsArray($array) { + foreach ($array as $app => $configs) { + foreach ($configs as $name => $value) { + if (!is_int($value) && !is_string($value) && !is_null($value)) { + throw new \UnexpectedValueException('Invalid app config value for "' . $app . '":"' . $name . '". Only integers, strings and null (delete) are allowed.'); + } + } + } + } +} diff --git a/core/command/config/listconfigs.php b/core/command/config/listconfigs.php new file mode 100644 index 00000000000..be3073e54d9 --- /dev/null +++ b/core/command/config/listconfigs.php @@ -0,0 +1,141 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config; + +use OC\Core\Command\Base; +use OC\SystemConfig; +use OCP\IAppConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class ListConfigs extends Base { + /** @var array */ + protected $sensitiveValues = [ + 'dbpassword', + 'dbuser', + 'mail_smtpname', + 'mail_smtppassword', + 'passwordsalt', + 'secret', + ]; + + /** * @var SystemConfig */ + protected $systemConfig; + + /** @var IAppConfig */ + protected $appConfig; + + /** + * @param SystemConfig $systemConfig + * @param IAppConfig $appConfig + */ + public function __construct(SystemConfig $systemConfig, IAppConfig $appConfig) { + parent::__construct(); + $this->systemConfig = $systemConfig; + $this->appConfig = $appConfig; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:list') + ->setDescription('List all configs') + ->addArgument( + 'app', + InputArgument::OPTIONAL, + 'Name of the app ("system" to get the config.php values, "all" for all apps and system)', + 'all' + ) + ->addOption( + 'private', + null, + InputOption::VALUE_NONE, + 'Use this option when you want to include sensitive configs like passwords, salts, ...' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $app = $input->getArgument('app'); + $noSensitiveValues = !$input->getOption('private'); + + if ($noSensitiveValues && !$input->hasParameterOption('--output')) { + // If you post this publicly we prefer the json format + $input->setOption('output', 'json_pretty'); + } + + switch ($app) { + case 'system': + $configs = [ + 'system' => $this->getSystemConfigs($noSensitiveValues), + ]; + break; + + case 'all': + $apps = $this->appConfig->getApps(); + $configs = [ + 'system' => $this->getSystemConfigs($noSensitiveValues), + 'apps' => [], + ]; + foreach ($apps as $appName) { + $configs['apps'][$appName] = $this->appConfig->getValues($appName, false); + } + break; + + default: + $configs = [ + 'apps' => [ + $app => $this->appConfig->getValues($app, false), + ], + ]; + } + + $this->writeArrayInOutputFormat($input, $output, $configs); + } + + /** + * Get the system configs + * + * @param bool $noSensitiveValues + * @return array + */ + protected function getSystemConfigs($noSensitiveValues) { + $keys = $this->systemConfig->getKeys(); + + $configs = []; + foreach ($keys as $key) { + if ($noSensitiveValues && in_array($key, $this->sensitiveValues)) { + continue; + } + + $value = $this->systemConfig->getValue($key, serialize(null)); + if ($value !== 'N;') { + $configs[$key] = $value; + } + } + + return $configs; + } +} diff --git a/core/command/config/system/deleteconfig.php b/core/command/config/system/deleteconfig.php new file mode 100644 index 00000000000..49bc2bc8c03 --- /dev/null +++ b/core/command/config/system/deleteconfig.php @@ -0,0 +1,75 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\System; + +use OC\Core\Command\Base; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class DeleteConfig extends Base { + /** * @var SystemConfig */ + protected $systemConfig; + + /** + * @param SystemConfig $systemConfig + */ + public function __construct(SystemConfig $systemConfig) { + parent::__construct(); + $this->systemConfig = $systemConfig; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:system:delete') + ->setDescription('Delete a system config value') + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to delete' + ) + ->addOption( + 'error-if-not-exists', + null, + InputOption::VALUE_NONE, + 'Checks whether the config exists before deleting it' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $configName = $input->getArgument('name'); + + if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { + $output->writeln('<error>Config ' . $configName . ' could not be deleted because it did not exist</error>'); + return 1; + } + + $this->systemConfig->deleteValue($configName); + $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); + return 0; + } +} diff --git a/core/command/config/system/getconfig.php b/core/command/config/system/getconfig.php new file mode 100644 index 00000000000..d53de18a0bb --- /dev/null +++ b/core/command/config/system/getconfig.php @@ -0,0 +1,87 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\System; + +use OC\Core\Command\Base; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class GetConfig extends Base { + /** * @var SystemConfig */ + protected $systemConfig; + + /** + * @param SystemConfig $systemConfig + */ + public function __construct(SystemConfig $systemConfig) { + parent::__construct(); + $this->systemConfig = $systemConfig; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:system:get') + ->setDescription('Get a system config value') + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to get' + ) + ->addOption( + 'default-value', + null, + InputOption::VALUE_OPTIONAL, + 'If no default value is set and the config does not exist, the command will exit with 1' + ) + ; + } + + /** + * Executes the current command. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * @return null|int null or 0 if everything went fine, or an error code + */ + protected function execute(InputInterface $input, OutputInterface $output) { + $configName = $input->getArgument('name'); + $defaultValue = $input->getOption('default-value'); + + if (!in_array($configName, $this->systemConfig->getKeys()) && !$input->hasParameterOption('--default-value')) { + return 1; + } + + if (!in_array($configName, $this->systemConfig->getKeys())) { + $configValue = $defaultValue; + } else { + $configValue = $this->systemConfig->getValue($configName); + } + + $this->writeMixedInOutputFormat($input, $output, $configValue); + return 0; + } +} diff --git a/core/command/config/system/setconfig.php b/core/command/config/system/setconfig.php new file mode 100644 index 00000000000..cb2f9fe616f --- /dev/null +++ b/core/command/config/system/setconfig.php @@ -0,0 +1,82 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Config\System; + +use OC\Core\Command\Base; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class SetConfig extends Base { + /** * @var SystemConfig */ + protected $systemConfig; + + /** + * @param SystemConfig $systemConfig + */ + public function __construct(SystemConfig $systemConfig) { + parent::__construct(); + $this->systemConfig = $systemConfig; + } + + protected function configure() { + parent::configure(); + + $this + ->setName('config:system:set') + ->setDescription('Set a system config value') + ->addArgument( + 'name', + InputArgument::REQUIRED, + 'Name of the config to set' + ) + ->addOption( + 'value', + null, + InputOption::VALUE_REQUIRED, + 'The new value of the config' + ) + ->addOption( + 'update-only', + null, + InputOption::VALUE_NONE, + 'Only updates the value, if it is not set before, it is not being added' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $configName = $input->getArgument('name'); + + if (!in_array($configName, $this->systemConfig->getKeys()) && $input->hasParameterOption('--update-only')) { + $output->writeln('<comment>Value not updated, as it has not been set before.</comment>'); + return 1; + } + $configValue = $input->getOption('value'); + + $this->systemConfig->setValue($configName, $configValue); + $output->writeln('<info>System config value ' . $configName . ' set to ' . $configValue . '</info>'); + return 0; + } +} diff --git a/core/command/maintenance/mimetypesjs.php b/core/command/maintenance/mimetypesjs.php new file mode 100644 index 00000000000..95a4bcd891a --- /dev/null +++ b/core/command/maintenance/mimetypesjs.php @@ -0,0 +1,112 @@ +<?php +/** + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Core\Command\Maintenance; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class MimeTypesJS extends Command { + protected function configure() { + $this + ->setName('maintenance:mimetypesjs') + ->setDescription('Update mimetypelist.js'); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + // Fetch all the aliases + $aliases = json_decode(file_get_contents(dirname(__DIR__) . '/../../config/mimetypealiases.json'), true); + + // Remove comments + $keys = array_filter(array_keys($aliases), function($k) { + return $k[0] === '_'; + }); + foreach($keys as $key) { + unset($aliases[$key]); + } + + // Fetch all files + $dir = new \DirectoryIterator(dirname(__DIR__) . '/../img/filetypes'); + + $files = []; + foreach($dir as $fileInfo) { + if ($fileInfo->isFile()) { + $file = preg_replace('/.[^.]*$/', '', $fileInfo->getFilename()); + $files[] = $file; + } + } + + //Remove duplicates + $files = array_values(array_unique($files)); + + + // Fetch all themes! + $themes = []; + $dirs = new \DirectoryIterator(dirname(__DIR__) . '/../../themes/'); + foreach($dirs as $dir) { + //Valid theme dir + if ($dir->isFile() || $dir->isDot()) { + continue; + } + + $theme = $dir->getFilename(); + $themeDir = $dir->getPath() . '/' . $theme . '/core/img/filetypes/'; + // Check if this theme has its own filetype icons + if (!file_exists($themeDir)) { + continue; + } + + $themes[$theme] = []; + // Fetch all the theme icons! + $themeIt = new \DirectoryIterator($themeDir); + foreach ($themeIt as $fileInfo) { + if ($fileInfo->isFile()) { + $file = preg_replace('/.[^.]*$/', '', $fileInfo->getFilename()); + $themes[$theme][] = $file; + } + } + + //Remove Duplicates + $themes[$theme] = array_values(array_unique($themes[$theme])); + } + + //Generate the JS + $js = '/** +* This file is automatically generated +* DO NOT EDIT MANUALLY! +* +* You can update the list of MimeType Aliases in config/mimetypealiases.json +* The list of files is fetched from core/img/filetypes +* To regenerate this file run ./occ maintenance:mimetypesjs +*/ +OC.MimeTypeList={ + aliases: ' . json_encode($aliases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . ', + files: ' . json_encode($files, JSON_PRETTY_PRINT) . ', + themes: ' . json_encode($themes, JSON_PRETTY_PRINT) . ' +}; +'; + + //Output the JS + file_put_contents(dirname(__DIR__) . '/../js/mimetypelist.js', $js); + + $output->writeln('<info>mimetypelist.js is updated'); + } +} diff --git a/core/js/config.php b/core/js/config.php index d6946f671d1..cecbf27e4b2 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -128,7 +128,8 @@ $array = array( 'slogan' => $defaults->getSlogan(), 'logoClaim' => $defaults->getLogoClaim(), 'shortFooter' => $defaults->getShortFooter(), - 'longFooter' => $defaults->getLongFooter() + 'longFooter' => $defaults->getLongFooter(), + 'folder' => OC_Util::getTheme(), ) ) ); diff --git a/core/js/core.json b/core/js/core.json index 90bc318b237..e75db534550 100644 --- a/core/js/core.json +++ b/core/js/core.json @@ -27,6 +27,8 @@ "multiselect.js", "oc-requesttoken.js", "setupchecks.js", - "../search/js/search.js" + "../search/js/search.js", + "mimetype.js", + "mimetypelist.js" ] } diff --git a/core/js/mimetype.js b/core/js/mimetype.js new file mode 100644 index 00000000000..d22b0a2378a --- /dev/null +++ b/core/js/mimetype.js @@ -0,0 +1,113 @@ +/** + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +/** + * Namespace to hold functions related to convert mimetype to icons + * + * @namespace + */ +OC.MimeType = { + + /** + * Cache that maps mimeTypes to icon urls + */ + _mimeTypeIcons: {}, + + /** + * Return the file icon we want to use for the given mimeType. + * The file needs to be present in the supplied file list + * + * @param {string} mimeType The mimeType we want an icon for + * @param {array} files The available icons in this theme + * @return {string} The icon to use or null if there is no match + */ + _getFile: function(mimeType, files) { + var icon = mimeType.replace(new RegExp('/', 'g'), '-'); + + // Generate path + if (mimeType === 'dir' && $.inArray('folder', files) !== -1) { + return 'folder'; + } else if (mimeType === 'dir-shared' && $.inArray('folder-shared', files) !== -1) { + return 'folder-shared'; + } else if (mimeType === 'dir-external' && $.inArray('folder-external', files) !== -1) { + return 'folder-external'; + } else if ($.inArray(icon, files) !== -1) { + return icon; + } else if ($.inArray(icon.split('-')[0], files) !== -1) { + return icon.split('-')[0]; + } else if ($.inArray('file', files) !== -1) { + return 'file'; + } + + return null; + }, + + /** + * Return the url to icon of the given mimeType + * + * @param {string} mimeType The mimeType to get the icon for + * @return {string} Url to the icon for mimeType + */ + getIconUrl: function(mimeType) { + if (_.isUndefined(mimeType)) { + return undefined; + } + + if (mimeType in OC.MimeTypeList.aliases) { + mimeType = OC.MimeTypeList.aliases[mimeType]; + } + if (mimeType in OC.MimeType._mimeTypeIcons) { + return OC.MimeType._mimeTypeIcons[mimeType]; + } + + // First try to get the correct icon from the current theme + var gotIcon = null; + var path = ''; + if (OC.theme.folder !== '' && $.isArray(OC.MimeTypeList.themes[OC.theme.folder])) { + path = OC.webroot + '/themes/' + OC.theme.folder + '/core/img/filetypes/'; + var icon = OC.MimeType._getFile(mimeType, OC.MimeTypeList.themes[OC.theme.folder]); + + if (icon !== null) { + gotIcon = true; + path += icon; + } + } + + // If we do not yet have an icon fall back to the default + if (gotIcon === null) { + path = OC.webroot + '/core/img/filetypes/'; + path += OC.MimeType._getFile(mimeType, OC.MimeTypeList.files); + } + + // Use svg if we can + if(OC.Util.hasSVGSupport()){ + path += '.svg'; + } else { + path += '.png'; + } + + // Cache the result + OC.MimeType._mimeTypeIcons[mimeType] = path; + return path; + } + +}; + + diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js new file mode 100644 index 00000000000..2a780fc2bcb --- /dev/null +++ b/core/js/mimetypelist.js @@ -0,0 +1,107 @@ +/** +* This file is automatically generated +* DO NOT EDIT MANUALLY! +* +* You can update the list of MimeType Aliases in config/mimetypealiases.json +* The list of files is fetched from core/img/filetypes +* To regenerate this file run ./occ maintenance:mimetypesjs +*/ +OC.MimeTypeList={ + aliases: { + "application/coreldraw": "image", + "application/font-sfnt": "font", + "application/font-woff": "font", + "application/illustrator": "image/vector", + "application/json": "text/code", + "application/msaccess": "database", + "application/msexcel": "x-office/spreadsheet", + "application/mspowerpoint": "x-office/presentation", + "application/msword": "x-office/document", + "application/octet-stream": "file", + "application/postscript": "image/vector", + "application/vnd.android.package-archive": "package/x-generic", + "application/vnd.ms-excel": "x-office/spreadsheet", + "application/vnd.ms-excel.addin.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.sheet.binary.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.sheet.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-excel.template.macroEnabled.12": "x-office/spreadsheet", + "application/vnd.ms-fontobject": "font", + "application/vnd.ms-powerpoint": "x-office/presentation", + "application/vnd.ms-powerpoint.addin.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.presentation.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.slideshow.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-powerpoint.template.macroEnabled.12": "x-office/presentation", + "application/vnd.ms-word.document.macroEnabled.12": "x-office/document", + "application/vnd.ms-word.template.macroEnabled.12": "x-office/document", + "application/vnd.oasis.opendocument.presentation": "x-office/presentation", + "application/vnd.oasis.opendocument.presentation-template": "x-office/presentation", + "application/vnd.oasis.opendocument.spreadsheet": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.spreadsheet-template": "x-office/spreadsheet", + "application/vnd.oasis.opendocument.text": "x-office/document", + "application/vnd.oasis.opendocument.text-master": "x-office/document", + "application/vnd.oasis.opendocument.text-template": "x-office/document", + "application/vnd.oasis.opendocument.text-web": "x-office/document", + "application/vnd.openxmlformats-officedocument.presentationml.presentation": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.presentationml.template": "x-office/presentation", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "x-office/spreadsheet", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": "x-office/spreadsheet", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "x-office/document", + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": "x-office/document", + "application/x-7z-compressed": "package/x-generic", + "application/x-compressed": "package/x-generic", + "application/x-dcraw": "image", + "application/x-deb": "package/x-generic", + "application/x-font": "font", + "application/x-gimp": "image", + "application/x-gzip": "package/x-generic", + "application/x-perl": "text/code", + "application/x-photoshop": "image", + "application/x-php": "text/code", + "application/x-rar-compressed": "package/x-generic", + "application/x-tar": "package/x-generic", + "application/x-tex": "text", + "application/xml": "text/html", + "application/yaml": "text/code", + "application/zip": "package/x-generic", + "image/svg+xml": "image/vector", + "text/css": "text/code", + "text/csv": "x-office/spreadsheet", + "text/x-shellscript": "text/code" +}, + files: [ + "text-x-h", + "application-rss+xml", + "video", + "folder-drag-accept", + "application-epub+zip", + "folder-public", + "package-x-generic", + "application-x-shockwave-flash", + "text", + "folder-external", + "web", + "text-vcard", + "application", + "image-vector", + "database", + "text-code", + "text-x-python", + "x-office-spreadsheet", + "application-pdf", + "folder", + "x-office-document", + "text-html", + "text-calendar", + "x-office-presentation", + "text-x-c", + "file", + "font", + "folder-shared", + "application-x-cbr", + "application-javascript", + "image", + "audio" +], + themes: [] +}; diff --git a/core/js/tests/specs/mimeTypeSpec.js b/core/js/tests/specs/mimeTypeSpec.js new file mode 100644 index 00000000000..182941de1a9 --- /dev/null +++ b/core/js/tests/specs/mimeTypeSpec.js @@ -0,0 +1,151 @@ +/** + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +describe('MimeType tests', function() { + var _files; + var _aliases; + var _theme; + + beforeEach(function() { + _files = OC.MimeTypeList.files; + _aliases = OC.MimeTypeList.aliases; + _theme = OC.MimeTypeList.themes['abc']; + + OC.MimeTypeList.files = ['folder', 'folder-shared', 'folder-external', 'foo-bar', 'foo', 'file']; + OC.MimeTypeList.aliases = {'app/foobar': 'foo/bar'}; + OC.MimeTypeList.themes['abc'] = ['folder']; + }); + + afterEach(function() { + OC.MimeTypeList.files = _files; + OC.MimeTypeList.aliases = _aliases; + OC.MimeTypeList.themes['abc'] = _theme; + }); + + describe('_getFile', function() { + + it('returns the correct icon for "dir"', function() { + var res = OC.MimeType._getFile('dir', OC.MimeTypeList.files); + expect(res).toEqual('folder'); + }); + + it('returns the correct icon for "dir-shared"', function() { + var res = OC.MimeType._getFile('dir-shared', OC.MimeTypeList.files); + expect(res).toEqual('folder-shared'); + }); + + it('returns the correct icon for "dir-external"', function() { + var res = OC.MimeType._getFile('dir-external', OC.MimeTypeList.files); + expect(res).toEqual('folder-external'); + }); + + it('returns the correct icon for a mimetype for which we have an icon', function() { + var res = OC.MimeType._getFile('foo/bar', OC.MimeTypeList.files); + expect(res).toEqual('foo-bar'); + }); + + it('returns the correct icon for a mimetype for which we only have a general mimetype icon', function() { + var res = OC.MimeType._getFile('foo/baz', OC.MimeTypeList.files); + expect(res).toEqual('foo'); + }); + + it('return the file mimetype if we have no matching icon but do have a file icon', function() { + var res = OC.MimeType._getFile('foobar', OC.MimeTypeList.files); + expect(res).toEqual('file'); + }); + + it('return null if we do not have a matching icon', function() { + var res = OC.MimeType._getFile('xyz', []); + expect(res).toEqual(null); + }); + }); + + describe('getIconUrl', function() { + + describe('no theme', function() { + var _themeFolder; + + beforeEach(function() { + _themeFolder = OC.theme.folder; + OC.theme.folder = ''; + //Clear mimetypeIcons caches + OC.MimeType._mimeTypeIcons = {}; + }); + + afterEach(function() { + OC.theme.folder = _themeFolder; + }); + + it('return undefined if the an icon for undefined is requested', function() { + var res = OC.MimeType.getIconUrl(undefined); + expect(res).toEqual(undefined); + }); + + it('return the url for the mimetype file', function() { + var res = OC.MimeType.getIconUrl('file'); + expect(res).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); + }); + + it('test if the cache works correctly', function() { + OC.MimeType._mimeTypeIcons = {}; + expect(Object.keys(OC.MimeType._mimeTypeIcons).length).toEqual(0); + + var res = OC.MimeType.getIconUrl('dir'); + expect(Object.keys(OC.MimeType._mimeTypeIcons).length).toEqual(1); + expect(OC.MimeType._mimeTypeIcons['dir']).toEqual(res); + + var res = OC.MimeType.getIconUrl('dir-shared'); + expect(Object.keys(OC.MimeType._mimeTypeIcons).length).toEqual(2); + expect(OC.MimeType._mimeTypeIcons['dir-shared']).toEqual(res); + }); + + it('test if alaiases are converted correctly', function() { + var res = OC.MimeType.getIconUrl('app/foobar'); + expect(res).toEqual(OC.webroot + '/core/img/filetypes/foo-bar.svg'); + expect(OC.MimeType._mimeTypeIcons['foo/bar']).toEqual(res); + }); + }); + + describe('themes', function() { + var _themeFolder; + + beforeEach(function() { + _themeFolder = OC.theme.folder; + OC.theme.folder = 'abc'; + //Clear mimetypeIcons caches + OC.MimeType._mimeTypeIcons = {}; + }); + + afterEach(function() { + OC.theme.folder = _themeFolder; + }); + + it('test if theme path is used if a theme icon is availble', function() { + var res = OC.MimeType.getIconUrl('dir'); + expect(res).toEqual(OC.webroot + '/themes/abc/core/img/filetypes/folder.svg'); + }); + + it('test if we fallback to the default theme if no icon is available in the theme', function() { + var res = OC.MimeType.getIconUrl('dir-shared'); + expect(res).toEqual(OC.webroot + '/core/img/filetypes/folder-shared.svg'); + }); + }); + }); +}); diff --git a/core/js/update.js b/core/js/update.js index 60f04832935..fd3c7a56bd6 100644 --- a/core/js/update.js +++ b/core/js/update.js @@ -22,6 +22,8 @@ return; } + var hasWarnings = false; + this.$el = $el; this._started = true; @@ -40,6 +42,7 @@ }); updateEventSource.listen('notice', function(message) { $('<span>').addClass('error').append(message).append('<br />').appendTo($el); + hasWarnings = true; }); updateEventSource.listen('error', function(message) { $('<span>').addClass('error').append(message).append('<br />').appendTo($el); @@ -57,14 +60,23 @@ .appendTo($el); }); updateEventSource.listen('done', function() { - // FIXME: use product name - $('<span>').addClass('bold') - .append('<br />') - .append(t('core', 'The update was successful. Redirecting you to ownCloud now.')) - .appendTo($el); - setTimeout(function () { - OC.redirect(OC.webroot); - }, 3000); + if (hasWarnings) { + $('<span>').addClass('bold') + .append('<br />') + .append(t('core', 'The update was successful. There were warnings.')) + .appendTo($el); + var message = t('core', 'Please reload the page.'); + $('<span>').append('<br />').append(message).append('<br />').appendTo($el); + } else { + // FIXME: use product name + $('<span>').addClass('bold') + .append('<br />') + .append(t('core', 'The update was successful. Redirecting you to ownCloud now.')) + .appendTo($el); + setTimeout(function () { + OC.redirect(OC.webroot); + }, 3000); + } }); }, diff --git a/core/l10n/bg_BG.js b/core/l10n/bg_BG.js index 3bd0feb1f2b..e96f8e2d6b0 100644 --- a/core/l10n/bg_BG.js +++ b/core/l10n/bg_BG.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Предупреждение при поправка:", "Repair error: " : "Грешка при поправка:", "Following incompatible apps have been disabled: %s" : "Следните несъвместими приложения бяха изключени: %s", - "Following 3rd party apps have been disabled: %s" : "Следните външни приложения бяха изключени : %s", "Invalid file provided" : "Предоставен е невалиден файл", "No image or file provided" : "Не бяха доставени картинка или файл", "Unknown filetype" : "Непознат файлов тип", diff --git a/core/l10n/bg_BG.json b/core/l10n/bg_BG.json index db846a8bbb2..84b5a5b72a4 100644 --- a/core/l10n/bg_BG.json +++ b/core/l10n/bg_BG.json @@ -9,7 +9,6 @@ "Repair warning: " : "Предупреждение при поправка:", "Repair error: " : "Грешка при поправка:", "Following incompatible apps have been disabled: %s" : "Следните несъвместими приложения бяха изключени: %s", - "Following 3rd party apps have been disabled: %s" : "Следните външни приложения бяха изключени : %s", "Invalid file provided" : "Предоставен е невалиден файл", "No image or file provided" : "Не бяха доставени картинка или файл", "Unknown filetype" : "Непознат файлов тип", diff --git a/core/l10n/ca.js b/core/l10n/ca.js index c3619dad77e..7ed783d68ed 100644 --- a/core/l10n/ca.js +++ b/core/l10n/ca.js @@ -10,7 +10,6 @@ OC.L10N.register( "Updated \"%s\" to %s" : "Actualitzat \"%s\" a %s", "Repair warning: " : "Advertiment de reparació:", "Following incompatible apps have been disabled: %s" : "Les següents apps incompatibles s'han deshabilitat: %s", - "Following 3rd party apps have been disabled: %s" : "Les següents aplicacions de tercers han estat deshabilitades: %s", "Invalid file provided" : "L'arxiu proporcionat no és vàlid", "No image or file provided" : "No s'han proporcionat imatges o fitxers", "Unknown filetype" : "Tipus de fitxer desconegut", diff --git a/core/l10n/ca.json b/core/l10n/ca.json index 476b59f56ea..fc855c2e7b4 100644 --- a/core/l10n/ca.json +++ b/core/l10n/ca.json @@ -8,7 +8,6 @@ "Updated \"%s\" to %s" : "Actualitzat \"%s\" a %s", "Repair warning: " : "Advertiment de reparació:", "Following incompatible apps have been disabled: %s" : "Les següents apps incompatibles s'han deshabilitat: %s", - "Following 3rd party apps have been disabled: %s" : "Les següents aplicacions de tercers han estat deshabilitades: %s", "Invalid file provided" : "L'arxiu proporcionat no és vàlid", "No image or file provided" : "No s'han proporcionat imatges o fitxers", "Unknown filetype" : "Tipus de fitxer desconegut", diff --git a/core/l10n/cs_CZ.js b/core/l10n/cs_CZ.js index 9cd3c35d30d..11dde0318d2 100644 --- a/core/l10n/cs_CZ.js +++ b/core/l10n/cs_CZ.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Upozornění opravy:", "Repair error: " : "Chyba opravy:", "Following incompatible apps have been disabled: %s" : "Následující nekompatibilní aplikace byly zakázány: %s", - "Following 3rd party apps have been disabled: %s" : "Následující aplikace 3. stran byly zakázány: %s", "Invalid file provided" : "Zadán neplatný soubor", "No image or file provided" : "Soubor nebo obrázek nebyl zadán", "Unknown filetype" : "Neznámý typ souboru", diff --git a/core/l10n/cs_CZ.json b/core/l10n/cs_CZ.json index 767864582d8..cce95f64690 100644 --- a/core/l10n/cs_CZ.json +++ b/core/l10n/cs_CZ.json @@ -10,7 +10,6 @@ "Repair warning: " : "Upozornění opravy:", "Repair error: " : "Chyba opravy:", "Following incompatible apps have been disabled: %s" : "Následující nekompatibilní aplikace byly zakázány: %s", - "Following 3rd party apps have been disabled: %s" : "Následující aplikace 3. stran byly zakázány: %s", "Invalid file provided" : "Zadán neplatný soubor", "No image or file provided" : "Soubor nebo obrázek nebyl zadán", "Unknown filetype" : "Neznámý typ souboru", diff --git a/core/l10n/da.js b/core/l10n/da.js index 61ff02ef397..c6f27c7124a 100644 --- a/core/l10n/da.js +++ b/core/l10n/da.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Reparationsadvarsel:", "Repair error: " : "Reparationsfejl:", "Following incompatible apps have been disabled: %s" : "Følgende inkompatible apps er blevet deaktiveret: %s", - "Following 3rd party apps have been disabled: %s" : "Følgende apps fra 3. part er blevet deaktiveret: %s", + "Following apps have been disabled: %s" : "Følgende apps er blevet deaktiveret: %s", "Invalid file provided" : "Der er angivet en ugyldig fil", "No image or file provided" : "Ingen fil eller billede givet", "Unknown filetype" : "Ukendt filtype", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Opdaterer {productName} til version {version}, det kan tage et stykke tid.", "Please reload the page." : "Genindlæs venligst siden", "The update was unsuccessful. " : "Opdateringen blev ikke gennemført.", + "The update was successful. There were warnings." : "Opdateringen blev gennemført. Der fremkom advarsler.", "The update was successful. Redirecting you to ownCloud now." : "Opdateringen blev udført korrekt. Du bliver nu viderestillet til ownCloud.", "Couldn't reset password because the token is invalid" : "Kunne ikke nulstille kodeordet, fordi symboludtrykket er ugyldigt", "Couldn't send reset email. Please make sure your username is correct." : "Der opstod et problem under afsendelse af nulstillings-e-mailen. Kontroller venligst om dit brugernavnet er korrekt", diff --git a/core/l10n/da.json b/core/l10n/da.json index 5b2aadfe73b..9688cb28ed7 100644 --- a/core/l10n/da.json +++ b/core/l10n/da.json @@ -10,7 +10,7 @@ "Repair warning: " : "Reparationsadvarsel:", "Repair error: " : "Reparationsfejl:", "Following incompatible apps have been disabled: %s" : "Følgende inkompatible apps er blevet deaktiveret: %s", - "Following 3rd party apps have been disabled: %s" : "Følgende apps fra 3. part er blevet deaktiveret: %s", + "Following apps have been disabled: %s" : "Følgende apps er blevet deaktiveret: %s", "Invalid file provided" : "Der er angivet en ugyldig fil", "No image or file provided" : "Ingen fil eller billede givet", "Unknown filetype" : "Ukendt filtype", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Opdaterer {productName} til version {version}, det kan tage et stykke tid.", "Please reload the page." : "Genindlæs venligst siden", "The update was unsuccessful. " : "Opdateringen blev ikke gennemført.", + "The update was successful. There were warnings." : "Opdateringen blev gennemført. Der fremkom advarsler.", "The update was successful. Redirecting you to ownCloud now." : "Opdateringen blev udført korrekt. Du bliver nu viderestillet til ownCloud.", "Couldn't reset password because the token is invalid" : "Kunne ikke nulstille kodeordet, fordi symboludtrykket er ugyldigt", "Couldn't send reset email. Please make sure your username is correct." : "Der opstod et problem under afsendelse af nulstillings-e-mailen. Kontroller venligst om dit brugernavnet er korrekt", diff --git a/core/l10n/de.js b/core/l10n/de.js index 06e68d736e1..965f8890813 100644 --- a/core/l10n/de.js +++ b/core/l10n/de.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Reperaturwarnung:", "Repair error: " : "Reperaturfehler:", "Following incompatible apps have been disabled: %s" : "Die folgenden inkompatiblen Apps sind deaktiviert worden: %s", - "Following 3rd party apps have been disabled: %s" : "Die folgenden Drittanbieter-Apps sind deaktiviert worden: %s", "Invalid file provided" : "Ungültige Datei zur Verfügung gestellt", "No image or file provided" : "Es wurde weder ein Bild noch eine Datei zur Verfügung gestellt", "Unknown filetype" : "Unbekannter Dateityp", diff --git a/core/l10n/de.json b/core/l10n/de.json index 52950957407..3a0cc4d4fe2 100644 --- a/core/l10n/de.json +++ b/core/l10n/de.json @@ -10,7 +10,6 @@ "Repair warning: " : "Reperaturwarnung:", "Repair error: " : "Reperaturfehler:", "Following incompatible apps have been disabled: %s" : "Die folgenden inkompatiblen Apps sind deaktiviert worden: %s", - "Following 3rd party apps have been disabled: %s" : "Die folgenden Drittanbieter-Apps sind deaktiviert worden: %s", "Invalid file provided" : "Ungültige Datei zur Verfügung gestellt", "No image or file provided" : "Es wurde weder ein Bild noch eine Datei zur Verfügung gestellt", "Unknown filetype" : "Unbekannter Dateityp", diff --git a/core/l10n/de_DE.js b/core/l10n/de_DE.js index dba7f158f55..a2a448e21d7 100644 --- a/core/l10n/de_DE.js +++ b/core/l10n/de_DE.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Reperaturwarnung:", "Repair error: " : "Reperaturfehler:", "Following incompatible apps have been disabled: %s" : "Die folgenden inkompatiblen Apps sind deaktiviert worden: %s", - "Following 3rd party apps have been disabled: %s" : "Die folgenden Drittanbieter-Apps sind deaktiviert worden: %s", "Invalid file provided" : "Ungültige Datei zur Verfügung gestellt", "No image or file provided" : "Es wurde weder ein Bild noch eine Datei zur Verfügung gestellt", "Unknown filetype" : "Unbekannter Dateityp", diff --git a/core/l10n/de_DE.json b/core/l10n/de_DE.json index d5d81a34f79..dd7f50913a0 100644 --- a/core/l10n/de_DE.json +++ b/core/l10n/de_DE.json @@ -10,7 +10,6 @@ "Repair warning: " : "Reperaturwarnung:", "Repair error: " : "Reperaturfehler:", "Following incompatible apps have been disabled: %s" : "Die folgenden inkompatiblen Apps sind deaktiviert worden: %s", - "Following 3rd party apps have been disabled: %s" : "Die folgenden Drittanbieter-Apps sind deaktiviert worden: %s", "Invalid file provided" : "Ungültige Datei zur Verfügung gestellt", "No image or file provided" : "Es wurde weder ein Bild noch eine Datei zur Verfügung gestellt", "Unknown filetype" : "Unbekannter Dateityp", diff --git a/core/l10n/el.js b/core/l10n/el.js index 04e49fb4598..6692f35778a 100644 --- a/core/l10n/el.js +++ b/core/l10n/el.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Προειδοποίηση διόρθωσης:", "Repair error: " : "Σφάλμα διόρθωσης:", "Following incompatible apps have been disabled: %s" : "Οι παρακάτω εφαρμογές έχουν απενεργοποιηθεί: %s", - "Following 3rd party apps have been disabled: %s" : "Οι παρακάτω εφαρμογές 3ων έχουν απενεργοποιηθεί: %s", "Invalid file provided" : "Έχει δοθεί μη έγκυρο αρχείο", "No image or file provided" : "Δεν δόθηκε εικόνα ή αρχείο", "Unknown filetype" : "Άγνωστος τύπος αρχείου", diff --git a/core/l10n/el.json b/core/l10n/el.json index 9f955c9d385..5c0d0822187 100644 --- a/core/l10n/el.json +++ b/core/l10n/el.json @@ -10,7 +10,6 @@ "Repair warning: " : "Προειδοποίηση διόρθωσης:", "Repair error: " : "Σφάλμα διόρθωσης:", "Following incompatible apps have been disabled: %s" : "Οι παρακάτω εφαρμογές έχουν απενεργοποιηθεί: %s", - "Following 3rd party apps have been disabled: %s" : "Οι παρακάτω εφαρμογές 3ων έχουν απενεργοποιηθεί: %s", "Invalid file provided" : "Έχει δοθεί μη έγκυρο αρχείο", "No image or file provided" : "Δεν δόθηκε εικόνα ή αρχείο", "Unknown filetype" : "Άγνωστος τύπος αρχείου", diff --git a/core/l10n/en_GB.js b/core/l10n/en_GB.js index 56442876616..4eb6b354261 100644 --- a/core/l10n/en_GB.js +++ b/core/l10n/en_GB.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Repair warning: ", "Repair error: " : "Repair error: ", "Following incompatible apps have been disabled: %s" : "Following incompatible apps have been disabled: %s", - "Following 3rd party apps have been disabled: %s" : "Following 3rd party apps have been disabled: %s", "Invalid file provided" : "Invalid file provided", "No image or file provided" : "No image or file provided", "Unknown filetype" : "Unknown filetype", diff --git a/core/l10n/en_GB.json b/core/l10n/en_GB.json index 3c1615a7fe7..e05bd7c73f5 100644 --- a/core/l10n/en_GB.json +++ b/core/l10n/en_GB.json @@ -9,7 +9,6 @@ "Repair warning: " : "Repair warning: ", "Repair error: " : "Repair error: ", "Following incompatible apps have been disabled: %s" : "Following incompatible apps have been disabled: %s", - "Following 3rd party apps have been disabled: %s" : "Following 3rd party apps have been disabled: %s", "Invalid file provided" : "Invalid file provided", "No image or file provided" : "No image or file provided", "Unknown filetype" : "Unknown filetype", diff --git a/core/l10n/es.js b/core/l10n/es.js index f58336b88f1..6b206f8bb96 100644 --- a/core/l10n/es.js +++ b/core/l10n/es.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Advertencia de reparación:", "Repair error: " : "Error que reparar:", "Following incompatible apps have been disabled: %s" : "Las siguientes apps incompatibles se han deshabilitado: %s", - "Following 3rd party apps have been disabled: %s" : "Las siguientes aplicaciones de terceros han sido deshabilitadas: %s", + "Following apps have been disabled: %s" : "Siguiendo aplicaciones ha sido deshabilitado: %s", "Invalid file provided" : "Archivo inválido", "No image or file provided" : "No se especificó ningún archivo o imagen", "Unknown filetype" : "Tipo de archivo desconocido", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Actualizando {productName} a la versión {version}. Esto puede tardar un poco.", "Please reload the page." : "Recargue/Actualice la página", "The update was unsuccessful. " : "La actualización ha fallado.", + "The update was successful. There were warnings." : "La actualización fue exitosa. Había advertencias.", "The update was successful. Redirecting you to ownCloud now." : "La actualización se ha realizado con éxito. Redireccionando a ownCloud ahora.", "Couldn't reset password because the token is invalid" : "No se puede restablecer la contraseña porque el vale de identificación es inválido.", "Couldn't send reset email. Please make sure your username is correct." : "No se pudo enviar el correo electrónico para el restablecimiento. Por favor, asegúrese de que su nombre de usuario es el correcto.", diff --git a/core/l10n/es.json b/core/l10n/es.json index 0385a94b2a3..ce593dac652 100644 --- a/core/l10n/es.json +++ b/core/l10n/es.json @@ -10,7 +10,7 @@ "Repair warning: " : "Advertencia de reparación:", "Repair error: " : "Error que reparar:", "Following incompatible apps have been disabled: %s" : "Las siguientes apps incompatibles se han deshabilitado: %s", - "Following 3rd party apps have been disabled: %s" : "Las siguientes aplicaciones de terceros han sido deshabilitadas: %s", + "Following apps have been disabled: %s" : "Siguiendo aplicaciones ha sido deshabilitado: %s", "Invalid file provided" : "Archivo inválido", "No image or file provided" : "No se especificó ningún archivo o imagen", "Unknown filetype" : "Tipo de archivo desconocido", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Actualizando {productName} a la versión {version}. Esto puede tardar un poco.", "Please reload the page." : "Recargue/Actualice la página", "The update was unsuccessful. " : "La actualización ha fallado.", + "The update was successful. There were warnings." : "La actualización fue exitosa. Había advertencias.", "The update was successful. Redirecting you to ownCloud now." : "La actualización se ha realizado con éxito. Redireccionando a ownCloud ahora.", "Couldn't reset password because the token is invalid" : "No se puede restablecer la contraseña porque el vale de identificación es inválido.", "Couldn't send reset email. Please make sure your username is correct." : "No se pudo enviar el correo electrónico para el restablecimiento. Por favor, asegúrese de que su nombre de usuario es el correcto.", diff --git a/core/l10n/fi_FI.js b/core/l10n/fi_FI.js index 8a2e445ddb3..52d8364c747 100644 --- a/core/l10n/fi_FI.js +++ b/core/l10n/fi_FI.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Korjausvaroitus:", "Repair error: " : "Korjausvirhe:", "Following incompatible apps have been disabled: %s" : "Seuraavat yhteensopimattomat sovellukset on poistettu käytöstä: %s", - "Following 3rd party apps have been disabled: %s" : "Seuraavat kolmansien osapuolten sovellukset on poistettu käytöstä: %s", + "Following apps have been disabled: %s" : "Seuraavat sovellukset on poistettu käytöstä: %s", "Invalid file provided" : "Määritetty virheellinen tiedosto", "No image or file provided" : "Kuvaa tai tiedostoa ei määritelty", "Unknown filetype" : "Tuntematon tiedostotyyppi", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Päivitetään {productName} versioon {version}, tämä saattaa kestää hetken.", "Please reload the page." : "Päivitä sivu.", "The update was unsuccessful. " : "Päivitys epäonnistui.", + "The update was successful. There were warnings." : "Päivitys onnistui, tosin ilmeni varoituksia.", "The update was successful. Redirecting you to ownCloud now." : "Päivitys onnistui. Selain ohjautuu nyt ownCloudiisi.", "Couldn't reset password because the token is invalid" : "Salasanaa ei voitu palauttaa koska valtuutus on virheellinen", "Couldn't send reset email. Please make sure your username is correct." : "Palautussähköpostin lähettäminen ei onnistunut. Varmista, että käyttäjätunnuksesi on oikein.", diff --git a/core/l10n/fi_FI.json b/core/l10n/fi_FI.json index 656717b346d..1738aeed31f 100644 --- a/core/l10n/fi_FI.json +++ b/core/l10n/fi_FI.json @@ -10,7 +10,7 @@ "Repair warning: " : "Korjausvaroitus:", "Repair error: " : "Korjausvirhe:", "Following incompatible apps have been disabled: %s" : "Seuraavat yhteensopimattomat sovellukset on poistettu käytöstä: %s", - "Following 3rd party apps have been disabled: %s" : "Seuraavat kolmansien osapuolten sovellukset on poistettu käytöstä: %s", + "Following apps have been disabled: %s" : "Seuraavat sovellukset on poistettu käytöstä: %s", "Invalid file provided" : "Määritetty virheellinen tiedosto", "No image or file provided" : "Kuvaa tai tiedostoa ei määritelty", "Unknown filetype" : "Tuntematon tiedostotyyppi", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Päivitetään {productName} versioon {version}, tämä saattaa kestää hetken.", "Please reload the page." : "Päivitä sivu.", "The update was unsuccessful. " : "Päivitys epäonnistui.", + "The update was successful. There were warnings." : "Päivitys onnistui, tosin ilmeni varoituksia.", "The update was successful. Redirecting you to ownCloud now." : "Päivitys onnistui. Selain ohjautuu nyt ownCloudiisi.", "Couldn't reset password because the token is invalid" : "Salasanaa ei voitu palauttaa koska valtuutus on virheellinen", "Couldn't send reset email. Please make sure your username is correct." : "Palautussähköpostin lähettäminen ei onnistunut. Varmista, että käyttäjätunnuksesi on oikein.", diff --git a/core/l10n/fr.js b/core/l10n/fr.js index db2569bfd18..f5147a3ecc7 100644 --- a/core/l10n/fr.js +++ b/core/l10n/fr.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Avertissement de réparation :", "Repair error: " : "Erreur de réparation :", "Following incompatible apps have been disabled: %s" : "Les applications incompatibles suivantes ont été désactivées : %s", - "Following 3rd party apps have been disabled: %s" : "Les applications tierces parties suivantes ont été désactivées : %s", + "Following apps have been disabled: %s" : "Les applications suivantes ont été désactivées : %s", "Invalid file provided" : "Fichier non valide", "No image or file provided" : "Aucun fichier fourni", "Unknown filetype" : "Type de fichier inconnu", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "La mise à jour de {productName} vers la version {version} est en cours. Cela peut prendre un certain temps.", "Please reload the page." : "Veuillez recharger la page.", "The update was unsuccessful. " : "La mise à jour a échoué.", + "The update was successful. There were warnings." : "La mise à jour a réussi. Des erreurs sont survenues.", "The update was successful. Redirecting you to ownCloud now." : "La mise à jour a réussi. Vous êtes maintenant redirigé vers ownCloud.", "Couldn't reset password because the token is invalid" : "Impossible de réinitialiser le mot de passe car le jeton n'est pas valable.", "Couldn't send reset email. Please make sure your username is correct." : "Impossible d'envoyer le courriel de réinitialisation. Veuillez vérifier que votre nom d'utilisateur est correct.", diff --git a/core/l10n/fr.json b/core/l10n/fr.json index bfebc91fda7..6ebaf20e0b1 100644 --- a/core/l10n/fr.json +++ b/core/l10n/fr.json @@ -10,7 +10,7 @@ "Repair warning: " : "Avertissement de réparation :", "Repair error: " : "Erreur de réparation :", "Following incompatible apps have been disabled: %s" : "Les applications incompatibles suivantes ont été désactivées : %s", - "Following 3rd party apps have been disabled: %s" : "Les applications tierces parties suivantes ont été désactivées : %s", + "Following apps have been disabled: %s" : "Les applications suivantes ont été désactivées : %s", "Invalid file provided" : "Fichier non valide", "No image or file provided" : "Aucun fichier fourni", "Unknown filetype" : "Type de fichier inconnu", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "La mise à jour de {productName} vers la version {version} est en cours. Cela peut prendre un certain temps.", "Please reload the page." : "Veuillez recharger la page.", "The update was unsuccessful. " : "La mise à jour a échoué.", + "The update was successful. There were warnings." : "La mise à jour a réussi. Des erreurs sont survenues.", "The update was successful. Redirecting you to ownCloud now." : "La mise à jour a réussi. Vous êtes maintenant redirigé vers ownCloud.", "Couldn't reset password because the token is invalid" : "Impossible de réinitialiser le mot de passe car le jeton n'est pas valable.", "Couldn't send reset email. Please make sure your username is correct." : "Impossible d'envoyer le courriel de réinitialisation. Veuillez vérifier que votre nom d'utilisateur est correct.", diff --git a/core/l10n/gl.js b/core/l10n/gl.js index 7799acf0696..0d37512f4f5 100644 --- a/core/l10n/gl.js +++ b/core/l10n/gl.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Aviso de arranxo:", "Repair error: " : "Arranxar o erro:", "Following incompatible apps have been disabled: %s" : "As seguintes aplicacións incompatíbeis foron desactivadas: %s", - "Following 3rd party apps have been disabled: %s" : "As seguintes aplicacións de terceiros foron desactivadas: %s", + "Following apps have been disabled: %s" : "As seguintes aplicacións foron desactivadas: %s", "Invalid file provided" : "O ficheiro fornecido non é válido", "No image or file provided" : "Non forneceu ningunha imaxe ou ficheiro", "Unknown filetype" : "Tipo de ficheiro descoñecido", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Actualizando {productName} a versión {version}, isto pode levar un anaco.", "Please reload the page." : "Volva cargar a páxina.", "The update was unsuccessful. " : "Fracasou a actualización.", + "The update was successful. There were warnings." : "A actualización realizouse correctamente. Houbo algún aviso.", "The update was successful. Redirecting you to ownCloud now." : "A actualización realizouse correctamente. Redirixíndoo agora á ownCloud.", "Couldn't reset password because the token is invalid" : "No, foi posíbel restabelecer o contrasinal, a marca non é correcta", "Couldn't send reset email. Please make sure your username is correct." : "Non foi posíbel enviar o correo do restabelecemento. Asegúrese de que o nome de usuario é o correcto.", diff --git a/core/l10n/gl.json b/core/l10n/gl.json index 023c30fa234..b32d636ecd2 100644 --- a/core/l10n/gl.json +++ b/core/l10n/gl.json @@ -10,7 +10,7 @@ "Repair warning: " : "Aviso de arranxo:", "Repair error: " : "Arranxar o erro:", "Following incompatible apps have been disabled: %s" : "As seguintes aplicacións incompatíbeis foron desactivadas: %s", - "Following 3rd party apps have been disabled: %s" : "As seguintes aplicacións de terceiros foron desactivadas: %s", + "Following apps have been disabled: %s" : "As seguintes aplicacións foron desactivadas: %s", "Invalid file provided" : "O ficheiro fornecido non é válido", "No image or file provided" : "Non forneceu ningunha imaxe ou ficheiro", "Unknown filetype" : "Tipo de ficheiro descoñecido", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Actualizando {productName} a versión {version}, isto pode levar un anaco.", "Please reload the page." : "Volva cargar a páxina.", "The update was unsuccessful. " : "Fracasou a actualización.", + "The update was successful. There were warnings." : "A actualización realizouse correctamente. Houbo algún aviso.", "The update was successful. Redirecting you to ownCloud now." : "A actualización realizouse correctamente. Redirixíndoo agora á ownCloud.", "Couldn't reset password because the token is invalid" : "No, foi posíbel restabelecer o contrasinal, a marca non é correcta", "Couldn't send reset email. Please make sure your username is correct." : "Non foi posíbel enviar o correo do restabelecemento. Asegúrese de que o nome de usuario é o correcto.", diff --git a/core/l10n/id.js b/core/l10n/id.js index 8b533c9a9fa..5e96897e218 100644 --- a/core/l10n/id.js +++ b/core/l10n/id.js @@ -4,6 +4,7 @@ OC.L10N.register( "Couldn't send mail to following users: %s " : "Tidak dapat mengirim Email ke pengguna berikut: %s", "Turned on maintenance mode" : "Hidupkan mode perawatan", "Turned off maintenance mode" : "Matikan mode perawatan", + "Maintenance mode is kept active" : "Mode Pemeliharaan masih aktif", "Updated database" : "Basis data terbaru", "Checked database schema update" : "Pembaruan skema basis data terperiksa", "Checked database schema update for apps" : "Pembaruan skema basis data terperiksa untuk aplikasi", @@ -11,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Peringatan perbaikan:", "Repair error: " : "Kesalahan perbaikan:", "Following incompatible apps have been disabled: %s" : "Aplikasi tidak kompatibel berikut telah dinonaktifkan: %s", - "Following 3rd party apps have been disabled: %s" : "Aplikasi pihak ke-3 berikut telah dinonaktifkan: %s", "Invalid file provided" : "Berkas yang diberikan tidak sah", "No image or file provided" : "Tidak ada gambar atau berkas yang disediakan", "Unknown filetype" : "Tipe berkas tidak dikenal", @@ -73,8 +73,11 @@ OC.L10N.register( "This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features." : "Server ini tidak tersambung ke internet. Ini berarti beberapa fitur seperti me-mount penyimpanan eksternal, notifikasi pembaruan atau instalasi aplikasi pihak ketiga tidak akan bekerja. Mengakses berkas secara remote dan mengirim notifikasi email juga tidak bekerja. Kami menyarankan untuk mengaktifkan koneksi internet untuk server ini jika Anda ingin memiliki fitur ini.", "Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root." : "Direktori data dan berkas Anda kemungkinan dapat diakses dari Internet. Berkas .htaccess tidak bekerja. Kami sangat menyarankan Anda untuk mengkonfigurasi server web agar direktori data tidak lagi dapat diakses atau pindahkan direktori data Anda di luar root dokumen server web.", "No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href=\"{docLink}\">documentation</a>." : "Tembolok memori tidak dikonfigurasi. Untuk meningkatkan kinerja, mohon konfigurasi memcache jika tersedia. Informasi lebih lanjut dapat ditemukan di <a href=\"{docLink}\">dokumentasi</a> kami.", + "/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href=\"{docLink}\">documentation</a>." : "/dev/urandom tidak terbaca oleh PHP sangat disarankan untuk alasan keamanan. Informasi lebih lanjut dapat ditemukan di <a href=\"{docLink}\">dokumentasi</a> kami.", "Error occurred while checking server setup" : "Kesalahan tidak terduga saat memeriksa setelan server", "The \"{header}\" HTTP header is not configured to equal to \"{expected}\". This is a potential security or privacy risk and we recommend adjusting this setting." : "Header HTTP \"{header}\" tidak dikonfigurasi sama dengan \"{expected}\". Hal ini berpotensi pada resiko keamanan dan privasi. Kami sarankan untuk menyesuaikan pengaturan ini.", + "The \"Strict-Transport-Security\" HTTP header is not configured to least \"{seconds}\" seconds. For enhanced security we recommend enabling HSTS as described in our <a href=\"{docUrl}\">security tips</a>." : "HTTP header \"Strict-Transport-Security\" tidak diatur kurang dari \"{seconds}\" detik. Untuk peningkatan keamanan, kami menyarankan untuk mengaktifkan HSTS seperti yang dijelaskan di <a href=\"{docUrl}\">tips keamanan</a>.", + "You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href=\"{docUrl}\">security tips</a>." : "Anda mengakses situs ini via HTTP. Kami sangat menyarankan Anda untuk mengatur server Anda menggunakan HTTPS yang dibahas di <a href=\"{docUrl}\">tips keamanan</a> kami.", "Shared" : "Dibagikan", "Shared with {recipients}" : "Dibagikan dengan {recipients}", "Share" : "Bagikan", @@ -132,6 +135,7 @@ OC.L10N.register( "Hello {name}, the weather is {weather}" : "Helo {name}, jepang {weather}", "Hello {name}" : "Helo {name}", "_download %n file_::_download %n files_" : ["unduh %n berkas"], + "{version} is available. Get more information on how to update." : "{version} tersedia. Dapatkan informasi lebih lanjut cara memperbaruinya.", "Updating {productName} to version {version}, this may take a while." : "Memperbarui {productName} ke versi {version}, ini memerlukan waktu.", "Please reload the page." : "Silakan muat ulang halaman.", "The update was unsuccessful. " : "Pembaruan tidak berhasil.", @@ -145,6 +149,7 @@ OC.L10N.register( "New Password" : "Sandi Baru", "Reset password" : "Setel ulang sandi", "Searching other places" : "Mencari tempat lainnya", + "No search results in other places" : "Tidak ada hasil pencarian di tempat lain", "_{count} search result in other places_::_{count} search results in other places_" : ["{count} hasil pencarian di tempat lain"], "Personal" : "Pribadi", "Users" : "Pengguna", @@ -187,6 +192,8 @@ OC.L10N.register( "Data folder" : "Folder data", "Configure the database" : "Konfigurasikan basis data", "Only %s is available." : "Hanya %s yang tersedia", + "Install and activate additional PHP modules to choose other database types." : "Pasang dan aktifkan modul PHP tambahan untuk memilih tipe basis data lainnya.", + "For more details check out the documentation." : "Untuk lebih rinci, periksa pada dokumentasi.", "Database user" : "Pengguna basis data", "Database password" : "Sandi basis data", "Database name" : "Nama basis data", diff --git a/core/l10n/id.json b/core/l10n/id.json index fb8ea0afea3..04e5a73ca74 100644 --- a/core/l10n/id.json +++ b/core/l10n/id.json @@ -2,6 +2,7 @@ "Couldn't send mail to following users: %s " : "Tidak dapat mengirim Email ke pengguna berikut: %s", "Turned on maintenance mode" : "Hidupkan mode perawatan", "Turned off maintenance mode" : "Matikan mode perawatan", + "Maintenance mode is kept active" : "Mode Pemeliharaan masih aktif", "Updated database" : "Basis data terbaru", "Checked database schema update" : "Pembaruan skema basis data terperiksa", "Checked database schema update for apps" : "Pembaruan skema basis data terperiksa untuk aplikasi", @@ -9,7 +10,6 @@ "Repair warning: " : "Peringatan perbaikan:", "Repair error: " : "Kesalahan perbaikan:", "Following incompatible apps have been disabled: %s" : "Aplikasi tidak kompatibel berikut telah dinonaktifkan: %s", - "Following 3rd party apps have been disabled: %s" : "Aplikasi pihak ke-3 berikut telah dinonaktifkan: %s", "Invalid file provided" : "Berkas yang diberikan tidak sah", "No image or file provided" : "Tidak ada gambar atau berkas yang disediakan", "Unknown filetype" : "Tipe berkas tidak dikenal", @@ -71,8 +71,11 @@ "This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features." : "Server ini tidak tersambung ke internet. Ini berarti beberapa fitur seperti me-mount penyimpanan eksternal, notifikasi pembaruan atau instalasi aplikasi pihak ketiga tidak akan bekerja. Mengakses berkas secara remote dan mengirim notifikasi email juga tidak bekerja. Kami menyarankan untuk mengaktifkan koneksi internet untuk server ini jika Anda ingin memiliki fitur ini.", "Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root." : "Direktori data dan berkas Anda kemungkinan dapat diakses dari Internet. Berkas .htaccess tidak bekerja. Kami sangat menyarankan Anda untuk mengkonfigurasi server web agar direktori data tidak lagi dapat diakses atau pindahkan direktori data Anda di luar root dokumen server web.", "No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href=\"{docLink}\">documentation</a>." : "Tembolok memori tidak dikonfigurasi. Untuk meningkatkan kinerja, mohon konfigurasi memcache jika tersedia. Informasi lebih lanjut dapat ditemukan di <a href=\"{docLink}\">dokumentasi</a> kami.", + "/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href=\"{docLink}\">documentation</a>." : "/dev/urandom tidak terbaca oleh PHP sangat disarankan untuk alasan keamanan. Informasi lebih lanjut dapat ditemukan di <a href=\"{docLink}\">dokumentasi</a> kami.", "Error occurred while checking server setup" : "Kesalahan tidak terduga saat memeriksa setelan server", "The \"{header}\" HTTP header is not configured to equal to \"{expected}\". This is a potential security or privacy risk and we recommend adjusting this setting." : "Header HTTP \"{header}\" tidak dikonfigurasi sama dengan \"{expected}\". Hal ini berpotensi pada resiko keamanan dan privasi. Kami sarankan untuk menyesuaikan pengaturan ini.", + "The \"Strict-Transport-Security\" HTTP header is not configured to least \"{seconds}\" seconds. For enhanced security we recommend enabling HSTS as described in our <a href=\"{docUrl}\">security tips</a>." : "HTTP header \"Strict-Transport-Security\" tidak diatur kurang dari \"{seconds}\" detik. Untuk peningkatan keamanan, kami menyarankan untuk mengaktifkan HSTS seperti yang dijelaskan di <a href=\"{docUrl}\">tips keamanan</a>.", + "You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href=\"{docUrl}\">security tips</a>." : "Anda mengakses situs ini via HTTP. Kami sangat menyarankan Anda untuk mengatur server Anda menggunakan HTTPS yang dibahas di <a href=\"{docUrl}\">tips keamanan</a> kami.", "Shared" : "Dibagikan", "Shared with {recipients}" : "Dibagikan dengan {recipients}", "Share" : "Bagikan", @@ -130,6 +133,7 @@ "Hello {name}, the weather is {weather}" : "Helo {name}, jepang {weather}", "Hello {name}" : "Helo {name}", "_download %n file_::_download %n files_" : ["unduh %n berkas"], + "{version} is available. Get more information on how to update." : "{version} tersedia. Dapatkan informasi lebih lanjut cara memperbaruinya.", "Updating {productName} to version {version}, this may take a while." : "Memperbarui {productName} ke versi {version}, ini memerlukan waktu.", "Please reload the page." : "Silakan muat ulang halaman.", "The update was unsuccessful. " : "Pembaruan tidak berhasil.", @@ -143,6 +147,7 @@ "New Password" : "Sandi Baru", "Reset password" : "Setel ulang sandi", "Searching other places" : "Mencari tempat lainnya", + "No search results in other places" : "Tidak ada hasil pencarian di tempat lain", "_{count} search result in other places_::_{count} search results in other places_" : ["{count} hasil pencarian di tempat lain"], "Personal" : "Pribadi", "Users" : "Pengguna", @@ -185,6 +190,8 @@ "Data folder" : "Folder data", "Configure the database" : "Konfigurasikan basis data", "Only %s is available." : "Hanya %s yang tersedia", + "Install and activate additional PHP modules to choose other database types." : "Pasang dan aktifkan modul PHP tambahan untuk memilih tipe basis data lainnya.", + "For more details check out the documentation." : "Untuk lebih rinci, periksa pada dokumentasi.", "Database user" : "Pengguna basis data", "Database password" : "Sandi basis data", "Database name" : "Nama basis data", diff --git a/core/l10n/it.js b/core/l10n/it.js index 536c49a481e..bcebb0fe818 100644 --- a/core/l10n/it.js +++ b/core/l10n/it.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Avviso di riparazione", "Repair error: " : "Errore di riparazione:", "Following incompatible apps have been disabled: %s" : "Le seguenti applicazioni incompatibili sono state disabilitate: %s", - "Following 3rd party apps have been disabled: %s" : "Le seguenti applicazioni di terze parti sono state disabilitate: %s", "Invalid file provided" : "File non valido fornito", "No image or file provided" : "Non è stata fornita alcun immagine o file", "Unknown filetype" : "Tipo di file sconosciuto", diff --git a/core/l10n/it.json b/core/l10n/it.json index 002111c2899..142c404ead4 100644 --- a/core/l10n/it.json +++ b/core/l10n/it.json @@ -10,7 +10,6 @@ "Repair warning: " : "Avviso di riparazione", "Repair error: " : "Errore di riparazione:", "Following incompatible apps have been disabled: %s" : "Le seguenti applicazioni incompatibili sono state disabilitate: %s", - "Following 3rd party apps have been disabled: %s" : "Le seguenti applicazioni di terze parti sono state disabilitate: %s", "Invalid file provided" : "File non valido fornito", "No image or file provided" : "Non è stata fornita alcun immagine o file", "Unknown filetype" : "Tipo di file sconosciuto", diff --git a/core/l10n/ja.js b/core/l10n/ja.js index ed5dcadcb54..e10c8a41cdc 100644 --- a/core/l10n/ja.js +++ b/core/l10n/ja.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "修復警告:", "Repair error: " : "修復エラー:", "Following incompatible apps have been disabled: %s" : "次の互換性のないアプリは無効にされています: %s", - "Following 3rd party apps have been disabled: %s" : "次のサードパーティーアプリは無効にされています。: %s", "Invalid file provided" : "無効なファイルが提供されました", "No image or file provided" : "画像もしくはファイルが提供されていません", "Unknown filetype" : "不明なファイルタイプ", diff --git a/core/l10n/ja.json b/core/l10n/ja.json index 78f68ca90b4..860f2e4c99e 100644 --- a/core/l10n/ja.json +++ b/core/l10n/ja.json @@ -9,7 +9,6 @@ "Repair warning: " : "修復警告:", "Repair error: " : "修復エラー:", "Following incompatible apps have been disabled: %s" : "次の互換性のないアプリは無効にされています: %s", - "Following 3rd party apps have been disabled: %s" : "次のサードパーティーアプリは無効にされています。: %s", "Invalid file provided" : "無効なファイルが提供されました", "No image or file provided" : "画像もしくはファイルが提供されていません", "Unknown filetype" : "不明なファイルタイプ", diff --git a/core/l10n/ko.js b/core/l10n/ko.js index fb92069899c..203e944ced3 100644 --- a/core/l10n/ko.js +++ b/core/l10n/ko.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "수리 경고:", "Repair error: " : "수리 오류:", "Following incompatible apps have been disabled: %s" : "다음 호환되지 않는 앱이 비활성화되었습니다: %s", - "Following 3rd party apps have been disabled: %s" : "다음 제 3자 앱이 비활성화되었습니다: %s", "Invalid file provided" : "잘못된 파일 지정됨", "No image or file provided" : "사진이나 파일이 없음", "Unknown filetype" : "알려지지 않은 파일 형식", diff --git a/core/l10n/ko.json b/core/l10n/ko.json index edefd99d360..d1bf81e44a6 100644 --- a/core/l10n/ko.json +++ b/core/l10n/ko.json @@ -9,7 +9,6 @@ "Repair warning: " : "수리 경고:", "Repair error: " : "수리 오류:", "Following incompatible apps have been disabled: %s" : "다음 호환되지 않는 앱이 비활성화되었습니다: %s", - "Following 3rd party apps have been disabled: %s" : "다음 제 3자 앱이 비활성화되었습니다: %s", "Invalid file provided" : "잘못된 파일 지정됨", "No image or file provided" : "사진이나 파일이 없음", "Unknown filetype" : "알려지지 않은 파일 형식", diff --git a/core/l10n/mk.js b/core/l10n/mk.js index bbebada0715..a023e7a676a 100644 --- a/core/l10n/mk.js +++ b/core/l10n/mk.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Предупредувања при поправка:", "Repair error: " : "Грешка при поправка:", "Following incompatible apps have been disabled: %s" : "Следниве некомпатибилни апликации се оневозможени: %s", - "Following 3rd party apps have been disabled: %s" : "Следниве апликации од 3-ти лица се оневозможени: %s", "Invalid file provided" : "Дадена е невалидна датотека", "No image or file provided" : "Не е доставена фотографија или датотека", "Unknown filetype" : "Непознат тип на датотека", diff --git a/core/l10n/mk.json b/core/l10n/mk.json index 2cd6b479dc2..419083daf48 100644 --- a/core/l10n/mk.json +++ b/core/l10n/mk.json @@ -9,7 +9,6 @@ "Repair warning: " : "Предупредувања при поправка:", "Repair error: " : "Грешка при поправка:", "Following incompatible apps have been disabled: %s" : "Следниве некомпатибилни апликации се оневозможени: %s", - "Following 3rd party apps have been disabled: %s" : "Следниве апликации од 3-ти лица се оневозможени: %s", "Invalid file provided" : "Дадена е невалидна датотека", "No image or file provided" : "Не е доставена фотографија или датотека", "Unknown filetype" : "Непознат тип на датотека", diff --git a/core/l10n/ms_MY.js b/core/l10n/ms_MY.js index 708f07615da..a6c70c32110 100644 --- a/core/l10n/ms_MY.js +++ b/core/l10n/ms_MY.js @@ -29,6 +29,7 @@ OC.L10N.register( "Share" : "Kongsi", "Error" : "Ralat", "Password" : "Kata laluan", + "Send" : "Hantar", "group" : "kumpulan", "can share" : "boleh berkongsi", "can edit" : "boleh mengubah", diff --git a/core/l10n/ms_MY.json b/core/l10n/ms_MY.json index 078304ee383..2e41332f778 100644 --- a/core/l10n/ms_MY.json +++ b/core/l10n/ms_MY.json @@ -27,6 +27,7 @@ "Share" : "Kongsi", "Error" : "Ralat", "Password" : "Kata laluan", + "Send" : "Hantar", "group" : "kumpulan", "can share" : "boleh berkongsi", "can edit" : "boleh mengubah", diff --git a/core/l10n/nb_NO.js b/core/l10n/nb_NO.js index 231ac727895..c01e230ac74 100644 --- a/core/l10n/nb_NO.js +++ b/core/l10n/nb_NO.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Advarsel fra reparering: ", "Repair error: " : "Feil ved reparering: ", "Following incompatible apps have been disabled: %s" : "Følgende inkompatible apper har blitt deaktivert: %s", - "Following 3rd party apps have been disabled: %s" : "Følgende tredjeparts apper har blitt deaktivert: %s", + "Following apps have been disabled: %s" : "Følgende apper har blitt deaktivert: %s", "Invalid file provided" : "Ugyldig fil oppgitt", "No image or file provided" : "Bilde eller fil ikke angitt", "Unknown filetype" : "Ukjent filtype", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Oppdaterer {productName} til versjon {version}. Dette kan ta litt tid.", "Please reload the page." : "Vennligst last siden på nytt.", "The update was unsuccessful. " : "Oppdateringen var mislykket.", + "The update was successful. There were warnings." : "Oppdateringen var vellykket. Det oppstod advarsler.", "The update was successful. Redirecting you to ownCloud now." : "Oppdateringen var vellykket. Du omdirigeres nå til ownCloud.", "Couldn't reset password because the token is invalid" : "Klarte ikke å tilbakestille passordet fordi token er ugyldig.", "Couldn't send reset email. Please make sure your username is correct." : "Klarte ikke å sende e-post for tilbakestilling av passord. Sjekk at brukernavnet ditt er korrekt.", diff --git a/core/l10n/nb_NO.json b/core/l10n/nb_NO.json index 243fc93e594..16828a6427c 100644 --- a/core/l10n/nb_NO.json +++ b/core/l10n/nb_NO.json @@ -10,7 +10,7 @@ "Repair warning: " : "Advarsel fra reparering: ", "Repair error: " : "Feil ved reparering: ", "Following incompatible apps have been disabled: %s" : "Følgende inkompatible apper har blitt deaktivert: %s", - "Following 3rd party apps have been disabled: %s" : "Følgende tredjeparts apper har blitt deaktivert: %s", + "Following apps have been disabled: %s" : "Følgende apper har blitt deaktivert: %s", "Invalid file provided" : "Ugyldig fil oppgitt", "No image or file provided" : "Bilde eller fil ikke angitt", "Unknown filetype" : "Ukjent filtype", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Oppdaterer {productName} til versjon {version}. Dette kan ta litt tid.", "Please reload the page." : "Vennligst last siden på nytt.", "The update was unsuccessful. " : "Oppdateringen var mislykket.", + "The update was successful. There were warnings." : "Oppdateringen var vellykket. Det oppstod advarsler.", "The update was successful. Redirecting you to ownCloud now." : "Oppdateringen var vellykket. Du omdirigeres nå til ownCloud.", "Couldn't reset password because the token is invalid" : "Klarte ikke å tilbakestille passordet fordi token er ugyldig.", "Couldn't send reset email. Please make sure your username is correct." : "Klarte ikke å sende e-post for tilbakestilling av passord. Sjekk at brukernavnet ditt er korrekt.", diff --git a/core/l10n/nl.js b/core/l10n/nl.js index b3e14782224..5634cf00698 100644 --- a/core/l10n/nl.js +++ b/core/l10n/nl.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Reparatiewaarschuwing:", "Repair error: " : "Reparatiefout:", "Following incompatible apps have been disabled: %s" : "De volgende incompatibele apps zijn uitgeschakeld: %s", - "Following 3rd party apps have been disabled: %s" : "De volgende 3e partij apps zijn uitgeschakeld: %s", + "Following apps have been disabled: %s" : "De volgende apps zijn gedeactiveerd: %s", "Invalid file provided" : "Ongeldig bestand opgegeven", "No image or file provided" : "Geen afbeelding of bestand opgegeven", "Unknown filetype" : "Onbekend bestandsformaat", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Bijwerken {productName} naar versie {version}, dit kan even duren.", "Please reload the page." : "Herlaad deze pagina.", "The update was unsuccessful. " : "De update is niet geslaagd.", + "The update was successful. There were warnings." : "De update is geslaagd. Er zijn wel waarschuwingen.", "The update was successful. Redirecting you to ownCloud now." : "De update is geslaagd. U wordt teruggeleid naar uw eigen ownCloud.", "Couldn't reset password because the token is invalid" : "Kon het wachtwoord niet herstellen, omdat het token ongeldig is", "Couldn't send reset email. Please make sure your username is correct." : "Kon e-mail niet versturen. Verifieer of uw gebruikersnaam correct is.", diff --git a/core/l10n/nl.json b/core/l10n/nl.json index 4763925af11..d106e938bd8 100644 --- a/core/l10n/nl.json +++ b/core/l10n/nl.json @@ -10,7 +10,7 @@ "Repair warning: " : "Reparatiewaarschuwing:", "Repair error: " : "Reparatiefout:", "Following incompatible apps have been disabled: %s" : "De volgende incompatibele apps zijn uitgeschakeld: %s", - "Following 3rd party apps have been disabled: %s" : "De volgende 3e partij apps zijn uitgeschakeld: %s", + "Following apps have been disabled: %s" : "De volgende apps zijn gedeactiveerd: %s", "Invalid file provided" : "Ongeldig bestand opgegeven", "No image or file provided" : "Geen afbeelding of bestand opgegeven", "Unknown filetype" : "Onbekend bestandsformaat", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Bijwerken {productName} naar versie {version}, dit kan even duren.", "Please reload the page." : "Herlaad deze pagina.", "The update was unsuccessful. " : "De update is niet geslaagd.", + "The update was successful. There were warnings." : "De update is geslaagd. Er zijn wel waarschuwingen.", "The update was successful. Redirecting you to ownCloud now." : "De update is geslaagd. U wordt teruggeleid naar uw eigen ownCloud.", "Couldn't reset password because the token is invalid" : "Kon het wachtwoord niet herstellen, omdat het token ongeldig is", "Couldn't send reset email. Please make sure your username is correct." : "Kon e-mail niet versturen. Verifieer of uw gebruikersnaam correct is.", diff --git a/core/l10n/oc.js b/core/l10n/oc.js index bf1b936d856..0c7d99c8f40 100644 --- a/core/l10n/oc.js +++ b/core/l10n/oc.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Avertiment de reparacion :", "Repair error: " : "Error de reparacion :", "Following incompatible apps have been disabled: %s" : "Las aplicacions incompatiblas seguentas son estadas desactivadas : %s", - "Following 3rd party apps have been disabled: %s" : "Las aplicacions tèrças partidas seguentas son estadas desactivadas : %s", "Invalid file provided" : "Fichièr invalid", "No image or file provided" : "Cap de fichièr pas provesit", "Unknown filetype" : "Tipe de fichièr desconegut", diff --git a/core/l10n/oc.json b/core/l10n/oc.json index 82305185e9f..2f8433d0db9 100644 --- a/core/l10n/oc.json +++ b/core/l10n/oc.json @@ -9,7 +9,6 @@ "Repair warning: " : "Avertiment de reparacion :", "Repair error: " : "Error de reparacion :", "Following incompatible apps have been disabled: %s" : "Las aplicacions incompatiblas seguentas son estadas desactivadas : %s", - "Following 3rd party apps have been disabled: %s" : "Las aplicacions tèrças partidas seguentas son estadas desactivadas : %s", "Invalid file provided" : "Fichièr invalid", "No image or file provided" : "Cap de fichièr pas provesit", "Unknown filetype" : "Tipe de fichièr desconegut", diff --git a/core/l10n/pl.js b/core/l10n/pl.js index e6ee12a5e04..7bc447bffce 100644 --- a/core/l10n/pl.js +++ b/core/l10n/pl.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Ostrzeżenie naprawiania:", "Repair error: " : "Błąd naprawiania:", "Following incompatible apps have been disabled: %s" : "Poniższe niezgodne aplikacje zostały wyłączone: %s", - "Following 3rd party apps have been disabled: %s" : "Poniższe aplikacje dostawców trzecich - 3rd - zostały wyłączone: %s", "Invalid file provided" : "Podano błędny plik", "No image or file provided" : "Brak obrazu lub pliku dostarczonego", "Unknown filetype" : "Nieznany typ pliku", diff --git a/core/l10n/pl.json b/core/l10n/pl.json index c0b5e7fdc33..66f3c36921c 100644 --- a/core/l10n/pl.json +++ b/core/l10n/pl.json @@ -9,7 +9,6 @@ "Repair warning: " : "Ostrzeżenie naprawiania:", "Repair error: " : "Błąd naprawiania:", "Following incompatible apps have been disabled: %s" : "Poniższe niezgodne aplikacje zostały wyłączone: %s", - "Following 3rd party apps have been disabled: %s" : "Poniższe aplikacje dostawców trzecich - 3rd - zostały wyłączone: %s", "Invalid file provided" : "Podano błędny plik", "No image or file provided" : "Brak obrazu lub pliku dostarczonego", "Unknown filetype" : "Nieznany typ pliku", diff --git a/core/l10n/pt_BR.js b/core/l10n/pt_BR.js index 8c7087ce475..08cda274ab7 100644 --- a/core/l10n/pt_BR.js +++ b/core/l10n/pt_BR.js @@ -12,7 +12,7 @@ OC.L10N.register( "Repair warning: " : "Aviso de reparação:", "Repair error: " : "Reparação de erro:", "Following incompatible apps have been disabled: %s" : "Seguir aplicativos incompatíveis foi desativado: %s", - "Following 3rd party apps have been disabled: %s" : "Seguir aplicativos de terceiros 3 foi desativado: %s", + "Following apps have been disabled: %s" : "Os seguintes aplicativos foram desabilitados: %s", "Invalid file provided" : "Arquivo fornecido inválido", "No image or file provided" : "Nenhuma imagem ou arquivo fornecido", "Unknown filetype" : "Tipo de arquivo desconhecido", @@ -140,6 +140,7 @@ OC.L10N.register( "Updating {productName} to version {version}, this may take a while." : "Atualizando {productName} para a versão {version}, isso pode demorar um pouco.", "Please reload the page." : "Por favor recarregue a página", "The update was unsuccessful. " : "A atualização não foi bem sucedida.", + "The update was successful. There were warnings." : "A atualização foi bem sucedida. Havia advertências.", "The update was successful. Redirecting you to ownCloud now." : "A atualização teve êxito. Você será redirecionado ao ownCloud agora.", "Couldn't reset password because the token is invalid" : "Não foi possível redefinir a senha porque o token é inválido", "Couldn't send reset email. Please make sure your username is correct." : "Não foi possível enviar e-mail de redefinição. Verifique se o seu nome de usuário está correto.", diff --git a/core/l10n/pt_BR.json b/core/l10n/pt_BR.json index f729817e08e..ddce0d164c1 100644 --- a/core/l10n/pt_BR.json +++ b/core/l10n/pt_BR.json @@ -10,7 +10,7 @@ "Repair warning: " : "Aviso de reparação:", "Repair error: " : "Reparação de erro:", "Following incompatible apps have been disabled: %s" : "Seguir aplicativos incompatíveis foi desativado: %s", - "Following 3rd party apps have been disabled: %s" : "Seguir aplicativos de terceiros 3 foi desativado: %s", + "Following apps have been disabled: %s" : "Os seguintes aplicativos foram desabilitados: %s", "Invalid file provided" : "Arquivo fornecido inválido", "No image or file provided" : "Nenhuma imagem ou arquivo fornecido", "Unknown filetype" : "Tipo de arquivo desconhecido", @@ -138,6 +138,7 @@ "Updating {productName} to version {version}, this may take a while." : "Atualizando {productName} para a versão {version}, isso pode demorar um pouco.", "Please reload the page." : "Por favor recarregue a página", "The update was unsuccessful. " : "A atualização não foi bem sucedida.", + "The update was successful. There were warnings." : "A atualização foi bem sucedida. Havia advertências.", "The update was successful. Redirecting you to ownCloud now." : "A atualização teve êxito. Você será redirecionado ao ownCloud agora.", "Couldn't reset password because the token is invalid" : "Não foi possível redefinir a senha porque o token é inválido", "Couldn't send reset email. Please make sure your username is correct." : "Não foi possível enviar e-mail de redefinição. Verifique se o seu nome de usuário está correto.", diff --git a/core/l10n/pt_PT.js b/core/l10n/pt_PT.js index 40a4ea8523b..d7d70d4b5d0 100644 --- a/core/l10n/pt_PT.js +++ b/core/l10n/pt_PT.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Aviso de reparação:", "Repair error: " : "Repare o erro:", "Following incompatible apps have been disabled: %s" : "As seguintes aplicações incompatíveis foram desativadas: %s", - "Following 3rd party apps have been disabled: %s" : "As seguintes aplicações de 3.ºs foram desativadas: %s", "Invalid file provided" : "Ficheiro selecionado inválido", "No image or file provided" : "Não foi fornecido nenhum ficheiro ou imagem", "Unknown filetype" : "Tipo de ficheiro desconhecido", diff --git a/core/l10n/pt_PT.json b/core/l10n/pt_PT.json index 51751c6e59a..947eea1a942 100644 --- a/core/l10n/pt_PT.json +++ b/core/l10n/pt_PT.json @@ -9,7 +9,6 @@ "Repair warning: " : "Aviso de reparação:", "Repair error: " : "Repare o erro:", "Following incompatible apps have been disabled: %s" : "As seguintes aplicações incompatíveis foram desativadas: %s", - "Following 3rd party apps have been disabled: %s" : "As seguintes aplicações de 3.ºs foram desativadas: %s", "Invalid file provided" : "Ficheiro selecionado inválido", "No image or file provided" : "Não foi fornecido nenhum ficheiro ou imagem", "Unknown filetype" : "Tipo de ficheiro desconhecido", diff --git a/core/l10n/ro.js b/core/l10n/ro.js index 51ff60c64a5..f088f92f3b5 100644 --- a/core/l10n/ro.js +++ b/core/l10n/ro.js @@ -9,7 +9,6 @@ OC.L10N.register( "Repair warning: " : "Alerte reparare:", "Repair error: " : "Eroare de reparare:", "Following incompatible apps have been disabled: %s" : "Următoarele aplicații incompatibile au fost dezactivate: %s", - "Following 3rd party apps have been disabled: %s" : "Următoarele aplicații externe au fost dezactivate: %s", "No image or file provided" : "Nu a fost furnizat vreo imagine sau fișier", "Unknown filetype" : "Tip fișier necunoscut", "Invalid image" : "Imagine invalidă", diff --git a/core/l10n/ro.json b/core/l10n/ro.json index bee38c7a4ae..702da64e6a1 100644 --- a/core/l10n/ro.json +++ b/core/l10n/ro.json @@ -7,7 +7,6 @@ "Repair warning: " : "Alerte reparare:", "Repair error: " : "Eroare de reparare:", "Following incompatible apps have been disabled: %s" : "Următoarele aplicații incompatibile au fost dezactivate: %s", - "Following 3rd party apps have been disabled: %s" : "Următoarele aplicații externe au fost dezactivate: %s", "No image or file provided" : "Nu a fost furnizat vreo imagine sau fișier", "Unknown filetype" : "Tip fișier necunoscut", "Invalid image" : "Imagine invalidă", diff --git a/core/l10n/ru.js b/core/l10n/ru.js index cd784531d9f..49d4c09e3f6 100644 --- a/core/l10n/ru.js +++ b/core/l10n/ru.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Предупреждение восстановления:", "Repair error: " : "Ошибка восстановления:", "Following incompatible apps have been disabled: %s" : "Слежка за несовместимыми приложениями отключена: %s", - "Following 3rd party apps have been disabled: %s" : "Слежка за приложениями 3-их лиц отключена: %s", "Invalid file provided" : "Указан неправильный файл", "No image or file provided" : "Не указано изображение или файл", "Unknown filetype" : "Неизвестный тип файла", diff --git a/core/l10n/ru.json b/core/l10n/ru.json index c68957eff08..74393023f2d 100644 --- a/core/l10n/ru.json +++ b/core/l10n/ru.json @@ -10,7 +10,6 @@ "Repair warning: " : "Предупреждение восстановления:", "Repair error: " : "Ошибка восстановления:", "Following incompatible apps have been disabled: %s" : "Слежка за несовместимыми приложениями отключена: %s", - "Following 3rd party apps have been disabled: %s" : "Слежка за приложениями 3-их лиц отключена: %s", "Invalid file provided" : "Указан неправильный файл", "No image or file provided" : "Не указано изображение или файл", "Unknown filetype" : "Неизвестный тип файла", diff --git a/core/l10n/sk_SK.js b/core/l10n/sk_SK.js index e5dde687d0d..2c92ce92896 100644 --- a/core/l10n/sk_SK.js +++ b/core/l10n/sk_SK.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Oznámenie opravy:", "Repair error: " : "Chyba opravy:", "Following incompatible apps have been disabled: %s" : "Nasledovné nekompatibilné aplikácie boli zakázané: %s", - "Following 3rd party apps have been disabled: %s" : "Nasledovné aplikácie tretích strán boli zakázané: %s", "Invalid file provided" : "Zadaný neplatný súbor", "No image or file provided" : "Obrázok alebo súbor nebol zadaný", "Unknown filetype" : "Neznámy typ súboru", diff --git a/core/l10n/sk_SK.json b/core/l10n/sk_SK.json index f19753c50c2..ac4cb4d0f86 100644 --- a/core/l10n/sk_SK.json +++ b/core/l10n/sk_SK.json @@ -10,7 +10,6 @@ "Repair warning: " : "Oznámenie opravy:", "Repair error: " : "Chyba opravy:", "Following incompatible apps have been disabled: %s" : "Nasledovné nekompatibilné aplikácie boli zakázané: %s", - "Following 3rd party apps have been disabled: %s" : "Nasledovné aplikácie tretích strán boli zakázané: %s", "Invalid file provided" : "Zadaný neplatný súbor", "No image or file provided" : "Obrázok alebo súbor nebol zadaný", "Unknown filetype" : "Neznámy typ súboru", diff --git a/core/l10n/sr.js b/core/l10n/sr.js index a8e5ce18840..4a645b1f1dd 100644 --- a/core/l10n/sr.js +++ b/core/l10n/sr.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Упозорење о поправци :", "Repair error: " : "Грешка поправке:", "Following incompatible apps have been disabled: %s" : "Следеће неусаглашене апликације су искључене: %s", - "Following 3rd party apps have been disabled: %s" : "Следеће апликације треће стране су искључене: %s", "Invalid file provided" : "Понуђени фајл је неисправан", "No image or file provided" : "Није дата ни слика ни фајл", "Unknown filetype" : "Непознат тип фајла", diff --git a/core/l10n/sr.json b/core/l10n/sr.json index a1b23e61eb3..a788d7633f3 100644 --- a/core/l10n/sr.json +++ b/core/l10n/sr.json @@ -10,7 +10,6 @@ "Repair warning: " : "Упозорење о поправци :", "Repair error: " : "Грешка поправке:", "Following incompatible apps have been disabled: %s" : "Следеће неусаглашене апликације су искључене: %s", - "Following 3rd party apps have been disabled: %s" : "Следеће апликације треће стране су искључене: %s", "Invalid file provided" : "Понуђени фајл је неисправан", "No image or file provided" : "Није дата ни слика ни фајл", "Unknown filetype" : "Непознат тип фајла", diff --git a/core/l10n/th_TH.js b/core/l10n/th_TH.js index adc2076d075..1ae375f0d17 100644 --- a/core/l10n/th_TH.js +++ b/core/l10n/th_TH.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "เตือนการซ่อมแซม:", "Repair error: " : "เกิดข้อผิดพลาดในการซ่อมแซม:", "Following incompatible apps have been disabled: %s" : "แอพพลิเคชันต่อไปนี้เข้ากันไม่ได้มันจะถูกปิดการใช้งาน: %s", - "Following 3rd party apps have been disabled: %s" : "แอพพลิเคชันของบุคคลที่ 3 ถูกปิดการใช้งาน: %s", "Invalid file provided" : "ระบุไฟล์ไม่ถูกต้อง", "No image or file provided" : "ไม่มีรูปภาพหรือไฟล์ที่ระบุ", "Unknown filetype" : "ไม่รู้จักชนิดของไฟล์", diff --git a/core/l10n/th_TH.json b/core/l10n/th_TH.json index a06ce2379c6..9076a1fc029 100644 --- a/core/l10n/th_TH.json +++ b/core/l10n/th_TH.json @@ -10,7 +10,6 @@ "Repair warning: " : "เตือนการซ่อมแซม:", "Repair error: " : "เกิดข้อผิดพลาดในการซ่อมแซม:", "Following incompatible apps have been disabled: %s" : "แอพพลิเคชันต่อไปนี้เข้ากันไม่ได้มันจะถูกปิดการใช้งาน: %s", - "Following 3rd party apps have been disabled: %s" : "แอพพลิเคชันของบุคคลที่ 3 ถูกปิดการใช้งาน: %s", "Invalid file provided" : "ระบุไฟล์ไม่ถูกต้อง", "No image or file provided" : "ไม่มีรูปภาพหรือไฟล์ที่ระบุ", "Unknown filetype" : "ไม่รู้จักชนิดของไฟล์", diff --git a/core/l10n/tr.js b/core/l10n/tr.js index 84764d7adad..d140294c17d 100644 --- a/core/l10n/tr.js +++ b/core/l10n/tr.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "Onarım uyarısı:", "Repair error: " : "Onarım hatası:", "Following incompatible apps have been disabled: %s" : "Aşağıdaki uyumsuz uygulamalar devre dışı bırakıldı: %s", - "Following 3rd party apps have been disabled: %s" : "Aşağıdaki üçüncü parti uygulamalar devre dışı bırakıldı: %s", "Invalid file provided" : "Geçersiz dosya sağlandı", "No image or file provided" : "Resim veya dosya belirtilmedi", "Unknown filetype" : "Bilinmeyen dosya türü", diff --git a/core/l10n/tr.json b/core/l10n/tr.json index d4f67e60758..2564189d346 100644 --- a/core/l10n/tr.json +++ b/core/l10n/tr.json @@ -10,7 +10,6 @@ "Repair warning: " : "Onarım uyarısı:", "Repair error: " : "Onarım hatası:", "Following incompatible apps have been disabled: %s" : "Aşağıdaki uyumsuz uygulamalar devre dışı bırakıldı: %s", - "Following 3rd party apps have been disabled: %s" : "Aşağıdaki üçüncü parti uygulamalar devre dışı bırakıldı: %s", "Invalid file provided" : "Geçersiz dosya sağlandı", "No image or file provided" : "Resim veya dosya belirtilmedi", "Unknown filetype" : "Bilinmeyen dosya türü", diff --git a/core/l10n/uk.js b/core/l10n/uk.js index 7ae09ba45b3..2792ace687c 100644 --- a/core/l10n/uk.js +++ b/core/l10n/uk.js @@ -11,7 +11,6 @@ OC.L10N.register( "Repair warning: " : "Попередження відновлення:", "Repair error: " : "Помилка відновлення:", "Following incompatible apps have been disabled: %s" : "Наступні несумісні додатки були вимкнені: %s", - "Following 3rd party apps have been disabled: %s" : "3rd party додатки були вимкнені: %s", "Invalid file provided" : "Надано невірний файл", "No image or file provided" : "Зображення або файлу не надано", "Unknown filetype" : "Невідомий тип файлу", diff --git a/core/l10n/uk.json b/core/l10n/uk.json index 875b402bce9..9604468f0e6 100644 --- a/core/l10n/uk.json +++ b/core/l10n/uk.json @@ -9,7 +9,6 @@ "Repair warning: " : "Попередження відновлення:", "Repair error: " : "Помилка відновлення:", "Following incompatible apps have been disabled: %s" : "Наступні несумісні додатки були вимкнені: %s", - "Following 3rd party apps have been disabled: %s" : "3rd party додатки були вимкнені: %s", "Invalid file provided" : "Надано невірний файл", "No image or file provided" : "Зображення або файлу не надано", "Unknown filetype" : "Невідомий тип файлу", diff --git a/core/l10n/zh_CN.js b/core/l10n/zh_CN.js index fa0f251134d..38efcae369d 100644 --- a/core/l10n/zh_CN.js +++ b/core/l10n/zh_CN.js @@ -12,7 +12,6 @@ OC.L10N.register( "Repair warning: " : "修复警告:", "Repair error: " : "修复错误:", "Following incompatible apps have been disabled: %s" : "下列不兼容应用已经被禁用:%s", - "Following 3rd party apps have been disabled: %s" : " 下列第三方应用已经被禁用:%s", "Invalid file provided" : "提供了无效文件", "No image or file provided" : "没有提供图片或文件", "Unknown filetype" : "未知的文件类型", diff --git a/core/l10n/zh_CN.json b/core/l10n/zh_CN.json index 365cee1fb0b..93b5f8b4aef 100644 --- a/core/l10n/zh_CN.json +++ b/core/l10n/zh_CN.json @@ -10,7 +10,6 @@ "Repair warning: " : "修复警告:", "Repair error: " : "修复错误:", "Following incompatible apps have been disabled: %s" : "下列不兼容应用已经被禁用:%s", - "Following 3rd party apps have been disabled: %s" : " 下列第三方应用已经被禁用:%s", "Invalid file provided" : "提供了无效文件", "No image or file provided" : "没有提供图片或文件", "Unknown filetype" : "未知的文件类型", diff --git a/core/register_command.php b/core/register_command.php index 03775fd7870..8815eca6b6b 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -32,30 +32,44 @@ $application->add(new OC\Core\Command\App\CheckCode()); $application->add(new OC\Core\Command\L10n\CreateJs()); if (\OC::$server->getConfig()->getSystemValue('installed', false)) { - $repair = new \OC\Repair(\OC\Repair::getRepairSteps()); - - $application->add(new OC\Core\Command\Db\GenerateChangeScript()); - $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory())); - $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig())); - $application->add(new OC\Core\Command\Maintenance\SingleUser()); - $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig())); $application->add(new OC\Core\Command\App\Disable()); $application->add(new OC\Core\Command\App\Enable()); $application->add(new OC\Core\Command\App\ListApps()); - $application->add(new OC\Core\Command\Maintenance\Repair($repair, \OC::$server->getConfig())); - $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); - $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager())); - $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager())); - $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager())); - $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager())); + $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig())); $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig())); $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig())); + + $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig())); + $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig())); + $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig())); + $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig())); + $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig())); + $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig())); + $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig())); + $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig())); + + $application->add(new OC\Core\Command\Db\GenerateChangeScript()); + $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory())); + $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig())); $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager())); $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager())); $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager())); $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager())); + + $application->add(new OC\Core\Command\Maintenance\MimeTypesJS()); + $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig())); + $application->add(new OC\Core\Command\Maintenance\Repair(new \OC\Repair(\OC\Repair::getRepairSteps()), \OC::$server->getConfig())); + $application->add(new OC\Core\Command\Maintenance\SingleUser()); + + $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig())); + + $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); + $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager())); + $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager())); + $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager())); + $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager())); } else { $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getConfig())); } diff --git a/core/setup/controller.php b/core/setup/controller.php index f5255fb453b..f616ae5a5b3 100644 --- a/core/setup/controller.php +++ b/core/setup/controller.php @@ -105,7 +105,7 @@ class Controller { public function loadAutoConfig($post) { if( file_exists($this->autoConfigFile)) { - \OC_Log::write('core', 'Autoconfig file found, setting up ownCloud…', \OC_Log::INFO); + \OCP\Util::writeLog('core', 'Autoconfig file found, setting up ownCloud…', \OCP\Util::INFO); $AUTOCONFIG = array(); include $this->autoConfigFile; $post = array_merge ($post, $AUTOCONFIG); @@ -54,7 +54,7 @@ try { // initialize a dummy memory session \OC::$server->setSession(new \OC\Session\Memory('')); - $logger = \OC_Log::$object; + $logger = \OC::$server->getLogger(); // Don't do anything if ownCloud has not been installed if (!OC_Config::getValue('installed', false)) { diff --git a/db_structure.xml b/db_structure.xml index 05d8dfb132b..7769c64d87c 100644 --- a/db_structure.xml +++ b/db_structure.xml @@ -471,6 +471,14 @@ </field> </index> + <index> + <name>gu_uid_index</name> + <field> + <name>uid</name> + <sorting>ascending</sorting> + </field> + </index> + </declaration> </table> @@ -859,6 +867,13 @@ <sorting>ascending</sorting> </field> </index> + <index> + <name>share_file_target</name> + <field> + <name>file_target</name> + <sorting>ascending</sorting> + </field> + </index> </declaration> </table> diff --git a/issue_template.md b/issue_template.md index df93e0ffe15..3859ea1c414 100644 --- a/issue_template.md +++ b/issue_template.md @@ -24,9 +24,21 @@ Tell us what happens instead **List of activated apps:** +``` +If you have access to your command line run e.g.: +sudo -u www-data php occ app:list +from within your ownCloud installation folder +``` + **The content of config/config.php:** ``` +If you have access to your command line run e.g.: +sudo -u www-data php occ config:list system --public +from within your ownCloud installation folder + +or + Insert your config.php content here (Without the database password, passwordsalt and secret) ``` @@ -40,9 +52,17 @@ Insert your config.php content here #### LDAP configuration (delete this part if not used) ``` -run: sqlite3 data/owncloud.db +On ownCloud 7+ with access to your command line run e.g.: +sudo -u www-data php occ ldap:show-config +from within your ownCloud installation folder + +On ownCloud 6 with access to your command line run e.g.: +sqlite3 data/owncloud.db or mysql -u root -p owncloud then execute: select * from oc_appconfig where appid='user_ldap'; +Without access to your command line download the data/owncloud.db to your local +computer or access your SQL server remotely and run the select query above. + Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ``` diff --git a/lib/autoloader.php b/lib/autoloader.php index 7031962fc49..23285f61e73 100644 --- a/lib/autoloader.php +++ b/lib/autoloader.php @@ -73,7 +73,7 @@ class Autoloader { * Remove "apps/" from inclusion path for smooth migration to mutli app dir */ if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) { - \OC_Log::write('core', 'include path for class "' . $class . '" starts with "apps/"', \OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'include path for class "' . $class . '" starts with "apps/"', \OCP\Util::DEBUG); $paths[] = str_replace('apps/', '', \OC::$CLASSPATH[$class]); } } elseif (strpos($class, 'OC_') === 0) { diff --git a/lib/base.php b/lib/base.php index 8812d5698f1..9a682a7e90f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -406,6 +406,8 @@ class OC { OC_Util::addScript('search', 'search'); OC_Util::addScript("oc-requesttoken"); OC_Util::addScript("apps"); + OC_Util::addScript('mimetype'); + OC_Util::addScript('mimetypelist'); OC_Util::addVendorScript('snapjs/dist/latest/snap'); // avatars @@ -572,7 +574,8 @@ class OC { OC_Util::isSetLocaleWorking(); if (!defined('PHPUNIT_RUN')) { - OC\Log\ErrorHandler::setLogger(OC_Log::$object); + $logger = \OC::$server->getLogger(); + OC\Log\ErrorHandler::setLogger($logger); if (defined('DEBUG') and DEBUG) { OC\Log\ErrorHandler::register(true); set_exception_handler(array('OC_Template', 'printExceptionErrorPage')); @@ -1029,7 +1032,7 @@ class OC { } if (defined("DEBUG") && DEBUG) { - OC_Log::write('core', 'Trying to login from cookie', OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'Trying to login from cookie', \OCP\Util::DEBUG); } if(OC_User::userExists($_COOKIE['oc_username'])) { @@ -1041,8 +1044,8 @@ class OC { OC_Util::redirectToDefaultPage(); // doesn't return } - OC_Log::write('core', 'Authentication cookie rejected for user ' . - $_COOKIE['oc_username'], OC_Log::WARN); + \OCP\Util::writeLog('core', 'Authentication cookie rejected for user ' . + $_COOKIE['oc_username'], \OCP\Util::WARN); // if you reach this point you have changed your password // or you are an attacker // we can not delete tokens here because users may reach diff --git a/lib/l10n/bg_BG.js b/lib/l10n/bg_BG.js index 986884d7310..58daa676df9 100644 --- a/lib/l10n/bg_BG.js +++ b/lib/l10n/bg_BG.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Необходима е библиотеката %s с версия по-ниска от %s - налична версия %s. ", "Following platforms are supported: %s" : "Поддържани са следните платформи: %s", "ownCloud %s or higher is required." : "Необходим е ownCloud %s или по-висока версия.", - "ownCloud with a version lower than %s is required." : "Необходим е ownCloud с по-ниска версия от %s.", "Help" : "Помощ", "Personal" : "Лични", "Users" : "Потребители", diff --git a/lib/l10n/bg_BG.json b/lib/l10n/bg_BG.json index 6db0d8894e8..a8160b795de 100644 --- a/lib/l10n/bg_BG.json +++ b/lib/l10n/bg_BG.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Необходима е библиотеката %s с версия по-ниска от %s - налична версия %s. ", "Following platforms are supported: %s" : "Поддържани са следните платформи: %s", "ownCloud %s or higher is required." : "Необходим е ownCloud %s или по-висока версия.", - "ownCloud with a version lower than %s is required." : "Необходим е ownCloud с по-ниска версия от %s.", "Help" : "Помощ", "Personal" : "Лични", "Users" : "Потребители", diff --git a/lib/l10n/cs_CZ.js b/lib/l10n/cs_CZ.js index fd30fc3463b..ab0a3ea1b12 100644 --- a/lib/l10n/cs_CZ.js +++ b/lib/l10n/cs_CZ.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Je vyžadována knihovna %s ve verzi nižší než %s - dostupná verze %s.", "Following platforms are supported: %s" : "Jsou podporovány následující systémy: %s", "ownCloud %s or higher is required." : "Je vyžadován ownCloud %s nebo vyšší.", - "ownCloud with a version lower than %s is required." : "Je vyžadován ownCloud ve verzi nižší než %s.", "Help" : "Nápověda", "Personal" : "Osobní", "Users" : "Uživatelé", diff --git a/lib/l10n/cs_CZ.json b/lib/l10n/cs_CZ.json index 3ee3cc16587..90f6161a8a0 100644 --- a/lib/l10n/cs_CZ.json +++ b/lib/l10n/cs_CZ.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Je vyžadována knihovna %s ve verzi nižší než %s - dostupná verze %s.", "Following platforms are supported: %s" : "Jsou podporovány následující systémy: %s", "ownCloud %s or higher is required." : "Je vyžadován ownCloud %s nebo vyšší.", - "ownCloud with a version lower than %s is required." : "Je vyžadován ownCloud ve verzi nižší než %s.", "Help" : "Nápověda", "Personal" : "Osobní", "Users" : "Uživatelé", diff --git a/lib/l10n/da.js b/lib/l10n/da.js index 147a2c40242..c086fd058ed 100644 --- a/lib/l10n/da.js +++ b/lib/l10n/da.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Der kræves en version af biblioteket %s, der er lavere end %s - tilgængelig version er %s.", "Following platforms are supported: %s" : "Følgende platforme understøttes: %s", "ownCloud %s or higher is required." : "Der kræves ownCloud %s eller højere.", - "ownCloud with a version lower than %s is required." : "Der kræves ownCloud i en version som er lavere end %s.", + "ownCloud %s or lower is required." : "ownCloud %s eller lavere er påkrævet.", "Help" : "Hjælp", "Personal" : "Personligt", "Users" : "Brugere", diff --git a/lib/l10n/da.json b/lib/l10n/da.json index 14057dc10ec..15e48886c46 100644 --- a/lib/l10n/da.json +++ b/lib/l10n/da.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Der kræves en version af biblioteket %s, der er lavere end %s - tilgængelig version er %s.", "Following platforms are supported: %s" : "Følgende platforme understøttes: %s", "ownCloud %s or higher is required." : "Der kræves ownCloud %s eller højere.", - "ownCloud with a version lower than %s is required." : "Der kræves ownCloud i en version som er lavere end %s.", + "ownCloud %s or lower is required." : "ownCloud %s eller lavere er påkrævet.", "Help" : "Hjælp", "Personal" : "Personligt", "Users" : "Brugere", diff --git a/lib/l10n/de.js b/lib/l10n/de.js index ceb61e470f0..fd727607993 100644 --- a/lib/l10n/de.js +++ b/lib/l10n/de.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Die Bibliothek %s wird in einer früheren Version als %s benötigt - verfügbare Version ist %s.", "Following platforms are supported: %s" : "Die folgenden Plattformen werden unterstützt: %s", "ownCloud %s or higher is required." : "ownCloud %s oder höher wird benötigt.", - "ownCloud with a version lower than %s is required." : "ownCloud wird in einer früheren Version als %s benötigt.", "Help" : "Hilfe", "Personal" : "Persönlich", "Users" : "Benutzer", diff --git a/lib/l10n/de.json b/lib/l10n/de.json index b2c380ff62b..1f007069a5d 100644 --- a/lib/l10n/de.json +++ b/lib/l10n/de.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Die Bibliothek %s wird in einer früheren Version als %s benötigt - verfügbare Version ist %s.", "Following platforms are supported: %s" : "Die folgenden Plattformen werden unterstützt: %s", "ownCloud %s or higher is required." : "ownCloud %s oder höher wird benötigt.", - "ownCloud with a version lower than %s is required." : "ownCloud wird in einer früheren Version als %s benötigt.", "Help" : "Hilfe", "Personal" : "Persönlich", "Users" : "Benutzer", diff --git a/lib/l10n/de_DE.js b/lib/l10n/de_DE.js index 9eb8396eda9..d966d88d394 100644 --- a/lib/l10n/de_DE.js +++ b/lib/l10n/de_DE.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Die Bibliothek %s wird in einer früheren Version als %s benötigt - vorhanden ist Version %s.", "Following platforms are supported: %s" : "Die folgenden Plattformen werden unterstützt: %s", "ownCloud %s or higher is required." : "ownCloud %s oder höher wird benötigt.", - "ownCloud with a version lower than %s is required." : "ownCloud wird in einer früheren Version als %s benötigt.", "Help" : "Hilfe", "Personal" : "Persönlich", "Users" : "Benutzer", diff --git a/lib/l10n/de_DE.json b/lib/l10n/de_DE.json index fa965557457..5b90bf042e3 100644 --- a/lib/l10n/de_DE.json +++ b/lib/l10n/de_DE.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Die Bibliothek %s wird in einer früheren Version als %s benötigt - vorhanden ist Version %s.", "Following platforms are supported: %s" : "Die folgenden Plattformen werden unterstützt: %s", "ownCloud %s or higher is required." : "ownCloud %s oder höher wird benötigt.", - "ownCloud with a version lower than %s is required." : "ownCloud wird in einer früheren Version als %s benötigt.", "Help" : "Hilfe", "Personal" : "Persönlich", "Users" : "Benutzer", diff --git a/lib/l10n/el.js b/lib/l10n/el.js index 4ead3fb9254..d687c1eb851 100644 --- a/lib/l10n/el.js +++ b/lib/l10n/el.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s παλαιότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", "Following platforms are supported: %s" : "Οι ακόλουθες πλατφόρμες υποστηρίζονται: %s", "ownCloud %s or higher is required." : "Απαιτείται ownCloud %s ή νεότερο", - "ownCloud with a version lower than %s is required." : "Απαιτείται έκδοση ownCloud παλαιότερη από την %s.", + "ownCloud %s or lower is required." : "Απαιτείται έκδοση του ownCloud παλαιότερη από την %s.", "Help" : "Βοήθεια", "Personal" : "Προσωπικά", "Users" : "Χρήστες", diff --git a/lib/l10n/el.json b/lib/l10n/el.json index bb6df966a87..05ca5aa4a2f 100644 --- a/lib/l10n/el.json +++ b/lib/l10n/el.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s παλαιότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", "Following platforms are supported: %s" : "Οι ακόλουθες πλατφόρμες υποστηρίζονται: %s", "ownCloud %s or higher is required." : "Απαιτείται ownCloud %s ή νεότερο", - "ownCloud with a version lower than %s is required." : "Απαιτείται έκδοση ownCloud παλαιότερη από την %s.", + "ownCloud %s or lower is required." : "Απαιτείται έκδοση του ownCloud παλαιότερη από την %s.", "Help" : "Βοήθεια", "Personal" : "Προσωπικά", "Users" : "Χρήστες", diff --git a/lib/l10n/en_GB.js b/lib/l10n/en_GB.js index 89fac8a92fe..f14cbbfdfea 100644 --- a/lib/l10n/en_GB.js +++ b/lib/l10n/en_GB.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Library %s with a version lower than %s is required - available version %s.", "Following platforms are supported: %s" : "Following platforms are supported: %s", "ownCloud %s or higher is required." : "ownCloud %s or higher is required.", - "ownCloud with a version lower than %s is required." : "ownCloud with a version lower than %s is required.", "Help" : "Help", "Personal" : "Personal", "Users" : "Users", diff --git a/lib/l10n/en_GB.json b/lib/l10n/en_GB.json index 73f4e3030fb..d50562272d0 100644 --- a/lib/l10n/en_GB.json +++ b/lib/l10n/en_GB.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Library %s with a version lower than %s is required - available version %s.", "Following platforms are supported: %s" : "Following platforms are supported: %s", "ownCloud %s or higher is required." : "ownCloud %s or higher is required.", - "ownCloud with a version lower than %s is required." : "ownCloud with a version lower than %s is required.", "Help" : "Help", "Personal" : "Personal", "Users" : "Users", diff --git a/lib/l10n/eo.js b/lib/l10n/eo.js index ad565d590b7..b672c053740 100644 --- a/lib/l10n/eo.js +++ b/lib/l10n/eo.js @@ -9,7 +9,6 @@ OC.L10N.register( "The command line tool %s could not be found" : "La komandolinia ilo %s ne troviĝis", "The library %s is not available." : "La biblioteko %s ne haveblas.", "ownCloud %s or higher is required." : "ownCloud %s aŭ pli alta necesas.", - "ownCloud with a version lower than %s is required." : "Eldono de ownCloud pli malalta ol %s necesas.", "Help" : "Helpo", "Personal" : "Persona", "Users" : "Uzantoj", diff --git a/lib/l10n/eo.json b/lib/l10n/eo.json index e7f8810e310..d3877595272 100644 --- a/lib/l10n/eo.json +++ b/lib/l10n/eo.json @@ -7,7 +7,6 @@ "The command line tool %s could not be found" : "La komandolinia ilo %s ne troviĝis", "The library %s is not available." : "La biblioteko %s ne haveblas.", "ownCloud %s or higher is required." : "ownCloud %s aŭ pli alta necesas.", - "ownCloud with a version lower than %s is required." : "Eldono de ownCloud pli malalta ol %s necesas.", "Help" : "Helpo", "Personal" : "Persona", "Users" : "Uzantoj", diff --git a/lib/l10n/es.js b/lib/l10n/es.js index 42ecd7e7bb1..71f3a8aa8bf 100644 --- a/lib/l10n/es.js +++ b/lib/l10n/es.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Biblioteca %s con una versión inferior que %s la requerida - versión disponible %s.", "Following platforms are supported: %s" : "Las siguientes plataformas están soportadas: %s", "ownCloud %s or higher is required." : "Se requiere ownCloud %s o superior.", - "ownCloud with a version lower than %s is required." : "ownCloud con una versión inferior que %s la requerida.", + "ownCloud %s or lower is required." : "Se requiere ownCloud %s o una versión inferior.", "Help" : "Ayuda", "Personal" : "Personal", "Users" : "Usuarios", diff --git a/lib/l10n/es.json b/lib/l10n/es.json index 6f28071f04b..1259ff53b49 100644 --- a/lib/l10n/es.json +++ b/lib/l10n/es.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Biblioteca %s con una versión inferior que %s la requerida - versión disponible %s.", "Following platforms are supported: %s" : "Las siguientes plataformas están soportadas: %s", "ownCloud %s or higher is required." : "Se requiere ownCloud %s o superior.", - "ownCloud with a version lower than %s is required." : "ownCloud con una versión inferior que %s la requerida.", + "ownCloud %s or lower is required." : "Se requiere ownCloud %s o una versión inferior.", "Help" : "Ayuda", "Personal" : "Personal", "Users" : "Usuarios", diff --git a/lib/l10n/eu.js b/lib/l10n/eu.js index ce77065574f..b9093d1bf41 100644 --- a/lib/l10n/eu.js +++ b/lib/l10n/eu.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "%s liburutegiak %s baino bertsio txikiagoa izan behar du - dagoen bertsioa %s.", "Following platforms are supported: %s" : "Hurrengo plataformak onartzen dira: %s", "ownCloud %s or higher is required." : "ownCloud %s edo haundiagoa behar da.", - "ownCloud with a version lower than %s is required." : "ownCloud %s baino bertsio txikiagoa behar da.", "Help" : "Laguntza", "Personal" : "Pertsonala", "Users" : "Erabiltzaileak", diff --git a/lib/l10n/eu.json b/lib/l10n/eu.json index 6fa2fc55a16..b921d8dd28b 100644 --- a/lib/l10n/eu.json +++ b/lib/l10n/eu.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "%s liburutegiak %s baino bertsio txikiagoa izan behar du - dagoen bertsioa %s.", "Following platforms are supported: %s" : "Hurrengo plataformak onartzen dira: %s", "ownCloud %s or higher is required." : "ownCloud %s edo haundiagoa behar da.", - "ownCloud with a version lower than %s is required." : "ownCloud %s baino bertsio txikiagoa behar da.", "Help" : "Laguntza", "Personal" : "Pertsonala", "Users" : "Erabiltzaileak", diff --git a/lib/l10n/fi_FI.js b/lib/l10n/fi_FI.js index c8b5fb5bdb4..5724595dbda 100644 --- a/lib/l10n/fi_FI.js +++ b/lib/l10n/fi_FI.js @@ -15,7 +15,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Kirjasto %s versiota alempi %s tarvitaan - käytettävissä oleva versio %s.", "Following platforms are supported: %s" : "Seuraavat alustat ovat tuettuja: %s", "ownCloud %s or higher is required." : "ownCloud %s tai uudempi vaaditaan.", - "ownCloud with a version lower than %s is required." : "ownCloud versiota %s alempi vaaditaan.", + "ownCloud %s or lower is required." : "ownCloud %s tai aiempi vaaditaan.", "Help" : "Ohje", "Personal" : "Henkilökohtainen", "Users" : "Käyttäjät", diff --git a/lib/l10n/fi_FI.json b/lib/l10n/fi_FI.json index 83171dd042c..223429b7f88 100644 --- a/lib/l10n/fi_FI.json +++ b/lib/l10n/fi_FI.json @@ -13,7 +13,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Kirjasto %s versiota alempi %s tarvitaan - käytettävissä oleva versio %s.", "Following platforms are supported: %s" : "Seuraavat alustat ovat tuettuja: %s", "ownCloud %s or higher is required." : "ownCloud %s tai uudempi vaaditaan.", - "ownCloud with a version lower than %s is required." : "ownCloud versiota %s alempi vaaditaan.", + "ownCloud %s or lower is required." : "ownCloud %s tai aiempi vaaditaan.", "Help" : "Ohje", "Personal" : "Henkilökohtainen", "Users" : "Käyttäjät", diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js index dcb797478fd..4f461a04178 100644 --- a/lib/l10n/fr.js +++ b/lib/l10n/fr.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "La librairie %s doit avoir une version antérieure à %s. Version disponible : %s.", "Following platforms are supported: %s" : "Les plateformes suivantes sont prises en charge : %s", "ownCloud %s or higher is required." : "ownCloud %s ou supérieur est requis.", - "ownCloud with a version lower than %s is required." : "Une version antérieure à %s d'ownCloud est requise.", + "ownCloud %s or lower is required." : "ownCloud %s ou inférieur est requis.", "Help" : "Aide", "Personal" : "Personnel", "Users" : "Utilisateurs", @@ -44,7 +44,7 @@ OC.L10N.register( "File name is a reserved word" : "Ce nom de fichier est un mot réservé", "File name contains at least one invalid character" : "Le nom de fichier contient un (des) caractère(s) non valide(s)", "File name is too long" : "Nom de fichier trop long", - "File is currently busy, please try again later" : "Le fichier est actuellement occupé, veuillez ré-essayer ultérieurement.", + "File is currently busy, please try again later" : "Le fichier est actuellement occupé, veuillez réessayer ultérieurement.", "Can't read file" : "Impossible de lire le fichier", "App directory already exists" : "Le dossier de l'application existe déjà", "Can't create app folder. Please fix permissions. %s" : "Impossible de créer le dossier de l'application. Corrigez les droits d'accès. %s", @@ -85,6 +85,7 @@ OC.L10N.register( "Set an admin username." : "Spécifiez un nom d'utilisateur pour l'administrateur.", "Set an admin password." : "Spécifiez un mot de passe pour l'administrateur.", "Can't create or write into the data directory %s" : "Impossible de créer, ou d'écrire dans, le répertoire des données %s", + "Invalid Federated Cloud ID" : "ID Federated Cloud incorrect", "%s shared »%s« with you" : "%s a partagé «%s» avec vous", "%s via %s" : "%s via %s", "Sharing %s failed, because the backend does not allow shares from type %i" : "Le partage de %s a échoué car l’infrastructure n'autorise pas les partages de type %i", diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json index b5b1ce1a0da..1ad7f53d6ca 100644 --- a/lib/l10n/fr.json +++ b/lib/l10n/fr.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "La librairie %s doit avoir une version antérieure à %s. Version disponible : %s.", "Following platforms are supported: %s" : "Les plateformes suivantes sont prises en charge : %s", "ownCloud %s or higher is required." : "ownCloud %s ou supérieur est requis.", - "ownCloud with a version lower than %s is required." : "Une version antérieure à %s d'ownCloud est requise.", + "ownCloud %s or lower is required." : "ownCloud %s ou inférieur est requis.", "Help" : "Aide", "Personal" : "Personnel", "Users" : "Utilisateurs", @@ -42,7 +42,7 @@ "File name is a reserved word" : "Ce nom de fichier est un mot réservé", "File name contains at least one invalid character" : "Le nom de fichier contient un (des) caractère(s) non valide(s)", "File name is too long" : "Nom de fichier trop long", - "File is currently busy, please try again later" : "Le fichier est actuellement occupé, veuillez ré-essayer ultérieurement.", + "File is currently busy, please try again later" : "Le fichier est actuellement occupé, veuillez réessayer ultérieurement.", "Can't read file" : "Impossible de lire le fichier", "App directory already exists" : "Le dossier de l'application existe déjà", "Can't create app folder. Please fix permissions. %s" : "Impossible de créer le dossier de l'application. Corrigez les droits d'accès. %s", @@ -83,6 +83,7 @@ "Set an admin username." : "Spécifiez un nom d'utilisateur pour l'administrateur.", "Set an admin password." : "Spécifiez un mot de passe pour l'administrateur.", "Can't create or write into the data directory %s" : "Impossible de créer, ou d'écrire dans, le répertoire des données %s", + "Invalid Federated Cloud ID" : "ID Federated Cloud incorrect", "%s shared »%s« with you" : "%s a partagé «%s» avec vous", "%s via %s" : "%s via %s", "Sharing %s failed, because the backend does not allow shares from type %i" : "Le partage de %s a échoué car l’infrastructure n'autorise pas les partages de type %i", diff --git a/lib/l10n/gl.js b/lib/l10n/gl.js index 67356d1c673..7ba4fff42ff 100644 --- a/lib/l10n/gl.js +++ b/lib/l10n/gl.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Requírese a biblioteca %s cunha versión inferior a %s - dispoñíbel a versión %s.", "Following platforms are supported: %s" : "Admítense as seguintes plataformas: %s", "ownCloud %s or higher is required." : "Requírese ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "Requírese ownCloud cunha versión inferior a %s.", + "ownCloud %s or lower is required." : "Requírese ownCloud %s ou inferior.", "Help" : "Axuda", "Personal" : "Persoal", "Users" : "Usuarios", diff --git a/lib/l10n/gl.json b/lib/l10n/gl.json index 355ba0dec48..57c29347f33 100644 --- a/lib/l10n/gl.json +++ b/lib/l10n/gl.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Requírese a biblioteca %s cunha versión inferior a %s - dispoñíbel a versión %s.", "Following platforms are supported: %s" : "Admítense as seguintes plataformas: %s", "ownCloud %s or higher is required." : "Requírese ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "Requírese ownCloud cunha versión inferior a %s.", + "ownCloud %s or lower is required." : "Requírese ownCloud %s ou inferior.", "Help" : "Axuda", "Personal" : "Persoal", "Users" : "Usuarios", diff --git a/lib/l10n/hr.js b/lib/l10n/hr.js index a885d452d9c..c1fb29d4169 100644 --- a/lib/l10n/hr.js +++ b/lib/l10n/hr.js @@ -13,7 +13,6 @@ OC.L10N.register( "The library %s is not available." : "Knjiznica %s nije dostupna.", "Following platforms are supported: %s" : "Sljedece platforme su podrzane: %s", "ownCloud %s or higher is required." : "ownCloud %s ili visi je potreban.", - "ownCloud with a version lower than %s is required." : "ownCloud sa verzijom manjom od %s je potrebna.", "Help" : "Pomoć", "Personal" : "Osobno", "Users" : "Korisnici", diff --git a/lib/l10n/hr.json b/lib/l10n/hr.json index 40ef41d0a38..4e22f203bf5 100644 --- a/lib/l10n/hr.json +++ b/lib/l10n/hr.json @@ -11,7 +11,6 @@ "The library %s is not available." : "Knjiznica %s nije dostupna.", "Following platforms are supported: %s" : "Sljedece platforme su podrzane: %s", "ownCloud %s or higher is required." : "ownCloud %s ili visi je potreban.", - "ownCloud with a version lower than %s is required." : "ownCloud sa verzijom manjom od %s je potrebna.", "Help" : "Pomoć", "Personal" : "Osobno", "Users" : "Korisnici", diff --git a/lib/l10n/id.js b/lib/l10n/id.js index afe6f97a182..94f0d3df53d 100644 --- a/lib/l10n/id.js +++ b/lib/l10n/id.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Diperlukan pustaka %s dengan versi yang lebih rendah dari %s - versi yang tersedia %s.", "Following platforms are supported: %s" : "Berikut adalah platform yang didukung: %s", "ownCloud %s or higher is required." : "Diperlukan ownCloud %s atau yang lebih tinggi.", - "ownCloud with a version lower than %s is required." : "Diperlukan ownCloud dengan versi yang lebih rendah dari %s.", "Help" : "Bantuan", "Personal" : "Pribadi", "Users" : "Pengguna", diff --git a/lib/l10n/id.json b/lib/l10n/id.json index e56619e28ca..5f067829b9e 100644 --- a/lib/l10n/id.json +++ b/lib/l10n/id.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Diperlukan pustaka %s dengan versi yang lebih rendah dari %s - versi yang tersedia %s.", "Following platforms are supported: %s" : "Berikut adalah platform yang didukung: %s", "ownCloud %s or higher is required." : "Diperlukan ownCloud %s atau yang lebih tinggi.", - "ownCloud with a version lower than %s is required." : "Diperlukan ownCloud dengan versi yang lebih rendah dari %s.", "Help" : "Bantuan", "Personal" : "Pribadi", "Users" : "Pengguna", diff --git a/lib/l10n/it.js b/lib/l10n/it.js index 1bdda442f01..7f7335a9341 100644 --- a/lib/l10n/it.js +++ b/lib/l10n/it.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Richiesta una versione della libreria %s minore di %s - versione disponibile %s.", "Following platforms are supported: %s" : "Sono supportate le seguenti piattaforme: %s", "ownCloud %s or higher is required." : "Richiesto ownCloud %s o superiore.", - "ownCloud with a version lower than %s is required." : "Richiesta una versione di ownCloud minore di %s.", + "ownCloud %s or lower is required." : "Richiesto ownCloud %s o inferiore.", "Help" : "Aiuto", "Personal" : "Personale", "Users" : "Utenti", diff --git a/lib/l10n/it.json b/lib/l10n/it.json index f802e65993b..14b8b05d98c 100644 --- a/lib/l10n/it.json +++ b/lib/l10n/it.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Richiesta una versione della libreria %s minore di %s - versione disponibile %s.", "Following platforms are supported: %s" : "Sono supportate le seguenti piattaforme: %s", "ownCloud %s or higher is required." : "Richiesto ownCloud %s o superiore.", - "ownCloud with a version lower than %s is required." : "Richiesta una versione di ownCloud minore di %s.", + "ownCloud %s or lower is required." : "Richiesto ownCloud %s o inferiore.", "Help" : "Aiuto", "Personal" : "Personale", "Users" : "Utenti", diff --git a/lib/l10n/ja.js b/lib/l10n/ja.js index 5808a219b27..ef5fa0356a1 100644 --- a/lib/l10n/ja.js +++ b/lib/l10n/ja.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "%s ライブラリーは、%s よりも古いバージョンが必要です。利用可能なバージョンは、 %s です。", "Following platforms are supported: %s" : "次のプラットフォームをサポートしています: %s", "ownCloud %s or higher is required." : "ownCloud %s 以上が必要です。", - "ownCloud with a version lower than %s is required." : "ownCloud %s 以下が必要です。", "Help" : "ヘルプ", "Personal" : "個人", "Users" : "ユーザー", diff --git a/lib/l10n/ja.json b/lib/l10n/ja.json index 0252dd906bf..3555295f80c 100644 --- a/lib/l10n/ja.json +++ b/lib/l10n/ja.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "%s ライブラリーは、%s よりも古いバージョンが必要です。利用可能なバージョンは、 %s です。", "Following platforms are supported: %s" : "次のプラットフォームをサポートしています: %s", "ownCloud %s or higher is required." : "ownCloud %s 以上が必要です。", - "ownCloud with a version lower than %s is required." : "ownCloud %s 以下が必要です。", "Help" : "ヘルプ", "Personal" : "個人", "Users" : "ユーザー", diff --git a/lib/l10n/ko.js b/lib/l10n/ko.js index a8b9f3def7b..e51702ab243 100644 --- a/lib/l10n/ko.js +++ b/lib/l10n/ko.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "%s 라이브러리의 버전 %s 미만이 필요합니다. 사용 가능한 버전은 %s입니다.", "Following platforms are supported: %s" : "다음 플랫폼을 지원합니다: %s", "ownCloud %s or higher is required." : "ownCloud 버전 %s 이상이 필요합니다.", - "ownCloud with a version lower than %s is required." : "ownCloud 버전 %s 미만이 필요합니다.", "Help" : "도움말", "Personal" : "개인", "Users" : "사용자", diff --git a/lib/l10n/ko.json b/lib/l10n/ko.json index 9a86f7f71cc..a0b042a7f3a 100644 --- a/lib/l10n/ko.json +++ b/lib/l10n/ko.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "%s 라이브러리의 버전 %s 미만이 필요합니다. 사용 가능한 버전은 %s입니다.", "Following platforms are supported: %s" : "다음 플랫폼을 지원합니다: %s", "ownCloud %s or higher is required." : "ownCloud 버전 %s 이상이 필요합니다.", - "ownCloud with a version lower than %s is required." : "ownCloud 버전 %s 미만이 필요합니다.", "Help" : "도움말", "Personal" : "개인", "Users" : "사용자", diff --git a/lib/l10n/lb.js b/lib/l10n/lb.js index ede516dbe67..0c884f98eea 100644 --- a/lib/l10n/lb.js +++ b/lib/l10n/lb.js @@ -1,6 +1,11 @@ OC.L10N.register( "lib", { + "See %s" : "%s kucken", + "Sample configuration detected" : "Beispill-Konfiguratioun erkannt", + "PHP %s or higher is required." : "PHP %s oder méi nei ass néideg.", + "PHP with a version lower than %s is required." : "PHP mat enger Versioun %s oder méi kleng ass néideg.", + "Following databases are supported: %s" : "Dës Datebanke ginn ënnerstëtzt: %s", "Help" : "Hëllef", "Personal" : "Perséinlech", "Users" : "Benotzer", @@ -9,11 +14,16 @@ OC.L10N.register( "Invalid image" : "Ongülteg d'Bild", "today" : "haut", "yesterday" : "gëschter", + "_%n day ago_::_%n days ago_" : ["%n Dag hier","%n Deeg hier"], "last month" : "Läschte Mount", + "_%n month ago_::_%n months ago_" : ["%n Mount hier","%n Méint hier"], "last year" : "Läscht Joer", + "_%n year ago_::_%n years ago_" : ["%n Joer hier","%n Joer hier"], + "_%n hour ago_::_%n hours ago_" : ["%n Stonn hier","%n Stonnen hier"], "seconds ago" : "Sekonnen hir", "web services under your control" : "Web-Servicer ënnert denger Kontroll", "Authentication error" : "Authentifikatioun's Fehler", - "%s shared »%s« with you" : "Den/D' %s huet »%s« mat dir gedeelt" + "%s shared »%s« with you" : "Den/D' %s huet »%s« mat dir gedeelt", + "Data directory (%s) is invalid" : "Daten-Dossier (%s) ass ongëlteg" }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/lb.json b/lib/l10n/lb.json index eb6067727bc..08057c7de24 100644 --- a/lib/l10n/lb.json +++ b/lib/l10n/lb.json @@ -1,4 +1,9 @@ { "translations": { + "See %s" : "%s kucken", + "Sample configuration detected" : "Beispill-Konfiguratioun erkannt", + "PHP %s or higher is required." : "PHP %s oder méi nei ass néideg.", + "PHP with a version lower than %s is required." : "PHP mat enger Versioun %s oder méi kleng ass néideg.", + "Following databases are supported: %s" : "Dës Datebanke ginn ënnerstëtzt: %s", "Help" : "Hëllef", "Personal" : "Perséinlech", "Users" : "Benotzer", @@ -7,11 +12,16 @@ "Invalid image" : "Ongülteg d'Bild", "today" : "haut", "yesterday" : "gëschter", + "_%n day ago_::_%n days ago_" : ["%n Dag hier","%n Deeg hier"], "last month" : "Läschte Mount", + "_%n month ago_::_%n months ago_" : ["%n Mount hier","%n Méint hier"], "last year" : "Läscht Joer", + "_%n year ago_::_%n years ago_" : ["%n Joer hier","%n Joer hier"], + "_%n hour ago_::_%n hours ago_" : ["%n Stonn hier","%n Stonnen hier"], "seconds ago" : "Sekonnen hir", "web services under your control" : "Web-Servicer ënnert denger Kontroll", "Authentication error" : "Authentifikatioun's Fehler", - "%s shared »%s« with you" : "Den/D' %s huet »%s« mat dir gedeelt" + "%s shared »%s« with you" : "Den/D' %s huet »%s« mat dir gedeelt", + "Data directory (%s) is invalid" : "Daten-Dossier (%s) ass ongëlteg" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/l10n/nb_NO.js b/lib/l10n/nb_NO.js index e797430c102..168fe4ad25c 100644 --- a/lib/l10n/nb_NO.js +++ b/lib/l10n/nb_NO.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Bibliotek %s med en versjon lavere nn %s kreves - tilgjengelig version %s.", "Following platforms are supported: %s" : "Følgende plattformer støttes: %s", "ownCloud %s or higher is required." : "ownCloud %s eller høyere kreves.", - "ownCloud with a version lower than %s is required." : "ownCloud med en versjon lavere enn %s kreves.", + "ownCloud %s or lower is required." : "ownCloud %s eller lavere kreves.", "Help" : "Hjelp", "Personal" : "Personlig", "Users" : "Brukere", diff --git a/lib/l10n/nb_NO.json b/lib/l10n/nb_NO.json index 081927ea686..b72d709a022 100644 --- a/lib/l10n/nb_NO.json +++ b/lib/l10n/nb_NO.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Bibliotek %s med en versjon lavere nn %s kreves - tilgjengelig version %s.", "Following platforms are supported: %s" : "Følgende plattformer støttes: %s", "ownCloud %s or higher is required." : "ownCloud %s eller høyere kreves.", - "ownCloud with a version lower than %s is required." : "ownCloud med en versjon lavere enn %s kreves.", + "ownCloud %s or lower is required." : "ownCloud %s eller lavere kreves.", "Help" : "Hjelp", "Personal" : "Personlig", "Users" : "Brukere", diff --git a/lib/l10n/nl.js b/lib/l10n/nl.js index 25e4f35241a..b62443f9117 100644 --- a/lib/l10n/nl.js +++ b/lib/l10n/nl.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Library %s met een versienummer lager dan %s is vereist - beschikbare versie %s.", "Following platforms are supported: %s" : "De volgende platformen worden ondersteund: %s", "ownCloud %s or higher is required." : "ownCloud %s of hoger vereist.", - "ownCloud with a version lower than %s is required." : "ownCloud met een versie lager dan %s is vereist.", + "ownCloud %s or lower is required." : "ownCloud %s of lager vereist.", "Help" : "Help", "Personal" : "Persoonlijk", "Users" : "Gebruikers", diff --git a/lib/l10n/nl.json b/lib/l10n/nl.json index d5b0dba3214..26dd33f54fc 100644 --- a/lib/l10n/nl.json +++ b/lib/l10n/nl.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "Library %s met een versienummer lager dan %s is vereist - beschikbare versie %s.", "Following platforms are supported: %s" : "De volgende platformen worden ondersteund: %s", "ownCloud %s or higher is required." : "ownCloud %s of hoger vereist.", - "ownCloud with a version lower than %s is required." : "ownCloud met een versie lager dan %s is vereist.", + "ownCloud %s or lower is required." : "ownCloud %s of lager vereist.", "Help" : "Help", "Personal" : "Persoonlijk", "Users" : "Gebruikers", diff --git a/lib/l10n/pl.js b/lib/l10n/pl.js index 4f460f08f0d..6d568685359 100644 --- a/lib/l10n/pl.js +++ b/lib/l10n/pl.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Biblioteka w wersji %s jest niższa niż %s, która jest wymagana - dostępna wersja %s.", "Following platforms are supported: %s" : "Obsługiwane są następujące platformy: %s", "ownCloud %s or higher is required." : "ownCloud %s jest w wersji wyższej niż wymagana.", - "ownCloud with a version lower than %s is required." : "ownCloud jest w wersji niższej niż wymagana wersja %s", "Help" : "Pomoc", "Personal" : "Osobiste", "Users" : "Użytkownicy", diff --git a/lib/l10n/pl.json b/lib/l10n/pl.json index 55f589edf60..ec89fc3acbd 100644 --- a/lib/l10n/pl.json +++ b/lib/l10n/pl.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Biblioteka w wersji %s jest niższa niż %s, która jest wymagana - dostępna wersja %s.", "Following platforms are supported: %s" : "Obsługiwane są następujące platformy: %s", "ownCloud %s or higher is required." : "ownCloud %s jest w wersji wyższej niż wymagana.", - "ownCloud with a version lower than %s is required." : "ownCloud jest w wersji niższej niż wymagana wersja %s", "Help" : "Pomoc", "Personal" : "Osobiste", "Users" : "Użytkownicy", diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js index 05abaa83ebb..e5940fb577e 100644 --- a/lib/l10n/pt_BR.js +++ b/lib/l10n/pt_BR.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "É requerida uma biblioteca %s com uma versão menor que %s - versão disponível %s.", "Following platforms are supported: %s" : "As seguintes plataformas são suportadas: %s", "ownCloud %s or higher is required." : "É necessário um ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "É necessário um ownCloud com uma versão menor que %s.", + "ownCloud %s or lower is required." : "É necessário um ownCloud %s ou inferior.", "Help" : "Ajuda", "Personal" : "Pessoal", "Users" : "Usuários", diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json index 454e3f05b8a..ba29f32e22d 100644 --- a/lib/l10n/pt_BR.json +++ b/lib/l10n/pt_BR.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "É requerida uma biblioteca %s com uma versão menor que %s - versão disponível %s.", "Following platforms are supported: %s" : "As seguintes plataformas são suportadas: %s", "ownCloud %s or higher is required." : "É necessário um ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "É necessário um ownCloud com uma versão menor que %s.", + "ownCloud %s or lower is required." : "É necessário um ownCloud %s ou inferior.", "Help" : "Ajuda", "Personal" : "Pessoal", "Users" : "Usuários", diff --git a/lib/l10n/pt_PT.js b/lib/l10n/pt_PT.js index c1f7310b6e5..5c9f84ee0df 100644 --- a/lib/l10n/pt_PT.js +++ b/lib/l10n/pt_PT.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "É necessário que a biblioteca %s tenha uma versão inferior a %s - versão disponível: %s.", "Following platforms are supported: %s" : "As seguintes plataformas são suportadas: %s", "ownCloud %s or higher is required." : "É necessário ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "É necessário uma versão do ownCloud inferior a %s.", "Help" : "Ajuda", "Personal" : "Pessoal", "Users" : "Utilizadores", diff --git a/lib/l10n/pt_PT.json b/lib/l10n/pt_PT.json index defa0723ed7..cf78d6fa9ab 100644 --- a/lib/l10n/pt_PT.json +++ b/lib/l10n/pt_PT.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "É necessário que a biblioteca %s tenha uma versão inferior a %s - versão disponível: %s.", "Following platforms are supported: %s" : "As seguintes plataformas são suportadas: %s", "ownCloud %s or higher is required." : "É necessário ownCloud %s ou superior.", - "ownCloud with a version lower than %s is required." : "É necessário uma versão do ownCloud inferior a %s.", "Help" : "Ajuda", "Personal" : "Pessoal", "Users" : "Utilizadores", diff --git a/lib/l10n/ro.js b/lib/l10n/ro.js index 7b417ab5628..fdaad0ad650 100644 --- a/lib/l10n/ro.js +++ b/lib/l10n/ro.js @@ -8,7 +8,6 @@ OC.L10N.register( "PHP with a version lower than %s is required." : "Este necesară o versiune PHP mai mică decât %s", "Following platforms are supported: %s" : "Sunt suportate următoarele platforme: %s", "ownCloud %s or higher is required." : "ownCloud %s sau mai mare este necesar.", - "ownCloud with a version lower than %s is required." : "ownCloud cu o versiune mai mică decât %s este necesară.", "Help" : "Ajutor", "Personal" : "Personal", "Users" : "Utilizatori", diff --git a/lib/l10n/ro.json b/lib/l10n/ro.json index 47ea0d5fbbd..7ae016ead7b 100644 --- a/lib/l10n/ro.json +++ b/lib/l10n/ro.json @@ -6,7 +6,6 @@ "PHP with a version lower than %s is required." : "Este necesară o versiune PHP mai mică decât %s", "Following platforms are supported: %s" : "Sunt suportate următoarele platforme: %s", "ownCloud %s or higher is required." : "ownCloud %s sau mai mare este necesar.", - "ownCloud with a version lower than %s is required." : "ownCloud cu o versiune mai mică decât %s este necesară.", "Help" : "Ajutor", "Personal" : "Personal", "Users" : "Utilizatori", diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index 625d537add6..98ca34eb2fa 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Требуется библиотека %s версии не выше %s, установлена версия %s.", "Following platforms are supported: %s" : "Поддерживаются следующие платформы: %s", "ownCloud %s or higher is required." : "Требуется ownCloud %s или выше.", - "ownCloud with a version lower than %s is required." : "Требуется версия ownCloud ниже %s.", "Help" : "Помощь", "Personal" : "Личное", "Users" : "Пользователи", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index 6d7497fafa8..cfee3ce15b0 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Требуется библиотека %s версии не выше %s, установлена версия %s.", "Following platforms are supported: %s" : "Поддерживаются следующие платформы: %s", "ownCloud %s or higher is required." : "Требуется ownCloud %s или выше.", - "ownCloud with a version lower than %s is required." : "Требуется версия ownCloud ниже %s.", "Help" : "Помощь", "Personal" : "Личное", "Users" : "Пользователи", diff --git a/lib/l10n/sk_SK.js b/lib/l10n/sk_SK.js index 7fb4d1f56ca..a8d53af8702 100644 --- a/lib/l10n/sk_SK.js +++ b/lib/l10n/sk_SK.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Požadovaná je knižnica %s v nižšej verzii ako %s - dostupná verzia %s.", "Following platforms are supported: %s" : "Podporované sú nasledovné systémy: %s", "ownCloud %s or higher is required." : "Požadovaná verzia ownCloudu %s alebo vyššia.", - "ownCloud with a version lower than %s is required." : "ownCloud je vyžadovaný v nižšej verzii ako %s.", "Help" : "Pomoc", "Personal" : "Osobné", "Users" : "Používatelia", diff --git a/lib/l10n/sk_SK.json b/lib/l10n/sk_SK.json index e2f7731a445..d223183f974 100644 --- a/lib/l10n/sk_SK.json +++ b/lib/l10n/sk_SK.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Požadovaná je knižnica %s v nižšej verzii ako %s - dostupná verzia %s.", "Following platforms are supported: %s" : "Podporované sú nasledovné systémy: %s", "ownCloud %s or higher is required." : "Požadovaná verzia ownCloudu %s alebo vyššia.", - "ownCloud with a version lower than %s is required." : "ownCloud je vyžadovaný v nižšej verzii ako %s.", "Help" : "Pomoc", "Personal" : "Osobné", "Users" : "Používatelia", diff --git a/lib/l10n/sl.js b/lib/l10n/sl.js index 769a7f7054f..4630fa87dee 100644 --- a/lib/l10n/sl.js +++ b/lib/l10n/sl.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Zahtevana je knjižnica %s z različico, manjšo od %s – na voljo je različica %s.", "Following platforms are supported: %s" : "Podprta so okolja: %s", "ownCloud %s or higher is required." : "Zahtevana je različica ownCloud %s ali višja.", - "ownCloud with a version lower than %s is required." : "Zahtevana je različica ownCloud %s ali nižja.", "Help" : "Pomoč", "Personal" : "Osebno", "Users" : "Uporabniki", diff --git a/lib/l10n/sl.json b/lib/l10n/sl.json index ab717c21dc2..ca40bc3cb12 100644 --- a/lib/l10n/sl.json +++ b/lib/l10n/sl.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Zahtevana je knjižnica %s z različico, manjšo od %s – na voljo je različica %s.", "Following platforms are supported: %s" : "Podprta so okolja: %s", "ownCloud %s or higher is required." : "Zahtevana je različica ownCloud %s ali višja.", - "ownCloud with a version lower than %s is required." : "Zahtevana je različica ownCloud %s ali nižja.", "Help" : "Pomoč", "Personal" : "Osebno", "Users" : "Uporabniki", diff --git a/lib/l10n/sr.js b/lib/l10n/sr.js index 7052d9f4f68..5e3e3858950 100644 --- a/lib/l10n/sr.js +++ b/lib/l10n/sr.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Библиотека %s издања нижег од %s је потребна - доступно издање %s.", "Following platforms are supported: %s" : "Следеће платформе су подржане: %s", "ownCloud %s or higher is required." : "оунКлауд %s или новији је потребан.", - "ownCloud with a version lower than %s is required." : "Потребна је оунКлауд верзија испод %s.", "Help" : "Помоћ", "Personal" : "Лично", "Users" : "Корисници", diff --git a/lib/l10n/sr.json b/lib/l10n/sr.json index 66126565cf1..5efb7613a42 100644 --- a/lib/l10n/sr.json +++ b/lib/l10n/sr.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Библиотека %s издања нижег од %s је потребна - доступно издање %s.", "Following platforms are supported: %s" : "Следеће платформе су подржане: %s", "ownCloud %s or higher is required." : "оунКлауд %s или новији је потребан.", - "ownCloud with a version lower than %s is required." : "Потребна је оунКлауд верзија испод %s.", "Help" : "Помоћ", "Personal" : "Лично", "Users" : "Корисници", diff --git a/lib/l10n/sv.js b/lib/l10n/sv.js index 16607aaf86b..59122082c7d 100644 --- a/lib/l10n/sv.js +++ b/lib/l10n/sv.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Bibliotek %s med version lägre än %s krävs - tillgänglig version %s.", "Following platforms are supported: %s" : "Följande plattformar stödjs: %s", "ownCloud %s or higher is required." : "ownCloud %s eller högre krävs.", - "ownCloud with a version lower than %s is required." : "ownCloud med version lägre än %s krävs.", "Help" : "Hjälp", "Personal" : "Personligt", "Users" : "Användare", diff --git a/lib/l10n/sv.json b/lib/l10n/sv.json index a346bdcd026..fcf8eb9b858 100644 --- a/lib/l10n/sv.json +++ b/lib/l10n/sv.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Bibliotek %s med version lägre än %s krävs - tillgänglig version %s.", "Following platforms are supported: %s" : "Följande plattformar stödjs: %s", "ownCloud %s or higher is required." : "ownCloud %s eller högre krävs.", - "ownCloud with a version lower than %s is required." : "ownCloud med version lägre än %s krävs.", "Help" : "Hjälp", "Personal" : "Personligt", "Users" : "Användare", diff --git a/lib/l10n/th_TH.js b/lib/l10n/th_TH.js index 70e700dc4d0..816af4506bb 100644 --- a/lib/l10n/th_TH.js +++ b/lib/l10n/th_TH.js @@ -16,7 +16,7 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "จำเป็นต้องมีไลบรารีรุ่น %s หรือรุ่นที่ต่ำกว่า %s - รุ่นที่ใช้ได้คือ %s", "Following platforms are supported: %s" : "แพลตฟอร์มต่อไปนี้ได้รับการสนับสนุน: %s", "ownCloud %s or higher is required." : "จำเป็นต้องมี ownCloud รุ่น %s หรือรุ่นที่สูงกว่า", - "ownCloud with a version lower than %s is required." : "จำเป็นต้องมี ownCloud รุ่นที่ต่ำกว่า %s", + "ownCloud %s or lower is required." : "ต้องการ ownCloud %s หรือรุ่นที่ต่ำกว่า", "Help" : "ช่วยเหลือ", "Personal" : "ส่วนตัว", "Users" : "ผู้ใช้งาน", diff --git a/lib/l10n/th_TH.json b/lib/l10n/th_TH.json index 32e5d276c32..eca70c531a2 100644 --- a/lib/l10n/th_TH.json +++ b/lib/l10n/th_TH.json @@ -14,7 +14,7 @@ "Library %s with a version lower than %s is required - available version %s." : "จำเป็นต้องมีไลบรารีรุ่น %s หรือรุ่นที่ต่ำกว่า %s - รุ่นที่ใช้ได้คือ %s", "Following platforms are supported: %s" : "แพลตฟอร์มต่อไปนี้ได้รับการสนับสนุน: %s", "ownCloud %s or higher is required." : "จำเป็นต้องมี ownCloud รุ่น %s หรือรุ่นที่สูงกว่า", - "ownCloud with a version lower than %s is required." : "จำเป็นต้องมี ownCloud รุ่นที่ต่ำกว่า %s", + "ownCloud %s or lower is required." : "ต้องการ ownCloud %s หรือรุ่นที่ต่ำกว่า", "Help" : "ช่วยเหลือ", "Personal" : "ส่วนตัว", "Users" : "ผู้ใช้งาน", diff --git a/lib/l10n/tr.js b/lib/l10n/tr.js index 106eab37b5e..59c45e93799 100644 --- a/lib/l10n/tr.js +++ b/lib/l10n/tr.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "%s kütüphanesinin %s sürümünden daha düşük sürümü gerekli - kullanılabilir sürüm %s.", "Following platforms are supported: %s" : "Aşağıdaki platformlar destekleniyor: %s", "ownCloud %s or higher is required." : "ownCloud %s veya daha üstü gerekli.", - "ownCloud with a version lower than %s is required." : "ownCloud %s sürümünden daha öncesi gerekli.", "Help" : "Yardım", "Personal" : "Kişisel", "Users" : "Kullanıcılar", diff --git a/lib/l10n/tr.json b/lib/l10n/tr.json index 0d212457791..1a6a7f76c19 100644 --- a/lib/l10n/tr.json +++ b/lib/l10n/tr.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "%s kütüphanesinin %s sürümünden daha düşük sürümü gerekli - kullanılabilir sürüm %s.", "Following platforms are supported: %s" : "Aşağıdaki platformlar destekleniyor: %s", "ownCloud %s or higher is required." : "ownCloud %s veya daha üstü gerekli.", - "ownCloud with a version lower than %s is required." : "ownCloud %s sürümünden daha öncesi gerekli.", "Help" : "Yardım", "Personal" : "Kişisel", "Users" : "Kullanıcılar", diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js index 0c6324ff041..8ebc66be6dd 100644 --- a/lib/l10n/uk.js +++ b/lib/l10n/uk.js @@ -16,7 +16,6 @@ OC.L10N.register( "Library %s with a version lower than %s is required - available version %s." : "Потрібна бібліотека %s версії менш ніж %s, встановлена версія %s.", "Following platforms are supported: %s" : "Підтримуються наступні платформи: %s", "ownCloud %s or higher is required." : "Потрібен ownCloud %s або вище.", - "ownCloud with a version lower than %s is required." : "Потрібна версія ownCloud нижче %s.", "Help" : "Допомога", "Personal" : "Особисте", "Users" : "Користувачі", diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json index e4b6b053dbc..a9f29cbfce2 100644 --- a/lib/l10n/uk.json +++ b/lib/l10n/uk.json @@ -14,7 +14,6 @@ "Library %s with a version lower than %s is required - available version %s." : "Потрібна бібліотека %s версії менш ніж %s, встановлена версія %s.", "Following platforms are supported: %s" : "Підтримуються наступні платформи: %s", "ownCloud %s or higher is required." : "Потрібен ownCloud %s або вище.", - "ownCloud with a version lower than %s is required." : "Потрібна версія ownCloud нижче %s.", "Help" : "Допомога", "Personal" : "Особисте", "Users" : "Користувачі", diff --git a/lib/private/app.php b/lib/private/app.php index e45d9ac07ba..83b2e8cd760 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -168,7 +168,7 @@ class OC_App { private static function getAppTypes($app) { //load the cache if (count(self::$appTypes) == 0) { - self::$appTypes = OC_Appconfig::getValues(false, 'types'); + self::$appTypes = \OC::$server->getAppConfig()->getValues(false, 'types'); } if (isset(self::$appTypes[$app])) { @@ -190,7 +190,7 @@ class OC_App { $appTypes = ''; } - OC_Appconfig::setValue($app, 'types', $appTypes); + \OC::$server->getAppConfig()->setValue($app, 'types', $appTypes); } /** @@ -511,7 +511,7 @@ class OC_App { } } - OC_Log::write('core', 'No application directories are marked as writable.', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'No application directories are marked as writable.', \OCP\Util::ERROR); return null; } @@ -771,7 +771,7 @@ class OC_App { foreach (OC::$APPSROOTS as $apps_dir) { if (!is_readable($apps_dir['path'])) { - OC_Log::write('core', 'unable to read app folder : ' . $apps_dir['path'], OC_Log::WARN); + \OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], \OCP\Util::WARN); continue; } $dh = opendir($apps_dir['path']); @@ -779,7 +779,7 @@ class OC_App { if (is_resource($dh)) { while (($file = readdir($dh)) !== false) { - if ($file[0] != '.' and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) { + if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) { $apps[] = $file; @@ -817,11 +817,11 @@ class OC_App { $info = OC_App::getAppInfo($app); if (!isset($info['name'])) { - OC_Log::write('core', 'App id "' . $app . '" has no name in appinfo', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', \OCP\Util::ERROR); continue; } - $enabled = OC_Appconfig::getValue($app, 'enabled', 'no'); + $enabled = \OC::$server->getAppConfig()->getValue($app, 'enabled', 'no'); $info['groups'] = null; if ($enabled === 'yes') { $active = true; @@ -1173,9 +1173,9 @@ class OC_App { //set remote/public handlers $appData = self::getAppInfo($appId); if (array_key_exists('ocsid', $appData)) { - OC_Appconfig::setValue($appId, 'ocsid', $appData['ocsid']); - } elseif(OC_Appconfig::getValue($appId, 'ocsid', null) !== null) { - OC_Appconfig::deleteKey($appId, 'ocsid'); + \OC::$server->getAppConfig()->setValue($appId, 'ocsid', $appData['ocsid']); + } elseif(\OC::$server->getAppConfig()->getValue($appId, 'ocsid', null) !== null) { + \OC::$server->getAppConfig()->deleteKey($appId, 'ocsid'); } foreach ($appData['remote'] as $name => $path) { OCP\CONFIG::setAppValue('core', 'remote_' . $name, $appId . '/' . $path); @@ -1187,7 +1187,7 @@ class OC_App { self::setAppTypes($appId); $version = \OC_App::getAppVersion($appId); - \OC_Appconfig::setValue($appId, 'installed_version', $version); + \OC::$server->getAppConfig()->setValue($appId, 'installed_version', $version); return true; } @@ -1205,11 +1205,11 @@ class OC_App { } return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId); } else { - OC_Log::write('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', \OCP\Util::ERROR); return false; } } else { - OC_Log::write('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', \OCP\Util::ERROR); return false; } } diff --git a/lib/private/app/codechecker.php b/lib/private/app/codechecker.php index 326bf8cd888..3f6cd19d6b4 100644 --- a/lib/private/app/codechecker.php +++ b/lib/private/app/codechecker.php @@ -71,6 +71,8 @@ class CodeChecker extends BasicEmitter { 'OC_Log', 'OC_Mail', 'OC_Preferences', + 'OC_Search_Provider', + 'OC_Search_Result', 'OC_Request', 'OC_Response', 'OC_Template', diff --git a/lib/private/app/dependencyanalyzer.php b/lib/private/app/dependencyanalyzer.php index 816c5082858..dd40e4052a7 100644 --- a/lib/private/app/dependencyanalyzer.php +++ b/lib/private/app/dependencyanalyzer.php @@ -30,9 +30,10 @@ class DependencyAnalyzer { /** @var Platform */ private $platform; - /** @var \OCP\IL10N */ private $l; + /** @var array */ + private $appInfo; /** * @param Platform $platform @@ -47,7 +48,7 @@ class DependencyAnalyzer { * @param array $app * @returns array of missing dependencies */ - public function analyze($app) { + public function analyze(array $app) { $this->appInfo = $app; if (isset($app['dependencies'])) { $dependencies = $app['dependencies']; @@ -61,11 +62,12 @@ class DependencyAnalyzer { $this->analyzeCommands($dependencies), $this->analyzeLibraries($dependencies), $this->analyzeOS($dependencies), - $this->analyzeOC($dependencies, $app)); + $this->analyzeOC($dependencies, $app) + ); } /** - * Truncates both verions to the lowest common version, e.g. + * Truncates both versions to the lowest common version, e.g. * 5.1.2.3 and 5.1 will be turned into 5.1 and 5.1, * 5.2.6.5 and 5.1 will be turned into 5.2 and 5.1 * @param string $first @@ -124,7 +126,11 @@ class DependencyAnalyzer { return $this->compare($first, $second, '<'); } - private function analyzePhpVersion($dependencies) { + /** + * @param array $dependencies + * @return array + */ + private function analyzePhpVersion(array $dependencies) { $missing = []; if (isset($dependencies['php']['@attributes']['min-version'])) { $minVersion = $dependencies['php']['@attributes']['min-version']; @@ -141,7 +147,11 @@ class DependencyAnalyzer { return $missing; } - private function analyzeDatabases($dependencies) { + /** + * @param array $dependencies + * @return array + */ + private function analyzeDatabases(array $dependencies) { $missing = []; if (!isset($dependencies['database'])) { return $missing; @@ -164,7 +174,11 @@ class DependencyAnalyzer { return $missing; } - private function analyzeCommands($dependencies) { + /** + * @param array $dependencies + * @return array + */ + private function analyzeCommands(array $dependencies) { $missing = []; if (!isset($dependencies['command'])) { return $missing; @@ -187,7 +201,11 @@ class DependencyAnalyzer { return $missing; } - private function analyzeLibraries($dependencies) { + /** + * @param array $dependencies + * @return array + */ + private function analyzeLibraries(array $dependencies) { $missing = []; if (!isset($dependencies['lib'])) { return $missing; @@ -225,7 +243,11 @@ class DependencyAnalyzer { return $missing; } - private function analyzeOS($dependencies) { + /** + * @param array $dependencies + * @return array + */ + private function analyzeOS(array $dependencies) { $missing = []; if (!isset($dependencies['os'])) { return $missing; @@ -249,7 +271,12 @@ class DependencyAnalyzer { return $missing; } - private function analyzeOC($dependencies, $appInfo) { + /** + * @param array $dependencies + * @param array $appInfo + * @return array + */ + private function analyzeOC(array $dependencies, array $appInfo) { $missing = []; $minVersion = null; if (isset($dependencies['owncloud']['@attributes']['min-version'])) { @@ -273,7 +300,7 @@ class DependencyAnalyzer { } if (!is_null($maxVersion)) { if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) { - $missing[] = (string)$this->l->t('ownCloud with a version lower than %s is required.', $maxVersion); + $missing[] = (string)$this->l->t('ownCloud %s or lower is required.', $maxVersion); } } return $missing; diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php index 69008c7fab5..a433b84d7bf 100644 --- a/lib/private/cache/file.php +++ b/lib/private/cache/file.php @@ -54,7 +54,7 @@ class File implements ICache { $this->storage = new View('/' . $user->getUID() . '/cache'); return $this->storage; } else { - \OC_Log::write('core', 'Can\'t get cache storage, user not logged in', \OC_Log::ERROR); + \OCP\Util::writeLog('core', 'Can\'t get cache storage, user not logged in', \OCP\Util::ERROR); throw new \OC\ForbiddenException('Can\t get cache storage, user not logged in'); } } diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index e4f53a219d2..18bd3b8d91d 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -128,7 +128,7 @@ class File extends Node implements IFile { try { $target = $partStorage->fopen($internalPartPath, 'wb'); if ($target === false) { - \OC_Log::write('webdav', '\OC\Files\Filesystem::fopen() failed', \OC_Log::ERROR); + \OCP\Util::writeLog('webdav', '\OC\Files\Filesystem::fopen() failed', \OCP\Util::ERROR); // because we have no clue about the cause we can only throw back a 500/Internal Server Error throw new Exception('Could not write file contents'); } @@ -192,7 +192,7 @@ class File extends Node implements IFile { $fileExists = $storage->file_exists($internalPath); } if (!$run || $renameOkay === false || $fileExists === false) { - \OC_Log::write('webdav', 'renaming part file to final file failed', \OC_Log::ERROR); + \OCP\Util::writeLog('webdav', 'renaming part file to final file failed', \OCP\Util::ERROR); throw new Exception('Could not rename part file to final file'); } } catch (\Exception $e) { @@ -366,7 +366,7 @@ class File extends Node implements IFile { $renameOkay = $this->fileView->rename($partFile, $targetPath); $fileExists = $this->fileView->file_exists($targetPath); if ($renameOkay === false || $fileExists === false) { - \OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR); + \OCP\Util::writeLog('webdav', '\OC\Files\Filesystem::rename() failed', \OCP\Util::ERROR); // only delete if an error occurred and the target file was already created if ($fileExists) { // set to null to avoid double-deletion when handling exception diff --git a/lib/private/db.php b/lib/private/db.php index 98df1c73714..1e93eb1892e 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -230,7 +230,7 @@ class OC_DB { try { $result = $schemaManager->updateDbFromStructure($file); } catch (Exception $e) { - OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL); + \OCP\Util::writeLog('core', 'Failed to update database structure ('.$e.')', \OCP\Util::FATAL); throw $e; } return $result; @@ -247,7 +247,7 @@ class OC_DB { try { $result = $schemaManager->simulateUpdateDbFromStructure($file); } catch (Exception $e) { - OC_Log::write('core', 'Simulated database structure update failed ('.$e.')', OC_Log::FATAL); + \OCP\Util::writeLog('core', 'Simulated database structure update failed ('.$e.')', \OCP\Util::FATAL); throw $e; } return $result; diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index 2d8ab550a70..a36bd2649df 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -103,7 +103,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { $statement = $this->adapter->fixupStatement($statement); if(\OC_Config::getValue( 'log_query', false)) { - \OC_Log::write('core', 'DB prepare : '.$statement, \OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'DB prepare : '.$statement, \OCP\Util::DEBUG); } return parent::prepare($statement); } diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php index a8fd168d157..4bdaf01f071 100644 --- a/lib/private/db/statementwrapper.php +++ b/lib/private/db/statementwrapper.php @@ -66,7 +66,7 @@ class OC_DB_StatementWrapper { public function execute($input=array()) { if(OC_Config::getValue( "log_query", false)) { $params_str = str_replace("\n", " ", var_export($input, true)); - OC_Log::write('core', 'DB execute with arguments : '.$params_str, OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'DB execute with arguments : '.$params_str, \OCP\Util::DEBUG); } $this->lastArguments = $input; if (count($input) > 0) { diff --git a/lib/private/files.php b/lib/private/files.php index 17e2e5a398f..b61d09d8a0c 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -317,9 +317,9 @@ class OC_Files { file_put_contents(OC::$SERVERROOT . '/.htaccess', $htaccess); return OC_Helper::computerFileSize($size); } else { - OC_Log::write('files', + \OCP\Util::writeLog('files', 'Can\'t write upload limit to ' . OC::$SERVERROOT . '/.htaccess. Please check the file permissions', - OC_Log::WARN); + \OCP\Util::WARN); } return false; } diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 680398e383f..8cf097421d4 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -120,7 +120,7 @@ class Cache { ]); $this->loadMimetypes(); } catch (\Doctrine\DBAL\DBALException $e) { - \OC_Log::write('core', 'Exception during mimetype insertion: ' . $e->getmessage(), \OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'Exception during mimetype insertion: ' . $e->getmessage(), \OCP\Util::DEBUG); return -1; } } diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 50609e1e20e..7c65c721352 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -355,7 +355,7 @@ class Scanner extends BasicEmitter { // might happen if inserting duplicate while a scanning // process is running in parallel // log and ignore - \OC_Log::write('core', 'Exception while scanning file "' . $child . '": ' . $ex->getMessage(), \OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'Exception while scanning file "' . $child . '": ' . $ex->getMessage(), \OCP\Util::DEBUG); $exceptionOccurred = true; } catch (\OCP\Lock\LockedException $e) { if ($this->useTransactions) { diff --git a/lib/private/files/mapper.php b/lib/private/files/mapper.php deleted file mode 100644 index 2c8760ba40e..00000000000 --- a/lib/private/files/mapper.php +++ /dev/null @@ -1,305 +0,0 @@ -<?php -/** - * @author infoneo <infoneo@yahoo.pl> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Lukas Reschke <lukas@owncloud.com> - * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -namespace OC\Files; - -/** - * class Mapper is responsible to translate logical paths to physical paths and reverse - */ -class Mapper -{ - private $unchangedPhysicalRoot; - - public function __construct($rootDir) { - $this->unchangedPhysicalRoot = $rootDir; - } - - /** - * @param string $logicPath - * @param bool $create indicates if the generated physical name shall be stored in the database or not - * @return string the physical path - */ - public function logicToPhysical($logicPath, $create) { - $physicalPath = $this->resolveLogicPath($logicPath); - if ($physicalPath !== null) { - return $physicalPath; - } - - return $this->create($logicPath, $create); - } - - /** - * @param string $physicalPath - * @return string - */ - public function physicalToLogic($physicalPath) { - $logicPath = $this->resolvePhysicalPath($physicalPath); - if ($logicPath !== null) { - return $logicPath; - } - - $this->insert($physicalPath, $physicalPath); - return $physicalPath; - } - - /** - * @param string $path - * @param bool $isLogicPath indicates if $path is logical or physical - * @param boolean $recursive - * @return void - */ - public function removePath($path, $isLogicPath, $recursive) { - if ($recursive) { - $path=$path.'%'; - } - - if ($isLogicPath) { - \OC_DB::executeAudited('DELETE FROM `*PREFIX*file_map` WHERE `logic_path` LIKE ?', array($path)); - } else { - \OC_DB::executeAudited('DELETE FROM `*PREFIX*file_map` WHERE `physic_path` LIKE ?', array($path)); - } - } - - /** - * @param string $path1 - * @param string $path2 - * @throws \Exception - */ - public function copy($path1, $path2) - { - $path1 = $this->resolveRelativePath($path1); - $path2 = $this->resolveRelativePath($path2); - $physicPath1 = $this->logicToPhysical($path1, true); - $physicPath2 = $this->logicToPhysical($path2, true); - - $sql = 'SELECT * FROM `*PREFIX*file_map` WHERE `logic_path` LIKE ?'; - $result = \OC_DB::executeAudited($sql, array($path1.'%')); - $updateQuery = \OC_DB::prepare('UPDATE `*PREFIX*file_map`' - .' SET `logic_path` = ?' - .' , `logic_path_hash` = ?' - .' , `physic_path` = ?' - .' , `physic_path_hash` = ?' - .' WHERE `logic_path` = ?'); - while( $row = $result->fetchRow()) { - $currentLogic = $row['logic_path']; - $currentPhysic = $row['physic_path']; - $newLogic = $path2.$this->stripRootFolder($currentLogic, $path1); - $newPhysic = $physicPath2.$this->stripRootFolder($currentPhysic, $physicPath1); - if ($path1 !== $currentLogic) { - try { - \OC_DB::executeAudited($updateQuery, array($newLogic, md5($newLogic), $newPhysic, md5($newPhysic), - $currentLogic)); - } catch (\Exception $e) { - error_log('Mapper::Copy failed '.$currentLogic.' -> '.$newLogic.'\n'.$e); - throw $e; - } - } - } - } - - /** - * @param string $path - * @param string $root - * @return false|string - */ - public function stripRootFolder($path, $root) { - if (strpos($path, $root) !== 0) { - // throw exception ??? - return false; - } - if (strlen($path) > strlen($root)) { - return substr($path, strlen($root)); - } - - return ''; - } - - /** - * @param string $logicPath - * @return null - * @throws \OC\DatabaseException - */ - private function resolveLogicPath($logicPath) { - $logicPath = $this->resolveRelativePath($logicPath); - $sql = 'SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?'; - $result = \OC_DB::executeAudited($sql, array(md5($logicPath))); - $result = $result->fetchRow(); - if ($result === false) { - return null; - } - - return $result['physic_path']; - } - - private function resolvePhysicalPath($physicalPath) { - $physicalPath = $this->resolveRelativePath($physicalPath); - $sql = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path_hash` = ?'); - $result = \OC_DB::executeAudited($sql, array(md5($physicalPath))); - $result = $result->fetchRow(); - - return $result['logic_path']; - } - - private function resolveRelativePath($path) { - $explodedPath = explode('/', $path); - $pathArray = array(); - foreach ($explodedPath as $pathElement) { - if (empty($pathElement) || ($pathElement == '.')) { - continue; - } elseif ($pathElement == '..') { - if (count($pathArray) == 0) { - return false; - } - array_pop($pathArray); - } else { - array_push($pathArray, $pathElement); - } - } - if (substr($path, 0, 1) == '/') { - $path = '/'; - } else { - $path = ''; - } - return $path.implode('/', $pathArray); - } - - /** - * @param string $logicPath - * @param bool $store - * @return string - */ - private function create($logicPath, $store) { - $logicPath = $this->resolveRelativePath($logicPath); - $index = 0; - - // create the slugified path - $physicalPath = $this->slugifyPath($logicPath); - - // detect duplicates - while ($this->resolvePhysicalPath($physicalPath) !== null) { - $physicalPath = $this->slugifyPath($logicPath, $index++); - } - - // insert the new path mapping if requested - if ($store) { - $this->insert($logicPath, $physicalPath); - } - - return $physicalPath; - } - - private function insert($logicPath, $physicalPath) { - $sql = 'INSERT INTO `*PREFIX*file_map` (`logic_path`, `physic_path`, `logic_path_hash`, `physic_path_hash`) - VALUES (?, ?, ?, ?)'; - \OC_DB::executeAudited($sql, array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath))); - } - - /** - * @param string $path - * @param int $index - * @return string - */ - public function slugifyPath($path, $index = null) { - $path = $this->stripRootFolder($path, $this->unchangedPhysicalRoot); - - $pathElements = explode('/', $path); - $sluggedElements = array(); - - foreach ($pathElements as $pathElement) { - // remove empty elements - if (empty($pathElement)) { - continue; - } - - $sluggedElements[] = $this->slugify($pathElement); - } - - // apply index to file name - if ($index !== null) { - $last = array_pop($sluggedElements); - - // if filename contains periods - add index number before last period - if (preg_match('~\.[^\.]+$~i', $last, $extension)) { - array_push($sluggedElements, substr($last, 0, -(strlen($extension[0]))) . '-' . $index . $extension[0]); - } else { - // if filename doesn't contain periods add index ofter the last char - array_push($sluggedElements, $last . '-' . $index); - } - } - - $sluggedPath = $this->unchangedPhysicalRoot.implode('/', $sluggedElements); - return $this->resolveRelativePath($sluggedPath); - } - - /** - * Modifies a string to remove all non ASCII characters and spaces. - * - * @param string $text - * @return string - */ - private function slugify($text) { - $originalText = $text; - // replace non letter or digits or dots by - - $text = preg_replace('~[^\\pL\d\.]+~u', '-', $text); - - // trim - $text = trim($text, '-'); - - // transliterate - if (function_exists('iconv')) { - $text = iconv('utf-8', 'us-ascii//TRANSLIT//IGNORE', $text); - } - - // lowercase - $text = strtolower($text); - - // remove unwanted characters - $text = preg_replace('~[^-\w\.]+~', '', $text); - - // trim ending dots (for security reasons and win compatibility) - $text = preg_replace('~\.+$~', '', $text); - - if (empty($text) || \OC\Files\Filesystem::isFileBlacklisted($text)) { - /** - * Item slug would be empty. Previously we used uniqid() here. - * However this means that the behaviour is not reproducible, so - * when uploading files into a "empty" folder, the folders name is - * different. - * - * The other case is, that the slugified name would be a blacklisted - * filename. In this case we just use the same workaround by - * returning the secure md5 hash of the original name. - * - * - * If there would be a md5() hash collision, the deduplicate check - * will spot this and append an index later, so this should not be - * a problem. - */ - return md5($originalText); - } - - return $text; - } -} diff --git a/lib/private/files/mount/mountpoint.php b/lib/private/files/mount/mountpoint.php index f1e492c8603..2871bbd9083 100644 --- a/lib/private/files/mount/mountpoint.php +++ b/lib/private/files/mount/mountpoint.php @@ -140,12 +140,12 @@ class MountPoint implements IMountPoint { // the root storage could not be initialized, show the user! throw new \Exception('The root storage could not be initialized. Please contact your local administrator.', $exception->getCode(), $exception); } else { - \OC_Log::write('core', $exception->getMessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('core', $exception->getMessage(), \OCP\Util::ERROR); } return null; } } else { - \OC_Log::write('core', 'storage backend ' . $this->class . ' not found', \OC_Log::ERROR); + \OCP\Util::writeLog('core', 'storage backend ' . $this->class . ' not found', \OCP\Util::ERROR); $this->invalidStorage = true; return null; } diff --git a/lib/private/files/storage/flysystem.php b/lib/private/files/storage/flysystem.php new file mode 100644 index 00000000000..6d8dee10622 --- /dev/null +++ b/lib/private/files/storage/flysystem.php @@ -0,0 +1,243 @@ +<?php +/** + * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Files\Storage; + +use Icewind\Streams\CallbackWrapper; +use Icewind\Streams\IteratorDirectory; +use League\Flysystem\AdapterInterface; +use League\Flysystem\FileNotFoundException; +use League\Flysystem\Filesystem; +use League\Flysystem\Plugin\GetWithMetadata; + +/** + * Generic adapter between flysystem adapters and owncloud's storage system + * + * To use: subclass and call $this->buildFlysystem with the flysystem adapter of choice + */ +abstract class Flysystem extends Common { + /** + * @var Filesystem + */ + protected $flysystem; + + /** + * @var string + */ + protected $root = ''; + + /** + * Initialize the storage backend with a flyssytem adapter + * + * @param \League\Flysystem\AdapterInterface $adapter + */ + protected function buildFlySystem(AdapterInterface $adapter) { + $this->flysystem = new Filesystem($adapter); + $this->flysystem->addPlugin(new GetWithMetadata()); + } + + protected function buildPath($path) { + $fullPath = \OC\Files\Filesystem::normalizePath($this->root . '/' . $path); + return ltrim($fullPath, '/'); + } + + /** + * {@inheritdoc} + */ + public function file_get_contents($path) { + return $this->flysystem->read($this->buildPath($path)); + } + + /** + * {@inheritdoc} + */ + public function file_put_contents($path, $data) { + return $this->flysystem->put($this->buildPath($path), $data); + } + + /** + * {@inheritdoc} + */ + public function file_exists($path) { + return $this->flysystem->has($this->buildPath($path)); + } + + /** + * {@inheritdoc} + */ + public function unlink($path) { + if ($this->is_dir($path)) { + return $this->rmdir($path); + } + try { + return $this->flysystem->delete($this->buildPath($path)); + } catch (FileNotFoundException $e) { + return false; + } + } + + /** + * {@inheritdoc} + */ + public function rename($source, $target) { + if ($this->file_exists($target)) { + $this->unlink($target); + } + return $this->flysystem->rename($this->buildPath($source), $this->buildPath($target)); + } + + /** + * {@inheritdoc} + */ + public function copy($source, $target) { + if ($this->file_exists($target)) { + $this->unlink($target); + } + return $this->flysystem->copy($this->buildPath($source), $this->buildPath($target)); + } + + /** + * {@inheritdoc} + */ + public function filesize($path) { + if ($this->is_dir($path)) { + return 0; + } else { + return $this->flysystem->getSize($this->buildPath($path)); + } + } + + /** + * {@inheritdoc} + */ + public function mkdir($path) { + if ($this->file_exists($path)) { + return false; + } + return $this->flysystem->createDir($this->buildPath($path)); + } + + /** + * {@inheritdoc} + */ + public function filemtime($path) { + return $this->flysystem->getTimestamp($this->buildPath($path)); + } + + /** + * {@inheritdoc} + */ + public function rmdir($path) { + try { + return @$this->flysystem->deleteDir($this->buildPath($path)); + } catch (FileNotFoundException $e) { + return false; + } + } + + /** + * {@inheritdoc} + */ + public function opendir($path) { + try { + $content = $this->flysystem->listContents($this->buildPath($path)); + } catch (FileNotFoundException $e) { + return false; + } + $names = array_map(function ($object) { + return $object['basename']; + }, $content); + return IteratorDirectory::wrap($names); + } + + /** + * {@inheritdoc} + */ + public function fopen($path, $mode) { + $fullPath = $this->buildPath($path); + $useExisting = true; + switch ($mode) { + case 'r': + case 'rb': + try { + return $this->flysystem->readStream($fullPath); + } catch (FileNotFoundException $e) { + return false; + } + case 'w': + case 'w+': + case 'wb': + case 'wb+': + $useExisting = false; + case 'a': + case 'ab': + case 'r+': + case 'a+': + case 'x': + case 'x+': + case 'c': + case 'c+': + //emulate these + if ($useExisting and $this->file_exists($path)) { + if (!$this->isUpdatable($path)) { + return false; + } + $tmpFile = $this->getCachedFile($path); + } else { + if (!$this->isCreatable(dirname($path))) { + return false; + } + $tmpFile = \OCP\Files::tmpFile(); + } + $source = fopen($tmpFile, $mode); + return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) { + $this->flysystem->putStream($fullPath, fopen($tmpFile, 'r')); + unlink($tmpFile); + }); + } + return false; + } + + /** + * {@inheritdoc} + */ + public function touch($path, $mtime = null) { + if ($this->file_exists($path)) { + return false; + } else { + $this->file_put_contents($path, ''); + return true; + } + } + + /** + * {@inheritdoc} + */ + public function stat($path) { + $info = $this->flysystem->getWithMetadata($this->buildPath($path), ['timestamp', 'size']); + return [ + 'mtime' => $info['timestamp'], + 'size' => $info['size'] + ]; + } + + /** + * {@inheritdoc} + */ + public function filetype($path) { + if ($path === '' or $path === '/' or $path === '.') { + return 'dir'; + } + try { + $info = $this->flysystem->getMetadata($this->buildPath($path)); + } catch (FileNotFoundException $e) { + return false; + } + return $info['type']; + } +} diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index 53465f8585e..b7272b7d1f0 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -36,361 +36,354 @@ namespace OC\Files\Storage; -if (\OC_Util::runningOnWindows()) { - class Local extends MappedLocal { - - } -} else { - - /** - * for local filestore, we only have to map the paths - */ - class Local extends \OC\Files\Storage\Common { - protected $datadir; +/** + * for local filestore, we only have to map the paths + */ +class Local extends \OC\Files\Storage\Common { + protected $datadir; - public function __construct($arguments) { - $this->datadir = $arguments['datadir']; - if (substr($this->datadir, -1) !== '/') { - $this->datadir .= '/'; - } + public function __construct($arguments) { + $this->datadir = $arguments['datadir']; + if (substr($this->datadir, -1) !== '/') { + $this->datadir .= '/'; } + } - public function __destruct() { - } + public function __destruct() { + } - public function getId() { - return 'local::' . $this->datadir; - } + public function getId() { + return 'local::' . $this->datadir; + } - public function mkdir($path) { - return @mkdir($this->getSourcePath($path), 0777, true); - } + public function mkdir($path) { + return @mkdir($this->getSourcePath($path), 0777, true); + } - public function rmdir($path) { - if (!$this->isDeletable($path)) { - return false; - } - try { - $it = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($this->getSourcePath($path)), - \RecursiveIteratorIterator::CHILD_FIRST - ); + public function rmdir($path) { + if (!$this->isDeletable($path)) { + return false; + } + try { + $it = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($this->getSourcePath($path)), + \RecursiveIteratorIterator::CHILD_FIRST + ); + /** + * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach + * This bug is fixed in PHP 5.5.9 or before + * See #8376 + */ + $it->rewind(); + while ($it->valid()) { /** - * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach - * This bug is fixed in PHP 5.5.9 or before - * See #8376 + * @var \SplFileInfo $file */ - $it->rewind(); - while ($it->valid()) { - /** - * @var \SplFileInfo $file - */ - $file = $it->current(); - if (in_array($file->getBasename(), array('.', '..'))) { - $it->next(); - continue; - } elseif ($file->isDir()) { - rmdir($file->getPathname()); - } elseif ($file->isFile() || $file->isLink()) { - unlink($file->getPathname()); - } + $file = $it->current(); + if (in_array($file->getBasename(), array('.', '..'))) { $it->next(); + continue; + } elseif ($file->isDir()) { + rmdir($file->getPathname()); + } elseif ($file->isFile() || $file->isLink()) { + unlink($file->getPathname()); } - return rmdir($this->getSourcePath($path)); - } catch (\UnexpectedValueException $e) { - return false; + $it->next(); } + return rmdir($this->getSourcePath($path)); + } catch (\UnexpectedValueException $e) { + return false; } + } - public function opendir($path) { - return opendir($this->getSourcePath($path)); - } - - public function is_dir($path) { - if (substr($path, -1) == '/') { - $path = substr($path, 0, -1); - } - return is_dir($this->getSourcePath($path)); - } + public function opendir($path) { + return opendir($this->getSourcePath($path)); + } - public function is_file($path) { - return is_file($this->getSourcePath($path)); + public function is_dir($path) { + if (substr($path, -1) == '/') { + $path = substr($path, 0, -1); } + return is_dir($this->getSourcePath($path)); + } - public function stat($path) { - clearstatcache(); - $fullPath = $this->getSourcePath($path); - $statResult = stat($fullPath); - if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { - $filesize = $this->filesize($path); - $statResult['size'] = $filesize; - $statResult[7] = $filesize; - } - return $statResult; - } + public function is_file($path) { + return is_file($this->getSourcePath($path)); + } - public function filetype($path) { - $filetype = filetype($this->getSourcePath($path)); - if ($filetype == 'link') { - $filetype = filetype(realpath($this->getSourcePath($path))); - } - return $filetype; + public function stat($path) { + clearstatcache(); + $fullPath = $this->getSourcePath($path); + $statResult = stat($fullPath); + if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { + $filesize = $this->filesize($path); + $statResult['size'] = $filesize; + $statResult[7] = $filesize; } + return $statResult; + } - public function filesize($path) { - if ($this->is_dir($path)) { - return 0; - } - $fullPath = $this->getSourcePath($path); - if (PHP_INT_SIZE === 4) { - $helper = new \OC\LargeFileHelper; - return $helper->getFilesize($fullPath); - } - return filesize($fullPath); + public function filetype($path) { + $filetype = filetype($this->getSourcePath($path)); + if ($filetype == 'link') { + $filetype = filetype(realpath($this->getSourcePath($path))); } + return $filetype; + } - public function isReadable($path) { - return is_readable($this->getSourcePath($path)); + public function filesize($path) { + if ($this->is_dir($path)) { + return 0; } - - public function isUpdatable($path) { - return is_writable($this->getSourcePath($path)); + $fullPath = $this->getSourcePath($path); + if (PHP_INT_SIZE === 4) { + $helper = new \OC\LargeFileHelper; + return $helper->getFilesize($fullPath); } + return filesize($fullPath); + } - public function file_exists($path) { - return file_exists($this->getSourcePath($path)); - } + public function isReadable($path) { + return is_readable($this->getSourcePath($path)); + } - public function filemtime($path) { - clearstatcache($this->getSourcePath($path)); - return filemtime($this->getSourcePath($path)); - } + public function isUpdatable($path) { + return is_writable($this->getSourcePath($path)); + } - public function touch($path, $mtime = null) { - // sets the modification time of the file to the given value. - // If mtime is nil the current time is set. - // note that the access time of the file always changes to the current time. - if ($this->file_exists($path) and !$this->isUpdatable($path)) { - return false; - } - if (!is_null($mtime)) { - $result = touch($this->getSourcePath($path), $mtime); - } else { - $result = touch($this->getSourcePath($path)); - } - if ($result) { - clearstatcache(true, $this->getSourcePath($path)); - } + public function file_exists($path) { + return file_exists($this->getSourcePath($path)); + } - return $result; - } + public function filemtime($path) { + clearstatcache($this->getSourcePath($path)); + return filemtime($this->getSourcePath($path)); + } - public function file_get_contents($path) { - return file_get_contents($this->getSourcePath($path)); + public function touch($path, $mtime = null) { + // sets the modification time of the file to the given value. + // If mtime is nil the current time is set. + // note that the access time of the file always changes to the current time. + if ($this->file_exists($path) and !$this->isUpdatable($path)) { + return false; } - - public function file_put_contents($path, $data) { - return file_put_contents($this->getSourcePath($path), $data); + if (!is_null($mtime)) { + $result = touch($this->getSourcePath($path), $mtime); + } else { + $result = touch($this->getSourcePath($path)); } - - public function unlink($path) { - if ($this->is_dir($path)) { - return $this->rmdir($path); - } else if ($this->is_file($path)) { - return unlink($this->getSourcePath($path)); - } else { - return false; - } - + if ($result) { + clearstatcache(true, $this->getSourcePath($path)); } - public function rename($path1, $path2) { - $srcParent = dirname($path1); - $dstParent = dirname($path2); + return $result; + } - if (!$this->isUpdatable($srcParent)) { - \OC_Log::write('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OC_Log::ERROR); - return false; - } + public function file_get_contents($path) { + return file_get_contents($this->getSourcePath($path)); + } - if (!$this->isUpdatable($dstParent)) { - \OC_Log::write('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OC_Log::ERROR); - return false; - } + public function file_put_contents($path, $data) { + return file_put_contents($this->getSourcePath($path), $data); + } - if (!$this->file_exists($path1)) { - \OC_Log::write('core', 'unable to rename, file does not exists : ' . $path1, \OC_Log::ERROR); - return false; - } + public function unlink($path) { + if ($this->is_dir($path)) { + return $this->rmdir($path); + } else if ($this->is_file($path)) { + return unlink($this->getSourcePath($path)); + } else { + return false; + } - if ($this->is_dir($path2)) { - $this->rmdir($path2); - } else if ($this->is_file($path2)) { - $this->unlink($path2); - } + } - if ($this->is_dir($path1)) { - // we cant move folders across devices, use copy instead - $stat1 = stat(dirname($this->getSourcePath($path1))); - $stat2 = stat(dirname($this->getSourcePath($path2))); - if ($stat1['dev'] !== $stat2['dev']) { - $result = $this->copy($path1, $path2); - if ($result) { - $result &= $this->rmdir($path1); - } - return $result; - } - } + public function rename($path1, $path2) { + $srcParent = dirname($path1); + $dstParent = dirname($path2); - return rename($this->getSourcePath($path1), $this->getSourcePath($path2)); + if (!$this->isUpdatable($srcParent)) { + \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OCP\Util::ERROR); + return false; } - public function copy($path1, $path2) { - if ($this->is_dir($path1)) { - return parent::copy($path1, $path2); - } else { - return copy($this->getSourcePath($path1), $this->getSourcePath($path2)); - } + if (!$this->isUpdatable($dstParent)) { + \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OCP\Util::ERROR); + return false; } - public function fopen($path, $mode) { - return fopen($this->getSourcePath($path), $mode); + if (!$this->file_exists($path1)) { + \OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, \OCP\Util::ERROR); + return false; } - public function hash($type, $path, $raw = false) { - return hash_file($type, $this->getSourcePath($path), $raw); + if ($this->is_dir($path2)) { + $this->rmdir($path2); + } else if ($this->is_file($path2)) { + $this->unlink($path2); } - public function free_space($path) { - $space = @disk_free_space($this->getSourcePath($path)); - if ($space === false || is_null($space)) { - return \OCP\Files\FileInfo::SPACE_UNKNOWN; + if ($this->is_dir($path1)) { + // we cant move folders across devices, use copy instead + $stat1 = stat(dirname($this->getSourcePath($path1))); + $stat2 = stat(dirname($this->getSourcePath($path2))); + if ($stat1['dev'] !== $stat2['dev']) { + $result = $this->copy($path1, $path2); + if ($result) { + $result &= $this->rmdir($path1); + } + return $result; } - return $space; } - public function search($query) { - return $this->searchInDir($query); - } + return rename($this->getSourcePath($path1), $this->getSourcePath($path2)); + } - public function getLocalFile($path) { - return $this->getSourcePath($path); + public function copy($path1, $path2) { + if ($this->is_dir($path1)) { + return parent::copy($path1, $path2); + } else { + return copy($this->getSourcePath($path1), $this->getSourcePath($path2)); } + } - public function getLocalFolder($path) { - return $this->getSourcePath($path); - } + public function fopen($path, $mode) { + return fopen($this->getSourcePath($path), $mode); + } - /** - * @param string $query - * @param string $dir - * @return array - */ - protected function searchInDir($query, $dir = '') { - $files = array(); - $physicalDir = $this->getSourcePath($dir); - foreach (scandir($physicalDir) as $item) { - if ($item == '.' || $item == '..') - continue; - $physicalItem = $physicalDir . '/' . $item; + public function hash($type, $path, $raw = false) { + return hash_file($type, $this->getSourcePath($path), $raw); + } - if (strstr(strtolower($item), strtolower($query)) !== false) { - $files[] = $dir . '/' . $item; - } - if (is_dir($physicalItem)) { - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); - } - } - return $files; + public function free_space($path) { + $space = @disk_free_space($this->getSourcePath($path)); + if ($space === false || is_null($space)) { + return \OCP\Files\FileInfo::SPACE_UNKNOWN; } + return $space; + } - /** - * check if a file or folder has been updated since $time - * - * @param string $path - * @param int $time - * @return bool - */ - public function hasUpdated($path, $time) { - if ($this->file_exists($path)) { - return $this->filemtime($path) > $time; - } else { - return true; - } - } + public function search($query) { + return $this->searchInDir($query); + } + + public function getLocalFile($path) { + return $this->getSourcePath($path); + } + + public function getLocalFolder($path) { + return $this->getSourcePath($path); + } - /** - * Get the source path (on disk) of a given path - * - * @param string $path - * @return string - */ - public function getSourcePath($path) { - $fullPath = $this->datadir . $path; - return $fullPath; + /** + * @param string $query + * @param string $dir + * @return array + */ + protected function searchInDir($query, $dir = '') { + $files = array(); + $physicalDir = $this->getSourcePath($dir); + foreach (scandir($physicalDir) as $item) { + if ($item == '.' || $item == '..') + continue; + $physicalItem = $physicalDir . '/' . $item; + + if (strstr(strtolower($item), strtolower($query)) !== false) { + $files[] = $dir . '/' . $item; + } + if (is_dir($physicalItem)) { + $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); + } } + return $files; + } - /** - * {@inheritdoc} - */ - public function isLocal() { + /** + * check if a file or folder has been updated since $time + * + * @param string $path + * @param int $time + * @return bool + */ + public function hasUpdated($path, $time) { + if ($this->file_exists($path)) { + return $this->filemtime($path) > $time; + } else { return true; } + } - /** - * get the ETag for a file or folder - * - * @param string $path - * @return string - */ - public function getETag($path) { - if ($this->is_file($path)) { - $stat = $this->stat($path); - return md5( - $stat['mtime'] . - $stat['ino'] . - $stat['dev'] . - $stat['size'] - ); - } else { - return parent::getETag($path); - } + /** + * Get the source path (on disk) of a given path + * + * @param string $path + * @return string + */ + public function getSourcePath($path) { + $fullPath = $this->datadir . $path; + return $fullPath; + } + + /** + * {@inheritdoc} + */ + public function isLocal() { + return true; + } + + /** + * get the ETag for a file or folder + * + * @param string $path + * @return string + */ + public function getETag($path) { + if ($this->is_file($path)) { + $stat = $this->stat($path); + return md5( + $stat['mtime'] . + $stat['ino'] . + $stat['dev'] . + $stat['size'] + ); + } else { + return parent::getETag($path); } + } - /** - * @param \OCP\Files\Storage $sourceStorage - * @param string $sourceInternalPath - * @param string $targetInternalPath - * @return bool - */ - public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { - if($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')){ - /** - * @var \OC\Files\Storage\Local $sourceStorage - */ - $rootStorage = new Local(['datadir' => '/']); - return $rootStorage->copy($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath)); - } else { - return parent::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); - } + /** + * @param \OCP\Files\Storage $sourceStorage + * @param string $sourceInternalPath + * @param string $targetInternalPath + * @return bool + */ + public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { + if($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')){ + /** + * @var \OC\Files\Storage\Local $sourceStorage + */ + $rootStorage = new Local(['datadir' => '/']); + return $rootStorage->copy($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath)); + } else { + return parent::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); } + } - /** - * @param \OCP\Files\Storage $sourceStorage - * @param string $sourceInternalPath - * @param string $targetInternalPath - * @return bool - */ - public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { - if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) { - /** - * @var \OC\Files\Storage\Local $sourceStorage - */ - $rootStorage = new Local(['datadir' => '/']); - return $rootStorage->rename($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath)); - } else { - return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); - } + /** + * @param \OCP\Files\Storage $sourceStorage + * @param string $sourceInternalPath + * @param string $targetInternalPath + * @return bool + */ + public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { + if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) { + /** + * @var \OC\Files\Storage\Local $sourceStorage + */ + $rootStorage = new Local(['datadir' => '/']); + return $rootStorage->rename($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath)); + } else { + return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); } } } diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php deleted file mode 100644 index 932320267e4..00000000000 --- a/lib/private/files/storage/mappedlocal.php +++ /dev/null @@ -1,456 +0,0 @@ -<?php -/** - * @author Andreas Fischer <bantu@owncloud.com> - * @author Arthur Schiwon <blizzz@owncloud.com> - * @author Bart Visscher <bartv@thisnet.nl> - * @author Clark Tomlinson <fallen013@gmail.com> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Lukas Reschke <lukas@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> - * @author Sjors van der Pluijm <sjors@desjors.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -namespace OC\Files\Storage; - -/** - * for local filestore, we only have to map the paths - */ -class MappedLocal extends \OC\Files\Storage\Common { - protected $datadir; - private $mapper; - - public function __construct($arguments) { - $this->datadir = $arguments['datadir']; - if (substr($this->datadir, -1) !== '/') { - $this->datadir .= '/'; - } - - $this->mapper = new \OC\Files\Mapper($this->datadir); - } - - public function __destruct() { - } - - public function getId() { - return 'local::' . $this->datadir; - } - - public function mkdir($path) { - return @mkdir($this->getSourcePath($path), 0777, true); - } - - public function rmdir($path) { - if (!$this->isDeletable($path)) { - return false; - } - try { - $it = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($this->getSourcePath($path)), - \RecursiveIteratorIterator::CHILD_FIRST - ); - /** - * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach - * This bug is fixed in PHP 5.5.9 or before - * See #8376 - */ - $it->rewind(); - while ($it->valid()) { - /** - * @var \SplFileInfo $file - */ - $file = $it->current(); - if (in_array($file->getBasename(), array('.', '..'))) { - $it->next(); - continue; - } elseif ($file->isDir()) { - rmdir($file->getPathname()); - } elseif ($file->isFile() || $file->isLink()) { - unlink($file->getPathname()); - } - $it->next(); - } - if ($result = @rmdir($this->getSourcePath($path))) { - $this->cleanMapper($path); - } - return $result; - } catch (\UnexpectedValueException $e) { - return false; - } - } - - public function opendir($path) { - $files = array('.', '..'); - $physicalPath = $this->getSourcePath($path); - - $logicalPath = $this->mapper->physicalToLogic($physicalPath); - $dh = opendir($physicalPath); - if (is_resource($dh)) { - while (($file = readdir($dh)) !== false) { - if ($file === '.' or $file === '..') { - continue; - } - - $logicalFilePath = $this->mapper->physicalToLogic($physicalPath . '/' . $file); - - $file = $this->mapper->stripRootFolder($logicalFilePath, $logicalPath); - $file = $this->stripLeading($file); - $files[] = $file; - } - } - - \OC\Files\Stream\Dir::register('local-win32' . $path, $files); - return opendir('fakedir://local-win32' . $path); - } - - public function is_dir($path) { - if (substr($path, -1) == '/') { - $path = substr($path, 0, -1); - } - return is_dir($this->getSourcePath($path)); - } - - public function is_file($path) { - return is_file($this->getSourcePath($path)); - } - - public function stat($path) { - clearstatcache(); - $fullPath = $this->getSourcePath($path); - $statResult = stat($fullPath); - if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) { - $filesize = $this->filesize($path); - $statResult['size'] = $filesize; - $statResult[7] = $filesize; - } - return $statResult; - } - - public function filetype($path) { - $filetype = filetype($this->getSourcePath($path)); - if ($filetype == 'link') { - $filetype = filetype(realpath($this->getSourcePath($path))); - } - return $filetype; - } - - public function filesize($path) { - if ($this->is_dir($path)) { - return 0; - } - $fullPath = $this->getSourcePath($path); - if (PHP_INT_SIZE === 4) { - $helper = new \OC\LargeFileHelper; - return $helper->getFilesize($fullPath); - } - return filesize($fullPath); - } - - public function isReadable($path) { - return is_readable($this->getSourcePath($path)); - } - - public function isUpdatable($path) { - return is_writable($this->getSourcePath($path)); - } - - public function file_exists($path) { - return file_exists($this->getSourcePath($path)); - } - - public function filemtime($path) { - clearstatcache($this->getSourcePath($path)); - return filemtime($this->getSourcePath($path)); - } - - public function touch($path, $mtime = null) { - // sets the modification time of the file to the given value. - // If mtime is nil the current time is set. - // note that the access time of the file always changes to the current time. - if ($this->file_exists($path) and !$this->isUpdatable($path)) { - return false; - } - if (!is_null($mtime)) { - $result = touch($this->getSourcePath($path), $mtime); - } else { - $result = touch($this->getSourcePath($path)); - } - if ($result) { - clearstatcache(true, $this->getSourcePath($path)); - } - - return $result; - } - - public function file_get_contents($path) { - return file_get_contents($this->getSourcePath($path)); - } - - public function file_put_contents($path, $data) { - return file_put_contents($this->getSourcePath($path), $data); - } - - public function unlink($path) { - return $this->delTree($path); - } - - public function rename($path1, $path2) { - $srcParent = $this->dirname($path1); - $dstParent = $this->dirname($path2); - - if (!$this->isUpdatable($srcParent)) { - \OC_Log::write('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OC_Log::ERROR); - return false; - } - - if (!$this->isUpdatable($dstParent)) { - \OC_Log::write('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OC_Log::ERROR); - return false; - } - - if (!$this->file_exists($path1)) { - \OC_Log::write('core', 'unable to rename, file does not exists : ' . $path1, \OC_Log::ERROR); - return false; - } - - if ($this->is_dir($path2)) { - $this->rmdir($path2); - } else if ($this->is_file($path2)) { - $this->unlink($path2); - } - - $physicPath1 = $this->getSourcePath($path1); - $physicPath2 = $this->getSourcePath($path2); - if ($return = rename($physicPath1, $physicPath2)) { - // mapper needs to create copies or all children - $this->copyMapping($path1, $path2); - $this->cleanMapper($physicPath1, false, true); - } - return $return; - } - - public function copy($path1, $path2) { - if ($this->is_dir($path1)) { - if ($this->is_dir($path2)) { - $this->rmdir($path2); - } else if ($this->is_file($path2)) { - $this->unlink($path2); - } - $dir = $this->opendir($path1); - $this->mkdir($path2); - while ($file = readdir($dir)) { - if (!\OC\Files\Filesystem::isIgnoredDir($file)) { - if (!$this->copy($path1 . '/' . $file, $path2 . '/' . $file)) { - return false; - } - } - } - closedir($dir); - return true; - } else { - if ($return = copy($this->getSourcePath($path1), $this->getSourcePath($path2))) { - $this->copyMapping($path1, $path2); - } - return $return; - } - } - - public function fopen($path, $mode) { - return fopen($this->getSourcePath($path), $mode); - } - - /** - * @param string $dir - * @param bool $isLogicPath - * @return bool - */ - private function delTree($dir, $isLogicPath = true) { - $dirRelative = $dir; - if ($isLogicPath) { - $dir = $this->getSourcePath($dir); - } - if (!file_exists($dir)) { - return true; - } - if (!is_dir($dir) || is_link($dir)) { - if ($return = unlink($dir)) { - $this->cleanMapper($dir, false); - return $return; - } - } - foreach (scandir($dir) as $item) { - if ($item == '.' || $item == '..') { - continue; - } - if (is_file($dir . '/' . $item)) { - if (unlink($dir . '/' . $item)) { - $this->cleanMapper($dir . '/' . $item, false); - } - } elseif (is_dir($dir . '/' . $item)) { - if (!$this->delTree($dir . "/" . $item, false)) { - return false; - }; - } - } - if ($return = rmdir($dir)) { - $this->cleanMapper($dir, false); - } - return $return; - } - - public function hash($type, $path, $raw = false) { - return hash_file($type, $this->getSourcePath($path), $raw); - } - - public function free_space($path) { - $space = @disk_free_space($this->getSourcePath($path)); - if ($space === false || is_null($space)) { - return \OCP\Files\FileInfo::SPACE_UNKNOWN; - } - return $space; - } - - public function search($query) { - return $this->searchInDir($query); - } - - public function getLocalFile($path) { - return $this->getSourcePath($path); - } - - public function getLocalFolder($path) { - return $this->getSourcePath($path); - } - - /** - * @param string $query - * @param string $dir - * @return array - */ - protected function searchInDir($query, $dir = '') { - $files = array(); - $physicalDir = $this->getSourcePath($dir); - foreach (scandir($physicalDir) as $item) { - if ($item == '.' || $item == '..') - continue; - $physicalItem = $this->mapper->physicalToLogic($physicalDir . '/' . $item); - $item = substr($physicalItem, strlen($physicalDir) + 1); - - if (strstr(strtolower($item), strtolower($query)) !== false) { - $files[] = $dir . '/' . $item; - } - if (is_dir($physicalItem)) { - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); - } - } - return $files; - } - - /** - * check if a file or folder has been updated since $time - * - * @param string $path - * @param int $time - * @return bool - */ - public function hasUpdated($path, $time) { - if ($this->file_exists($path)) { - return $this->filemtime($path) > $time; - } else { - return true; - } - } - - /** - * Get the source path (on disk) of a given path - * - * @param string $path - * @return string - */ - protected function getSourcePath($path) { - $path = $this->stripLeading($path); - $fullPath = $this->datadir . $path; - return $this->mapper->logicToPhysical($fullPath, true); - } - - /** - * {@inheritdoc} - */ - public function isLocal() { - return true; - } - - /** - * @param string $path - * @return string - */ - private function dirName($path) { - $path = dirname($path); - if ($path === '.') { - return ''; - } else { - return $path; - } - } - - /** - * @param string $path - */ - private function cleanMapper($path, $isLogicPath = true, $recursive = true) { - $fullPath = $path; - if ($isLogicPath) { - $fullPath = $this->datadir . $path; - } - $this->mapper->removePath($fullPath, $isLogicPath, $recursive); - } - - /** - * @param string $path1 - * @param string $path2 - */ - private function copyMapping($path1, $path2) { - $path1 = $this->stripLeading($path1); - $path2 = $this->stripLeading($path2); - - $fullPath1 = $this->datadir . $path1; - $fullPath2 = $this->datadir . $path2; - - $this->mapper->copy($fullPath1, $fullPath2); - } - - /** - * @param string $path - */ - private function stripLeading($path) { - if (strpos($path, '/') === 0) { - $path = substr($path, 1); - } - if (strpos($path, '\\') === 0) { - $path = substr($path, 1); - } - if ($path === false) { - return ''; - } - - return $path; - } -} diff --git a/lib/private/files/storage/polyfill/copydirectory.php b/lib/private/files/storage/polyfill/copydirectory.php new file mode 100644 index 00000000000..1b4873a3a76 --- /dev/null +++ b/lib/private/files/storage/polyfill/copydirectory.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Files\Storage\PolyFill; + +trait CopyDirectory { + /** + * Check if a path is a directory + * + * @param string $path + * @return bool + */ + abstract public function is_dir($path); + + /** + * Check if a file or folder exists + * + * @param string $path + * @return bool + */ + abstract public function file_exists($path); + + /** + * Delete a file or folder + * + * @param string $path + * @return bool + */ + abstract public function unlink($path); + + /** + * Open a directory handle for a folder + * + * @param string $path + * @return resource | bool + */ + abstract public function opendir($path); + + /** + * Create a new folder + * + * @param string $path + * @return bool + */ + abstract public function mkdir($path); + + public function copy($source, $target) { + if ($this->is_dir($source)) { + if ($this->file_exists($target)) { + $this->unlink($target); + } + $this->mkdir($target); + return $this->copyRecursive($source, $target); + } else { + return parent::copy($source, $target); + } + } + + /** + * For adapters that dont support copying folders natively + * + * @param $source + * @param $target + * @return bool + */ + protected function copyRecursive($source, $target) { + $dh = $this->opendir($source); + $result = true; + while ($file = readdir($dh)) { + if ($file !== '.' and $file !== '..') { + if ($this->is_dir($source . '/' . $file)) { + $this->mkdir($target . '/' . $file); + $result = $this->copyRecursive($source . '/' . $file, $target . '/' . $file); + } else { + $result = parent::copy($source . '/' . $file, $target . '/' . $file); + } + if (!$result) { + break; + } + } + } + return $result; + } +} diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 1706818f03e..cb3c05d2bca 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -848,7 +848,7 @@ class View { $hooks[] = 'write'; break; default: - \OC_Log::write('core', 'invalid mode (' . $mode . ') for ' . $path, \OC_Log::ERROR); + \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, \OCP\Util::ERROR); } return $this->basicOperation('fopen', $path, $hooks, $mode); diff --git a/lib/private/helper.php b/lib/private/helper.php index 4c2f1f509c8..b7938416fb2 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -54,77 +54,7 @@ class OC_Helper { private static $mimetypeDetector; private static $templateManager; /** @var string[] */ - private static $mimeTypeAlias = array( - 'application/octet-stream' => 'file', // use file icon as fallback - - 'application/illustrator' => 'image/vector', - 'application/postscript' => 'image/vector', - 'image/svg+xml' => 'image/vector', - - 'application/coreldraw' => 'image', - 'application/x-gimp' => 'image', - 'application/x-photoshop' => 'image', - 'application/x-dcraw' => 'image', - - 'application/font-sfnt' => 'font', - 'application/x-font' => 'font', - 'application/font-woff' => 'font', - 'application/vnd.ms-fontobject' => 'font', - - 'application/json' => 'text/code', - 'application/x-perl' => 'text/code', - 'application/x-php' => 'text/code', - 'text/x-shellscript' => 'text/code', - 'application/yaml' => 'text/code', - 'application/xml' => 'text/html', - 'text/css' => 'text/code', - 'application/x-tex' => 'text', - - 'application/x-compressed' => 'package/x-generic', - 'application/x-7z-compressed' => 'package/x-generic', - 'application/x-deb' => 'package/x-generic', - 'application/x-gzip' => 'package/x-generic', - 'application/x-rar-compressed' => 'package/x-generic', - 'application/x-tar' => 'package/x-generic', - 'application/vnd.android.package-archive' => 'package/x-generic', - 'application/zip' => 'package/x-generic', - - 'application/msword' => 'x-office/document', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'x-office/document', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'x-office/document', - 'application/vnd.ms-word.document.macroEnabled.12' => 'x-office/document', - 'application/vnd.ms-word.template.macroEnabled.12' => 'x-office/document', - 'application/vnd.oasis.opendocument.text' => 'x-office/document', - 'application/vnd.oasis.opendocument.text-template' => 'x-office/document', - 'application/vnd.oasis.opendocument.text-web' => 'x-office/document', - 'application/vnd.oasis.opendocument.text-master' => 'x-office/document', - - 'application/mspowerpoint' => 'x-office/presentation', - 'application/vnd.ms-powerpoint' => 'x-office/presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'x-office/presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'x-office/presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'x-office/presentation', - 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => 'x-office/presentation', - 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => 'x-office/presentation', - 'application/vnd.ms-powerpoint.template.macroEnabled.12' => 'x-office/presentation', - 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => 'x-office/presentation', - 'application/vnd.oasis.opendocument.presentation' => 'x-office/presentation', - 'application/vnd.oasis.opendocument.presentation-template' => 'x-office/presentation', - - 'application/msexcel' => 'x-office/spreadsheet', - 'application/vnd.ms-excel' => 'x-office/spreadsheet', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'x-office/spreadsheet', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'x-office/spreadsheet', - 'application/vnd.ms-excel.sheet.macroEnabled.12' => 'x-office/spreadsheet', - 'application/vnd.ms-excel.template.macroEnabled.12' => 'x-office/spreadsheet', - 'application/vnd.ms-excel.addin.macroEnabled.12' => 'x-office/spreadsheet', - 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => 'x-office/spreadsheet', - 'application/vnd.oasis.opendocument.spreadsheet' => 'x-office/spreadsheet', - 'application/vnd.oasis.opendocument.spreadsheet-template' => 'x-office/spreadsheet', - 'text/csv' => 'x-office/spreadsheet', - - 'application/msaccess' => 'database', - ); + private static $mimeTypeAlias = []; /** * Creates an url using a defined route @@ -256,6 +186,12 @@ class OC_Helper { */ public static function mimetypeIcon($mimetype) { + // On first access load the list of mimetype aliases + if (empty(self::$mimeTypeAlias)) { + $file = file_get_contents(OC::$SERVERROOT . '/config/mimetypealiases.json'); + self::$mimeTypeAlias = get_object_vars(json_decode($file)); + } + if (isset(self::$mimeTypeAlias[$mimetype])) { $mimetype = self::$mimeTypeAlias[$mimetype]; } diff --git a/lib/private/hook.php b/lib/private/hook.php index 188c3d65acb..faf5495b646 100644 --- a/lib/private/hook.php +++ b/lib/private/hook.php @@ -111,9 +111,9 @@ class OC_Hook{ if (empty($message)) { $message = get_class($e); } - OC_Log::write('hook', + \OCP\Util::writeLog('hook', 'error while running hook (' . $class . '::' . $i["name"] . '): ' . $message, - OC_Log::ERROR); + \OCP\Util::ERROR); if($e instanceof \OC\ServerNotAvailableException) { throw $e; } diff --git a/lib/private/installer.php b/lib/private/installer.php index bd214be5667..37af8d0edcb 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -114,7 +114,7 @@ class OC_Installer{ //install the database if(is_file($basedir.'/appinfo/database.xml')) { - if (OC_Appconfig::getValue($info['id'], 'installed_version') === null) { + if (\OC::$server->getAppConfig()->getValue($info['id'], 'installed_version') === null) { OC_DB::createDbFromStructure($basedir.'/appinfo/database.xml'); } else { OC_DB::updateDbFromStructure($basedir.'/appinfo/database.xml'); @@ -127,8 +127,8 @@ class OC_Installer{ } //set the installed version - OC_Appconfig::setValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id'])); - OC_Appconfig::setValue($info['id'], 'enabled', 'no'); + \OC::$server->getAppConfig()->setValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id'])); + \OC::$server->getAppConfig()->setValue($info['id'], 'enabled', 'no'); //set remote/public handelers foreach($info['remote'] as $name=>$path) { @@ -151,7 +151,7 @@ class OC_Installer{ * Checks whether or not an app is installed, i.e. registered in apps table. */ public static function isInstalled( $app ) { - return (OC_Appconfig::getValue($app, "installed_version") !== null); + return (\OC::$server->getAppConfig()->getValue($app, "installed_version") !== null); } /** @@ -184,7 +184,7 @@ class OC_Installer{ * -# setting the installed version * * upgrade.php can determine the current installed version of the app using - * "OC_Appconfig::getValue($appid, 'installed_version')" + * "\OC::$server->getAppConfig()->getValue($appid, 'installed_version')" */ public static function updateApp( $info=array(), $isShipped=false) { list($extractDir, $path) = self::downloadApp($info); @@ -387,7 +387,7 @@ class OC_Installer{ return false; } - $ocsid=OC_Appconfig::getValue( $app, 'ocsid', ''); + $ocsid=\OC::$server->getAppConfig()->getValue( $app, 'ocsid', ''); if($ocsid<>'') { $ocsClient = new OCSClient( @@ -480,7 +480,7 @@ class OC_Installer{ return true; }else{ - OC_Log::write('core', 'can\'t remove app '.$name.'. It is not installed.', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'can\'t remove app '.$name.'. It is not installed.', \OCP\Util::ERROR); return false; } @@ -503,7 +503,7 @@ class OC_Installer{ $enabled = isset($info['default_enable']); if( $enabled ) { OC_Installer::installShippedApp($filename); - OC_Appconfig::setValue($filename, 'enabled', 'yes'); + \OC::$server->getAppConfig()->setValue($filename, 'enabled', 'yes'); } } } @@ -533,9 +533,9 @@ class OC_Installer{ if (is_null($info)) { return false; } - OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app)); + \OC::$server->getAppConfig()->setValue($app, 'installed_version', OC_App::getAppVersion($app)); if (array_key_exists('ocsid', $info)) { - OC_Appconfig::setValue($app, 'ocsid', $info['ocsid']); + \OC::$server->getAppConfig()->setValue($app, 'ocsid', $info['ocsid']); } //set remote/public handlers diff --git a/lib/private/legacy/appconfig.php b/lib/private/legacy/appconfig.php deleted file mode 100644 index 54e568d9ff6..00000000000 --- a/lib/private/legacy/appconfig.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php -/** - * @author Bart Visscher <bartv@thisnet.nl> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * This class provides an easy way for apps to store config values in the - * database. - * - * @deprecated use \OC::$server->getAppConfig() to get an \OCP\IAppConfig instance - */ -class OC_Appconfig { - /** - * @return \OCP\IAppConfig - */ - private static function getAppConfig() { - return \OC::$server->getAppConfig(); - } - - /** - * Get all apps using the config - * @return array an array of app ids - * - * This function returns a list of all apps that have at least one - * entry in the appconfig table. - */ - public static function getApps() { - return self::getAppConfig()->getApps(); - } - - /** - * Get the available keys for an app - * @param string $app the app we are looking for - * @return array an array of key names - * - * This function gets all keys of an app. Please note that the values are - * not returned. - */ - public static function getKeys($app) { - return self::getAppConfig()->getKeys($app); - } - - /** - * Gets the config value - * @param string $app app - * @param string $key key - * @param string $default = null, default value if the key does not exist - * @return string the value or $default - * - * This function gets a value from the appconfig table. If the key does - * not exist the default value will be returned - */ - public static function getValue($app, $key, $default = null) { - return self::getAppConfig()->getValue($app, $key, $default); - } - - /** - * check if a key is set in the appconfig - * @param string $app - * @param string $key - * @return bool - */ - public static function hasKey($app, $key) { - return self::getAppConfig()->hasKey($app, $key); - } - - /** - * sets a value in the appconfig - * @param string $app app - * @param string $key key - * @param string $value value - * - * Sets a value. If the key did not exist before it will be created. - */ - public static function setValue($app, $key, $value) { - self::getAppConfig()->setValue($app, $key, $value); - } - - /** - * Deletes a key - * @param string $app app - * @param string $key key - * - * Deletes a key. - */ - public static function deleteKey($app, $key) { - self::getAppConfig()->deleteKey($app, $key); - } - - /** - * Remove app from appconfig - * @param string $app app - * - * Removes all keys in appconfig belonging to the app. - */ - public static function deleteApp($app) { - self::getAppConfig()->deleteApp($app); - } - - /** - * get multiply values, either the app or key can be used as wildcard by setting it to false - * - * @param string|false $app - * @param string|false $key - * @return array - */ - public static function getValues($app, $key) { - return self::getAppConfig()->getValues($app, $key); - } -} diff --git a/lib/private/legacy/log.php b/lib/private/legacy/log.php deleted file mode 100644 index f9a2044da77..00000000000 --- a/lib/private/legacy/log.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * @author Bart Visscher <bartv@thisnet.nl> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * logging utilities - * - * Log is saved by default at data/owncloud.log using OC_Log_Owncloud. - * Selecting other backend is done with a config option 'log_type'. - */ - -OC_Log::$object = new \OC\Log(); -/** - * @deprecated use \OC::$server->getLogger() to get an \OCP\ILogger instance - */ -class OC_Log { - public static $object; - - const DEBUG=0; - const INFO=1; - const WARN=2; - const ERROR=3; - const FATAL=4; - - static private $level_funcs = array( - self::DEBUG => 'debug', - self::INFO => 'info', - self::WARN => 'warning', - self::ERROR => 'error', - self::FATAL => 'emergency', - ); - - static public $enabled = true; - static protected $class = null; - - /** - * write a message in the log - * @param string $app - * @param string $message - * @param int $level - */ - public static function write($app, $message, $level) { - if (self::$enabled) { - $context = array('app' => $app); - $func = array(self::$object, self::$level_funcs[$level]); - call_user_func($func, $message, $context); - } - } -} diff --git a/lib/private/legacy/search.php b/lib/private/legacy/search.php deleted file mode 100644 index d113412dc4a..00000000000 --- a/lib/private/legacy/search.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * @author Andrew Brown <andrew@casabrown.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * provides an interface to all search providers - * - * @deprecated use \OCP\ISearch / \OC\Search instead - */ -class OC_Search { - /** - * @return \OCP\ISearch - */ - private static function getSearch() { - return \OC::$server->getSearch(); - } - - /** - * Search all providers for $query - * @param string $query - * @return array An array of OCP\Search\Result's - */ - public static function search($query) { - return self::getSearch()->search($query); - } - - /** - * Register a new search provider to search with - * @param string $class class name of a OCP\Search\Provider - * @param array $options optional - */ - public static function registerProvider($class, $options = array()) { - return self::getSearch()->registerProvider($class, $options); - } - - /** - * Remove one existing search provider - * @param string $provider class name of a OCP\Search\Provider - */ - public static function removeProvider($provider) { - return self::getSearch()->removeProvider($provider); - } - - /** - * Remove all registered search providers - */ - public static function clearProviders() { - return self::getSearch()->clearProviders(); - } - -} diff --git a/lib/private/legacy/search/result.php b/lib/private/legacy/search/result.php deleted file mode 100644 index 73ee91f089d..00000000000 --- a/lib/private/legacy/search/result.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Andrew Brown <andrew@casabrown.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * @deprecated use \OCP\Search\Result instead - */ -class OC_Search_Result extends \OCP\Search\Result { - /** - * Create a new search result - * @param string $id unique identifier from application: '[app_name]/[item_identifier_in_app]' - * @param string $name displayed text of result - * @param string $link URL to the result within its app - * @param string $type @deprecated because it is now set in \OC\Search\Result descendants - */ - public function __construct($id = null, $name = null, $link = null, $type = null) { - $this->id = $id; - $this->name = $name; - $this->link = $link; - $this->type = $type; - } -} diff --git a/lib/private/log.php b/lib/private/log.php index dd5cb6efbb9..3c0e7b45d1b 100644 --- a/lib/private/log.php +++ b/lib/private/log.php @@ -79,7 +79,7 @@ class Log implements ILogger { * @param array $context */ public function emergency($message, array $context = array()) { - $this->log(\OC_Log::FATAL, $message, $context); + $this->log(\OCP\Util::FATAL, $message, $context); } /** @@ -92,7 +92,7 @@ class Log implements ILogger { * @param array $context */ public function alert($message, array $context = array()) { - $this->log(\OC_Log::ERROR, $message, $context); + $this->log(\OCP\Util::ERROR, $message, $context); } /** @@ -104,7 +104,7 @@ class Log implements ILogger { * @param array $context */ public function critical($message, array $context = array()) { - $this->log(\OC_Log::ERROR, $message, $context); + $this->log(\OCP\Util::ERROR, $message, $context); } /** @@ -115,7 +115,7 @@ class Log implements ILogger { * @param array $context */ public function error($message, array $context = array()) { - $this->log(\OC_Log::ERROR, $message, $context); + $this->log(\OCP\Util::ERROR, $message, $context); } /** @@ -128,7 +128,7 @@ class Log implements ILogger { * @param array $context */ public function warning($message, array $context = array()) { - $this->log(\OC_Log::WARN, $message, $context); + $this->log(\OCP\Util::WARN, $message, $context); } /** @@ -138,7 +138,7 @@ class Log implements ILogger { * @param array $context */ public function notice($message, array $context = array()) { - $this->log(\OC_Log::INFO, $message, $context); + $this->log(\OCP\Util::INFO, $message, $context); } /** @@ -150,7 +150,7 @@ class Log implements ILogger { * @param array $context */ public function info($message, array $context = array()) { - $this->log(\OC_Log::INFO, $message, $context); + $this->log(\OCP\Util::INFO, $message, $context); } /** @@ -160,7 +160,7 @@ class Log implements ILogger { * @param array $context */ public function debug($message, array $context = array()) { - $this->log(\OC_Log::DEBUG, $message, $context); + $this->log(\OCP\Util::DEBUG, $message, $context); } @@ -172,7 +172,7 @@ class Log implements ILogger { * @param array $context */ public function log($level, $message, array $context = array()) { - $minLevel = min($this->config->getValue('loglevel', \OC_Log::WARN), \OC_Log::ERROR); + $minLevel = min($this->config->getValue('loglevel', \OCP\Util::WARN), \OCP\Util::ERROR); $logCondition = $this->config->getValue('log.condition', []); if (isset($context['app'])) { @@ -185,7 +185,7 @@ class Log implements ILogger { if(!empty($logCondition) && isset($logCondition['apps']) && in_array($app, $logCondition['apps'], true)) { - $minLevel = \OC_Log::DEBUG; + $minLevel = \OCP\Util::DEBUG; } } else { @@ -233,7 +233,7 @@ class Log implements ILogger { // if log condition is satisfied change the required log level to DEBUG if($this->logConditionSatisfied) { - $minLevel = \OC_Log::DEBUG; + $minLevel = \OCP\Util::DEBUG; } if ($level >= $minLevel) { diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php index 01112ef7f9d..c98f21208bb 100644 --- a/lib/private/log/owncloud.php +++ b/lib/private/log/owncloud.php @@ -78,8 +78,8 @@ class OC_Log_Owncloud { $remoteAddr = $request->getRemoteAddress(); // remove username/passwords from URLs before writing the to the log file $time = $time->format($format); - $minLevel=min($config->getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR); - if($minLevel == OC_Log::DEBUG) { + $minLevel=min($config->getValue( "loglevel", \OCP\Util::WARN ), \OCP\Util::ERROR); + if($minLevel == \OCP\Util::DEBUG) { $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '--'; $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '--'; $entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time', 'method', 'url'); @@ -107,7 +107,7 @@ class OC_Log_Owncloud { */ public static function getEntries($limit=50, $offset=0) { self::init(); - $minLevel=OC_Config::getValue( "loglevel", OC_Log::WARN ); + $minLevel=OC_Config::getValue( "loglevel", \OCP\Util::WARN ); $entries = array(); $handle = @fopen(self::$logFile, 'rb'); if ($handle) { diff --git a/lib/private/log/rotate.php b/lib/private/log/rotate.php index a8882e0e2f1..4572a9904d2 100644 --- a/lib/private/log/rotate.php +++ b/lib/private/log/rotate.php @@ -44,6 +44,6 @@ class Rotate extends \OC\BackgroundJob\Job { $rotatedLogfile = $logfile.'.1'; rename($logfile, $rotatedLogfile); $msg = 'Log file "'.$logfile.'" was over '.$this->max_log_size.' bytes, moved to "'.$rotatedLogfile.'"'; - \OC_Log::write('OC\Log\Rotate', $msg, \OC_Log::WARN); + \OCP\Util::writeLog('OC\Log\Rotate', $msg, \OCP\Util::WARN); } } diff --git a/lib/private/log/syslog.php b/lib/private/log/syslog.php index 863d1d6c201..cb42c1dc011 100644 --- a/lib/private/log/syslog.php +++ b/lib/private/log/syslog.php @@ -23,11 +23,11 @@ class OC_Log_Syslog { static protected $levels = array( - OC_Log::DEBUG => LOG_DEBUG, - OC_Log::INFO => LOG_INFO, - OC_Log::WARN => LOG_WARNING, - OC_Log::ERROR => LOG_ERR, - OC_Log::FATAL => LOG_CRIT, + \OCP\Util::DEBUG => LOG_DEBUG, + \OCP\Util::INFO => LOG_INFO, + \OCP\Util::WARN => LOG_WARNING, + \OCP\Util::ERROR => LOG_ERR, + \OCP\Util::FATAL => LOG_CRIT, ); /** diff --git a/lib/private/naturalsort.php b/lib/private/naturalsort.php index 310a029b6de..26b9cec6cf1 100644 --- a/lib/private/naturalsort.php +++ b/lib/private/naturalsort.php @@ -39,7 +39,7 @@ class NaturalSort { // or inject an instance of \OC\NaturalSort_DefaultCollator to force using Owncloud's default collator if (isset($injectedCollator)) { $this->collator = $injectedCollator; - \OC_Log::write('core', 'forced use of '.get_class($injectedCollator), \OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'forced use of '.get_class($injectedCollator), \OCP\Util::DEBUG); } } diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index 18ba4cea003..d6593e5089a 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -272,7 +272,7 @@ class OCSClient { $tmp = $data->data->content; if (is_null($tmp)) { - \OC_Log::write('core', 'No update found at the ownCloud appstore for app ' . $id, \OC_Log::INFO); + \OCP\Util::writeLog('core', 'No update found at the ownCloud appstore for app ' . $id, \OCP\Util::INFO); return null; } diff --git a/lib/private/preview.php b/lib/private/preview.php index cc954bc3653..5dcab476a4f 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -135,7 +135,7 @@ class Preview { && \OC::$server->getConfig() ->getSystemValue('enable_previews', true) ) { - \OC_Log::write('core', 'No preview providers exist', \OC_Log::ERROR); + \OCP\Util::writeLog('core', 'No preview providers exist', \OCP\Util::ERROR); throw new \Exception('No preview providers'); } } diff --git a/lib/private/preview/bitmap.php b/lib/private/preview/bitmap.php index 12ad4f020eb..065425c9a1d 100644 --- a/lib/private/preview/bitmap.php +++ b/lib/private/preview/bitmap.php @@ -46,7 +46,7 @@ abstract class Bitmap extends Provider { try { $bp = $this->getResizedPreview($tmpPath, $maxX, $maxY); } catch (\Exception $e) { - \OC_Log::write('core', 'ImageMagick says: ' . $e->getmessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('core', 'ImageMagick says: ' . $e->getmessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php index f72c5def35f..30398147aa6 100644 --- a/lib/private/preview/office.php +++ b/lib/private/preview/office.php @@ -56,7 +56,7 @@ abstract class Office extends Provider { } catch (\Exception $e) { unlink($absPath); unlink($pdfPreview); - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/preview/svg.php b/lib/private/preview/svg.php index 4e3cba576fb..f8318e9a69a 100644 --- a/lib/private/preview/svg.php +++ b/lib/private/preview/svg.php @@ -52,7 +52,7 @@ class SVG extends Provider { $svg->readImageBlob($content); $svg->setImageFormat('png32'); } catch (\Exception $e) { - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/setup/mssql.php b/lib/private/setup/mssql.php index f8815259af4..0ae02d6cbcc 100644 --- a/lib/private/setup/mssql.php +++ b/lib/private/setup/mssql.php @@ -66,7 +66,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { $row = sqlsrv_fetch_array($result); @@ -77,7 +77,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { if ($row == null) { $query = "CREATE LOGIN [".$this->dbuser."] WITH PASSWORD = '".$this->dbpassword."';"; @@ -89,7 +89,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } } } @@ -106,7 +106,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { $row = sqlsrv_fetch_array($result); @@ -117,7 +117,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { if ($row == null) { $query = "USE [".$this->dbname."]; CREATE USER [".$this->dbuser."] FOR LOGIN [".$this->dbuser."];"; @@ -129,7 +129,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } } @@ -142,7 +142,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } } } @@ -158,7 +158,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } } @@ -179,7 +179,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { $row = sqlsrv_fetch_array($result); @@ -190,7 +190,7 @@ class MSSQL extends AbstractDatabase { $entry = ''; } $entry.='Offending command was: '.$query.'<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } else { if ($row == null) { \OC_DB::createDbFromStructure($this->dbDefinitionFile); diff --git a/lib/private/setup/mysql.php b/lib/private/setup/mysql.php index b9246a915a6..c01ff724b80 100644 --- a/lib/private/setup/mysql.php +++ b/lib/private/setup/mysql.php @@ -103,7 +103,7 @@ class MySQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(mysql_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.mssql', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.mssql', $entry, \OCP\Util::WARN); } $query="GRANT ALL PRIVILEGES ON `$name` . * TO '$user'"; diff --git a/lib/private/setup/oci.php b/lib/private/setup/oci.php index 791dc7232f5..d46d5529da0 100644 --- a/lib/private/setup/oci.php +++ b/lib/private/setup/oci.php @@ -66,7 +66,7 @@ class OCI extends AbstractDatabase { } else { $easy_connect_string = '//'.$e_host.'/'.$e_dbname; } - \OC_Log::write('setup oracle', 'connect string: ' . $easy_connect_string, \OC_Log::DEBUG); + \OCP\Util::writeLog('setup oracle', 'connect string: ' . $easy_connect_string, \OCP\Util::DEBUG); $connection = @oci_connect($this->dbuser, $this->dbpassword, $easy_connect_string); if(!$connection) { $errorMessage = $this->getLastError(); @@ -93,7 +93,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } $result = oci_execute($stmt); if($result) { @@ -155,7 +155,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } $result = oci_execute($stmt); @@ -178,14 +178,14 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } oci_bind_by_name($stmt, ':un', $name); $result = oci_execute($stmt); if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } if(! oci_fetch_row($stmt)) { @@ -196,7 +196,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } //oci_bind_by_name($stmt, ':un', $name); $result = oci_execute($stmt); @@ -204,7 +204,7 @@ class OCI extends AbstractDatabase { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } } else { // change password of the existing role $query = "ALTER USER :un IDENTIFIED BY :pw"; @@ -212,7 +212,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } oci_bind_by_name($stmt, ':un', $name); oci_bind_by_name($stmt, ':pw', $password); @@ -220,7 +220,7 @@ class OCI extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } } // grant necessary roles @@ -229,14 +229,14 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } $result = oci_execute($stmt); if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; - \OC_Log::write('setup.oci', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); } } diff --git a/lib/private/setup/postgresql.php b/lib/private/setup/postgresql.php index 597e38f43a6..c8fd3b98fe4 100644 --- a/lib/private/setup/postgresql.php +++ b/lib/private/setup/postgresql.php @@ -118,7 +118,7 @@ class PostgreSQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(pg_last_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.pg', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.pg', $entry, \OCP\Util::WARN); } if(! pg_fetch_row($result)) { //The database does not exists... let's create it @@ -127,7 +127,7 @@ class PostgreSQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(pg_last_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.pg', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.pg', $entry, \OCP\Util::WARN); } else { $query = "REVOKE ALL PRIVILEGES ON DATABASE \"$e_name\" FROM PUBLIC"; @@ -144,7 +144,7 @@ class PostgreSQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(pg_last_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.pg', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.pg', $entry, \OCP\Util::WARN); } if(! pg_fetch_row($result)) { @@ -154,7 +154,7 @@ class PostgreSQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(pg_last_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.pg', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.pg', $entry, \OCP\Util::WARN); } } else { // change password of the existing role @@ -163,7 +163,7 @@ class PostgreSQL extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array(pg_last_error($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OC_Log::write('setup.pg', $entry, \OC_Log::WARN); + \OCP\Util::writeLog('setup.pg', $entry, \OCP\Util::WARN); } } } diff --git a/lib/private/share/share.php b/lib/private/share/share.php index af7f78b9ff5..7fcbb695c68 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -87,10 +87,10 @@ class Share extends Constants { } return true; } - \OC_Log::write('OCP\Share', + \OCP\Util::writeLog('OCP\Share', 'Sharing backend '.$class.' not registered, '.self::$backendTypes[$itemType]['class'] .' is already registered for '.$itemType, - \OC_Log::WARN); + \OCP\Util::WARN); } return false; } @@ -102,7 +102,7 @@ class Share extends Constants { * The Share API is enabled by default if not configured */ public static function isEnabled() { - if (\OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes') == 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_enabled', 'yes') == 'yes') { return true; } return false; @@ -142,18 +142,28 @@ class Share extends Constants { while ($source !== -1) { // Fetch all shares with another user - $query = \OC_DB::prepare( - 'SELECT `share_with`, `file_source`, `file_target` + if (!$returnUserPaths) { + $query = \OC_DB::prepare( + 'SELECT `share_with`, `file_source`, `file_target` + FROM + `*PREFIX*share` + WHERE + `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')' + ); + $result = $query->execute(array($source, self::SHARE_TYPE_USER)); + } else { + $query = \OC_DB::prepare( + 'SELECT `share_with`, `file_source`, `file_target` FROM `*PREFIX*share` WHERE - `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')' - ); - - $result = $query->execute(array($source, self::SHARE_TYPE_USER)); + `item_source` = ? AND `share_type` IN (?, ?) AND `item_type` IN (\'file\', \'folder\')' + ); + $result = $query->execute(array($source, self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique)); + } if (\OCP\DB::isError($result)) { - \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR); } else { while ($row = $result->fetchRow()) { $shares[] = $row['share_with']; @@ -175,14 +185,19 @@ class Share extends Constants { $result = $query->execute(array($source, self::SHARE_TYPE_GROUP)); if (\OCP\DB::isError($result)) { - \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR); } else { while ($row = $result->fetchRow()) { $usersInGroup = \OC_Group::usersInGroup($row['share_with']); $shares = array_merge($shares, $usersInGroup); if ($returnUserPaths) { foreach ($usersInGroup as $user) { - $fileTargets[(int) $row['file_source']][$user] = $row; + if (!isset($fileTargets[(int) $row['file_source']][$user])) { + // When the user already has an entry for this file source + // the file is either shared directly with him as well, or + // he has an exception entry (because of naming conflict). + $fileTargets[(int) $row['file_source']][$user] = $row; + } } } } @@ -238,9 +253,6 @@ class Share extends Constants { // Include owner in list of users, if requested if ($includeOwner) { $shares[] = $ownerUser; - if ($returnUserPaths) { - $sharePaths[$ownerUser] = $path; - } } if ($returnUserPaths) { @@ -256,7 +268,7 @@ class Share extends Constants { $result = $query->execute(); if (\OCP\DB::isError($result)) { - \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR); } else { while ($row = $result->fetchRow()) { foreach ($fileTargets[$row['fileid']] as $uid => $shareData) { @@ -268,6 +280,12 @@ class Share extends Constants { } } + if ($includeOwner) { + $sharePaths[$ownerUser] = $path; + } else { + unset($sharePaths[$ownerUser]); + } + return $sharePaths; } @@ -464,7 +482,7 @@ class Share extends Constants { $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?', 1); $result = $query->execute(array($token)); if (\OC_DB::isError($result)) { - \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage() . ', token=' . $token, \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage() . ', token=' . $token, \OCP\Util::ERROR); } $row = $result->fetchRow(); if ($row === false) { @@ -581,7 +599,7 @@ class Share extends Constants { if ($backend->isShareTypeAllowed($shareType) === false) { $message = 'Sharing %s failed, because the backend does not allow shares from type %i'; $message_t = $l->t('Sharing %s failed, because the backend does not allow shares from type %i', array($itemSourceName, $shareType)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareType), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareType), \OCP\Util::ERROR); throw new \Exception($message_t); } @@ -599,14 +617,14 @@ class Share extends Constants { if (!$path) { $message = 'Sharing %s failed, because the file does not exist'; $message_t = $l->t('Sharing %s failed, because the file does not exist', array($itemSourceName)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::ERROR); throw new \Exception($message_t); } // verify that the user has share permission if (!\OC\Files\Filesystem::isSharable($path)) { $message = 'You are not allowed to share %s'; $message_t = $l->t('You are not allowed to share %s', array($itemSourceName)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -619,7 +637,7 @@ class Share extends Constants { foreach ($mounts as $mount) { if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) { $message = 'Sharing "' . $itemSourceName . '" failed, because it contains files shared with you!'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', $message, \OCP\Util::ERROR); throw new \Exception($message); } @@ -636,13 +654,13 @@ class Share extends Constants { if ($shareWith == $uidOwner) { $message = 'Sharing %s failed, because the user %s is the item owner'; $message_t = $l->t('Sharing %s failed, because the user %s is the item owner', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } if (!\OC_User::userExists($shareWith)) { $message = 'Sharing %s failed, because the user %s does not exist'; $message_t = $l->t('Sharing %s failed, because the user %s does not exist', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } if ($shareWithinGroupOnly) { @@ -651,7 +669,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because the user ' .'%s is not a member of any groups that %s is a member of'; $message_t = $l->t('Sharing %s failed, because the user %s is not a member of any groups that %s is a member of', array($itemSourceName, $shareWith, $uidOwner)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith, $uidOwner), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith, $uidOwner), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -664,7 +682,7 @@ class Share extends Constants { if ($checkExists['uid_owner'] != $uidOwner || $checkExists['share_type'] == $shareType) { $message = 'Sharing %s failed, because this item is already shared with %s'; $message_t = $l->t('Sharing %s failed, because this item is already shared with %s', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -672,14 +690,14 @@ class Share extends Constants { if (!\OC_Group::groupExists($shareWith)) { $message = 'Sharing %s failed, because the group %s does not exist'; $message_t = $l->t('Sharing %s failed, because the group %s does not exist', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } if ($shareWithinGroupOnly && !\OC_Group::inGroup($uidOwner, $shareWith)) { $message = 'Sharing %s failed, because ' .'%s is not a member of the group %s'; $message_t = $l->t('Sharing %s failed, because %s is not a member of the group %s', array($itemSourceName, $uidOwner, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $uidOwner, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $uidOwner, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } // Check if the item source is already shared with the group, either from the same owner or a different user @@ -692,7 +710,7 @@ class Share extends Constants { if ($checkExists['uid_owner'] != $uidOwner || $checkExists['share_type'] == $shareType) { $message = 'Sharing %s failed, because this item is already shared with %s'; $message_t = $l->t('Sharing %s failed, because this item is already shared with %s', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -703,7 +721,7 @@ class Share extends Constants { $shareWith['users'] = array_diff(\OC_Group::usersInGroup($group), array($uidOwner)); } else if ($shareType === self::SHARE_TYPE_LINK) { $updateExistingShare = false; - if (\OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes') == 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_links', 'yes') == 'yes') { // when updating a link share // FIXME Don't delete link if we update it @@ -731,7 +749,7 @@ class Share extends Constants { if (\OCP\Util::isPublicLinkPasswordRequired() && empty($shareWith)) { $message = 'You need to provide a password to create a public link, only protected links are allowed'; $message_t = $l->t('You need to provide a password to create a public link, only protected links are allowed'); - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', $message, \OCP\Util::ERROR); throw new \Exception($message_t); } @@ -760,7 +778,7 @@ class Share extends Constants { } $message = 'Sharing %s failed, because sharing with links is not allowed'; $message_t = $l->t('Sharing %s failed, because sharing with links is not allowed', array($itemSourceName)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::ERROR); throw new \Exception($message_t); } else if ($shareType === self::SHARE_TYPE_REMOTE) { $token = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(self::TOKEN_LENGTH, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_UPPER . @@ -787,7 +805,7 @@ class Share extends Constants { // Future share types need to include their own conditions $message = 'Share type %s is not valid for %s'; $message_t = $l->t('Share type %s is not valid for %s', array($shareType, $itemSource)); - \OC_Log::write('OCP\Share', sprintf($message, $shareType, $itemSource), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $shareType, $itemSource), \OCP\Util::ERROR); throw new \Exception($message_t); } @@ -988,7 +1006,7 @@ class Share extends Constants { $result = $query->execute(array($status, $itemType, $itemSource, $shareType, $recipient)); if($result === false) { - \OC_Log::write('OCP\Share', 'Couldn\'t set send mail status', \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', 'Couldn\'t set send mail status', \OCP\Util::ERROR); } } @@ -1015,7 +1033,7 @@ class Share extends Constants { $message = 'Setting permissions for %s failed,' .' because the permissions exceed permissions granted to %s'; $message_t = $l->t('Setting permissions for %s failed, because the permissions exceed permissions granted to %s', array($itemSource, \OC_User::getUser())); - \OC_Log::write('OCP\Share', sprintf($message, $itemSource, \OC_User::getUser()), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, \OC_User::getUser()), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -1078,7 +1096,7 @@ class Share extends Constants { $message = 'Setting permissions for %s failed, because the item was not found'; $message_t = $l->t('Setting permissions for %s failed, because the item was not found', array($itemSource)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSource), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource), \OCP\Util::ERROR); throw new \Exception($message_t); } @@ -1340,20 +1358,20 @@ class Share extends Constants { if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) { $message = 'Sharing backend %s must implement the interface OCP\Share_Backend'; $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class)); - \OC_Log::write('OCP\Share', sprintf($message, $class), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $class), \OCP\Util::ERROR); throw new \Exception($message_t); } return self::$backends[$itemType]; } else { $message = 'Sharing backend %s not found'; $message_t = $l->t('Sharing backend %s not found', array($class)); - \OC_Log::write('OCP\Share', sprintf($message, $class), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $class), \OCP\Util::ERROR); throw new \Exception($message_t); } } $message = 'Sharing backend for %s not found'; $message_t = $l->t('Sharing backend for %s not found', array($itemType)); - \OC_Log::write('OCP\Share', sprintf($message, $itemType), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemType), \OCP\Util::ERROR); throw new \Exception($message_t); } @@ -1365,7 +1383,7 @@ class Share extends Constants { */ public static function isResharingAllowed() { if (!isset(self::$isResharingAllowed)) { - if (\OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes') == 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes') == 'yes') { self::$isResharingAllowed = true; } else { self::$isResharingAllowed = false; @@ -1509,7 +1527,7 @@ class Share extends Constants { $queryArgs = array($itemType); } } - if (\OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { $where .= ' AND `share_type` != ?'; $queryArgs[] = self::SHARE_TYPE_LINK; } @@ -1617,9 +1635,9 @@ class Share extends Constants { $query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$where, $queryLimit); $result = $query->execute($queryArgs); if (\OC_DB::isError($result)) { - \OC_Log::write('OCP\Share', + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage() . ', select=' . $select . ' where=', - \OC_Log::ERROR); + \OCP\Util::ERROR); } $items = array(); $targets = array(); @@ -1681,9 +1699,9 @@ class Share extends Constants { $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); $parentResult = $query->execute(array($row['parent'])); if (\OC_DB::isError($result)) { - \OC_Log::write('OCP\Share', 'Can\'t select parent: ' . + \OCP\Util::writeLog('OCP\Share', 'Can\'t select parent: ' . \OC_DB::getErrorMessage() . ', select=' . $select . ' where=' . $where, - \OC_Log::ERROR); + \OCP\Util::ERROR); } else { $parentRow = $parentResult->fetchRow(); $tmpPath = $parentRow['file_target']; @@ -2124,7 +2142,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because the user %s is the original sharer'; $message_t = $l->t('Sharing %s failed, because the user %s is the original sharer', array($itemSourceName, $shareWith)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::ERROR); throw new \Exception($message_t); } } @@ -2136,7 +2154,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because the permissions exceed permissions granted to %s'; $message_t = $l->t('Sharing %s failed, because the permissions exceed permissions granted to %s', array($itemSourceName, $uidOwner)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $uidOwner), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $uidOwner), \OCP\Util::ERROR); throw new \Exception($message_t); } else { // TODO Don't check if inside folder @@ -2162,7 +2180,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because resharing is not allowed'; $message_t = $l->t('Sharing %s failed, because resharing is not allowed', array($itemSourceName)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::ERROR); throw new \Exception($message_t); } } else { @@ -2175,7 +2193,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because the sharing backend for ' .'%s could not find its source'; $message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSource, $itemType), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, $itemType), \OCP\Util::ERROR); throw new \Exception($message_t); } if ($backend instanceof \OCP\Share_Backend_File_Dependent) { @@ -2190,7 +2208,7 @@ class Share extends Constants { $message = 'Sharing %s failed, because the file could not be found in the file cache'; $message_t = $l->t('Sharing %s failed, because the file could not be found in the file cache', array($itemSource)); - \OC_Log::write('OCP\Share', sprintf($message, $itemSource), \OC_Log::ERROR); + \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource), \OCP\Util::ERROR); throw new \Exception($message_t); } } else { @@ -2504,7 +2522,7 @@ class Share extends Constants { * @return bool */ public static function shareWithGroupMembersOnly() { - $value = \OC_Appconfig::getValue('core', 'shareapi_only_share_with_group_members', 'no'); + $value = \OC::$server->getAppConfig()->getValue('core', 'shareapi_only_share_with_group_members', 'no'); return ($value === 'yes') ? true : false; } diff --git a/lib/private/systemconfig.php b/lib/private/systemconfig.php index 451ccd85e2f..13b0959768a 100644 --- a/lib/private/systemconfig.php +++ b/lib/private/systemconfig.php @@ -29,6 +29,14 @@ namespace OC; */ class SystemConfig { /** + * Lists all available config keys + * @return array an array of key names + */ + public function getKeys() { + return \OC_Config::getKeys(); + } + + /** * Sets a new system wide value * * @param string $key the key of the value, under which will be saved diff --git a/lib/private/user.php b/lib/private/user.php index 7c3cb528a9a..1d8b89e273f 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -142,12 +142,12 @@ class OC_User { case 'database': case 'mysql': case 'sqlite': - OC_Log::write('core', 'Adding user backend ' . $backend . '.', OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'Adding user backend ' . $backend . '.', \OCP\Util::DEBUG); self::$_usedBackends[$backend] = new OC_User_Database(); self::getManager()->registerBackend(self::$_usedBackends[$backend]); break; default: - OC_Log::write('core', 'Adding default user backend ' . $backend . '.', OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'Adding default user backend ' . $backend . '.', \OCP\Util::DEBUG); $className = 'OC_USER_' . strToUpper($backend); self::$_usedBackends[$backend] = new $className(); self::getManager()->registerBackend(self::$_usedBackends[$backend]); @@ -184,10 +184,10 @@ class OC_User { self::useBackend($backend); self::$_setupedBackends[] = $i; } else { - OC_Log::write('core', 'User backend ' . $class . ' already initialized.', OC_Log::DEBUG); + \OCP\Util::writeLog('core', 'User backend ' . $class . ' already initialized.', \OCP\Util::DEBUG); } } else { - OC_Log::write('core', 'User backend ' . $class . ' not found.', OC_Log::ERROR); + \OCP\Util::writeLog('core', 'User backend ' . $class . ' not found.', \OCP\Util::ERROR); } } } diff --git a/lib/private/user/database.php b/lib/private/user/database.php index 3cf73f939e5..081066398c0 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -211,7 +211,7 @@ class OC_User_Database extends OC_User_Backend implements \OCP\IUserBackend { $result = $query->execute(array($uid)); if (OC_DB::isError($result)) { - OC_Log::write('core', OC_DB::getErrorMessage(), OC_Log::ERROR); + \OCP\Util::writeLog('core', OC_DB::getErrorMessage(), \OCP\Util::ERROR); return false; } @@ -288,7 +288,7 @@ class OC_User_Database extends OC_User_Backend implements \OCP\IUserBackend { $query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`'); $result = $query->execute(); if (OC_DB::isError($result)) { - OC_Log::write('core', OC_DB::getErrorMessage(), OC_Log::ERROR); + \OCP\Util::writeLog('core', OC_DB::getErrorMessage(), \OCP\Util::ERROR); return false; } return $result->fetchOne(); diff --git a/lib/private/util.php b/lib/private/util.php index ab2d4a221d7..39d64952dc6 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -212,9 +212,9 @@ class OC_Util { * @return boolean */ public static function isSharingDisabledForUser() { - if (\OC_Appconfig::getValue('core', 'shareapi_exclude_groups', 'no') === 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_exclude_groups', 'no') === 'yes') { $user = \OCP\User::getUser(); - $groupsList = \OC_Appconfig::getValue('core', 'shareapi_exclude_groups_list', ''); + $groupsList = \OC::$server->getAppConfig()->getValue('core', 'shareapi_exclude_groups_list', ''); $excludedGroups = explode(',', $groupsList); $usersGroups = \OC_Group::getUserGroups($user); if (!empty($usersGroups)) { @@ -999,7 +999,7 @@ class OC_Util { if (isset($_REQUEST['redirect_url']) && strpos($_REQUEST['redirect_url'], '@') === false) { $location = $urlGenerator->getAbsoluteURL(urldecode($_REQUEST['redirect_url'])); } else { - $defaultPage = OC_Appconfig::getValue('core', 'defaultpage'); + $defaultPage = \OC::$server->getAppConfig()->getValue('core', 'defaultpage'); if ($defaultPage) { $location = $urlGenerator->getAbsoluteURL($defaultPage); } else { @@ -1245,6 +1245,7 @@ class OC_Util { * @return string of the response or false on error * This function get the content of a page via curl, if curl is enabled. * If not, file_get_contents is used. + * @deprecated Use \OCP\Http\Client\IClientService */ public static function getUrlContent($url) { try { @@ -1344,7 +1345,7 @@ class OC_Util { // XCache if (function_exists('xcache_clear_cache')) { if (ini_get('xcache.admin.enable_auth')) { - OC_Log::write('core', 'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.', \OC_Log::WARN); + \OCP\Util::writeLog('core', 'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.', \OCP\Util::WARN); } else { @xcache_clear_cache(XC_TYPE_PHP, 0); } diff --git a/lib/public/app.php b/lib/public/app.php index 13f41025425..c66d988c315 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -41,18 +41,6 @@ namespace OCP; * @since 4.0.0 */ class App { - /** - * Makes ownCloud aware of this app - * @param array $data with all information - * @return boolean - * - * @deprecated 4.5.0 This method is deprecated. Do not call it anymore. - * It'll remain in our public API for compatibility reasons. - * - */ - public static function register( $data ) { - return true; // don't do anything - } /** * Adds an entry to the navigation diff --git a/lib/public/appframework/http/jsonresponse.php b/lib/public/appframework/http/jsonresponse.php index 1a770109d45..456a5616d4d 100644 --- a/lib/public/appframework/http/jsonresponse.php +++ b/lib/public/appframework/http/jsonresponse.php @@ -61,9 +61,16 @@ class JSONResponse extends Response { * Returns the rendered json * @return string the rendered json * @since 6.0.0 + * @throws \Exception If data could not get encoded */ - public function render(){ - return json_encode($this->data); + public function render() { + $response = json_encode($this->data); + if($response === false) { + throw new \Exception(sprintf('Could not json_encode due to invalid ' . + 'non UTF-8 characters in the array: %s', var_export($this->data, true))); + } + + return $response; } /** diff --git a/lib/public/util.php b/lib/public/util.php index 087bb639618..06ad5de60ca 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -78,7 +78,7 @@ class Util { public static function setChannel($channel) { //Flush timestamp to reload version.php \OC::$server->getSession()->set('OC_Version_Timestamp', 0); - return \OC::$server->getAppConfig()->setValue('core', 'OC_Channel', $channel); + \OC::$server->getAppConfig()->setValue('core', 'OC_Channel', $channel); } /** @@ -148,8 +148,8 @@ class Util { * @since 4.0.0 */ public static function writeLog( $app, $message, $level ) { - // call the internal log class - \OC_LOG::write( $app, $message, $level ); + $context = ['app' => $app]; + \OC::$server->getLogger()->log($level, $message, $context); } /** diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index 69b186bb9f3..55298430e28 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -31,6 +31,6 @@ try { OC_App::enable(OC_App::cleanAppId((string)$_POST['appid']), $groups); OC_JSON::success(); } catch (Exception $e) { - OC_Log::write('core', $e->getMessage(), OC_Log::ERROR); + \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index affdb310291..a9012a55345 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -54,7 +54,7 @@ if($username) { if($quota === 'default') {//'default' as default quota makes no sense $quota='none'; } - OC_Appconfig::setValue('files', 'default_quota', $quota); + \OC::$server->getAppConfig()->setValue('files', 'default_quota', $quota); } OC_JSON::success(array("data" => array( "username" => $username , 'quota' => $quota))); diff --git a/settings/l10n/fr.js b/settings/l10n/fr.js index 6fc16b5e142..1d69c2c8169 100644 --- a/settings/l10n/fr.js +++ b/settings/l10n/fr.js @@ -61,7 +61,7 @@ OC.L10N.register( "Experimental" : "Expérimentale", "All" : "Tous", "Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use." : "Les applications officielles sont développées par et avec la communauté ownCloud. Elles permettent à ownCloud d'offrir ses fonctionnalités principales et sont prêtes pour une utilisation en environnement de production. ", - "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Les applications approuvées sont créées par des développeurs de confiance et ont passé les test de sécurité. Elles sont activement maintenues dans un dépôt ouvert et leurs développeurs les considèrent stables pour une utilisation normale.", + "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Les applications approuvées sont créées par des développeurs de confiance et ont passé les tests de sécurité. Elles sont activement maintenues et leur code source est ouvert. Leurs développeurs les considèrent stables pour une utilisation normale.", "This app is not checked for security issues and is new or known to be unstable. Install at your own risk." : "Cette application est nouvelle ou instable, et sa sécurité n'a pas été vérifiée. Installez-la à vos risques et périls!", "Update to %s" : "Mettre à niveau vers la version %s", "Please wait...." : "Veuillez patienter…", @@ -186,6 +186,8 @@ OC.L10N.register( "Improving the config.php" : "Amélioration du config.php ", "Theming" : "Personnalisation de l'apparence", "Hardening and security guidance" : "Guide pour le renforcement et la sécurité", + "Transactional File Locking is enabled." : "Le verrouillage transactionnel de fichiers est activé", + "Transactional File Locking is disabled." : "Le verrouillage transactionnel de fichiers est désactivé", "Version" : "Version", "Developer documentation" : "Documentation pour développeurs", "Experimental applications ahead" : "Attention! Applications expérimentales", diff --git a/settings/l10n/fr.json b/settings/l10n/fr.json index adfe0289230..bda6c83580c 100644 --- a/settings/l10n/fr.json +++ b/settings/l10n/fr.json @@ -59,7 +59,7 @@ "Experimental" : "Expérimentale", "All" : "Tous", "Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use." : "Les applications officielles sont développées par et avec la communauté ownCloud. Elles permettent à ownCloud d'offrir ses fonctionnalités principales et sont prêtes pour une utilisation en environnement de production. ", - "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Les applications approuvées sont créées par des développeurs de confiance et ont passé les test de sécurité. Elles sont activement maintenues dans un dépôt ouvert et leurs développeurs les considèrent stables pour une utilisation normale.", + "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Les applications approuvées sont créées par des développeurs de confiance et ont passé les tests de sécurité. Elles sont activement maintenues et leur code source est ouvert. Leurs développeurs les considèrent stables pour une utilisation normale.", "This app is not checked for security issues and is new or known to be unstable. Install at your own risk." : "Cette application est nouvelle ou instable, et sa sécurité n'a pas été vérifiée. Installez-la à vos risques et périls!", "Update to %s" : "Mettre à niveau vers la version %s", "Please wait...." : "Veuillez patienter…", @@ -184,6 +184,8 @@ "Improving the config.php" : "Amélioration du config.php ", "Theming" : "Personnalisation de l'apparence", "Hardening and security guidance" : "Guide pour le renforcement et la sécurité", + "Transactional File Locking is enabled." : "Le verrouillage transactionnel de fichiers est activé", + "Transactional File Locking is disabled." : "Le verrouillage transactionnel de fichiers est désactivé", "Version" : "Version", "Developer documentation" : "Documentation pour développeurs", "Experimental applications ahead" : "Attention! Applications expérimentales", diff --git a/settings/l10n/id.js b/settings/l10n/id.js index f932327f5ad..8f66ba0d52b 100644 --- a/settings/l10n/id.js +++ b/settings/l10n/id.js @@ -1,6 +1,8 @@ OC.L10N.register( "settings", { + "APCu" : "APCu", + "Redis" : "Redis", "Security & setup warnings" : "Peringatan Keamanan & Pengaturan", "Sharing" : "Berbagi", "Server-side encryption" : "Enkripsi sisi-server", @@ -8,6 +10,7 @@ OC.L10N.register( "Cron" : "Cron", "Email server" : "Server email", "Log" : "Log", + "Server Status" : "Status Server", "Tips & tricks" : "Tips & trik", "Updates" : "Pembaruan", "Authentication error" : "Terjadi kesalahan saat otentikasi", @@ -53,9 +56,13 @@ OC.L10N.register( "Migration in progress. Please wait until the migration is finished" : "Migrasi sedang dalam proses. Mohon tunggu sampai migrasi selesai.", "Migration started …" : "Migrasi dimulai ...", "Sending..." : "Mengirim", + "Official" : "Resmi", + "Approved" : "Disetujui", + "Experimental" : "Uji Coba", "All" : "Semua", "Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use." : "Aplikasi resmi dikembangkan oleh komunitas ownCloud. Mereka menawarkan fitur pusat bagi ownCloud dan siap digunakan untuk penggunaan produksi.", "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Aplikasi tersetujui dikembangkan oleh pengembang terpercaya dan telah lulus pemeriksaan keamanan. Mereka secara aktif dipelihara direpositori kode terbuka dan pemelihara sudah memastikan mereka stabil untuk penggunaan normal.", + "This app is not checked for security issues and is new or known to be unstable. Install at your own risk." : "Apl ini belum diperiksa masalah keamanannya dan masih baru atau biasanya tidak stabil. Instal dengan resiko Anda sendiri.", "Update to %s" : "Perbarui ke %s", "Please wait...." : "Mohon tunggu....", "Error while disabling app" : "Terjadi kesalahan saat menonaktifkan aplikasi", @@ -113,6 +120,7 @@ OC.L10N.register( "PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible." : "PHP tampaknya disetel menjadi strip inline doc blocks. Hal ini akan membuat beberapa aplikasi inti tidak dapat diakses.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Hal ini kemungkinan disebabkan oleh cache/akselerator seperti Zend OPcache atau eAccelerator.", "Your server is running on Microsoft Windows. We highly recommend Linux for optimal user experience." : "Server Anda dijalankan di Microsoft Windows. Kami sangat menyarankan Linux untuk mendapatkan pengalaman pengguna yang optimal.", + "%1$s below version %2$s is installed, for stability and performance reasons we recommend to update to a newer %1$s version." : "%1$s dibawah versi %2$s telah diinstal, untuk alasan kestabilan dan performa, kami menyarankan untuk memperbarui ke versi %1$s yang lebih baru.", "The PHP module 'fileinfo' is missing. We strongly recommend to enable this module to get best results with mime-type detection." : "Module 'fileinfo' pada PHP tidak ada. Kami sangat menyarankan untuk mengaktifkan modul ini untuk mendapatkan hasil terbaik pada proses pendeteksian mime-type.", "System locale can not be set to a one which supports UTF-8." : "Sistem lokal tidak dapat diatur untuk satu yang mendukung UTF-8.", "This means that there might be problems with certain characters in file names." : "Ini artinya mungkin ada masalah dengan karakter tertentu pada nama berkas.", @@ -146,6 +154,7 @@ OC.L10N.register( "Enable encryption" : "Aktifkan enkripsi", "No encryption module loaded, please enable an encryption module in the app menu." : "Tidak ada modul enkripsi yang dimuat, mohon aktifkan modul enkripsi di menu aplikasi.", "Select default encryption module:" : "Pilih modul enkripsi baku:", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the \"Default encryption module\" and run 'occ encryption:migrate'" : "Anda perlu mengganti kunci enkrispi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon aktifkan \"Modul enkripsi standar\" dan jalankan 'occ encryption:migrate'", "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one." : "Anda perlu untuk mengubah kunci enkripsi dari enkripsi lama (ownCloud <= 8.0) ke yang baru.", "Start migration" : "Mulai migrasi", "This is used for sending out notifications." : "Ini digunakan untuk mengirim notifikasi keluar.", @@ -177,6 +186,8 @@ OC.L10N.register( "Improving the config.php" : "Memperbaiki config.php", "Theming" : "Tema", "Hardening and security guidance" : "Panduan Keselamatan dan Keamanan", + "Transactional File Locking is enabled." : "Penguncian Berkas Transaksional diaktifkan.", + "Transactional File Locking is disabled." : "Penguncian Berkas Transaksional dinonaktifkan.", "Version" : "Versi", "Developer documentation" : "Dokumentasi pengembang", "Experimental applications ahead" : "Aplikasi percobaan terdepan", diff --git a/settings/l10n/id.json b/settings/l10n/id.json index 3b11766f1ab..4f0a813c936 100644 --- a/settings/l10n/id.json +++ b/settings/l10n/id.json @@ -1,4 +1,6 @@ { "translations": { + "APCu" : "APCu", + "Redis" : "Redis", "Security & setup warnings" : "Peringatan Keamanan & Pengaturan", "Sharing" : "Berbagi", "Server-side encryption" : "Enkripsi sisi-server", @@ -6,6 +8,7 @@ "Cron" : "Cron", "Email server" : "Server email", "Log" : "Log", + "Server Status" : "Status Server", "Tips & tricks" : "Tips & trik", "Updates" : "Pembaruan", "Authentication error" : "Terjadi kesalahan saat otentikasi", @@ -51,9 +54,13 @@ "Migration in progress. Please wait until the migration is finished" : "Migrasi sedang dalam proses. Mohon tunggu sampai migrasi selesai.", "Migration started …" : "Migrasi dimulai ...", "Sending..." : "Mengirim", + "Official" : "Resmi", + "Approved" : "Disetujui", + "Experimental" : "Uji Coba", "All" : "Semua", "Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use." : "Aplikasi resmi dikembangkan oleh komunitas ownCloud. Mereka menawarkan fitur pusat bagi ownCloud dan siap digunakan untuk penggunaan produksi.", "Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "Aplikasi tersetujui dikembangkan oleh pengembang terpercaya dan telah lulus pemeriksaan keamanan. Mereka secara aktif dipelihara direpositori kode terbuka dan pemelihara sudah memastikan mereka stabil untuk penggunaan normal.", + "This app is not checked for security issues and is new or known to be unstable. Install at your own risk." : "Apl ini belum diperiksa masalah keamanannya dan masih baru atau biasanya tidak stabil. Instal dengan resiko Anda sendiri.", "Update to %s" : "Perbarui ke %s", "Please wait...." : "Mohon tunggu....", "Error while disabling app" : "Terjadi kesalahan saat menonaktifkan aplikasi", @@ -111,6 +118,7 @@ "PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible." : "PHP tampaknya disetel menjadi strip inline doc blocks. Hal ini akan membuat beberapa aplikasi inti tidak dapat diakses.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Hal ini kemungkinan disebabkan oleh cache/akselerator seperti Zend OPcache atau eAccelerator.", "Your server is running on Microsoft Windows. We highly recommend Linux for optimal user experience." : "Server Anda dijalankan di Microsoft Windows. Kami sangat menyarankan Linux untuk mendapatkan pengalaman pengguna yang optimal.", + "%1$s below version %2$s is installed, for stability and performance reasons we recommend to update to a newer %1$s version." : "%1$s dibawah versi %2$s telah diinstal, untuk alasan kestabilan dan performa, kami menyarankan untuk memperbarui ke versi %1$s yang lebih baru.", "The PHP module 'fileinfo' is missing. We strongly recommend to enable this module to get best results with mime-type detection." : "Module 'fileinfo' pada PHP tidak ada. Kami sangat menyarankan untuk mengaktifkan modul ini untuk mendapatkan hasil terbaik pada proses pendeteksian mime-type.", "System locale can not be set to a one which supports UTF-8." : "Sistem lokal tidak dapat diatur untuk satu yang mendukung UTF-8.", "This means that there might be problems with certain characters in file names." : "Ini artinya mungkin ada masalah dengan karakter tertentu pada nama berkas.", @@ -144,6 +152,7 @@ "Enable encryption" : "Aktifkan enkripsi", "No encryption module loaded, please enable an encryption module in the app menu." : "Tidak ada modul enkripsi yang dimuat, mohon aktifkan modul enkripsi di menu aplikasi.", "Select default encryption module:" : "Pilih modul enkripsi baku:", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the \"Default encryption module\" and run 'occ encryption:migrate'" : "Anda perlu mengganti kunci enkrispi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon aktifkan \"Modul enkripsi standar\" dan jalankan 'occ encryption:migrate'", "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one." : "Anda perlu untuk mengubah kunci enkripsi dari enkripsi lama (ownCloud <= 8.0) ke yang baru.", "Start migration" : "Mulai migrasi", "This is used for sending out notifications." : "Ini digunakan untuk mengirim notifikasi keluar.", @@ -175,6 +184,8 @@ "Improving the config.php" : "Memperbaiki config.php", "Theming" : "Tema", "Hardening and security guidance" : "Panduan Keselamatan dan Keamanan", + "Transactional File Locking is enabled." : "Penguncian Berkas Transaksional diaktifkan.", + "Transactional File Locking is disabled." : "Penguncian Berkas Transaksional dinonaktifkan.", "Version" : "Versi", "Developer documentation" : "Dokumentasi pengembang", "Experimental applications ahead" : "Aplikasi percobaan terdepan", diff --git a/settings/l10n/lb.js b/settings/l10n/lb.js index 7fae2ae2f3c..79643dc416a 100644 --- a/settings/l10n/lb.js +++ b/settings/l10n/lb.js @@ -1,6 +1,8 @@ OC.L10N.register( "settings", { + "APCu" : "APCu", + "Redis" : "Redis", "Cron" : "Cron", "Log" : "Log", "Authentication error" : "Authentifikatioun's Fehler", @@ -27,6 +29,7 @@ OC.L10N.register( "Allow resharing" : "Resharing erlaben", "Authentication required" : "Authentifizéierung néideg", "Server address" : "Server Adress", + "Port" : "Port", "More" : "Méi", "Less" : "Manner", "by" : "vun", diff --git a/settings/l10n/lb.json b/settings/l10n/lb.json index 99510c77501..26af461d141 100644 --- a/settings/l10n/lb.json +++ b/settings/l10n/lb.json @@ -1,4 +1,6 @@ { "translations": { + "APCu" : "APCu", + "Redis" : "Redis", "Cron" : "Cron", "Log" : "Log", "Authentication error" : "Authentifikatioun's Fehler", @@ -25,6 +27,7 @@ "Allow resharing" : "Resharing erlaben", "Authentication required" : "Authentifizéierung néideg", "Server address" : "Server Adress", + "Port" : "Port", "More" : "Méi", "Less" : "Manner", "by" : "vun", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 085eb2069c4..bd94ca67754 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -17,4 +17,3 @@ if (!class_exists('PHPUnit_Framework_TestCase')) { } OC_Hook::clear(); -OC_Log::$enabled = false; diff --git a/tests/core/command/config/app/deleteconfigtest.php b/tests/core/command/config/app/deleteconfigtest.php new file mode 100644 index 00000000000..7056e1b1ff9 --- /dev/null +++ b/tests/core/command/config/app/deleteconfigtest.php @@ -0,0 +1,123 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\App; + + +use OC\Core\Command\Config\App\DeleteConfig; +use Test\TestCase; + +class DeleteConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $config; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $config = $this->config = $this->getMockBuilder('OCP\IConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OCP\IConfig $config */ + $this->command = new DeleteConfig($config); + } + + + public function deleteData() { + return [ + [ + 'name', + true, + true, + 0, + 'info', + ], + [ + 'name', + true, + false, + 0, + 'info', + ], + [ + 'name', + false, + false, + 0, + 'info', + ], + [ + 'name', + false, + true, + 1, + 'error', + ], + ]; + } + + /** + * @dataProvider deleteData + * + * @param string $configName + * @param bool $configExists + * @param bool $checkIfExists + * @param int $expectedReturn + * @param string $expectedMessage + */ + public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage) { + $this->config->expects(($checkIfExists) ? $this->once() : $this->never()) + ->method('getAppKeys') + ->with('app-name') + ->willReturn($configExists ? [$configName] : []); + + $this->config->expects(($expectedReturn === 0) ? $this->once() : $this->never()) + ->method('deleteAppValue') + ->with('app-name', $configName); + + $this->consoleInput->expects($this->exactly(2)) + ->method('getArgument') + ->willReturnMap([ + ['app', 'app-name'], + ['name', $configName], + ]); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->with('--error-if-not-exists') + ->willReturn($checkIfExists); + + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->with($this->stringContains($expectedMessage)); + + $this->assertSame($expectedReturn, $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput])); + } +} diff --git a/tests/core/command/config/app/getconfigtest.php b/tests/core/command/config/app/getconfigtest.php new file mode 100644 index 00000000000..1ceeb16ccf4 --- /dev/null +++ b/tests/core/command/config/app/getconfigtest.php @@ -0,0 +1,163 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\App; + + +use OC\Core\Command\Config\App\GetConfig; +use Test\TestCase; + +class GetConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $config; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $config = $this->config = $this->getMockBuilder('OCP\IConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OCP\IConfig $config */ + $this->command = new GetConfig($config); + } + + + public function getData() { + return [ + // String output as json + ['name', 'newvalue', true, null, false, 'json', 0, json_encode('newvalue')], + // String output as plain text + ['name', 'newvalue', true, null, false, 'plain', 0, 'newvalue'], + // String falling back to default output as json + ['name', null, false, 'newvalue', true, 'json', 0, json_encode('newvalue')], + // String falling back without default: error + ['name', null, false, null, false, 'json', 1, null], + + // Int "0" output as json/plain + ['name', 0, true, null, false, 'json', 0, json_encode(0)], + ['name', 0, true, null, false, 'plain', 0, '0'], + // Int "1" output as json/plain + ['name', 1, true, null, false, 'json', 0, json_encode(1)], + ['name', 1, true, null, false, 'plain', 0, '1'], + + // Bool "true" output as json/plain + ['name', true, true, null, false, 'json', 0, json_encode(true)], + ['name', true, true, null, false, 'plain', 0, 'true'], + // Bool "false" output as json/plain + ['name', false, true, null, false, 'json', 0, json_encode(false)], + ['name', false, true, null, false, 'plain', 0, 'false'], + + // Null output as json/plain + ['name', null, true, null, false, 'json', 0, json_encode(null)], + ['name', null, true, null, false, 'plain', 0, 'null'], + + // Array output as json/plain + ['name', ['a', 'b'], true, null, false, 'json', 0, json_encode(['a', 'b'])], + ['name', ['a', 'b'], true, null, false, 'plain', 0, "a\nb"], + // Key array output as json/plain + ['name', [0 => 'a', 1 => 'b'], true, null, false, 'json', 0, json_encode(['a', 'b'])], + ['name', [0 => 'a', 1 => 'b'], true, null, false, 'plain', 0, "a\nb"], + // Associative array output as json/plain + ['name', ['a' => 1, 'b' => 2], true, null, false, 'json', 0, json_encode(['a' => 1, 'b' => 2])], + ['name', ['a' => 1, 'b' => 2], true, null, false, 'plain', 0, "a: 1\nb: 2"], + + ]; + } + + /** + * @dataProvider getData + * + * @param string $configName + * @param mixed $value + * @param bool $configExists + * @param mixed $defaultValue + * @param bool $hasDefault + * @param string $outputFormat + * @param int $expectedReturn + * @param string $expectedMessage + */ + public function testGet($configName, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage) { + $this->config->expects($this->atLeastOnce()) + ->method('getAppKeys') + ->with('app-name') + ->willReturn($configExists ? [$configName] : []); + + if (!$expectedReturn) { + if ($configExists) { + $this->config->expects($this->once()) + ->method('getAppValue') + ->with('app-name', $configName) + ->willReturn($value); + } + } + + $this->consoleInput->expects($this->exactly(2)) + ->method('getArgument') + ->willReturnMap([ + ['app', 'app-name'], + ['name', $configName], + ]); + $this->consoleInput->expects($this->any()) + ->method('getOption') + ->willReturnMap([ + ['default-value', $defaultValue], + ['output', $outputFormat], + ]); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->willReturnMap([ + ['--output', true], + ['--default-value', $hasDefault], + ]); + + if ($expectedMessage !== null) { + global $output; + + $output = ''; + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->willReturnCallback(function($value) { + global $output; + $output .= $value . "\n"; + return $output; + }); + } + + $this->assertSame($expectedReturn, $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput])); + + if ($expectedMessage !== null) { + global $output; + // Remove the trailing newline + $this->assertSame($expectedMessage, substr($output, 0, -1)); + } + } +} diff --git a/tests/core/command/config/app/setconfigtest.php b/tests/core/command/config/app/setconfigtest.php new file mode 100644 index 00000000000..14d7b0cb7b5 --- /dev/null +++ b/tests/core/command/config/app/setconfigtest.php @@ -0,0 +1,118 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\App; + + +use OC\Core\Command\Config\App\SetConfig; +use Test\TestCase; + +class SetConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $config; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $config = $this->config = $this->getMockBuilder('OCP\IConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OCP\IConfig $config */ + $this->command = new SetConfig($config); + } + + + public function setData() { + return [ + [ + 'name', + 'newvalue', + true, + true, + true, + 'info', + ], + [ + 'name', + 'newvalue', + false, + true, + false, + 'comment', + ], + ]; + } + + /** + * @dataProvider setData + * + * @param string $configName + * @param mixed $newValue + * @param bool $configExists + * @param bool $updateOnly + * @param bool $updated + * @param string $expectedMessage + */ + public function testSet($configName, $newValue, $configExists, $updateOnly, $updated, $expectedMessage) { + $this->config->expects($this->once()) + ->method('getAppKeys') + ->with('app-name') + ->willReturn($configExists ? [$configName] : []); + + if ($updated) { + $this->config->expects($this->once()) + ->method('setAppValue') + ->with('app-name', $configName, $newValue); + } + + $this->consoleInput->expects($this->exactly(2)) + ->method('getArgument') + ->willReturnMap([ + ['app', 'app-name'], + ['name', $configName], + ]); + $this->consoleInput->expects($this->any()) + ->method('getOption') + ->with('value') + ->willReturn($newValue); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->with('--update-only') + ->willReturn($updateOnly); + + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->with($this->stringContains($expectedMessage)); + + $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]); + } +} diff --git a/tests/core/command/config/importtest.php b/tests/core/command/config/importtest.php new file mode 100644 index 00000000000..f14880f8bf4 --- /dev/null +++ b/tests/core/command/config/importtest.php @@ -0,0 +1,185 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config; + + +use OC\Core\Command\Config\Import; +use Test\TestCase; + +class ImportTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $config; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $config = $this->config = $this->getMockBuilder('OCP\IConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OCP\IConfig $config */ + $this->command = new Import($config); + } + + public function validateAppsArrayData() { + return [ + [0], + [1], + [null], + ['new \Exception()'], + [json_encode([])], + ]; + } + + /** + * @dataProvider validateAppsArrayData + * + * @param mixed $configValue + */ + public function testValidateAppsArray($configValue) { + $this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]); + $this->assertTrue(true, 'Asserting that no exception is thrown'); + } + + public function validateAppsArrayThrowsData() { + return [ + [false], + [true], + [[]], + [new \Exception()], + ]; + } + + /** + * @dataProvider validateAppsArrayThrowsData + * + * @param mixed $configValue + */ + public function testValidateAppsArrayThrows($configValue) { + try { + $this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]); + $this->fail('Did not throw expected UnexpectedValueException'); + } catch (\UnexpectedValueException $e) { + $this->assertStringStartsWith('Invalid app config value for "app":"name".', $e->getMessage()); + } + } + + public function checkTypeRecursivelyData() { + return [ + [0], + [1], + [null], + ['new \Exception()'], + [json_encode([])], + [false], + [true], + [[]], + [['string']], + [['test' => 'string']], + [['test' => ['sub' => 'string']]], + ]; + } + + /** + * @dataProvider checkTypeRecursivelyData + * + * @param mixed $configValue + */ + public function testCheckTypeRecursively($configValue) { + $this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']); + $this->assertTrue(true, 'Asserting that no exception is thrown'); + } + + public function checkTypeRecursivelyThrowsData() { + return [ + [new \Exception()], + [[new \Exception()]], + [['test' => new \Exception()]], + [['test' => ['sub' => new \Exception()]]], + ]; + } + + /** + * @dataProvider checkTypeRecursivelyThrowsData + * + * @param mixed $configValue + */ + public function testCheckTypeRecursivelyThrows($configValue) { + try { + $this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']); + $this->fail('Did not throw expected UnexpectedValueException'); + } catch (\UnexpectedValueException $e) { + $this->assertStringStartsWith('Invalid system config value for "name"', $e->getMessage()); + } + } + + public function validateArrayData() { + return [ + [['system' => []]], + [['apps' => []]], + [['system' => [], 'apps' => []]], + ]; + } + + /** + * @dataProvider validateArrayData + * + * @param array $configArray + */ + public function testValidateArray($configArray) { + $this->invokePrivate($this->command, 'validateArray', [$configArray]); + $this->assertTrue(true, 'Asserting that no exception is thrown'); + } + + public function validateArrayThrowsData() { + return [ + [[], 'At least one key of the following is expected:'], + [[0 => []], 'Found invalid entries in root'], + [['string' => []], 'Found invalid entries in root'], + ]; + } + + /** + * @dataProvider validateArrayThrowsData + * + * @param mixed $configArray + * @param string $expectedException + */ + public function testValidateArrayThrows($configArray, $expectedException) { + try { + $this->invokePrivate($this->command, 'validateArray', [$configArray]); + $this->fail('Did not throw expected UnexpectedValueException'); + } catch (\UnexpectedValueException $e) { + $this->assertStringStartsWith($expectedException, $e->getMessage()); + } + } +} diff --git a/tests/core/command/config/listconfigstest.php b/tests/core/command/config/listconfigstest.php new file mode 100644 index 00000000000..c9913d83f7f --- /dev/null +++ b/tests/core/command/config/listconfigstest.php @@ -0,0 +1,300 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config; + + +use OC\Core\Command\Config\ListConfigs; +use Test\TestCase; + +class ListConfigsTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $appConfig; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $systemConfig; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + ->disableOriginalConstructor() + ->getMock(); + $appConfig = $this->appConfig = $this->getMockBuilder('OCP\IAppConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OC\SystemConfig $systemConfig */ + /** @var \OCP\IAppConfig $appConfig */ + $this->command = new ListConfigs($systemConfig, $appConfig); + } + + public function listData() { + return [ + [ + 'all', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + false, + json_encode([ + 'system' => [ + 'overwrite.cli.url' => 'http://localhost', + ], + 'apps' => [ + 'core' => [ + 'global_cache_gc_lastrun' => '1430388388', + ], + 'files' => [ + 'enabled' => 'yes', + ], + ], + ]), + ], + [ + 'all', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + true, + json_encode([ + 'system' => [ + 'secret' => 'my secret', + 'overwrite.cli.url' => 'http://localhost', + ], + 'apps' => [ + 'core' => [ + 'global_cache_gc_lastrun' => '1430388388', + ], + 'files' => [ + 'enabled' => 'yes', + ], + ], + ]), + ], + [ + 'system', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + false, + json_encode([ + 'system' => [ + 'overwrite.cli.url' => 'http://localhost', + ], + ]), + ], + [ + 'system', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + true, + json_encode([ + 'system' => [ + 'secret' => 'my secret', + 'overwrite.cli.url' => 'http://localhost', + ], + ]), + ], + [ + 'files', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + false, + json_encode([ + 'apps' => [ + 'files' => [ + 'enabled' => 'yes', + ], + ], + ]), + ], + [ + 'files', + // config.php + [ + 'secret', + 'overwrite.cli.url', + ], + [ + ['secret', 'N;', 'my secret'], + ['overwrite.cli.url', 'N;', 'http://localhost'], + ], + // app config + [ + ['files', false, [ + 'enabled' => 'yes', + ]], + ['core', false, [ + 'global_cache_gc_lastrun' => '1430388388', + ]], + ], + true, + json_encode([ + 'apps' => [ + 'files' => [ + 'enabled' => 'yes', + ], + ], + ]), + ], + ]; + } + + /** + * @dataProvider listData + * + * @param string $app + * @param array $systemConfigs + * @param array $systemConfigMap + * @param array $appConfig + * @param bool $private + * @param string $expected + */ + public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected) { + $this->systemConfig->expects($this->any()) + ->method('getKeys') + ->willReturn($systemConfigs); + $this->systemConfig->expects($this->any()) + ->method('getValue') + ->willReturnMap($systemConfigMap); + + $this->appConfig->expects($this->any()) + ->method('getApps') + ->willReturn(['core', 'files']); + $this->appConfig->expects($this->any()) + ->method('getValues') + ->willReturnMap($appConfig); + + $this->consoleInput->expects($this->once()) + ->method('getArgument') + ->with('app') + ->willReturn($app); + + $this->consoleInput->expects($this->any()) + ->method('getOption') + ->willReturnMap([ + ['output', 'json'], + ['private', $private], + ]); + + global $output; + + $output = ''; + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->willReturnCallback(function($value) { + global $output; + $output .= $value . "\n"; + return $output; + }); + + $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]); + + $this->assertEquals($expected, trim($output, "\n")); + } +} diff --git a/tests/core/command/config/system/deleteconfigtest.php b/tests/core/command/config/system/deleteconfigtest.php new file mode 100644 index 00000000000..aa1f93274c7 --- /dev/null +++ b/tests/core/command/config/system/deleteconfigtest.php @@ -0,0 +1,120 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\System; + + +use OC\Core\Command\Config\System\DeleteConfig; +use Test\TestCase; + +class DeleteConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $systemConfig; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OC\SystemConfig $systemConfig */ + $this->command = new DeleteConfig($systemConfig); + } + + + public function deleteData() { + return [ + [ + 'name', + true, + true, + 0, + 'info', + ], + [ + 'name', + true, + false, + 0, + 'info', + ], + [ + 'name', + false, + false, + 0, + 'info', + ], + [ + 'name', + false, + true, + 1, + 'error', + ], + ]; + } + + /** + * @dataProvider deleteData + * + * @param string $configName + * @param bool $configExists + * @param bool $checkIfExists + * @param int $expectedReturn + * @param string $expectedMessage + */ + public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage) { + $this->systemConfig->expects(($checkIfExists) ? $this->once() : $this->never()) + ->method('getKeys') + ->willReturn($configExists ? [$configName] : []); + + $this->systemConfig->expects(($expectedReturn === 0) ? $this->once() : $this->never()) + ->method('deleteValue') + ->with($configName); + + $this->consoleInput->expects($this->once()) + ->method('getArgument') + ->with('name') + ->willReturn($configName); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->with('--error-if-not-exists') + ->willReturn($checkIfExists); + + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->with($this->stringContains($expectedMessage)); + + $this->assertSame($expectedReturn, $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput])); + } +} diff --git a/tests/core/command/config/system/getconfigtest.php b/tests/core/command/config/system/getconfigtest.php new file mode 100644 index 00000000000..54dcdd434ab --- /dev/null +++ b/tests/core/command/config/system/getconfigtest.php @@ -0,0 +1,160 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\System; + + +use OC\Core\Command\Config\System\GetConfig; +use Test\TestCase; + +class GetConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $systemConfig; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OC\SystemConfig $systemConfig */ + $this->command = new GetConfig($systemConfig); + } + + + public function getData() { + return [ + // String output as json + ['name', 'newvalue', true, null, false, 'json', 0, json_encode('newvalue')], + // String output as plain text + ['name', 'newvalue', true, null, false, 'plain', 0, 'newvalue'], + // String falling back to default output as json + ['name', null, false, 'newvalue', true, 'json', 0, json_encode('newvalue')], + // String falling back without default: error + ['name', null, false, null, false, 'json', 1, null], + + // Int "0" output as json/plain + ['name', 0, true, null, false, 'json', 0, json_encode(0)], + ['name', 0, true, null, false, 'plain', 0, '0'], + // Int "1" output as json/plain + ['name', 1, true, null, false, 'json', 0, json_encode(1)], + ['name', 1, true, null, false, 'plain', 0, '1'], + + // Bool "true" output as json/plain + ['name', true, true, null, false, 'json', 0, json_encode(true)], + ['name', true, true, null, false, 'plain', 0, 'true'], + // Bool "false" output as json/plain + ['name', false, true, null, false, 'json', 0, json_encode(false)], + ['name', false, true, null, false, 'plain', 0, 'false'], + + // Null output as json/plain + ['name', null, true, null, false, 'json', 0, json_encode(null)], + ['name', null, true, null, false, 'plain', 0, 'null'], + + // Array output as json/plain + ['name', ['a', 'b'], true, null, false, 'json', 0, json_encode(['a', 'b'])], + ['name', ['a', 'b'], true, null, false, 'plain', 0, "a\nb"], + // Key array output as json/plain + ['name', [0 => 'a', 1 => 'b'], true, null, false, 'json', 0, json_encode(['a', 'b'])], + ['name', [0 => 'a', 1 => 'b'], true, null, false, 'plain', 0, "a\nb"], + // Associative array output as json/plain + ['name', ['a' => 1, 'b' => 2], true, null, false, 'json', 0, json_encode(['a' => 1, 'b' => 2])], + ['name', ['a' => 1, 'b' => 2], true, null, false, 'plain', 0, "a: 1\nb: 2"], + + ]; + } + + /** + * @dataProvider getData + * + * @param string $configName + * @param mixed $value + * @param bool $configExists + * @param mixed $defaultValue + * @param bool $hasDefault + * @param string $outputFormat + * @param int $expectedReturn + * @param string $expectedMessage + */ + public function testGet($configName, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage) { + $this->systemConfig->expects($this->atLeastOnce()) + ->method('getKeys') + ->willReturn($configExists ? [$configName] : []); + + if (!$expectedReturn) { + if ($configExists) { + $this->systemConfig->expects($this->once()) + ->method('getValue') + ->with($configName) + ->willReturn($value); + } + } + + $this->consoleInput->expects($this->once()) + ->method('getArgument') + ->with('name') + ->willReturn($configName); + $this->consoleInput->expects($this->any()) + ->method('getOption') + ->willReturnMap([ + ['default-value', $defaultValue], + ['output', $outputFormat], + ]); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->willReturnMap([ + ['--output', true], + ['--default-value', $hasDefault], + ]); + + if ($expectedMessage !== null) { + global $output; + + $output = ''; + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->willReturnCallback(function($value) { + global $output; + $output .= $value . "\n"; + return $output; + }); + } + + $this->assertSame($expectedReturn, $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput])); + + if ($expectedMessage !== null) { + global $output; + // Remove the trailing newline + $this->assertSame($expectedMessage, substr($output, 0, -1)); + } + } +} diff --git a/tests/core/command/config/system/setconfigtest.php b/tests/core/command/config/system/setconfigtest.php new file mode 100644 index 00000000000..bbabee9b18f --- /dev/null +++ b/tests/core/command/config/system/setconfigtest.php @@ -0,0 +1,115 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Tests\Core\Command\Config\System; + + +use OC\Core\Command\Config\System\SetConfig; +use Test\TestCase; + +class SetConfigTest extends TestCase { + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $systemConfig; + + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleInput; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $consoleOutput; + + /** @var \Symfony\Component\Console\Command\Command */ + protected $command; + + protected function setUp() { + parent::setUp(); + + $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface'); + $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + + /** @var \OC\SystemConfig $systemConfig */ + $this->command = new SetConfig($systemConfig); + } + + + public function setData() { + return [ + [ + 'name', + 'newvalue', + true, + true, + true, + 'info', + ], + [ + 'name', + 'newvalue', + false, + true, + false, + 'comment', + ], + ]; + } + + /** + * @dataProvider setData + * + * @param string $configName + * @param mixed $newValue + * @param bool $configExists + * @param bool $updateOnly + * @param bool $updated + * @param string $expectedMessage + */ + public function testSet($configName, $newValue, $configExists, $updateOnly, $updated, $expectedMessage) { + $this->systemConfig->expects($this->once()) + ->method('getKeys') + ->willReturn($configExists ? [$configName] : []); + + if ($updated) { + $this->systemConfig->expects($this->once()) + ->method('setValue') + ->with($configName, $newValue); + } + + $this->consoleInput->expects($this->once()) + ->method('getArgument') + ->with('name') + ->willReturn($configName); + $this->consoleInput->expects($this->any()) + ->method('getOption') + ->with('value') + ->willReturn($newValue); + $this->consoleInput->expects($this->any()) + ->method('hasParameterOption') + ->with('--update-only') + ->willReturn($updateOnly); + + $this->consoleOutput->expects($this->any()) + ->method('writeln') + ->with($this->stringContains($expectedMessage)); + + $this->invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]); + } +} diff --git a/tests/files/file_put_contents.txt b/tests/files/file_put_contents.txt deleted file mode 100644 index e69de29bb2d..00000000000 --- a/tests/files/file_put_contents.txt +++ /dev/null diff --git a/tests/lib/app/dependencyanalyzer.php b/tests/lib/app/dependencyanalyzer.php index d73bac5a2a7..58f1c0a7a99 100644 --- a/tests/lib/app/dependencyanalyzer.php +++ b/tests/lib/app/dependencyanalyzer.php @@ -68,6 +68,10 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { /** * @dataProvider providesPhpVersion + * + * @param string $expectedMissing + * @param string $minVersion + * @param string $maxVersion */ public function testPhpVersion($expectedMissing, $minVersion, $maxVersion) { $app = array( @@ -106,6 +110,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { /** * @dataProvider providesCommands + * + * @param string $expectedMissing + * @param string|null $commands */ public function testCommand($expectedMissing, $commands) { $app = array( @@ -179,6 +186,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { $this->assertEquals($expectedMissing, $missing); } + /** + * @return array + */ function providesOC() { return array( // no version -> no missing dependency @@ -188,10 +198,13 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { array(array(), array('@attributes' => array('min-version' => '8.0.2', 'max-version' => '8.0.2'))), array(array('ownCloud 8.0.3 or higher is required.'), array('@attributes' => array('min-version' => '8.0.3'))), array(array('ownCloud 9 or higher is required.'), array('@attributes' => array('min-version' => '9'))), - array(array('ownCloud with a version lower than 8.0.1 is required.'), array('@attributes' => array('max-version' => '8.0.1'))), + [['ownCloud 8.0.1 or lower is required.'], ['@attributes' => ['max-version' => '8.0.1']]], ); } + /** + * @return array + */ function providesOS() { return array( array(array(), null), @@ -201,6 +214,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { ); } + /** + * @return array + */ function providesLibs() { return array( // we expect curl to exist @@ -226,6 +242,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { ); } + /** + * @return array + */ function providesCommands() { return array( array(array(), null), @@ -240,6 +259,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { ); } + /** + * @return array + */ function providesDatabases() { return array( // non BC - in case on databases are defined -> all are supported @@ -250,6 +272,9 @@ class DependencyAnalyzer extends \PHPUnit_Framework_TestCase { ); } + /** + * @return array + */ function providesPhpVersion() { return array( array(array(), null, null), diff --git a/tests/lib/appconfig.php b/tests/lib/appconfig.php index adff45706cc..5a2cb3f88fc 100644 --- a/tests/lib/appconfig.php +++ b/tests/lib/appconfig.php @@ -68,7 +68,6 @@ class Test_Appconfig extends \Test\TestCase { public function getAppConfigs() { return [ - ['\OC_Appconfig'], [new \OC\AppConfig(\OC::$server->getDatabaseConnection())], ]; } diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php index cdd8d269b41..692237f57b2 100644 --- a/tests/lib/appframework/http/JSONResponseTest.php +++ b/tests/lib/appframework/http/JSONResponseTest.php @@ -76,6 +76,17 @@ class JSONResponseTest extends \Test\TestCase { $this->assertEquals($expected, $this->json->render()); } + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not json_encode due to invalid non UTF-8 characters in the array: array ( + * @requires PHP 5.5 + */ + public function testRenderWithNonUtf8Encoding() { + $params = ['test' => hex2bin('e9')]; + $this->json->setData($params); + $this->json->render(); + } + public function testConstructorAllowsToSetData() { $data = array('hi'); $code = 300; diff --git a/tests/lib/files/mapper.php b/tests/lib/files/mapper.php deleted file mode 100644 index cd35d4f8fc3..00000000000 --- a/tests/lib/files/mapper.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -/** - * ownCloud - * - * @author Thomas Müller - * @copyright 2013 Thomas Müller thomas.mueller@owncloud.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU AFFERO GENERAL PUBLIC LICENSE for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - -namespace Test\Files; - -class Mapper extends \Test\TestCase { - - /** - * @var \OC\Files\Mapper - */ - private $mapper = null; - - protected function setUp() { - parent::setUp(); - $this->mapper = new \OC\Files\Mapper('D:/'); - } - - public function slugifyPathData() { - return array( - // with extension - array('D:/text.txt', 'D:/text.txt'), - array('D:/text-2.txt', 'D:/text.txt', 2), - array('D:/a/b/text.txt', 'D:/a/b/text.txt'), - - // without extension - array('D:/text', 'D:/text'), - array('D:/text-2', 'D:/text', 2), - array('D:/a/b/text', 'D:/a/b/text'), - - // with double dot - array('D:/text.text.txt', 'D:/text.text.txt'), - array('D:/text.text-2.txt', 'D:/text.text.txt', 2), - array('D:/a/b/text.text.txt', 'D:/a/b/text.text.txt'), - - // foldername and filename with periods - array('D:/folder.name.with.periods', 'D:/folder.name.with.periods'), - array('D:/folder.name.with.periods/test-2.txt', 'D:/folder.name.with.periods/test.txt', 2), - array('D:/folder.name.with.periods/test.txt', 'D:/folder.name.with.periods/test.txt'), - - // foldername and filename with periods and spaces - array('D:/folder.name.with.peri-ods', 'D:/folder.name.with.peri ods'), - array('D:/folder.name.with.peri-ods/te-st-2.t-x-t', 'D:/folder.name.with.peri ods/te st.t x t', 2), - array('D:/folder.name.with.peri-ods/te-st.t-x-t', 'D:/folder.name.with.peri ods/te st.t x t'), - - /** - * If a foldername is empty, after we stripped out some unicode and other characters, - * the resulting name must be reproducable otherwise uploading a file into that folder - * will not write the file into the same folder. - */ - array('D:/' . md5('ありがとう'), 'D:/ありがとう'), - array('D:/' . md5('ありがとう') . '/issue6722.txt', 'D:/ありがとう/issue6722.txt'), - array('D:/' . md5('.htaccess'), 'D:/.htaccess'), - array('D:/' . md5('.htaccess.'), 'D:/.htaccess.'), - array('D:/' . md5('.htAccess'), 'D:/.htAccess'), - array('D:/' . md5('.htAccess\\…\\') . '/a', 'D:/.htAccess\…\/とa'), - array('D:/' . md5('.htaccess-'), 'D:/.htaccess-'), - array('D:/' . md5('.htaあccess'), 'D:/.htaあccess'), - array('D:/' . md5(' .htaccess'), 'D:/ .htaccess'), - array('D:/' . md5('.htaccess '), 'D:/.htaccess '), - array('D:/' . md5(' .htaccess '), 'D:/ .htaccess '), - ); - } - - /** - * @dataProvider slugifyPathData - */ - public function testSlugifyPath($slug, $path, $index = null) { - $this->assertEquals($slug, $this->mapper->slugifyPath($path, $index)); - } -} diff --git a/tests/lib/files/storage/copydirectory.php b/tests/lib/files/storage/copydirectory.php new file mode 100644 index 00000000000..3338747f49b --- /dev/null +++ b/tests/lib/files/storage/copydirectory.php @@ -0,0 +1,46 @@ +<?php +/** + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace Test\Files\Storage; + +use OC\Files\Storage\Temporary; + +class StorageNoRecursiveCopy extends Temporary { + public function copy($path1, $path2) { + if ($this->is_dir($path1)) { + return false; + } + return copy($this->getSourcePath($path1), $this->getSourcePath($path2)); + } +} + +class CopyDirectoryStorage extends StorageNoRecursiveCopy { + use \OC\Files\Storage\PolyFill\CopyDirectory; +} + +class CopyDirectory extends Storage { + + protected function setUp() { + parent::setUp(); + $this->instance = new CopyDirectoryStorage([]); + } +} + diff --git a/tests/lib/files/storage/mappedlocal.php b/tests/lib/files/storage/mappedlocal.php deleted file mode 100644 index 1e87b53d00a..00000000000 --- a/tests/lib/files/storage/mappedlocal.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** -* ownCloud -* -* @author Robin Appelman -* @copyright 2012 Robin Appelman icewind@owncloud.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -namespace Test\Files\Storage; - -class MappedLocal extends Storage { - /** - * @var string tmpDir - */ - private $tmpDir; - protected function setUp() { - parent::setUp(); - - $this->tmpDir=\OC_Helper::tmpFolder(); - $this->instance=new \OC\Files\Storage\MappedLocal(array('datadir'=>$this->tmpDir)); - } - - protected function tearDown() { - \OC_Helper::rmdirr($this->tmpDir); - unset($this->instance); - parent::tearDown(); - } -} - diff --git a/tests/lib/files/storage/mappedlocalwithdotteddatadir.php b/tests/lib/files/storage/mappedlocalwithdotteddatadir.php deleted file mode 100644 index 3a733b7b469..00000000000 --- a/tests/lib/files/storage/mappedlocalwithdotteddatadir.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** -* ownCloud -* -* @author Robin Appelman -* @copyright 2012 Robin Appelman icewind@owncloud.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - -namespace Test\Files\Storage; - -class MappedLocalWithDottedDataDir extends Storage { - /** - * @var string tmpDir - */ - private $tmpDir; - - protected function setUp() { - parent::setUp(); - - $this->tmpDir = \OC_Helper::tmpFolder().'dir.123'.DIRECTORY_SEPARATOR; - mkdir($this->tmpDir); - $this->instance=new \OC\Files\Storage\MappedLocal(array('datadir'=>$this->tmpDir)); - } - - protected function tearDown() { - \OC_Helper::rmdirr($this->tmpDir); - unset($this->instance); - parent::tearDown(); - } -} - diff --git a/tests/lib/logger.php b/tests/lib/logger.php index 9a9f5be12fc..c8566988cf4 100644 --- a/tests/lib/logger.php +++ b/tests/lib/logger.php @@ -40,7 +40,7 @@ class Logger extends TestCase { $this->config->expects($this->any()) ->method('getValue') ->will(($this->returnValueMap([ - ['loglevel', \OC_Log::WARN, \OC_Log::WARN], + ['loglevel', \OCP\Util::WARN, \OCP\Util::WARN], ['log.condition', [], ['apps' => ['files']]] ]))); $logger = $this->logger; diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php index 92f6b612688..e225f2a4002 100644 --- a/tests/lib/share/share.php +++ b/tests/lib/share/share.php @@ -74,8 +74,8 @@ class Test_Share extends \Test\TestCase { OCP\Share::registerBackend('test', 'Test_Share_Backend'); OC_Hook::clear('OCP\\Share'); OC::registerShareHooks(); - $this->resharing = OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'); - OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes'); + $this->resharing = \OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes'); // 20 Minutes in the past, 20 minutes in the future. $now = time(); @@ -87,7 +87,7 @@ class Test_Share extends \Test\TestCase { protected function tearDown() { $query = OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?'); $query->execute(array('test')); - OC_Appconfig::setValue('core', 'shareapi_allow_resharing', $this->resharing); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', $this->resharing); OC_User::deleteUser($this->user1); OC_User::deleteUser($this->user2); @@ -486,8 +486,8 @@ class Test_Share extends \Test\TestCase { ); // exclude group2 from sharing - \OC_Appconfig::setValue('core', 'shareapi_exclude_groups_list', $this->group2); - \OC_Appconfig::setValue('core', 'shareapi_exclude_groups', "yes"); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', $this->group2); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', "yes"); OC_User::setUserId($this->user4); @@ -496,8 +496,8 @@ class Test_Share extends \Test\TestCase { $this->assertSame(\OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_SHARE, $share['permissions'], 'Failed asserting that user 4 is excluded from re-sharing'); - \OC_Appconfig::deleteKey('core', 'shareapi_exclude_groups_list'); - \OC_Appconfig::deleteKey('core', 'shareapi_exclude_groups'); + \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_exclude_groups_list'); + \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_exclude_groups'); } @@ -569,8 +569,8 @@ class Test_Share extends \Test\TestCase { } catch (Exception $exception) { $this->assertEquals($message, $exception->getMessage()); } - $policy = OC_Appconfig::getValue('core', 'shareapi_only_share_with_group_members', 'no'); - OC_Appconfig::setValue('core', 'shareapi_only_share_with_group_members', 'yes'); + $policy = \OC::$server->getAppConfig()->getValue('core', 'shareapi_only_share_with_group_members', 'no'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_only_share_with_group_members', 'yes'); $message = 'Sharing test.txt failed, because '.$this->user1.' is not a member of the group '.$this->group2; try { OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group2, \OCP\Constants::PERMISSION_READ); @@ -578,7 +578,7 @@ class Test_Share extends \Test\TestCase { } catch (Exception $exception) { $this->assertEquals($message, $exception->getMessage()); } - OC_Appconfig::setValue('core', 'shareapi_only_share_with_group_members', $policy); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_only_share_with_group_members', $policy); // Valid share $this->shareUserOneTestFileWithGroupOne(); @@ -1224,9 +1224,9 @@ class Test_Share extends \Test\TestCase { public function testClearExpireDateWhileEnforced() { OC_User::setUserId($this->user1); - \OC_Appconfig::setValue('core', 'shareapi_default_expire_date', 'yes'); - \OC_Appconfig::setValue('core', 'shareapi_expire_after_n_days', '2'); - \OC_Appconfig::setValue('core', 'shareapi_enforce_expire_date', 'yes'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_default_expire_date', 'yes'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '2'); + \OC::$server->getAppConfig()->setValue('core', 'shareapi_enforce_expire_date', 'yes'); $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ); $this->assertInternalType( @@ -1247,9 +1247,9 @@ class Test_Share extends \Test\TestCase { $this->assertTrue($setExpireDateFailed); - \OC_Appconfig::deleteKey('core', 'shareapi_default_expire_date'); - \OC_Appconfig::deleteKey('core', 'shareapi_expire_after_n_days'); - \OC_Appconfig::deleteKey('core', 'shareapi_enforce_expire_date'); + \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_default_expire_date'); + \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_expire_after_n_days'); + \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_enforce_expire_date'); } /** diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php index 407c5165140..fd0b8d5f2de 100644 --- a/tests/lib/testcase.php +++ b/tests/lib/testcase.php @@ -99,7 +99,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { public static function tearDownAfterClass() { $dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest'); - self::tearDownAfterClassCleanFileMapper($dataDir); self::tearDownAfterClassCleanStorages(); self::tearDownAfterClassCleanFileCache(); self::tearDownAfterClassCleanStrayDataFiles($dataDir); @@ -110,18 +109,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { } /** - * Remove all entries from the files map table - * - * @param string $dataDir - */ - static protected function tearDownAfterClassCleanFileMapper($dataDir) { - if (\OC_Util::runningOnWindows()) { - $mapper = new \OC\Files\Mapper($dataDir); - $mapper->removePath($dataDir, true, true); - } - } - - /** * Remove all entries from the storages table * * @throws \OC\DatabaseException diff --git a/version.php b/version.php index 341e82671ea..1e112ca86db 100644 --- a/version.php +++ b/version.php @@ -22,7 +22,7 @@ // We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // when updating major/minor version number. -$OC_Version=array(8, 2, 0, 0); +$OC_Version=array(8, 2, 0, 1); // The human readable string $OC_VersionString='8.2 pre alpha'; |