Compare commits

...

455 Commits

Author SHA1 Message Date
Andreas Fischer 5ac339b866 Document memcached settings in config.sample.php 2013-12-09 14:35:20 +01:00
Morris Jobke 95c90ddbc4 fix wrong test data in l10n 2013-12-09 10:41:57 +01:00
Morris Jobke 2417c8a49e fix plural translation - fixes #6226 2013-12-09 10:41:51 +01:00
Frank Karlitschek 26d0adf2fe 6.0.0 2013-12-06 21:20:22 +01:00
Frank Karlitschek 734fdbddea RC4 2013-12-06 21:06:42 +01:00
Robin Appelman 33144941a9 add test case for removing background jobs that are throwing exceptions 2013-12-06 20:58:12 +01:00
Robin Appelman f309920bef Dont use exceptions for the backgroundjob test cases 2013-12-06 20:58:06 +01:00
Robin Appelman e78a309111 remove background jobs if they are failing 2013-12-06 20:57:58 +01:00
Robin Appelman 46a4ad4f3c Catch exceptions from background jobs and log them 2013-12-06 20:57:52 +01:00
Frank Karlitschek 3842c0d766 Merge pull request #6225 from owncloud/stable6-backgroundscan-reuse-etag
Stable6 backgroundscan reuse etag
2013-12-06 11:55:23 -08:00
Robin Appelman 8369c1f05b get rid of failing test that don't cause additional downloads 2013-12-06 19:19:10 +01:00
Robin Appelman cadf1c232e extend test case for etag preservation 2013-12-06 19:19:10 +01:00
Robin Appelman 713651738c reuse etags when doing a background scan 2013-12-06 19:19:10 +01:00
Bart Visscher 1475245465 XSendfile and encryption don't work together
The file on disk is encrypted, and not readable on client systems
2013-12-06 19:07:22 +01:00
Bart Visscher 281bbf4bd4 Don't try to encrypt a file when the temp file isn't created 2013-12-06 19:07:11 +01:00
Bart Visscher a2bbbb1448 Users of getFolderContent are mostly interested in the unecrypted file size 2013-12-06 19:06:42 +01:00
root 87a28957aa correctly propagate the return value of ldap_set_option
otherwise LDAP_OPT_REFERRALS won't be set to 0 and in turn
active directory paging will stop working
(Operations error on ldap_control_paged_result_response)
2013-12-06 18:01:42 +01:00
Bjoern Schiessle 01de6c565a set unencrypted_size to 0 after decryption... so that the unencrypted_size gets re-calculated if encryption was enabled again 2013-12-06 17:08:17 +01:00
Bjoern Schiessle f3e341edac add a optional parameter to skip check for expired files, this is necessary to find out to whom a file was shared after it was expired. 2013-12-06 14:42:09 +01:00
Bjoern Schiessle c5d6af3c5a get owner from share item, if we expire a share while the user updates his /Shared folder than the owner is different from the currently logged in user 2013-12-06 14:41:59 +01:00
Bjoern Schiessle cc1577054d it is not possible to unshare files 2013-12-06 12:36:31 +01:00
Björn Schießle 3e6b18b2d0 Merge pull request #6208 from owncloud/enc_only_create_new_key_if_no_other_key_exists
[Encryption] Only create new key if no other key exists
2013-12-06 03:07:52 -08:00
Nico Kaiser 7eb505e6dd Fix user's displayName being overwritten by (old) cookie 2013-12-05 20:56:41 +01:00
Bjoern Schiessle 91ca1cf985 fix typo 2013-12-05 20:02:41 +01:00
Bjoern Schiessle f8a4bcdd50 only create new key on password change if a recovery key exists or if the user don't have any private/public keys 2013-12-05 19:41:01 +01:00
Bjoern Schiessle 418d401bf9 show change password form if key couldn't be decrypted 2013-12-05 18:50:52 +01:00
Bjoern Schiessle d0afd774b7 add method to check if users private/public key exists 2013-12-05 18:49:55 +01:00
Morris Jobke 0af65cae37 fix appearance of error message - .errors is outdated 2013-12-05 16:11:52 +01:00
Frank Karlitschek 4d50fe5f12 ownCloud 6 RC3 2013-12-05 12:02:53 +01:00
Vincent Petry f24aca61a9 Merge pull request #6180 from owncloud/fix_6143
fixes checkboxes in Advanced Tab don't save unchecked state anymore, #6143
2013-12-04 08:33:12 -08:00
Bjoern Schiessle d3e2226b38 config switch to disable auto expire for the trash bin 2013-12-04 16:55:07 +01:00
Arthur Schiwon 73fa6259be LDAP Wizard: avoid a manually deactivated LDAP configuration is enabled by just opening the admin page 2013-12-04 14:01:31 +01:00
Morris Jobke dffc2a8b1c Revert "Adjust files_encryption requirements to the new core requirement (PHP 5.3.8)."
This reverts commit efbf18652c.
2013-12-04 13:26:59 +01:00
Vincent Petry fd634fdec8 Added unit test for the test() method
This is to make sure that method isn't broken
2013-12-04 13:22:25 +01:00
Arthur Schiwon 328ebaefde LDAP: make unsetting checkboxes from Advanced tab work again, fixes #6143 2013-12-04 13:15:17 +01:00
Thomas Müller 4de8c4e5db Merge pull request #6175 from owncloud/fix_6142
LDAP Wizard: make sure auto-detected suggestions are really applied initially, fixes #6142
2013-12-04 02:54:07 -08:00
Frank Karlitschek 8dc3cb2ffb lower required php version to 5.3.3 2013-12-04 10:51:12 +01:00
Arthur Schiwon c67ece0f6b LDAP Wizard: don't generate filter when not allowed 2013-12-03 20:50:46 +01:00
Arthur Schiwon 6640e120b7 some equals are more equal than other equals 2013-12-03 20:45:05 +01:00
Thomas Mueller 6f7b394d99 fixing PHPDoc and spelling 2013-12-03 17:49:37 +01:00
Andreas Fischer 91f47645b0 Use getLastError() everywhere. 2013-12-03 17:49:37 +01:00
Andreas Fischer 18903cc8f7 Add getLastError() 2013-12-03 17:49:37 +01:00
Andreas Fischer 7e467484a8 No function as oci_last_error. It's oci_error. 2013-12-03 17:49:37 +01:00
Andreas Fischer 21bf6abd41 There is no property such as dbusername. It's 'dbuser'. 2013-12-03 17:49:37 +01:00
Andreas Fischer 401728b2a2 Correct property name. It's 'dbpassword', with the 'db' prefix. 2013-12-03 17:49:37 +01:00
Andreas Fischer bfd0dc3314 Correct property name. It's just 'tableprefix', without the 'db' prefix. 2013-12-03 17:49:37 +01:00
Jan-Christoph Borchardt ad92b12559 fix time input field properly, details 2013-12-03 17:42:03 +01:00
Morris Jobke 4391992b8c fix public page - gallery view issues 2013-12-03 17:20:29 +01:00
Morris Jobke 728e6d735a fix trashbin and pbulic page controls 2013-12-03 17:20:23 +01:00
Morris Jobke 66df8c3bb3 fix and cleanup CSS for public page 2013-12-03 17:20:17 +01:00
Jan-Christoph Borchardt ca08d21da0 change different shades of grey for public share page to white 2013-12-03 17:20:08 +01:00
Jan-Christoph Borchardt 7d0f458f11 remove app specific code 2013-12-03 17:20:00 +01:00
Jan-Christoph Borchardt f15aeb3bbc fix details for buttons in header and controls bar 2013-12-03 17:19:53 +01:00
Jan-Christoph Borchardt 9333244925 account for shift of controls bar due to app navigation, do not shift on public page 2013-12-03 17:19:38 +01:00
Vincent Petry 50f5ab8515 Merge pull request #6173 from owncloud/stable6-extstorage-s3fixes
Backport of S3 ext storage fixes to stable6
2013-12-03 08:16:10 -08:00
Arthur Schiwon 4df0d2e7e8 LDAP Wizard: return correct var 2013-12-03 16:37:11 +01:00
Vincent Petry f2e17a0b68 Fixed placeholder after page reload
The placeholder somehow had too many characters stripping from it...
2013-12-03 15:55:24 +01:00
Vincent Petry e372971f2b Fixed test function for S3
Fixes #5752
2013-12-03 15:55:15 +01:00
Vincent Petry 3bf30377b8 Fixed Amazon S3 ext storage config UI
Optional parameters are now really optional

Fixes #5861
2013-12-03 15:55:08 +01:00
Arthur Schiwon 67b67b6d66 LDAP Wizard: make sure auto-detected suggestions are really applied initially. Also make initial filter compilation and user counting robust against race conditions. 2013-12-03 13:27:45 +01:00
Arthur Schiwon b8390f15d4 LDAP: on testing configuration, set active property to true, otherwise inactive connections cannot be tested properly 2013-12-03 13:21:55 +01:00
Robin Appelman 5ac3f9bfa5 check if a directory exists before we try to remove it 2013-12-03 12:45:41 +01:00
Arthur Schiwon 02fe013d2f LDAP: set default value for login filter to empty, otherwise the wizard signals completed configuration too early when it might be not correct, i.e. login won't work 2013-12-03 12:11:43 +01:00
Bjoern Schiessle 5e5e4fe3a4 make it possible to select folders 2013-12-02 22:23:51 +01:00
Arthur Schiwon d49e4e53fd LDAP Wizard: don't send ldap_tls change back to the interface as the element was removed, for it is detected fully automatically. Resolves an JS error and thus an ever-spinning spinner 2013-12-02 21:11:20 +01:00
Bjoern Schiessle 2d11290121 check explicitely all possible dir values 2013-12-02 16:06:51 +01:00
Bjoern Schiessle 1a197292da set delete all to true if a complete folder was deleted 2013-12-02 16:06:36 +01:00
Bjoern Schiessle 3b59979746 fix delete files from trash bin 2013-12-02 16:06:24 +01:00
Bjoern Schiessle 259d619af3 fix restore from files in sub-folders 2013-12-02 16:06:14 +01:00
Frank Karlitschek c2e83e635d ownCloud 6 RC2 2013-12-02 00:10:28 +01:00
Thomas Müller 832be7c908 Merge pull request #6052 from owncloud/datetime-doctrine
Get rid of date strings for DB. Completely use Doctrine and DateTime.
2013-12-01 01:29:35 -08:00
Thomas Müller c2b11cae83 Merge pull request #6132 from owncloud/encryption-version-bump
Adjust files_encryption requirements to the new core requirement (PHP 5.3.8)
2013-11-29 15:20:54 -08:00
Andreas Fischer efbf18652c Adjust files_encryption requirements to the new core requirement (PHP 5.3.8). 2013-11-29 20:34:57 +01:00
Vincent Petry baa587fd3c Merge pull request #6123 from owncloud/extstorage-deletedirs2
Fixed FTP and SMB to use rmdir() when deleting folders
2013-11-29 11:23:02 -08:00
Thomas Müller 338a55e36c Merge pull request #6128 from owncloud/fix-6126-master
Also merge autoconfig variables into $_REQUEST.
2013-11-29 11:22:44 -08:00
Jenkins for ownCloud 1b18c5a047 [tx-robot] updated from transifex 2013-11-29 14:10:40 -05:00
Frank Karlitschek 3c62de90fd Merge pull request #6129 from owncloud/chunking-fixtouchafterassemble
Fixed touch after chunk assembling
2013-11-29 09:19:51 -08:00
Morris Jobke 0d464421ed Merge pull request #6127 from owncloud/minimum_php_version
make 5.3.8 the minimum supported version.
2013-11-29 08:07:43 -08:00
Vincent Petry 80d2371f97 Fixed touch after chunk assembling
Fixed touch after chunk assembling which was using the wrong path,
resulting in the creation of an extra file.

Fixes #6007
2013-11-29 16:29:35 +01:00
Andreas Fischer 2ec085b51f Also merge autoconfig variables into $_REQUEST. 2013-11-29 16:24:48 +01:00
Frank Karlitschek 7ca0de9bd3 make 5.3.8 the minimum supported version. This fixes several issues with broken PHP versions like: https://github.com/owncloud/core/issues/5734
Also make the version compare clearer. It was pure luck that floatval on a php version returned the correct value.
2013-11-29 15:46:10 +01:00
Vincent Petry d69243ee51 Fixed FTP and SMB to use rmdir() when deleting folders
Some storages need to use different calls for deleting files or folders,
usually unlink() and rmdir().

Fixes #4532 (SMB dir deletion)
Fixes #5941 (FTP dir deletion)

Note that the extra is_dir() should be fast because it's read from the
stat cache.
2013-11-29 13:01:01 +01:00
Frank Karlitschek 1dc931b778 Merge pull request #5984 from owncloud/nav-scrollbar
always show app navigation scrollbar when too many apps in there
2013-11-29 03:27:50 -08:00
Frank Karlitschek a03ba06dcd Merge pull request #6077 from owncloud/fix-api-documentation
API doc for contacts manager, server container and share
2013-11-29 03:24:19 -08:00
Frank Karlitschek 0b698e6901 Merge pull request #6111 from owncloud/non-floating-trash-button-chrome
Fix resize issue for trash button in chrome and overflowing spinner in ....
2013-11-29 02:44:49 -08:00
Morris Jobke 41a1a32e5a Merge pull request #6099 from owncloud/fix_source_not_found_warnings
make sure that we don't try to access an already deleted files
2013-11-28 12:59:24 -08:00
Morris Jobke 0cbe9d79ba Merge pull request #6106 from owncloud/fix_preview_creation
Fix preview creation
2013-11-28 12:48:19 -08:00
Morris Jobke 587fc1aff3 Fix resize issue for trash button in chrome and overflowing spinner in .update class
fixes #6108
2013-11-28 21:36:43 +01:00
Bjoern Schiessle b3724cd9c6 remove duplicate 2013-11-28 20:58:32 +01:00
Bjoern Schiessle 348706854c use better coding style 2013-11-28 19:31:35 +01:00
Bjoern Schiessle 466ed01e5d correctFolder() already resolves the dirname internally 2013-11-28 19:25:49 +01:00
Bjoern Schiessle bdfef554c4 add PHPDoc for setMimetype() 2013-11-28 19:05:43 +01:00
Bjoern Schiessle bef5108218 detect mimetype from the original filename, without the versioning timestamp 2013-11-28 18:59:38 +01:00
Bjoern Schiessle 863aedf784 detect mimetype from the original filename, without the delete timestamp 2013-11-28 18:59:12 +01:00
Bjoern Schiessle eeb31420fe we need to be able to set the mimetype manually 2013-11-28 18:52:58 +01:00
ganomi f723bf744a Merge pull request #6090 from ganomi/summaryfix
Fix filellist/rename/summary problem
2013-11-28 08:00:41 -08:00
Morris Jobke 3a31f7eb4a Merge pull request #6097 from owncloud/extstorage-ftptrailingslash
Add trailing slash in FTP root path when missing
2013-11-28 04:52:08 -08:00
Morris Jobke 603613e6e6 Merge pull request #6098 from owncloud/files-renamediriconfix
Fixed directory icon after rename
2013-11-28 04:50:17 -08:00
Morris Jobke b87e88b48a Merge pull request #6100 from owncloud/fix_loginnameusage
loginname is not necessarily username
2013-11-28 04:46:54 -08:00
Bjoern Schiessle eaedda2116 make sure that we don't try to access an already deleted files, fixes some file source not found warnings 2013-11-28 13:31:08 +01:00
Arthur Schiwon ee78d48186 loginname is not necessarily username 2013-11-28 13:26:31 +01:00
Vincent Petry da1a89fd15 Fixed directory icon after rename 2013-11-28 13:15:20 +01:00
Frank Karlitschek f361036cf8 ownCloud 6 RC1 2013-11-28 13:00:02 +01:00
Frank Karlitschek dab3629ff5 Merge pull request #6089 from owncloud/files-mimetyperefreshafterrename
Redetect mime type whenever extension is renamed
2013-11-28 03:46:42 -08:00
Vincent Petry 30b2ed588b Merge pull request #6096 from owncloud/files-txtextfornewfiles
New file box now has default file name + extension
2013-11-28 03:38:58 -08:00
Vincent Petry 84f3dd15a6 Add trailing slash in FTP root path when missing
Fixes #6093
2013-11-28 11:45:26 +01:00
Frank Karlitschek 6c16d45dc7 Merge pull request #6070 from ganomi/showstars
Show stars as password placeholder for sharing
2013-11-28 02:16:44 -08:00
Frank Karlitschek d2567129a1 Merge pull request #6072 from owncloud/mssql-fix-schema-migration-oc6
on mssql the schema migration sometimes fails due to an already existing...
2013-11-28 02:16:16 -08:00
Vincent Petry 69a3327f47 Moved new file extension out of the translated string 2013-11-28 10:52:59 +01:00
Vincent Petry a1d2f0f516 Merge pull request #6094 from owncloud/enc_fix_reshares
fix path reconstruction for reshares
2013-11-28 01:41:34 -08:00
Vincent Petry 24a08c686d New file box now has default file name + extension
Whenever a user creates a file or folder in the web UI, the input field
will contain a default file name, pre-selected up to the extension for
easier typing.

The purpose is mostly to prevent users creating text files without an
extension.

Fixes #6045
2013-11-28 10:18:31 +01:00
Thomas Müller f23d641b82 Merge pull request #6084 from owncloud/fix-app-routing
fix custom routes defined by apps
2013-11-28 00:00:09 -08:00
Bjoern Schiessle efe7c4075a fix path reconstruction for reshares 2013-11-27 23:26:04 +01:00
Vincent Petry bc64931cd0 Fixed unit tests for ajax rename 2013-11-27 23:19:57 +01:00
Morris Jobke 54b24ca88d Merge pull request #6048 from owncloud/encryption_initial_enc_indicator
show a message at the log-in screen if inital encryption take place
2013-11-27 14:10:11 -08:00
Morris Jobke 55d7cf8ffd improve encryption message 2013-11-27 23:07:19 +01:00
Bjoern Schiessle d9729168f9 some small js fixes 2013-11-27 22:42:03 +01:00
Bjoern Schiessle 0219b8b3b9 add spinner to the template so that it can be loaded in time 2013-11-27 22:36:47 +01:00
Bjoern Schiessle e0924a5f07 switch to large spinner 2013-11-27 21:58:38 +01:00
Vincent Petry 68f610a90e Update file list entry on rename
Whenever a file is renamed, if the extension changes, the mime type and
preview might change. This fix passes the updated info to the client
that updates it.
2013-11-27 21:35:00 +01:00
Vincent Petry 43b1cf7988 Redetect mime type whenever extension is renamed 2013-11-27 21:34:51 +01:00
Robin Appelman 885d04bc86 Fix getRawPathInfo for the '/' edge case 2013-11-27 21:28:54 +01:00
Björn Schießle 5295993144 Merge pull request #6088 from owncloud/fix_public_previews
fix public preview creation if a user is logged in
2013-11-27 11:05:27 -08:00
Björn Schießle 34a8c3c4cd Merge pull request #6039 from owncloud/trashbin_move_file_to_owners_trash
move files to owners trash
2013-11-27 10:24:55 -08:00
ganomi f94180a996 Fix filellist/rename/summary problem
Fixes #6055
This contribution is MIT licensed!
2013-11-27 19:09:49 +01:00
Bjoern Schiessle aee7781f22 fix public preview creation if a user ios logged in 2013-11-27 18:44:01 +01:00
Morris Jobke 39f9e16f20 Merge pull request #6086 from owncloud/incognito_mode
return false if user is in incognito mode
2013-11-27 09:11:18 -08:00
Jenkins for ownCloud 4a78f12682 [tx-robot] updated from transifex 2013-11-27 12:10:54 -05:00
Vincent Petry d2840a045d Fixed sharing hook to not remove the share before the trashbin
Fixed the hook order between sharing app and trashbin
2013-11-27 17:22:48 +01:00
Bjoern Schiessle 1536c7ea58 switch from "name" attribute to "id" 2013-11-27 17:01:21 +01:00
Bjoern Schiessle 6deda1b9f6 return false if user is in incognito mode 2013-11-27 16:52:30 +01:00
Morris Jobke 6b3b3d8af4 Fix for IE - an ugly horizontal scrollbar appears
* for IE9 the nav bar was too narrow
 * for other IEs the width of each app element was to wide and
   cause the horizontal scoll bar - now this content is hidden like
   before this PR
2013-11-27 16:45:04 +01:00
Bjoern Schiessle 1065c33543 Merge branch 'master' into encryption_initial_enc_indicator 2013-11-27 16:44:06 +01:00
Vincent Petry 40231c08cf Merge pull request #5977 from owncloud/encryption_enable_public_upload
Encryption enable public upload
2013-11-27 07:39:03 -08:00
Morris Jobke 41c6752030 fix navbar 2013-11-27 16:10:49 +01:00
Jan-Christoph Borchardt 3360719bbf prevent shift of app names caused by scrollbar, part 2 2013-11-27 16:10:48 +01:00
Jan-Christoph Borchardt f9f123c6f6 prevent shift of app titles caused by scrollbar 2013-11-27 16:10:48 +01:00
Jan-Christoph Borchardt 457a7d4baa always show app navigation scrollbar when too many apps in there 2013-11-27 16:10:48 +01:00
Robin Appelman c47e46fda0 fix custom routes defined by apps 2013-11-27 15:35:49 +01:00
Bjoern Schiessle 060e0ad0cd with the latest changes in master $this-userID is always the correct ID, so we no longer need the extra parameter 2013-11-27 15:35:32 +01:00
Bjoern Schiessle 9fb71af988 Merge branch 'master' into encryption_enable_public_upload
Conflicts:
	apps/files_encryption/lib/helper.php
	apps/files_encryption/lib/keymanager.php
	apps/files_encryption/lib/stream.php
	apps/files_encryption/lib/util.php
	apps/files_encryption/tests/keymanager.php
2013-11-27 15:08:09 +01:00
Thomas Müller 5b7b053634 Merge pull request #5976 from owncloud/encryption_work_with_public_gallery
Encryption work with public gallery
2013-11-27 04:25:54 -08:00
Bjoern Schiessle 7f2bdb0e97 typo fixed 2013-11-27 12:25:04 +01:00
Bjoern Schiessle 7f3b178d73 some small changes according to the review comments 2013-11-27 11:46:24 +01:00
Morris Jobke a81909097c Merge pull request #6027 from owncloud/public-api-restful-routing-oc6
fix appframework routing
2013-11-27 01:55:52 -08:00
Morris Jobke 7755e69af0 add PHPDoc for urlParams 2013-11-27 10:55:06 +01:00
Morris Jobke b910524acb add comment from @DeepDiver 2013-11-27 10:32:48 +01:00
blizzz 34704eded6 Merge pull request #5955 from owncloud/fix5863
LDAP Wizard: Add raw login filter to corresponding tab for consistency, fix behaviour on raw filter input
2013-11-27 00:30:15 -08:00
Thomas Müller af46d99730 Merge pull request #6075 from owncloud/ssl-warning
add warning for HTTP connection
2013-11-27 00:29:04 -08:00
Thomas Müller 3456109916 Merge pull request #6071 from owncloud/db-documentation
Add some documentation to db_structure.xml
2013-11-27 00:28:03 -08:00
Morris Jobke 8506d2bf42 fix wording 2013-11-27 00:38:56 +01:00
Morris Jobke 7c88736292 API doc for contacts manager, server container and share 2013-11-27 00:35:36 +01:00
Morris Jobke 2d822e3b95 add warning for HTTP connection 2013-11-27 00:05:48 +01:00
Thomas Mueller 4fbc2774ef on mssql the schema migration sometimes fails due to an already existing transaction - error: 'New transaction is not allowed because there are other threads running in the session.'
The solution is to simple reconnect to the database to start with a fresh connection
2013-11-26 22:39:01 +01:00
Andreas Fischer 0013e2e6a8 Fix spacing. 2013-11-26 22:16:14 +01:00
Andreas Fischer 68986f5272 db-doc: privatedata description 2013-11-26 22:13:01 +01:00
Andreas Fischer 2714a22ba8 db-doc: vcategory* descriptions 2013-11-26 22:06:20 +01:00
Andreas Fischer ab773650cd db-doc: users description 2013-11-26 21:53:55 +01:00
Andreas Fischer bc77ba1d4c db-doc: jobs description 2013-11-26 21:52:30 +01:00
Andreas Fischer 8cde5e80f6 db-doc: share description 2013-11-26 21:48:31 +01:00
Andreas Fischer f4031d4320 db-doc: properties description 2013-11-26 21:23:57 +01:00
Andreas Fischer 035199acab db-doc: preferences description 2013-11-26 21:18:42 +01:00
Andreas Fischer 5450d166b0 db-doc: locks description 2013-11-26 21:15:23 +01:00
Andreas Fischer 466e8985a8 db-doc: groups description 2013-11-26 21:14:52 +01:00
blizzz 4f15282bc9 Merge pull request #6058 from owncloud/ldap2avatar
Set Avatar for LDAP users automatically (if a picture is available)
2013-11-26 12:05:32 -08:00
Andreas Fischer 43f0e30315 db-doc: group_admin reduction note 2013-11-26 20:55:19 +01:00
Andreas Fischer 790155e574 db-doc: group_admin description 2013-11-26 20:55:08 +01:00
Andreas Fischer 46e32b08c0 db-doc: group_user description 2013-11-26 20:50:21 +01:00
Andreas Fischer 6da5b05176 Remove the dbprefix from comments. It has no information. 2013-11-26 20:42:15 +01:00
Andreas Fischer d083108e72 db-doc: permissions description 2013-11-26 20:41:05 +01:00
Andreas Fischer ea26282493 Prettier ASCII lists. ^^ 2013-11-26 20:27:51 +01:00
Andreas Fischer 421a1e69dc db-doc: filecache description 2013-11-26 20:27:18 +01:00
ganomi 33e77d34f4 Show stars as placeholder 2013-11-26 20:17:13 +01:00
Andreas Fischer ad603388ca db-doc: mimetypes description 2013-11-26 19:30:59 +01:00
Bjoern Schiessle 7240d349da Merge branch 'master' into encryption_initial_enc_indicator 2013-11-26 19:15:53 +01:00
Björn Schießle 1fef97f6a5 Merge pull request #6060 from owncloud/fix-6050-oc6
fixing getRawPathInfo() once more
2013-11-26 10:13:58 -08:00
Andreas Fischer 7d1f67b7a9 db-doc: storages description 2013-11-26 18:57:39 +01:00
Andreas Fischer a018dacac2 db-doc: appconfig description 2013-11-26 18:39:19 +01:00
Vincent Petry e2ca88af5e Merge pull request #6066 from owncloud/extstorage-sftp-overwriteonrename
Fixed SFTP storage to overwrite on rename
2013-11-26 09:01:41 -08:00
Bjoern Schiessle c7e1fe50c2 added a small version of the dark loading gif, looks nicer on the blue background 2013-11-26 17:14:16 +01:00
Thomas Müller 52941341fd fixing failing unit test 2013-11-26 16:52:33 +01:00
Jenkins for ownCloud fb7aa2f014 [tx-robot] updated from transifex 2013-11-26 10:47:07 -05:00
Thomas Müller d9a98b126e Merge pull request #6065 from owncloud/l10n-update
Translate reload message after update
2013-11-26 07:45:22 -08:00
Vincent Petry 30e086fb53 Fixed SFTP storage to overwrite on rename 2013-11-26 16:32:44 +01:00
Morris Jobke 81f6be92ef Translate reload message after update
fixes #6064
2013-11-26 16:22:01 +01:00
Vincent Petry 2653d914d9 Merge pull request #6008 from owncloud/extstorage-smb-webdav-renamefix
Fixed SMB rename function to overwrite target file
2013-11-26 06:42:36 -08:00
Morris Jobke dbd8128c07 Merge pull request #6059 from owncloud/occ-repair
Add a (currently) empty system for running common repair steps
2013-11-26 06:09:45 -08:00
Thomas Müller 2a93720f3f fixes #6050 2013-11-26 14:13:33 +01:00
Robin Appelman 10d84f6e9b Add a (currently) empty system for running common repair steps 2013-11-26 14:12:48 +01:00
Morris Jobke eca9f69282 Merge pull request #6053 from owncloud/remove_passwords_from_log
remove passwords from logfile
2013-11-26 04:53:02 -08:00
Morris Jobke 16ce56553c Merge pull request #6056 from owncloud/check_login
check if user is logged in
2013-11-26 04:50:43 -08:00
Morris Jobke a48fc120d0 Merge pull request #6054 from owncloud/extstorage-dropboxfixes
Fixed various Dropbox issues + unit tests
2013-11-26 04:48:54 -08:00
Morris Jobke 5cb1ce4a28 Merge pull request #6057 from owncloud/extstorage-touchoperation
Return true when touch succeeds
2013-11-26 04:40:25 -08:00
Bjoern Schiessle 5d2299eab8 only create complete share key if we know the exact path 2013-11-26 13:30:59 +01:00
Arthur Schiwon 69518b9013 Make sure Avatar is set from LDAP upon first login, not later, but also not before due to missing user folder 2013-11-26 12:57:39 +01:00
Vincent Petry 712b47757a Updated unit tests for SMB
- coverage for touch return value
- fixed directory provider to exclude unsupported cases
2013-11-26 12:53:03 +01:00
Bjoern Schiessle 2556647a10 check if user is logged in 2013-11-26 12:47:59 +01:00
Vincent Petry e102eec89a Return true when touch succeeds 2013-11-26 12:47:00 +01:00
Bjoern Schiessle 62afe7fe7a remove passwords from logfile 2013-11-26 12:26:32 +01:00
Andreas Fischer 06df3822a0 Timestamp test is no longer necessary as we rely on Doctrine and DateTime. 2013-11-26 12:22:08 +01:00
Andreas Fischer 3bbaba1eca Use the Doctrine to convert date string to DateTime object. 2013-11-26 12:21:31 +01:00
Andreas Fischer a330b2ef9b Use DateTime object instead of fixed format date string.
Use a DateTime object and have conversion handled by Doctrine instead of using
a date string with a fixed format.
2013-11-26 12:00:31 +01:00
Vincent Petry 7c81ac3d28 Fixed various Dropbox issues + unit tests
- fixed touch function to return true on success
- fixed local metadata cache to remove deleted files/directories
- fixed getMetaData() to ignore files reported as deleted by
  Dropbox
- fixed "file not found" case to not log as exception
- fixed "overwrite on rename" case
- fixed unit tests to exclude unsupported cases
- added unit test for touch return value
- unit tests for Dropbox should all run correctly now
2013-11-26 11:59:36 +01:00
Andreas Fischer 9fb1da2811 Use bindValue() instead of passing parameters in execute(). 2013-11-26 11:50:14 +01:00
Bjoern Schiessle 0617e06f69 use POST instead of GET 2013-11-26 11:38:49 +01:00
Bjoern Schiessle 35a6ad255d fix typo in var name 2013-11-26 11:38:45 +01:00
Jenkins for ownCloud dc67c7efa9 [tx-robot] updated from transifex 2013-11-26 04:04:05 -05:00
Morris Jobke faf14b4c79 Merge pull request #5937 from owncloud/calc_version_size
use oc filesystem operations to calc the versions size
2013-11-25 23:36:18 -08:00
Bjoern Schiessle 46dff0677d Merge branch 'master' into calc_version_size 2013-11-26 00:03:54 +01:00
Bjoern Schiessle 8974107b4e remove debug output 2013-11-25 23:57:08 +01:00
Bjoern Schiessle d6fb2afa85 show a message at the log-in screen if inital encryption take place 2013-11-25 23:49:05 +01:00
Vincent Petry 5310a5924b Merge pull request #6044 from owncloud/extstorage-ftpunittestfix
Fixed FTP storage unit tests to use the correct class
2013-11-25 14:21:34 -08:00
Morris Jobke d7d7d9b8e3 Merge pull request #6036 from owncloud/single-user-mode
Add "single user mode"
2013-11-25 14:10:07 -08:00
Arthur Schiwon 03375d6c52 LDAP: username2dn should only return DNs that belong to the current LDAP server. Might be not perfect. Easy perfect solution would increase communication with LDAP server. Let's see if it is good enough 2013-11-25 22:08:11 +01:00
Arthur Schiwon 3955388f20 LDAP: proxy: configurable return to determine when to try the next LDAP server and when to return (multi server setup) 2013-11-25 22:05:00 +01:00
Robin Appelman 9fbccc83e3 merge master into single-user-mode 2013-11-25 21:25:04 +01:00
Owen Winkler 844b4785f1 Merge pull request #6034 from owncloud/fix-api-documentation
Fix api documentation
2013-11-25 11:17:16 -08:00
icewind1991 4626fae882 Merge pull request #6038 from owncloud/occ-app-enable
add occ commands for enabling and disabling apps
2013-11-25 10:12:49 -08:00
Vincent Petry c3e34676ba Improved unit test for "overwrite on move"
Now using a different content to make sure the file was overwritten.
2013-11-25 18:54:58 +01:00
Vincent Petry af7118aa5d Added unit test for "overwrite file on rename/move"
Also fixed "rename" unit test that was ready the result out of the wrong
file.
2013-11-25 18:52:14 +01:00
Vincent Petry 944d4156bf Fixed FTP storage unit tests to use the correct class 2013-11-25 18:44:34 +01:00
Robin Appelman abe63bd329 Add occ command to list all apps 2013-11-25 17:34:16 +01:00
Robin Appelman fc1d897ea5 rename app_id to app-id 2013-11-25 17:28:01 +01:00
Jörn Friedrich Dreyer 4b67d4258d Merge pull request #6035 from owncloud/fixing-rawpath-reverseproxy-oc6
Fixing rawpath reverseproxy oc6
2013-11-25 08:21:33 -08:00
Thomas Müller a42d152ac3 Merge pull request #6037 from owncloud/fix-6007-oc6
adding chunked upload handling
2013-11-25 08:16:45 -08:00
Thomas Müller 1fdd2ac7ee adding documentation for registerRoutes() 2013-11-25 17:15:08 +01:00
Raghu Nayyar a5bfa6b1c3 Merge pull request #6040 from owncloud/fix-navbar-css
Fix navbar issue
2013-11-25 08:10:57 -08:00
Morris Jobke 4dc35909b5 Fix navbar issue
fixes #6024
2013-11-25 17:04:19 +01:00
Bjoern Schiessle f8fcd567a7 move files to owners trash 2013-11-25 16:51:31 +01:00
Morris Jobke b3e7e54c8d fix some capital letters 2013-11-25 16:42:28 +01:00
Morris Jobke 4e0fa85307 page level doc blocks and class descriptions 2013-11-25 16:39:01 +01:00
Morris Jobke bc8cc9142e AppFramework(Controller|HTTP|HTTP-Responses|Middleware), IContainer API fixes 2013-11-25 16:28:24 +01:00
icewind1991 019f3299b0 Merge pull request #6030 from owncloud/cli-errors
provide more cli friendly error messages when in cli mode
2013-11-25 07:06:48 -08:00
Robin Appelman a609a53647 add documentation for single user config option to config.sample.php 2013-11-25 16:01:42 +01:00
Robin Appelman 1bcb04f94e Add template for single user mode message 2013-11-25 15:59:37 +01:00
Thomas Müller 27cc333dfe adding chunked upload handling 2013-11-25 15:35:26 +01:00
Robin Appelman a324c09e6c Add occ command to enable and disable single user mode 2013-11-25 15:27:05 +01:00
Robin Appelman 71c1327691 Add "single user mode" which restricts access to users in the admin group
This can be enabled by setting 'singleuser' to true in config.php
2013-11-25 15:08:24 +01:00
Thomas Müller b9fed935b4 in case uri and script name don't match we better throw an exception 2013-11-25 14:42:34 +01:00
Morris Jobke 248eed16a6 fix defaults.php doc 2013-11-25 14:26:26 +01:00
Björn Schießle 31d0ba0344 Merge pull request #5641 from owncloud/filestrash-emptytrash
Deleting all files in trash now only sends a single flag
2013-11-25 05:24:11 -08:00
Thomas Müller a0a665ea45 handle duplicate slashes in case of reverse proxy configuration 2013-11-25 14:21:51 +01:00
Morris Jobke 7f47cc062c fix defaults.php doc 2013-11-25 14:13:58 +01:00
Vincent Petry 2d2af90fce Merge pull request #6028 from owncloud/extstorage-touchoperationreturnvalue
Fixed ext storage touch function to return true on success
2013-11-25 05:08:24 -08:00
Morris Jobke b7ddc78626 fix db.php doc 2013-11-25 14:06:25 +01:00
Robin Appelman d3bfb433d1 add occ commands for enabling and disabling apps 2013-11-25 13:20:16 +01:00
Robin Appelman 317d421874 provide more cli friendly error messages 2013-11-25 13:04:23 +01:00
Vincent Petry d88025bf6b Fixed ext storage touch function to return true on success
Some ext storage impl didn't return true on success.

Fixes #5943 (Dropbox)
Fixes #6010 (WebDAV)
2013-11-25 12:44:27 +01:00
Thomas Müller 993fea2f05 fix appframework routing 2013-11-25 11:36:33 +01:00
Vincent Petry 1b0c5e57e5 Fixed SMB rename function to overwrite target file
When uploading files through WebDAV, a part file is created and a rename
operation is performed with the expectation that the part file
overwrites an existing file, if any.

This fix makes the SMB external storage delete the target file before
renaming, as smbclient doesn't support overwrite on move/rename.

Fixes #5348
2013-11-25 11:17:38 +01:00
Vincent Petry de2b444030 Merge pull request #5960 from owncloud/enc_small_visual_improvements
[encryption] some small visual improvements
2013-11-25 02:12:31 -08:00
Vincent Petry 15f7315231 Merge pull request #6025 from owncloud/typo
fix typo
2013-11-25 02:12:09 -08:00
Bjoern Schiessle f1f172e16e fix typo 2013-11-25 11:09:31 +01:00
Bjoern Schiessle 49038545f8 Merge branch 'encryption_work_with_public_gallery' of github.com:owncloud/core into encryption_work_with_public_gallery 2013-11-25 10:29:53 +01:00
Bjoern Schiessle 9c4b8ae54c fix typo in comment 2013-11-25 10:29:05 +01:00
Morris Jobke b82146eeee Merge pull request #5991 from owncloud/extstorage-mountpointvalidation
Prevent using root as mount point for external storage
2013-11-25 00:30:06 -08:00
Thomas Müller 60e2ee631a Merge pull request #5998 from owncloud/navigation-fix
Doesn't Cut the top arrow from navigation
2013-11-24 15:02:56 -08:00
Thomas Müller 1a69079139 Merge pull request #6021 from owncloud/show_build
Show build number
2013-11-24 15:01:11 -08:00
Thomas Mueller 2a465fb20f Merge branch 'master' into encryption_work_with_public_gallery 2013-11-24 23:20:46 +01:00
Thomas Müller a2d4cd87d0 Merge pull request #5874 from owncloud/fix-5845
Fix file uploads on Windows with SQL Server
2013-11-24 14:15:17 -08:00
Thomas Müller 45db67d174 Merge pull request #6018 from owncloud/fix_overwritehost
fix overwrite host support and make the code a bit more readable
2013-11-24 14:02:51 -08:00
Thomas Mueller f6df4b349f remove logic from template and fix syntax error 2013-11-24 21:27:32 +01:00
Thomas Mueller 228f1788fa add new function to generate the human readable version string based on version, channel and build number 2013-11-24 21:26:34 +01:00
Thomas Mueller 229630f14c adding simple unit test to test scriptName() under overwrite condition 2013-11-24 21:19:06 +01:00
Thomas Mueller 6229f457d0 update PHPDoc 2013-11-24 21:18:14 +01:00
Frank Karlitschek 77bb168007 replace echo with p 2013-11-24 17:17:10 +01:00
Frank Karlitschek 22e39baf77 show the build number if on the daily build update channel 2013-11-24 16:46:07 +01:00
Frank Karlitschek a11192bab3 send the build number too to push the next daily build. This is needed for the new daily build update channel 2013-11-24 16:45:06 +01:00
Frank Karlitschek 2ce850f7db fix overwrite host support and make the code a bit more readable 2013-11-24 12:41:09 +01:00
Vincent Petry aef34618de Merge pull request #5995 from owncloud/extstorage-isreadablefix
Return plausible isReadable() default impl for ext storage
2013-11-24 03:04:33 -08:00
Jenkins for ownCloud ba0e09adce [tx-robot] updated from transifex 2013-11-24 00:14:51 -05:00
Arthur Schiwon d9347f2c9b LDAP: last avatar lookup must be stored per user. Someone had a blackout, eh? 2013-11-22 23:58:30 +01:00
Arthur Schiwon 6085878966 Avatar: accept OC_Image as in setParameter 2013-11-22 23:57:23 +01:00
Vincent Petry 2d947835b9 Now also preventing the user of "Shared" as mountpoint 2013-11-22 18:36:27 +01:00
Vincent Petry c62cce8269 Moved default isReadable/isUpdatable impl into Common class
Also adjusted all ext storage backends to not override these when the
default behavior is expected.
2013-11-22 18:21:17 +01:00
Vincent Petry a49e873d3f Return plausible isReadable() default impl for ext storage
When an ext storage doesn't implement isReadable(), always returning
true made the file scanner believe that the file exists and creates a
cache entry with the size zero.

This fix makes the default impl of isReadable() use file_exists().

Fixes #5940
2013-11-22 18:21:17 +01:00
Bjoern Schiessle aeefe48cba Revert "use relative paths to create images from a file. This way it also works if"
This reverts commit 3488f0b77a.
2013-11-22 18:01:44 +01:00
Bjoern Schiessle acf74b24f2 remove unused variable 2013-11-22 16:10:30 +01:00
Morris Jobke ae6610f0ea fix navigation scrollbar 2013-11-22 15:48:24 +01:00
Vincent Petry 3b904647b0 Merge pull request #6003 from owncloud/incognito_mode
Incognito mode
2013-11-22 06:08:49 -08:00
Thomas Müller c67b8f2b22 fixed documentation 2013-11-22 14:58:36 +01:00
Bjoern Schiessle 2cc0c90015 set incognito mode for public.php calls. Because in this case ownCloud should always work the same way as if no user is logged in 2013-11-22 14:00:08 +01:00
Bjoern Schiessle 7e4f50d4e3 add incognito mode, allows to hide my user ID. For example, this is useful to access public resources while a user is still logged in 2013-11-22 13:55:38 +01:00
Thomas Müller c05177b25b Merge pull request #5882 from owncloud/preview-movie-5s
Movie preview - use frame after 5 seconds
2013-11-22 04:27:34 -08:00
Arthur Schiwon 6fdce3b7e9 LDAP: user proxy must support canChangeAvatar too 2013-11-22 13:25:20 +01:00
Arthur Schiwon 8ccac86c98 Enable user backends to provide avatar images 2013-11-22 13:25:20 +01:00
Arthur Schiwon 54f0deff2a LDAP: get user photo from LDAP and set it as avatar if available 2013-11-22 13:25:20 +01:00
Raghu Nayyar c503588827 Merge pull request #6000 from owncloud/use_relative_path_to_create_images
use relative paths to create images from a file.
2013-11-22 03:52:40 -08:00
blizzz 2f73db12bb Merge pull request #5040 from owncloud/public_api_avatar_master
Add public API for \OC\Avatar
2013-11-22 03:42:28 -08:00
Thomas Müller 92c8672c0f fixing PHPDoc comments and syntax 2013-11-22 12:34:37 +01:00
Bjoern Schiessle 3488f0b77a use relative paths to create images from a file. This way it also works if
no user is logged in (e.g. public gallery share)
2013-11-22 12:26:01 +01:00
Thomas Müller 14e7075030 we better use 5MB (1024 * 1024 * 5 = 5242880) instead of 1MB.
in some cases 1MB was no enough to generate thumbnail
2013-11-22 12:23:22 +01:00
Thomas Müller c22019dec5 Working on a chunked video can result in a broken frame index the option -vsync 1 can heal that 2013-11-22 12:20:06 +01:00
Jenkins for ownCloud 60cfdae503 [tx-robot] updated from transifex 2013-11-21 21:07:12 -05:00
Arthur Schiwon f94a6eb166 Add missing Avatar Interface 2013-11-22 00:43:23 +01:00
Arthur Schiwon 00071401d7 Round out Avatar Public API 2013-11-21 23:40:25 +01:00
raghunayyar aa5d5a422f Doesn't Cut the top arrow from navigation 2013-11-22 02:10:22 +05:30
Vincent Petry 3b48d23478 Merge pull request #5970 from owncloud/extstorage-webdavdotdirfix
Fixed path normalization to prevent dot dirs
2013-11-21 09:01:47 -08:00
Vincent Petry 476d8e6de0 Added unit test for root mount point validation 2013-11-21 17:26:13 +01:00
Vincent Petry 0b2c9b823c Prevent using root as mount point for external storage
Fixes #5981
2013-11-21 17:22:12 +01:00
Thomas Müller 4a2f9636cf Merge pull request #5773 from owncloud/fix-2152-master
Make working en_US.UTF-8 locale a hard requirement
2013-11-21 08:03:21 -08:00
Vincent Petry 39cbdca429 Fixed path normalization to prevent dot dirs
Fixes #5945 where stat(.) would cause the backend OC to cache a dot dir
(only in older versions)
2013-11-21 16:07:01 +01:00
Jenkins for ownCloud 5d9731cef2 [tx-robot] updated from transifex 2013-11-21 10:05:34 -05:00
Bjoern Schiessle 6443e570c2 Merge branch 'encryption_work_with_public_gallery' into encryption_enable_public_upload 2013-11-21 16:00:21 +01:00
Vincent Petry d0265f3388 Merge pull request #5715 from owncloud/quota-sharing-wrapotherusershome
Quota storage wrapper is now used for all users in sharing mode
2013-11-21 06:59:50 -08:00
Bjoern Schiessle d2e6f7d979 check HTTP Referer to check if we come from public.php or from a internal page.
Necessary to detect public access also if a user is logged in.
2013-11-21 15:57:49 +01:00
Morris Jobke 3e1ade4397 Merge pull request #5988 from owncloud/files-mobilequickfix
Added min width to files table
2013-11-21 06:09:11 -08:00
Thomas Müller 418a9b11c4 Merge pull request #5983 from owncloud/fixing-l10n-again-master
Fixing l10n again master
2013-11-21 06:02:53 -08:00
Vincent Petry 14ad1ebf53 Added min width to files table
Having a too small widths for the files table doesn't make sense as it
overlaps file actions with the files themselves and make them
unclickable, especially when viewed on mobile phone.

The compromise that this fix introduces is to have a minimum width that
will trigger horizontal scrolling, which will at least make it possible
to click files on mobile phones.
2013-11-21 14:45:24 +01:00
Thomas Müller cd1cf58875 Fixing the warning notifications 2013-11-21 14:44:25 +01:00
blizzz a20c6049c3 Merge pull request #5979 from owncloud/fix5881
LDAP Wizard: add objectclass for group detection in Zimbra
2013-11-21 04:03:33 -08:00
Vincent Petry bd50ed0ded Merge pull request #5980 from owncloud/public_view_fixes
Public view fixes
2013-11-21 04:01:14 -08:00
Vincent Petry 69e8e7dbd5 Now using the "Home" storage detection approach for quota
To find out whether to apply a quota, we now try and detect whether the
storage to wrap is a "Home" storage.
2013-11-21 12:17:47 +01:00
Bjoern Schiessle 9d16353e09 disable trahs in files_sharing/public.php 2013-11-21 12:06:35 +01:00
Vincent Petry 356eef0739 Quota storage wrapper is now used for all users in sharing mode
When accessing a shared folder, the folder's owner appears as mountpoint
but wasn't wrapped by a quota storage wrapper.

This fix makes sure that all home storages are wrapped by a quota
storage wrapper, if applicable, to make sure quotas are respected when
uploading into shared folders.
2013-11-21 12:04:54 +01:00
Bjoern Schiessle c9646ddc4c fix undefined index errors if public share view 2013-11-21 12:03:27 +01:00
Arthur Schiwon dd5e1092c7 LDAP Wizard: add objectclass for group detection in Zimbra 2013-11-21 11:20:31 +01:00
Bjoern Schiessle 87f2696e6a Merge branch 'encryption_work_with_public_gallery' into encryption_enable_public_upload 2013-11-21 11:18:53 +01:00
Bjoern Schiessle c7dc6dc2c2 fix getFileKey() call 2013-11-21 11:11:15 +01:00
Bjoern Schiessle 009bbef17e Merge branch 'encryption_work_with_public_gallery' into encryption_enable_public_upload 2013-11-21 10:34:25 +01:00
Bjoern Schiessle 16b484209c Merge branch 'master' into encryption_work_with_public_gallery
Conflicts:
	apps/files_encryption/lib/keymanager.php
	apps/files_encryption/lib/stream.php
	apps/files_encryption/lib/util.php
	apps/files_encryption/tests/crypt.php
2013-11-21 10:33:37 +01:00
Bjoern Schiessle 18c80e47b6 Merge branch 'encryption_work_with_public_gallery' into encryption_enable_public_upload
Conflicts:
	apps/files_encryption/lib/stream.php
2013-11-21 10:24:47 +01:00
Vincent Petry 391f267d38 Merge pull request #5897 from hkjolhede/master
Fixed error-checking error in sftp.php
2013-11-21 01:22:05 -08:00
Vincent Petry 19af45c7d1 Merge pull request #5972 from owncloud/extstorage-webdav-moveoperationfix
Fixed move operation to pass the whole URL as expected
2013-11-21 01:20:19 -08:00
Bjoern Schiessle 2b361ea085 better distinction between userID and keyId 2013-11-21 10:09:07 +01:00
Thomas Müller f2fe47bc21 fixing spelling and restructure sentence 2013-11-21 09:59:21 +01:00
Thomas Müller 02b92137b3 unify translation string - less work for the translators 2013-11-21 09:58:35 +01:00
Bjoern Schiessle b27fc42e1f public upload now also works with encryption enabled 2013-11-21 00:23:38 +01:00
Bjoern Schiessle 318db64b2d adapt tests to the new code 2013-11-20 23:27:42 +01:00
Bjoern Schiessle b9c18d16fe make sure that we always use the correct user id 2013-11-20 23:23:23 +01:00
Bjoern Schiessle e11afd3066 fix some getShareKey() and getFileKey() calls 2013-11-20 22:44:23 +01:00
Frank Karlitschek c2ccf4a6b3 beta 5 is here 2013-11-20 19:30:30 +01:00
Vincent Petry e26500045f Fixed move operation to pass the whole URL as expected
The MOVE and COPY spec expect the "Destination" header to receive the
full URL, not only the root.

Fixes #5942
2013-11-20 18:59:02 +01:00
Bjoern Schiessle c5cb4206f5 [wip] make encryption work with public gallery sharing 2013-11-20 18:10:56 +01:00
Vincent Petry 5de5c317c1 Merge pull request #5967 from owncloud/encryption-extstorage-fixsizereset
Fix for extstorage + encryption where unencrypted size is not kept
2013-11-20 09:04:37 -08:00
Vincent Petry a88aec8a5c Merge pull request #5965 from owncloud/mimetype-only-path
Change default mimetype detection for storage backends to only use filename
2013-11-20 08:11:41 -08:00
blizzz 8f33286b19 Merge pull request #5966 from owncloud/fixing-fileid-webdav-master
always get the right node for the given file path
2013-11-20 07:51:47 -08:00
Vincent Petry c221e8272c Merge pull request #5959 from owncloud/encryption_check_if_file_is_encrypted
only check if the key file exists to decide if it is an encrypted file or not
2013-11-20 07:32:43 -08:00
Vincent Petry fe44024868 Fix for extstorage + encryption where unencrypted size is not kept
Fix for external storage with encryption where the unencrypted size is
first written in the DB, then set back to zero, causing performance
issue because the file needs to be reopened every time to find out the
unencrypted size (and potentially needs a full redownload)
2013-11-20 16:22:55 +01:00
Thomas Müller 51a8172868 always get the right node for the given file path 2013-11-20 16:14:08 +01:00
Arthur Schiwon ce1318c9f1 LDAP Wizard: clear the cache on save so changes have immediate effect 2013-11-20 15:56:25 +01:00
Robin Appelman a0d570b4cc Change default mimetype detection for storage backends to only use filename 2013-11-20 15:25:29 +01:00
Bjoern Schiessle b4e7258a04 Merge branch 'master' into encryption_check_if_file_is_encrypted 2013-11-20 14:45:04 +01:00
Vincent Petry 30b8f4ec8e Merge pull request #5961 from owncloud/core-fixgetfiletempfilecondition
Fixed getLocalFile() condition for x-send-file
2013-11-20 05:42:21 -08:00
Vincent Petry 726a202cdb Fixed getLocalFile() condition for x-send-file
Until now, addSendfileHeader() was called even when no x-send-file
headers were set. Even though the method itself doesn't do anything,
a call to getLocalFile() was done and would trigger a full download
when using external storage.

Additionally, the storage resolution code is wrong and always
returns the local storage of the root filesystem, which caused the code to
be run anyway.

This commit fixes both issues.
2013-11-20 14:33:59 +01:00
Bjoern Schiessle f3e2a63712 check if it is a cached file or a version to resolve the correct path to the file key 2013-11-20 12:34:23 +01:00
Bjoern Schiessle caf486d6e7 - show a spinner while decrypting files if the encryption app was disabled
- don't fade-out the decryption result
2013-11-20 12:23:10 +01:00
Bjoern Schiessle 0c24c7c420 only check if the key file exists to decide if it is an encrypted file or not.
This solves problems with external storage which doesn't support fseek
2013-11-20 11:02:22 +01:00
Arthur Schiwon ff9ecc8a51 LDAP Wizard: proper behaviour for raw filter input. remember the editing mode and compose filter only when desired. 2013-11-19 23:58:08 +01:00
Frank Karlitschek 8bc339413b Merge pull request #5926 from owncloud/less-bold
remove bold from legend, table header, label - less obtrusive
2013-11-19 13:57:21 -08:00
blizzz 93ff86e31f Merge pull request #5951 from owncloud/ldap_encryption_fix
fix encryption with LDAP, make sure that the owners home is mounted correctly
2013-11-19 13:51:12 -08:00
Bjoern Schiessle b823505bd1 make sure that the owners home is mounted correctly 2013-11-19 18:28:51 +01:00
Vincent Petry 5f6f78ee03 Merge pull request #5878 from owncloud/extstorage-smb
[SMB] Fix stat and unlink
2013-11-19 06:13:25 -08:00
Vincent Petry 5b6d1d79d0 Fixed SMB file deletion success detection
Since unlink() smb4php doesn't return true on deletion success, we need
to check whether the file was deleted to confirm success.

Fixes #5866
2013-11-19 15:05:11 +01:00
Vincent Petry 8ab40f1959 Removing trailing dot in path that samba doesn't seem to like
Fixes #5778
Added unit test for getId() and constructUrl()
2013-11-19 15:05:11 +01:00
Vincent Petry a7962faa56 Fixed delete action to show error message as notification 2013-11-19 15:05:11 +01:00
Bjoern Schiessle c309067c81 use oc filesystem operations to calc the versions size. This makes sure that we can handle missing directories correctly 2013-11-19 12:23:14 +01:00
Morris Jobke b55a66187c Merge pull request #5916 from owncloud/extstorage-smb-ignorenetbioserror
SMB ignore connection errors when NetBIOS is disabled
2013-11-18 15:23:11 -08:00
Morris Jobke 4a0d295e4a Merge pull request #5927 from owncloud/quota-excludeextstorage
External storage space is now not counted in total space
2013-11-18 14:42:40 -08:00
Morris Jobke cdc72ddd8d Merge pull request #5928 from owncloud/quota-totalsizeoffiles
Root size for home storage is now size of "files" subdir
2013-11-18 14:31:00 -08:00
Vincent Petry 3e2fd9942b Root size for home storage is now size of "files" subdir
Fixes #4593
2013-11-18 18:17:25 +01:00
Vincent Petry 614e4d485c External storage space is now not counted in total space
Added argument to getFileInfo() to disable adding the size of
mountpoints to a directory's size.

Fixes #5924
2013-11-18 18:09:01 +01:00
Jan-Christoph Borchardt b51d405852 Merge pull request #5923 from owncloud/font-weight
change bold 'deleted files' button to normal for less focus
2013-11-18 08:39:46 -08:00
Jan-Christoph Borchardt b678766c7d remove bold from legend, table header, label - less obtrusive 2013-11-18 17:32:06 +01:00
Jörn Friedrich Dreyer 5da2929180 fix filtering number like filenames in filelist
forward port of https://github.com/owncloud/core/commit/847ad6c40b951cbd3d187e3c72cb55dc3acd6951
2013-11-18 17:18:31 +01:00
Thomas Müller c8cf3320a4 Merge pull request #5922 from owncloud/fix-time-inputs
fix input type time fields, have them use the default styles
2013-11-18 07:17:09 -08:00
Jan-Christoph Borchardt 463b054530 adjust input CSS to multiline, coding guidelines 2013-11-18 16:14:13 +01:00
Jan-Christoph Borchardt f2d18867af change bold 'deleted files' button to normal for less focus 2013-11-18 15:06:38 +01:00
Jan-Christoph Borchardt 8dd50dc9a6 fix input type time fields, have them use the default styles 2013-11-18 14:51:43 +01:00
Vincent Petry 44c2f9aad2 Merge pull request #5915 from owncloud/fix_apps_versioncheck
Fix apps versioncheck
2013-11-18 05:48:17 -08:00
Vincent Petry d306f5c4cf Merge pull request #5908 from owncloud/fix_errorpage_call
[encryption] fix redirectToErrorPage() call
2013-11-18 05:17:28 -08:00
Morris Jobke a2e3821b87 Merge pull request #5914 from owncloud/fix_5832
Check which permissions are possible to re-share a file
2013-11-18 05:16:05 -08:00
Vincent Petry 7e6f3817d0 SMB ignore connection errors when NetBIOS is disabled
When NetBIOS is blocked or disabled, a smb::look() call can still get
the list of shares from smbclient, even though the name resolution at
the end of the command fails.

This fix makes it ignore the connection error if we already got the list
of shares.

Fixed #5860
2013-11-18 12:31:55 +01:00
Frank Karlitschek 385a296864 one tab less 2013-11-18 12:19:16 +01:00
Frank Karlitschek e5994f9c1a fix the version check for downloaded apps. Fixes https://github.com/owncloud/apps/issues/1485 2013-11-18 12:16:03 +01:00
Bjoern Schiessle 7f3d717037 Check which permissions are possible to re-share a file 2013-11-18 11:58:42 +01:00
Bjoern Schiessle 82f30d37ca call error page with session as parameter 2013-11-17 13:23:07 +01:00
Jenkins for ownCloud c3746e866a [tx-robot] updated from transifex 2013-11-15 22:56:31 -05:00
hkjolhede 3e2d4c1bc1 Fixed error-checking error in sftp.php 2013-11-15 21:10:09 +01:00
Vincent Petry 68f278025c Merge pull request #5894 from owncloud/readd_sharing_token
readd sharing token to public template
2013-11-15 09:25:46 -08:00
blizzz cb968c77d1 Merge pull request #5772 from owncloud/fix5741
LDAP Wizard: introduce configuration status indicator, fixes #5741
2013-11-15 08:52:41 -08:00
Björn Schießle 3ad546002f Merge pull request #5833 from owncloud/encryption_fixes
[encryption] preserve timestamps and etags during encryption/decryption
2013-11-15 08:47:22 -08:00
Vincent Petry 6355af162c Merge pull request #5880 from owncloud/replace_etmp_files
write encryption tmp files to the cache folder
2013-11-15 07:53:23 -08:00
Bjoern Schiessle f36ee69855 tests added 2013-11-15 16:49:50 +01:00
Jörn Friedrich Dreyer 11425d142d readd sharing token to public template
necessary for https://github.com/owncloud/apps/pull/1476
2013-11-15 16:27:41 +01:00
Frank Karlitschek fa44c699f7 Merge pull request #5889 from owncloud/extstorage-smb-brokenfseek
Fix for smb4php fseek
2013-11-15 07:00:36 -08:00
Bart Visscher 368342a085 Update error messages 2013-11-15 14:46:00 +01:00
Vincent Petry f9a64d2b27 Fix for smb4php fseek
The stream_fseek function must return a boolean which will be mapped
to 0 for success and -1 for failure for the caller.

This patch fixes stream_fseek of smb4php to also respect this
convention.

Since the encryption app is relying on fseek to detect whether a file is
encrypted by reading the last bit of data, this will fix #5023
2013-11-15 14:23:24 +01:00
Bart Visscher 630e46f60a Merge pull request #5789 from ogasser/db_fix_default_for_numeric
DB: Set correct default value for numeric types
2013-11-15 04:19:33 -08:00
Bart Visscher bcf56b0407 Use \Patchwork\Utf8\Bootup::initLocale 2013-11-15 13:06:35 +01:00
Frank Karlitschek 16dce51917 increase version number to trigger a DB migration to get more testers for the new indexes. 2013-11-15 10:30:04 +01:00
Frank Karlitschek 54364f172e Merge pull request #5814 from owncloud/add-indexes
Add some more indexes to tables to improve db queries
2013-11-15 01:25:59 -08:00
Thomas Müller 1e863cd959 Merge pull request #5700 from owncloud/ldapWizSetDisplayNames
LDAP Wizard: do not forget to set display name attributes for user and g...
2013-11-15 01:12:54 -08:00
Thomas Müller 49e9f771ff Merge pull request #5813 from owncloud/fix-4736-master
Don't set a default value when there isn't a default specified
2013-11-15 01:06:38 -08:00
Morris Jobke 926b274200 Movie preview - use frame after 5 seconds 2013-11-15 01:46:51 +01:00
Morris Jobke 6ef39931cb Merge pull request #5767 from owncloud/moviepreviewfallback
Added ffmpeg fallback when avconv is not available
2013-11-14 16:39:39 -08:00
Morris Jobke 57a3141cb1 Merge pull request #5867 from owncloud/users-groupadmindropdown
Users groupadmindropdown
2013-11-14 13:28:05 -08:00
Thomas Müller 617dc0e468 Merge branch 'master' into moviepreviewfallback
Conflicts:
	lib/private/preview/movies.php
2013-11-14 20:57:29 +01:00
Thomas Müller ecc7b01cee Merge pull request #5824 from owncloud/fix-publicshare-non-existing
Fix fatal error when trying to open a non existing public link
2013-11-14 11:45:08 -08:00
Thomas Müller 2bb4c266a6 Merge pull request #5862 from owncloud/files-singledotdirs
Files singledotdirs
2013-11-14 11:40:21 -08:00
Arthur Schiwon 98c9334175 LDAP Wizard: move raw login filter field from advanced tab to login filter tab for consistency 2013-11-14 18:29:18 +01:00
Bjoern Schiessle faa08da944 instead of writing etmp files we write the dummy file to data/user/cache to avoid that etmp files show up in the users files list 2013-11-14 17:32:21 +01:00
Thomas Müller 447e468d1a Merge pull request #5850 from owncloud/oc_api_tests
Add unit tests for OC_API::mergeResponses and fix error with api returning incorrect status codes.
2013-11-14 07:58:51 -08:00
Frank Karlitschek 29e9f2833d Merge pull request #5214 from owncloud/no_extra_slashes
Don't double-slash filenames at the root.
2013-11-14 07:53:51 -08:00
ringmaster bd3ead0d31 Compare dirname() results to DIRECTORY_SEPARATOR, not '/' 2013-11-14 09:42:56 -05:00
ringmaster ca675d7b08 Alias the aggregate columns so SQL Server doesn't combine them. 2013-11-14 09:41:55 -05:00
Thomas Müller 7e63722534 make use of data providers 2013-11-14 15:37:30 +01:00
Vincent Petry d9ab964ff9 Added missing test with leading backslash 2013-11-14 15:36:03 +01:00
Thomas Müller 19e03ef77f Merge pull request #5827 from owncloud/avoid_preview_errors
Use dedicated OC_Image loader methods in previews
2013-11-14 05:52:51 -08:00
Vincent Petry f670d74634 Added min-height in case of empty multi-select 2013-11-14 14:26:48 +01:00
Vincent Petry 55355ba28e Fixed multiselect to not set the button's height on itself after select
Fixes #5841
2013-11-14 14:18:22 +01:00
Vincent Petry 008c3b80d6 Files app backend now normalizes paths before rendering templates
Before rendering breadcrumbs or the file list, the paths are now
normalized. This prevents the UI to show "." breadcrumbs in case the
path contains sections with "/./"

Fixes #5848
2013-11-14 13:24:05 +01:00
Vincent Petry c06d8bb007 Fixed normalizePath() to strip out single dot dirs
Now removing "/./" and trailing "/." from the paths when normalizing.
2013-11-14 13:15:03 +01:00
Bjoern Schiessle 2624a6cb32 remove debug output 2013-11-14 12:13:22 +01:00
Bjoern Schiessle 2df3763675 test encryptAll() and decryptAll() to make sure that mtime and etag stay the same 2013-11-14 12:11:21 +01:00
tomneedham 1449437c9e Merge multiple failed third party responses when returning the result 2013-11-14 01:21:54 +00:00
tomneedham bb182bbfb2 Merge multiple shipped failures before responding. 2013-11-14 01:19:46 +00:00
tomneedham ca5c39a3a1 Return failed shipped responses over succedded shipped responses 2013-11-14 01:14:37 +00:00
tomneedham 5a2d700866 Fix type in unit test 2013-11-14 01:11:22 +00:00
tomneedham a39f3fdbf9 Return result object when only one successful response is returned 2013-11-14 01:10:56 +00:00
tomneedham 790055571d Update lib/private/api.php after merge conflict 2013-11-14 01:00:14 +00:00
tomneedham b06682b7fb Merge branch 'ocs_api_fix_success_code' into oc_api_tests 2013-11-14 00:41:04 +00:00
tomneedham 00944a376a Merge branch 'master' into oc_api_tests 2013-11-14 00:40:57 +00:00
tomneedham 959513fdc8 Add tests for OC_API::mergeResponses() 2013-11-14 00:40:09 +00:00
tomneedham f19caeed33 Remove OC_App dependancy from OC_API::mergeResponses() 2013-11-13 22:46:24 +00:00
Frank Karlitschek 8d0d0836ba Merge branch 'master' of https://github.com/owncloud/core 2013-11-13 19:43:18 +01:00
Frank Karlitschek cd4a816c11 beta 4 2013-11-13 19:42:52 +01:00
Arthur Schiwon 84a882c651 LDAP Wizard: make 'Configuration OK' and 'Help' texts grey so they don't take too much awareness 2013-11-13 19:07:28 +01:00
Arthur Schiwon 7a61dcadd2 LDAP Wizard: move status indicator in one line with back and continue buttons 2013-11-13 19:07:28 +01:00
Arthur Schiwon 4ee296051b LDAP Wizard: introduce configuration status indicator, fixes #5741 2013-11-13 19:07:28 +01:00
Bjoern Schiessle 222fa88eec Merge branch 'master' into encryption_fixes 2013-11-13 12:11:12 +01:00
Tom Needham 17e45e2002 Pick any none 100 status code before defaulting to 100 2013-11-13 00:45:49 +00:00
Thomas Tanghus ec51825d31 Use dedicated OC_Image loader methods
This prevents excessive logging and disk access
2013-11-13 00:36:42 +01:00
Bjoern Schiessle dd0ebcede2 fixPartialFilePath() is now stripPartialFileExtension() 2013-11-12 18:48:31 +01:00
Bjoern Schiessle e2fb8d7128 only update file cache if the file is already indexed to avoid that we create a incomplete file cache entry 2013-11-12 15:55:59 +01:00
Bjoern Schiessle 894856ce01 make sure that we keep the correct timestamp and etag after encryoption/decryption 2013-11-12 15:51:51 +01:00
Robin Appelman abc428916c Fix fatal error when trying to open a non existing public link 2013-11-12 15:38:00 +01:00
Oliver Gasser 53f17a71d1 treat numeric as an alias for decimal 2013-11-12 13:55:20 +01:00
Oliver Gasser 4b01eaf6cc changed type to decimal 2013-11-12 13:47:47 +01:00
Morris Jobke 9c1c8d57f0 fix DB schema test - no default value 2013-11-12 13:45:28 +01:00
Oliver Gasser 95b3eb2c75 Add DB tests for default numeric
Add a table with a numeric column and an empty default directive.
2013-11-12 11:27:57 +01:00
Vincent Petry 80c8666d3a Deleting all files in trash now only sends a single flag
To prevent having to send the list of all files for deletion, only set a
flag "allfiles". This should make it a bit smoother when deleting 5000+
files.

Also fixes some "empty trash" message issues.
2013-11-11 17:58:33 +01:00
Bart Visscher dcca887f18 Don't set a default value when there isn't a default specified 2013-11-11 17:58:25 +01:00
Bart Visscher c5cd0b2d26 Add some more indexes to tables to improve db queries 2013-11-11 17:57:17 +01:00
Vincent Petry 99ee95d46c Added missing escaping 2013-11-11 15:41:03 +01:00
Oliver Gasser b278356eb9 DB: Set correct default value for numeric types
Set 0 as default value for columns with numeric data type instead of the
empty string ''. Otherwise the database complains about an invalid
default value for this column.

To reproduce put the following in your ````appinfo/database.xml````:

````
<field>
        <name>modified</name>
        <type>decimal</type>
        <default/>
        <notnull>true</notnull>
        <length>15</length>
</field>
````

See owncloud/mozilla_sync#14
2013-11-10 14:15:33 +01:00
Vincent Petry df288605d4 Fixed undefined variable error when using avconv 2013-11-10 11:46:46 +01:00
Bart Visscher a6d8854d2a Make working en_US.UTF-8 locale a hard requirement 2013-11-08 14:30:08 +01:00
Vincent Petry 4b5083e3ca Fixed the rebellous space, replaced with a tab 2013-11-08 12:27:53 +01:00
Vincent Petry 0c6af55112 Added ffmpeg fallback when avconv is not available
On some distros, avconv isn't available yet.
This fix adds a fallback to ffmpeg.
When none is found, no error message is displayed in the console any
more.

Fixes #5745

Also, this now uses exec() instead of shell_exec() to be able to get the
return code.

The binary path found with "which" is now used to prevent further FS
binary lookup when running the commands.

Moved the "-ss" parameter before "-i" for ffmpeg.
2013-11-08 12:19:32 +01:00
kondou bcd776b0c0 Fix a regression (Tags→TagManager) 2013-11-07 12:51:03 +01:00
kondou 4ac05e071a Remove duplicate getAvatarManager() 2013-11-07 12:48:41 +01:00
kondou 507325dd50 Add public API for \OC\Avatar 2013-11-07 12:48:40 +01:00
Arthur Schiwon fc040755c1 LDAP Wizard: do not forget to set display name attributes for user and group, makes Test Connection succeed 2013-11-05 13:19:32 +01:00
ringmaster c737b521ab Don't double-slash filenames at the root.
Replace either the end of the dir string that isn't preceded by a slash or the slash at the end of the dir string with a slash and the filename.
This prevents the root directory from ending up as two slashes, which breaks files_versions on Windows servers. See #4079 for an explanation.
2013-10-08 12:48:59 -04:00
1158 changed files with 35202 additions and 23800 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn();
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);
if (!\OC\Files\Filesystem::is_dir($dir . '/')) {
header("HTTP/1.0 404 Not Found");
exit();
+5 -1
View File
@@ -14,10 +14,11 @@
padding: 0 !important; /* override default control bar button padding */
}
#trash {
margin-right: 12px;
margin-right: 8px;
float: right;
z-index: 1010;
padding: 10px;
font-weight: normal;
}
#new>a {
padding: 14px 10px;
@@ -64,6 +65,9 @@
top: 44px;
width: 100%;
}
#filestable, #controls {
min-width: 680px;
}
#filestable tbody tr { background-color:#fff; height:2.5em; }
#filestable tbody tr:hover, tbody tr:active {
background-color: rgb(240,240,240);
+2 -2
View File
@@ -36,6 +36,7 @@ OCP\Util::addscript('files', 'filelist');
OCP\App::setActiveNavigationEntry('files_index');
// Load the files
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);
// Redirect if directory does not exist
if (!\OC\Files\Filesystem::is_dir($dir . '/')) {
header('Location: ' . OCP\Util::getScriptName() . '');
@@ -107,7 +108,6 @@ if ($needUpgrade) {
// if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code)
$encryptionInitStatus = 2;
if (OC_App::isEnabled('files_encryption')) {
$publicUploadEnabled = 'no';
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$encryptionInitStatus = $session->getInitialized();
}
@@ -128,7 +128,7 @@ if ($needUpgrade) {
$tmpl = new OCP\Template('files', 'index', 'user');
$tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir));
$tmpl->assign('dir', $dir);
$tmpl->assign('isCreatable', $isCreatable);
$tmpl->assign('permissions', $permissions);
$tmpl->assign('files', $files);
+13 -3
View File
@@ -508,11 +508,15 @@ $(document).ready(function() {
$(this).children('p').remove();
// add input field
var form=$('<form></form>');
var input=$('<input type="text">');
var form = $('<form></form>');
var input = $('<input type="text">');
var newName = $(this).attr('data-newname') || '';
if (newName) {
input.val(newName);
}
form.append(input);
$(this).append(form);
var lastPos;
var checkInput = function () {
var filename = input.val();
if (type === 'web' && filename.length === 0) {
@@ -543,6 +547,12 @@ $(document).ready(function() {
});
input.focus();
// pre select name up to the extension
lastPos = newName.lastIndexOf('.');
if (lastPos === -1) {
lastPos = newName.length;
}
input.selectRange(0, lastPos);
form.submit(function(event) {
event.stopPropagation();
event.preventDefault();
+33 -7
View File
@@ -422,12 +422,27 @@ var FileList={
}
tr.find('.fileactions').effect('highlight', {}, 5000);
tr.effect('highlight', {}, 5000);
// remove loading mark and recover old image
td.css('background-image', oldBackgroundImage);
}
else {
var fileInfo = result.data;
tr.attr('data-mime', fileInfo.mime);
tr.attr('data-etag', fileInfo.etag);
if (fileInfo.isPreviewAvailable) {
Files.lazyLoadPreview(fileInfo.directory + '/' + fileInfo.name, result.data.mime, function(previewpath) {
tr.find('td.filename').attr('style','background-image:url('+previewpath+')');
}, null, null, result.data.etag);
}
else {
tr.find('td.filename').removeClass('preview').attr('style','background-image:url('+fileInfo.icon+')');
}
}
// reinsert row
tr.detach();
FileList.insertElement( tr.attr('data-file'), tr.attr('data-type'),tr );
// remove loading mark and recover old image
td.css('background-image', oldBackgroundImage);
// update file actions in case the extension changed
FileActions.display( tr.find('td.filename'), true);
}
});
}
@@ -569,8 +584,18 @@ var FileList={
FileList.updateEmptyContent();
Files.updateStorageStatistics();
} else {
if (result.status === 'error' && result.data.message) {
OC.Notification.show(result.data.message);
}
else {
OC.Notification.show(t('files', 'Error deleting file.'));
}
// hide notification after 10 sec
setTimeout(function() {
OC.Notification.hide();
}, 10000);
$.each(files,function(index,file) {
var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete");
var deleteAction = $('tr[data-file="' + file + '"] .action.delete');
deleteAction.removeClass('progress-icon').addClass('delete-icon');
});
}
@@ -598,7 +623,7 @@ var FileList={
var fileSize = '<td class="filesize">'+humanFileSize(summary.totalSize)+'</td>';
}
var $summary = $('<tr class="summary"><td><span class="info">'+info+'</span></td>'+fileSize+'<td></td></tr>');
var $summary = $('<tr class="summary" data-file="undefined"><td><span class="info">'+info+'</span></td>'+fileSize+'<td></td></tr>');
$('#fileList').append($summary);
var $dirInfo = $summary.find('.dirinfo');
@@ -681,8 +706,9 @@ var FileList={
var $fileList = $('#fileList');
var permissions = $('#permissions').val();
var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
$('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').exists());
$('#filestable th').toggleClass('hidden', $fileList.find('tr').exists() === false);
var exists = $fileList.find('tr:first').exists();
$('#emptycontent').toggleClass('hidden', !isCreatable || exists);
$('#filestable th').toggleClass('hidden', !exists);
},
showMask: function() {
// in case one was shown before
@@ -723,7 +749,7 @@ var FileList={
},
filter:function(query) {
$('#fileList tr:not(.summary)').each(function(i,e) {
if ($(e).data('file').toLowerCase().indexOf(query.toLowerCase()) !== -1) {
if ($(e).data('file').toString().toLowerCase().indexOf(query.toLowerCase()) !== -1) {
$(e).addClass("searchresult");
} else {
$(e).removeClass("searchresult");
+16
View File
@@ -3,6 +3,14 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nelze přesunout %s - již existuje soubor se stejným názvem",
"Could not move %s" => "Nelze přesunout %s",
"File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.",
"File name must not contain \"/\". Please choose a different name." => "Název souboru nesmí obsahovat \"/\". Vyberte prosím jiné jméno.",
"The name %s is already used in the folder %s. Please choose a different name." => "Název %s ve složce %s již existuje. Vyberte prosím jiné jméno.",
"Not a valid source" => "Neplatný zdroj",
"Error while downloading %s to %s" => "Chyba při stahování %s do %s",
"Error when creating the file" => "Chyba při vytváření souboru",
"Folder name cannot be empty." => "Název složky nemůže být prázdný.",
"Folder name must not contain \"/\". Please choose a different name." => "Název složky nesmí obsahovat \"/\". Zvolte prosím jiný.",
"Error when creating the folder" => "Chyba při vytváření složky",
"Unable to set upload directory." => "Nelze nastavit adresář pro nahrané soubory.",
"Invalid Token" => "Neplatný token",
"No file was uploaded. Unknown error" => "Žádný soubor nebyl odeslán. Neznámá chyba",
@@ -23,13 +31,19 @@ $TRANSLATIONS = array(
"Upload cancelled." => "Odesílání zrušeno.",
"Could not get result from server." => "Nepodařilo se získat výsledek ze serveru.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky způsobí zrušení nahrávání.",
"URL cannot be empty" => "URL nemůže zůstat prázdná",
"In the home folder 'Shared' is a reserved filename" => "V osobní složce je název 'Shared' rezervovaný",
"{new_name} already exists" => "{new_name} již existuje",
"Could not create file" => "Nepodařilo se vytvořit soubor",
"Could not create folder" => "Nepodařilo se vytvořit složku",
"Share" => "Sdílet",
"Delete permanently" => "Trvale odstranit",
"Rename" => "Přejmenovat",
"Pending" => "Nevyřízené",
"Could not rename file" => "Nepodařilo se přejmenovat soubor",
"replaced {new_name} with {old_name}" => "nahrazeno {new_name} s {old_name}",
"undo" => "vrátit zpět",
"Error deleting file." => "Chyba při mazání souboru.",
"_%n folder_::_%n folders_" => array("%n složka","%n složky","%n složek"),
"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"),
"{dirs} and {files}" => "{dirs} a {files}",
@@ -47,6 +61,7 @@ $TRANSLATIONS = array(
"Name" => "Název",
"Size" => "Velikost",
"Modified" => "Upraveno",
"Invalid folder name. Usage of 'Shared' is reserved." => "Neplatný název složky. Použití 'Shared' je rezervováno.",
"%s could not be renamed" => "%s nemůže být přejmenován",
"Upload" => "Odeslat",
"File handling" => "Zacházení se soubory",
@@ -63,6 +78,7 @@ $TRANSLATIONS = array(
"From link" => "Z odkazu",
"Deleted files" => "Odstraněné soubory",
"Cancel upload" => "Zrušit odesílání",
"You dont have permission to upload or create files here" => "Nemáte oprávnění zde nahrávat či vytvářet soubory",
"Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.",
"Download" => "Stáhnout",
"Unshare" => "Zrušit sdílení",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Die Datei konnte nicht umbenannt werden",
"replaced {new_name} with {old_name}" => "{old_name} ersetzt durch {new_name}",
"undo" => "rückgängig machen",
"Error deleting file." => "Fehler beim Löschen der Datei.",
"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"),
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
"{dirs} and {files}" => "{dirs} und {files}",
+7 -6
View File
@@ -22,11 +22,11 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Kein temporärer Ordner vorhanden",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough storage available" => "Nicht genug Speicher vorhanden.",
"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.",
"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.",
"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Die Dateiinformationen konnten nicht abgerufen werden.",
"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Die hochgeladene Datei konnte nicht gefunden werden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Not enough space available" => "Nicht genügend Speicherplatz verfügbar",
"Upload cancelled." => "Upload abgebrochen.",
"Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.",
@@ -34,7 +34,7 @@ $TRANSLATIONS = array(
"URL cannot be empty" => "Die URL darf nicht leer sein",
"In the home folder 'Shared' is a reserved filename" => "Das Benutzerverzeichnis 'Shared' ist ein reservierter Dateiname",
"{new_name} already exists" => "{new_name} existiert bereits",
"Could not create file" => "Datei konnte nicht erstellt werden",
"Could not create file" => "Die Datei konnte nicht erstellt werden",
"Could not create folder" => "Der Ordner konnte nicht erstellt werden",
"Share" => "Teilen",
"Delete permanently" => "Endgültig löschen",
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Die Datei konnte nicht umbenannt werden",
"replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}",
"undo" => "rückgängig machen",
"Error deleting file." => "Fehler beim Löschen der Datei.",
"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"),
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
"{dirs} and {files}" => "{dirs} und {files}",
@@ -51,8 +52,8 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert aber Ihre Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisieren Sie Ihr privates Schlüssel-Passwort um den Zugriff auf Ihre verschlüsselten Dateien wiederherzustellen.",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert, aber Ihre Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisieren Sie Ihr privates Schlüssel-Passwort, um den Zugriff auf Ihre verschlüsselten Dateien wiederherzustellen.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.",
"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
"Error moving file" => "Fehler beim Verschieben der Datei",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Could not rename file",
"replaced {new_name} with {old_name}" => "replaced {new_name} with {old_name}",
"undo" => "undo",
"Error deleting file." => "Error deleting file.",
"_%n folder_::_%n folders_" => array("%n folder","%n folders"),
"_%n file_::_%n files_" => array("%n file","%n files"),
"{dirs} and {files}" => "{dirs} and {files}",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "No se pudo renombrar el archivo",
"replaced {new_name} with {old_name}" => "reemplazado {new_name} con {old_name}",
"undo" => "deshacer",
"Error deleting file." => "Error borrando el archivo.",
"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"),
"_%n file_::_%n files_" => array("%n archivo","%n archivos"),
"{dirs} and {files}" => "{dirs} y {files}",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Ei suuda faili ümber nimetada",
"replaced {new_name} with {old_name}" => "asendas nime {old_name} nimega {new_name}",
"undo" => "tagasi",
"Error deleting file." => "Viga faili kustutamisel.",
"_%n folder_::_%n folders_" => array("%n kataloog","%n kataloogi"),
"_%n file_::_%n files_" => array("%n fail","%n faili"),
"{dirs} and {files}" => "{dirs} ja {files}",
+5
View File
@@ -6,6 +6,7 @@ $TRANSLATIONS = array(
"File name must not contain \"/\". Please choose a different name." => "Tiedoston nimessä ei saa olla merkkiä \"/\". Valitse toinen nimi.",
"The name %s is already used in the folder %s. Please choose a different name." => "Nimi %s on jo käytössä kansiossa %s. Valitse toinen nimi.",
"Not a valid source" => "Virheellinen lähde",
"Error while downloading %s to %s" => "Virhe ladatessa kohdetta %s sijaintiin %s",
"Error when creating the file" => "Virhe tiedostoa luotaessa",
"Folder name cannot be empty." => "Kansion nimi ei voi olla tyhjä.",
"Folder name must not contain \"/\". Please choose a different name." => "Kansion nimessä ei saa olla merkkiä \"/\". Valitse toinen nimi.",
@@ -19,6 +20,7 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Tilapäiskansio puuttuu",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
"Not enough storage available" => "Tallennustilaa ei ole riittävästi käytettävissä",
"Upload failed. Could not find uploaded file" => "Lähetys epäonnistui. Lähettävää tiedostoa ei löydetty.",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kohdetta {filename} ei voi lähettää, koska se on joko kansio tai sen koko on 0 tavua",
@@ -36,6 +38,7 @@ $TRANSLATIONS = array(
"Pending" => "Odottaa",
"Could not rename file" => "Tiedoston nimeäminen uudelleen epäonnistui",
"undo" => "kumoa",
"Error deleting file." => "Virhe tiedostoa poistaessa.",
"_%n folder_::_%n folders_" => array("%n kansio","%n kansiota"),
"_%n file_::_%n files_" => array("%n tiedosto","%n tiedostoa"),
"{dirs} and {files}" => "{dirs} ja {files}",
@@ -51,6 +54,8 @@ $TRANSLATIONS = array(
"Name" => "Nimi",
"Size" => "Koko",
"Modified" => "Muokattu",
"Invalid folder name. Usage of 'Shared' is reserved." => "Virheellinen kansion nimi. 'Shared':n käyttö on varattu.",
"%s could not be renamed" => "%s ei pysty uudelleen nimeämään",
"Upload" => "Lähetä",
"File handling" => "Tiedostonhallinta",
"Maximum upload size" => "Lähetettävän tiedoston suurin sallittu koko",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Impossible de renommer le fichier",
"replaced {new_name} with {old_name}" => "{new_name} a été remplacé par {old_name}",
"undo" => "annuler",
"Error deleting file." => "Erreur pendant la suppression du fichier.",
"_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"),
"_%n file_::_%n files_" => array("%n fichier","%n fichiers"),
"{dirs} and {files}" => "{dirs} et {files}",
+7
View File
@@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
+2 -1
View File
@@ -1,6 +1,6 @@
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Non se moveu %s - Xa existe un ficheiro con ese nome.",
"Could not move %s - File with this name already exists" => "Non foi posíbel mover %s; Xa existe un ficheiro con ese nome.",
"Could not move %s" => "Non foi posíbel mover %s",
"File name cannot be empty." => "O nome de ficheiro non pode estar baleiro",
"File name must not contain \"/\". Please choose a different name." => "O nome do ficheiro non pode conter «/». Escolla outro nome.",
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Non foi posíbel renomear o ficheiro",
"replaced {new_name} with {old_name}" => "substituír {new_name} por {old_name}",
"undo" => "desfacer",
"Error deleting file." => "Produciuse un erro ao eliminar o ficheiro.",
"_%n folder_::_%n folders_" => array("%n cartafol","%n cartafoles"),
"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"),
"{dirs} and {files}" => "{dirs} e {files}",
+1
View File
@@ -60,6 +60,7 @@ $TRANSLATIONS = array(
"Name" => "Név",
"Size" => "Méret",
"Modified" => "Módosítva",
"Invalid folder name. Usage of 'Shared' is reserved." => "Érvénytelen mappanév. A 'Shared' a rendszer számára fenntartott elnevezés.",
"%s could not be renamed" => "%s átnevezése nem sikerült",
"Upload" => "Feltöltés",
"File handling" => "Fájlkezelés",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Impossibile rinominare il file",
"replaced {new_name} with {old_name}" => "sostituito {new_name} con {old_name}",
"undo" => "annulla",
"Error deleting file." => "Errore durante l'eliminazione del file.",
"_%n folder_::_%n folders_" => array("%n cartella","%n cartelle"),
"_%n file_::_%n files_" => array("%n file","%n file"),
"{dirs} and {files}" => "{dirs} e {files}",
+2
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "ファイルの名前変更ができませんでした",
"replaced {new_name} with {old_name}" => "{old_name} を {new_name} に置換",
"undo" => "元に戻す",
"Error deleting file." => "ファイルの削除エラー。",
"_%n folder_::_%n folders_" => array("%n 個のフォルダ"),
"_%n file_::_%n files_" => array("%n 個のファイル"),
"{dirs} and {files}" => "{dirs} と {files}",
@@ -60,6 +61,7 @@ $TRANSLATIONS = array(
"Name" => "名前",
"Size" => "サイズ",
"Modified" => "更新日時",
"Invalid folder name. Usage of 'Shared' is reserved." => "無効なフォルダ名。「Shared」の利用は予約されています。",
"%s could not be renamed" => "%sの名前を変更できませんでした",
"Upload" => "アップロード",
"File handling" => "ファイル操作",
+3
View File
@@ -4,6 +4,8 @@ $TRANSLATIONS = array(
"Could not move %s" => "Nepavyko perkelti %s",
"File name cannot be empty." => "Failo pavadinimas negali būti tuščias.",
"File name must not contain \"/\". Please choose a different name." => "Failo pavadinime negali būti simbolio \"/\". Prašome pasirinkti kitokį pavadinimą.",
"The name %s is already used in the folder %s. Please choose a different name." => "Pavadinimas %s jau naudojamas aplanke %s. Prašome pasirinkti kitokį pavadinimą.",
"Not a valid source" => "Netinkamas šaltinis",
"Error while downloading %s to %s" => "Klaida siunčiant %s į %s",
"Error when creating the file" => "Klaida kuriant failą",
"Folder name cannot be empty." => "Aplanko pavadinimas negali būti tuščias.",
@@ -40,6 +42,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Neįmanoma pervadinti failo",
"replaced {new_name} with {old_name}" => "pakeiskite {new_name} į {old_name}",
"undo" => "anuliuoti",
"Error deleting file." => "Klaida trinant failą.",
"_%n folder_::_%n folders_" => array("%n aplankas","%n aplankai","%n aplankų"),
"_%n file_::_%n files_" => array("%n failas","%n failai","%n failų"),
"{dirs} and {files}" => "{dirs} ir {files}",
+14
View File
@@ -3,7 +3,14 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nie można było przenieść %s - Plik o takiej nazwie już istnieje",
"Could not move %s" => "Nie można było przenieść %s",
"File name cannot be empty." => "Nazwa pliku nie może być pusta.",
"File name must not contain \"/\". Please choose a different name." => "Nazwa pliku nie może zawierać \"/\". Proszę wybrać inną nazwę.",
"The name %s is already used in the folder %s. Please choose a different name." => "Nazwa %s jest już używana w folderze %s. Proszę wybrać inną nazwę.",
"Not a valid source" => "Niepoprawne źródło",
"Error while downloading %s to %s" => "Błąd podczas pobierania %s do %S",
"Error when creating the file" => "Błąd przy tworzeniu pliku",
"Folder name cannot be empty." => "Nazwa folderu nie może być pusta.",
"Folder name must not contain \"/\". Please choose a different name." => "Nazwa folderu nie może zawierać \"/\". Proszę wybrać inną nazwę.",
"Error when creating the folder" => "Błąd przy tworzeniu folderu",
"Unable to set upload directory." => "Nie można ustawić katalog wczytywania.",
"Invalid Token" => "Nieprawidłowy Token",
"No file was uploaded. Unknown error" => "Żaden plik nie został załadowany. Nieznany błąd",
@@ -24,11 +31,16 @@ $TRANSLATIONS = array(
"Upload cancelled." => "Wczytywanie anulowane.",
"Could not get result from server." => "Nie można uzyskać wyniku z serwera.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Wysyłanie pliku jest w toku. Jeśli opuścisz tę stronę, wysyłanie zostanie przerwane.",
"URL cannot be empty" => "URL nie może być pusty",
"In the home folder 'Shared' is a reserved filename" => "W katalogu domowym \"Shared\" jest zarezerwowana nazwa pliku",
"{new_name} already exists" => "{new_name} już istnieje",
"Could not create file" => "Nie można utworzyć pliku",
"Could not create folder" => "Nie można utworzyć folderu",
"Share" => "Udostępnij",
"Delete permanently" => "Trwale usuń",
"Rename" => "Zmień nazwę",
"Pending" => "Oczekujące",
"Could not rename file" => "Nie można zmienić nazwy pliku",
"replaced {new_name} with {old_name}" => "zastąpiono {new_name} przez {old_name}",
"undo" => "cofnij",
"_%n folder_::_%n folders_" => array("%n katalog","%n katalogi","%n katalogów"),
@@ -48,6 +60,7 @@ $TRANSLATIONS = array(
"Name" => "Nazwa",
"Size" => "Rozmiar",
"Modified" => "Modyfikacja",
"Invalid folder name. Usage of 'Shared' is reserved." => "Niepoprawna nazwa folderu. Wykorzystanie \"Shared\" jest zarezerwowane.",
"%s could not be renamed" => "%s nie można zmienić nazwy",
"Upload" => "Wyślij",
"File handling" => "Zarządzanie plikami",
@@ -64,6 +77,7 @@ $TRANSLATIONS = array(
"From link" => "Z odnośnika",
"Deleted files" => "Pliki usunięte",
"Cancel upload" => "Anuluj wysyłanie",
"You dont have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu",
"Nothing in here. Upload something!" => "Pusto. Wyślij coś!",
"Download" => "Pobierz",
"Unshare" => "Zatrzymaj współdzielenie",
+1
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Não foi possível renomear o arquivo",
"replaced {new_name} with {old_name}" => "Substituído {old_name} por {new_name} ",
"undo" => "desfazer",
"Error deleting file." => "Erro eliminando o arquivo.",
"_%n folder_::_%n folders_" => array("%n pasta","%n pastas"),
"_%n file_::_%n files_" => array("%n arquivo","%n arquivos"),
"{dirs} and {files}" => "{dirs} e {files}",
+3 -1
View File
@@ -7,9 +7,11 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
"Error" => "Ошибка",
"Size" => "Размер",
"Upload" => "Загрузка",
"Save" => "Сохранить",
"Cancel upload" => "Отмена загрузки",
"Download" => "Загрузка"
"Download" => "Загрузка",
"Delete" => "Удалить"
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
+15
View File
@@ -3,6 +3,14 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nie je možné presunúť %s - súbor s týmto menom už existuje",
"Could not move %s" => "Nie je možné presunúť %s",
"File name cannot be empty." => "Meno súboru nemôže byť prázdne",
"File name must not contain \"/\". Please choose a different name." => "Názov súboru nesmie obsahovať \"/\". Prosím zvoľte iný názov.",
"The name %s is already used in the folder %s. Please choose a different name." => "Názov %s už používa priečinok s%. Prosím zvoľte iný názov.",
"Not a valid source" => "Neplatný zdroj",
"Error while downloading %s to %s" => "Chyba pri sťahovaní súboru %s do %s",
"Error when creating the file" => "Chyba pri vytváraní súboru",
"Folder name cannot be empty." => "Názov súboru nemôže byť prázdny.",
"Folder name must not contain \"/\". Please choose a different name." => "Názov priečinka nesmie obsahovať \"/\". Prosím zvoľte iný názov.",
"Error when creating the folder" => "Chyba pri vytváraní priečinka",
"Unable to set upload directory." => "Nemožno nastaviť priečinok pre nahrané súbory.",
"Invalid Token" => "Neplatný token",
"No file was uploaded. Unknown error" => "Žiaden súbor nebol nahraný. Neznáma chyba",
@@ -23,11 +31,16 @@ $TRANSLATIONS = array(
"Upload cancelled." => "Odosielanie zrušené.",
"Could not get result from server." => "Nepodarilo sa dostať výsledky zo servera.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.",
"URL cannot be empty" => "URL nemôže byť prázdna",
"In the home folder 'Shared' is a reserved filename" => "V domovskej zložke je názov \"Shared\" vyhradený názov súboru",
"{new_name} already exists" => "{new_name} už existuje",
"Could not create file" => "Nemožno vytvoriť súbor",
"Could not create folder" => "Nemožno vytvoriť priečinok",
"Share" => "Zdieľať",
"Delete permanently" => "Zmazať trvalo",
"Rename" => "Premenovať",
"Pending" => "Prebieha",
"Could not rename file" => "Nemožno premenovať súbor",
"replaced {new_name} with {old_name}" => "prepísaný {new_name} súborom {old_name}",
"undo" => "vrátiť",
"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"),
@@ -47,6 +60,7 @@ $TRANSLATIONS = array(
"Name" => "Názov",
"Size" => "Veľkosť",
"Modified" => "Upravené",
"Invalid folder name. Usage of 'Shared' is reserved." => "Názov priečinka je chybný. Použitie názvu 'Shared' nie je povolené.",
"%s could not be renamed" => "%s nemohol byť premenovaný",
"Upload" => "Odoslať",
"File handling" => "Nastavenie správania sa k súborom",
@@ -63,6 +77,7 @@ $TRANSLATIONS = array(
"From link" => "Z odkazu",
"Deleted files" => "Zmazané súbory",
"Cancel upload" => "Zrušiť odosielanie",
"You dont have permission to upload or create files here" => "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory",
"Nothing in here. Upload something!" => "Žiadny súbor. Nahrajte niečo!",
"Download" => "Sťahovanie",
"Unshare" => "Zrušiť zdieľanie",
+34 -9
View File
@@ -1,8 +1,16 @@
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "%s ni mogoče premakniti - datoteka s tem imenom že obstaja",
"Could not move %s" => "Ni mogoče premakniti %s",
"Could not move %s - File with this name already exists" => "Datoteke %s ni mogoče premakniti - datoteka s tem imenom že obstaja.",
"Could not move %s" => "Datoteke %s ni mogoče premakniti",
"File name cannot be empty." => "Ime datoteke ne sme biti prazno polje.",
"File name must not contain \"/\". Please choose a different name." => "Ime datoteke ne sme vsebovati znaka \"/\". Določiti je treba drugo ime.",
"The name %s is already used in the folder %s. Please choose a different name." => "Ime %s je že v mapi %s že v uporabi. Izbrati je treba drugo ime.",
"Not a valid source" => "Vir ni veljaven",
"Error while downloading %s to %s" => "Napaka med prejemanjem %s v mapo %s",
"Error when creating the file" => "Napaka med ustvarjanjem datoteke",
"Folder name cannot be empty." => "Ime mape ne more biti prazna vrednost.",
"Folder name must not contain \"/\". Please choose a different name." => "Ime mape ne sme vsebovati znaka \"/\". Določiti je treba drugo ime.",
"Error when creating the folder" => "Napaka med ustvarjanjem mape",
"Unable to set upload directory." => "Mapo, v katero boste prenašali dokumente, ni mogoče določiti",
"Invalid Token" => "Neveljaven žeton",
"No file was uploaded. Unknown error" => "Ni poslane datoteke. Neznana napaka.",
@@ -14,31 +22,47 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manjka začasna mapa",
"Failed to write to disk" => "Pisanje na disk je spodletelo",
"Not enough storage available" => "Na voljo ni dovolj prostora",
"Upload failed. Could not get file info." => "Pošiljanje je spodletelo. Ni mogoče pridobiti podrobnosti datoteke.",
"Upload failed. Could not find uploaded file" => "Pošiljanje je spodletelo. Ni mogoče najti poslane datoteke.",
"Invalid directory." => "Neveljavna mapa.",
"Files" => "Datoteke",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Ni mogoče poslati datoteke {filename}, saj je to ali mapa ali pa je velikost datoteke 0 bajtov.",
"Not enough space available" => "Na voljo ni dovolj prostora.",
"Upload cancelled." => "Pošiljanje je preklicano.",
"Could not get result from server." => "Ni mogoče pridobiti podatkov s strežnika.",
"File upload is in progress. Leaving the page now will cancel the upload." => "V teku je pošiljanje datoteke. Če zapustite to stran zdaj, bo pošiljanje preklicano.",
"URL cannot be empty" => "Polje naslova URL ne sme biti prazno",
"In the home folder 'Shared' is a reserved filename" => "V domači mapi ni dovoljeno ustvariti mape z imenom 'Souporabe', saj je ime zadržano za javno mapo.",
"{new_name} already exists" => "{new_name} že obstaja",
"Could not create file" => "Ni mogoče ustvariti datoteke",
"Could not create folder" => "Ni mogoče ustvariti mape",
"Share" => "Souporaba",
"Delete permanently" => "Izbriši dokončno",
"Rename" => "Preimenuj",
"Pending" => "V čakanju ...",
"Could not rename file" => "Ni mogoče preimenovati datoteke",
"replaced {new_name} with {old_name}" => "preimenovano ime {new_name} z imenom {old_name}",
"undo" => "razveljavi",
"_%n folder_::_%n folders_" => array("","","",""),
"_%n file_::_%n files_" => array("","","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","","",""),
"Error deleting file." => "Napaka brisanja datoteke.",
"_%n folder_::_%n folders_" => array("%n mapa","%n mapi","%n mape","%n map"),
"_%n file_::_%n files_" => array("%n datoteka","%n datoteki","%n datoteke","%n datotek"),
"{dirs} and {files}" => "{dirs} in {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Posodabljanje %n datoteke","Posodabljanje %n datotek","Posodabljanje %n datotek","Posodabljanje %n datotek"),
"'.' is an invalid file name." => "'.' je neveljavno ime datoteke.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neveljavno ime, znaki '\\', '/', '<', '>', ':', '\"', '|', '?' in '*' niso dovoljeni.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neveljavno ime; znaki '\\', '/', '<', '>', ':', '\"', '|', '?' in '*' niso dovoljeni.",
"Your storage is full, files can not be updated or synced anymore!" => "Shramba je povsem napolnjena. Datotek ni več mogoče posodabljati in usklajevati!",
"Your storage is almost full ({usedSpacePercent}%)" => "Mesto za shranjevanje je skoraj polno ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Postopek priprave datoteke za prejem je lahko dolgotrajen, če je datoteka zelo velika.",
"Your storage is almost full ({usedSpacePercent}%)" => "Prostor za shranjevanje je skoraj do konca zaseden ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Program za šifriranje je omogočen, vendar ni začet. Odjavite se in nato ponovno prijavite.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ni ustreznega osebnega ključa za program za šifriranje. Posodobite osebni ključ za dostop do šifriranih datotek med nastavitvami.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifriranje je onemogočeno, datoteke pa so še vedno šifrirane. Odšifrirajte jih med nastavitvami.",
"Your download is being prepared. This might take some time if the files are big." => "Postopek priprave datoteke za prejem je lahko dolgotrajen, kadar je datoteka zelo velika.",
"Error moving file" => "Napaka premikanja datoteke",
"Error" => "Napaka",
"Name" => "Ime",
"Size" => "Velikost",
"Modified" => "Spremenjeno",
"%s could not be renamed" => "%s ni bilo mogoče preimenovati",
"Invalid folder name. Usage of 'Shared' is reserved." => "Neveljavno ime mape. Ime 'Souporaba' je zadržana za javno mapo.",
"%s could not be renamed" => "%s ni mogoče preimenovati",
"Upload" => "Pošlji",
"File handling" => "Upravljanje z datotekami",
"Maximum upload size" => "Največja velikost za pošiljanja",
@@ -54,6 +78,7 @@ $TRANSLATIONS = array(
"From link" => "Iz povezave",
"Deleted files" => "Izbrisane datoteke",
"Cancel upload" => "Prekliči pošiljanje",
"You dont have permission to upload or create files here" => "Ni ustreznih dovoljenj za pošiljanje ali ustvarjanje datotek na tem mestu.",
"Nothing in here. Upload something!" => "Tukaj še ni ničesar. Najprej je treba kakšno datoteko poslati v oblak!",
"Download" => "Prejmi",
"Unshare" => "Prekliči souporabo",
+2
View File
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Kan ej byta filnamn",
"replaced {new_name} with {old_name}" => "ersatt {new_name} med {old_name}",
"undo" => "ångra",
"Error deleting file." => "Kunde inte ta bort filen.",
"_%n folder_::_%n folders_" => array("%n mapp","%n mappar"),
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"{dirs} and {files}" => "{dirs} och {files}",
@@ -60,6 +61,7 @@ $TRANSLATIONS = array(
"Name" => "Namn",
"Size" => "Storlek",
"Modified" => "Ändrad",
"Invalid folder name. Usage of 'Shared' is reserved." => "Ogiltigt mappnamn. Användande av 'Shared' är reserverat av ownCloud",
"%s could not be renamed" => "%s kunde inte namnändras",
"Upload" => "Ladda upp",
"File handling" => "Filhantering",
+2 -1
View File
@@ -1,6 +1,6 @@
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "%s taşınamadı. Bu isimde dosya zaten var.",
"Could not move %s - File with this name already exists" => "%s taşınamadı - Bu isimde dosya zaten var",
"Could not move %s" => "%s taşınamadı",
"File name cannot be empty." => "Dosya adı boş olamaz.",
"File name must not contain \"/\". Please choose a different name." => "Dosya adı \"/\" içermemelidir. Lütfen farklı bir isim seçin.",
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Dosya adlandırılamadı",
"replaced {new_name} with {old_name}" => "{new_name} ismi {old_name} ile değiştirildi",
"undo" => "geri al",
"Error deleting file." => "Dosya silinirken hata.",
"_%n folder_::_%n folders_" => array("%n dizin","%n dizin"),
"_%n file_::_%n files_" => array("%n dosya","%n dosya"),
"{dirs} and {files}" => "{dirs} ve {files}",
+18 -5
View File
@@ -76,12 +76,25 @@ class App {
$this->view->rename($dir . '/' . $oldname, $dir . '/' . $newname)
) {
// successful rename
$result['success'] = true;
$result['data'] = array(
'dir' => $dir,
'file' => $oldname,
'newname' => $newname
$meta = $this->view->getFileInfo($dir . '/' . $newname);
if ($meta['mimetype'] === 'httpd/unix-directory') {
$meta['type'] = 'dir';
}
else {
$meta['type'] = 'file';
}
$fileinfo = array(
'id' => $meta['fileid'],
'mime' => $meta['mimetype'],
'size' => $meta['size'],
'etag' => $meta['etag'],
'directory' => $dir,
'name' => $newname,
'isPreviewAvailable' => \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']),
'icon' => \OCA\Files\Helper::determineIcon($meta)
);
$result['success'] = true;
$result['data'] = $fileinfo;
} else {
// rename failed
$result['data'] = array(
+10 -18
View File
@@ -5,9 +5,9 @@
<a><?php p($l->t('New'));?></a>
<ul>
<li style="background-image:url('<?php p(OCP\mimetype_icon('text/plain')) ?>')"
data-type='file'><p><?php p($l->t('Text file'));?></p></li>
data-type='file' data-newname='<?php p($l->t('New text file')) ?>.txt'><p><?php p($l->t('Text file'));?></p></li>
<li style="background-image:url('<?php p(OCP\mimetype_icon('dir')) ?>')"
data-type='folder'><p><?php p($l->t('Folder'));?></p></li>
data-type='folder' data-newname='<?php p($l->t('New folder')) ?>'><p><?php p($l->t('Folder'));?></p></li>
<li style="background-image:url('<?php p(OCP\image_path('core', 'places/link.svg')) ?>')"
data-type='web'><p><?php p($l->t('From link'));?></p></li>
</ul>
@@ -25,7 +25,7 @@
data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
<a href="#" class="svg"></a>
</div>
<?php if ($_['trash'] ): ?>
<?php if ($_['trash']): ?>
<input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>></input>
<?php endif; ?>
<div id="uploadprogresswrapper">
@@ -69,20 +69,11 @@
<th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
<!-- NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->
<?php if ($_['dir'] == '/Shared'): ?>
<span class="selectedActions"><a href="" class="delete-selected">
<?php p($l->t('Unshare'))?>
<img class="svg" alt="<?php p($l->t('Unshare'))?>"
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
</a></span>
<?php else: ?>
<span class="selectedActions"><a href="" class="delete-selected">
<?php p($l->t('Delete'))?>
<img class="svg" alt="<?php p($l->t('Delete'))?>"
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
</a></span>
<?php endif; ?>
<span class="selectedActions"><a href="" class="delete-selected">
<?php p($l->t('Delete'))?>
<img class="svg" alt="<?php p($l->t('Delete'))?>"
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
</a></span>
<?php endif; ?>
</th>
</tr>
@@ -111,8 +102,9 @@
<input type="hidden" name="ajaxLoad" id="ajaxLoad" value="<?php p($_['ajaxLoad']); ?>" />
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" />
<?php if (!$_['isPublic']) :?>
<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
<?php endif;
+61 -21
View File
@@ -22,23 +22,39 @@
*/
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
private static $user;
function setUp() {
// mock OC_L10n
if (!self::$user) {
self::$user = uniqid();
}
\OC_User::createUser(self::$user, 'password');
\OC_User::setUserId(self::$user);
\OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files');
$l10nMock = $this->getMock('\OC_L10N', array('t'), array(), '', false);
$l10nMock->expects($this->any())
->method('t')
->will($this->returnArgument(0));
$viewMock = $this->getMock('\OC\Files\View', array('rename', 'normalizePath'), array(), '', false);
$viewMock = $this->getMock('\OC\Files\View', array('rename', 'normalizePath', 'getFileInfo'), array(), '', false);
$viewMock->expects($this->any())
->method('normalizePath')
->will($this->returnArgument(0));
$viewMock->expects($this->any())
->method('rename')
->will($this->returnValue(true));
$this->viewMock = $viewMock;
$this->files = new \OCA\Files\App($viewMock, $l10nMock);
}
function tearDown() {
$result = \OC_User::deleteUser(self::$user);
$this->assertTrue($result);
\OC\Files\Filesystem::tearDown();
}
/**
* @brief test rename of file/folder named "Shared"
*/
@@ -64,17 +80,28 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
$oldname = 'Shared';
$newname = 'new_name';
$result = $this->files->rename($dir, $oldname, $newname);
$expected = array(
'success' => true,
'data' => array(
'dir' => $dir,
'file' => $oldname,
'newname' => $newname
)
);
$this->viewMock->expects($this->any())
->method('getFileInfo')
->will($this->returnValue(array(
'fileid' => 123,
'type' => 'dir',
'mimetype' => 'httpd/unix-directory',
'size' => 18,
'etag' => 'abcdef',
'directory' => '/',
'name' => 'new_name',
)));
$this->assertEquals($expected, $result);
$result = $this->files->rename($dir, $oldname, $newname);
$this->assertTrue($result['success']);
$this->assertEquals(123, $result['data']['id']);
$this->assertEquals('new_name', $result['data']['name']);
$this->assertEquals('/test', $result['data']['directory']);
$this->assertEquals(18, $result['data']['size']);
$this->assertEquals('httpd/unix-directory', $result['data']['mime']);
$this->assertEquals(\OC_Helper::mimetypeIcon('dir'), $result['data']['icon']);
$this->assertFalse($result['data']['isPreviewAvailable']);
}
/**
@@ -102,16 +129,29 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
$oldname = 'oldname';
$newname = 'newname';
$result = $this->files->rename($dir, $oldname, $newname);
$expected = array(
'success' => true,
'data' => array(
'dir' => $dir,
'file' => $oldname,
'newname' => $newname
)
);
$this->viewMock->expects($this->any())
->method('getFileInfo')
->will($this->returnValue(array(
'fileid' => 123,
'type' => 'dir',
'mimetype' => 'httpd/unix-directory',
'size' => 18,
'etag' => 'abcdef',
'directory' => '/',
'name' => 'new_name',
)));
$this->assertEquals($expected, $result);
$result = $this->files->rename($dir, $oldname, $newname);
$this->assertTrue($result['success']);
$this->assertEquals(123, $result['data']['id']);
$this->assertEquals('newname', $result['data']['name']);
$this->assertEquals('/', $result['data']['directory']);
$this->assertEquals(18, $result['data']['size']);
$this->assertEquals('httpd/unix-directory', $result['data']['mime']);
$this->assertEquals('abcdef', $result['data']['etag']);
$this->assertEquals(\OC_Helper::mimetypeIcon('dir'), $result['data']['icon']);
$this->assertFalse($result['data']['isPreviewAvailable']);
}
}
@@ -0,0 +1,28 @@
<?php
/**
* Copyright (c) 2013, Bjoern Schiessle <schiessle@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief check migration status
*/
use OCA\Encryption\Util;
\OCP\JSON::checkAppEnabled('files_encryption');
$loginname = isset($_POST['user']) ? $_POST['user'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$migrationCompleted = true;
if ($loginname !== '' && $password !== '') {
$username = \OCP\User::checkPassword($loginname, $password);
if ($username) {
$util = new Util(new \OC_FilesystemView('/'), $username);
if ($util->getMigrationStatus() !== Util::MIGRATION_COMPLETED) {
$migrationCompleted = false;
}
}
}
\OCP\JSON::success(array('data' => array('migrationCompleted' => $migrationCompleted)));
+2 -1
View File
@@ -10,6 +10,8 @@ OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php';
OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php';
OC::$CLASSPATH['OCA\Encryption\Helper'] = 'files_encryption/lib/helper.php';
\OCP\Util::addscript('files_encryption', 'detect-migration');
if (!OC_Config::getValue('maintenance', false)) {
OC_FileProxy::register(new OCA\Encryption\Proxy());
@@ -52,4 +54,3 @@ if (!OC_Config::getValue('maintenance', false)) {
// Register settings scripts
OCP\App::registerAdmin('files_encryption', 'settings-admin');
OCP\App::registerPersonal('files_encryption', 'settings-personal');
+30 -25
View File
@@ -179,9 +179,9 @@ class Hooks {
// the necessary keys)
if (Crypt::mode() === 'server') {
if ($params['uid'] === \OCP\User::getUser()) {
$view = new \OC_FilesystemView('/');
$view = new \OC_FilesystemView('/');
if ($params['uid'] === \OCP\User::getUser()) {
$session = new \OCA\Encryption\Session($view);
@@ -202,36 +202,41 @@ class Hooks {
} else { // admin changed the password for a different user, create new keys and reencrypt file keys
$user = $params['uid'];
$recoveryPassword = $params['recoveryPassword'];
$newUserPassword = $params['password'];
$util = new Util($view, $user);
$recoveryPassword = isset($params['recoveryPassword']) ? $params['recoveryPassword'] : null;
$view = new \OC_FilesystemView('/');
if (($util->recoveryEnabledForUser() && $recoveryPassword)
|| !$util->userKeysExists()) {
// make sure that the users home is mounted
\OC\Files\Filesystem::initMountPoints($user);
$recoveryPassword = $params['recoveryPassword'];
$newUserPassword = $params['password'];
$keypair = Crypt::createKeypair();
// make sure that the users home is mounted
\OC\Files\Filesystem::initMountPoints($user);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$keypair = Crypt::createKeypair();
// Save public key
$view->file_put_contents('/public-keys/' . $user . '.public.key', $keypair['publicKey']);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// Encrypt private key empty passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], $newUserPassword);
// Save public key
$view->file_put_contents('/public-keys/' . $user . '.public.key', $keypair['publicKey']);
// Save private key
$view->file_put_contents(
'/' . $user . '/files_encryption/' . $user . '.private.key', $encryptedPrivateKey);
// Encrypt private key empty passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], $newUserPassword);
if ($recoveryPassword) { // if recovery key is set we can re-encrypt the key files
$util = new Util($view, $user);
$util->recoverUsersFiles($recoveryPassword);
// Save private key
$view->file_put_contents(
'/' . $user . '/files_encryption/' . $user . '.private.key', $encryptedPrivateKey);
if ($recoveryPassword) { // if recovery key is set we can re-encrypt the key files
$util = new Util($view, $user);
$util->recoverUsersFiles($recoveryPassword);
}
\OC_FileProxy::$enabled = $proxyStatus;
}
\OC_FileProxy::$enabled = $proxyStatus;
}
}
}
@@ -318,8 +323,8 @@ class Hooks {
// get the parent from current share
$parent = $util->getShareParent($params['parent']);
// if parent is file the it is an 1:1 share
if ($parent['item_type'] === 'file') {
// if parent has the same type than the child it is a 1:1 share
if ($parent['item_type'] === $params['itemType']) {
// prefix path with Shared
$path = '/Shared' . $parent['file_target'];
@@ -0,0 +1,29 @@
/**
* Copyright (c) 2013
* Bjoern Schiessle <schiessle@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
$(document).ready(function(){
$('form[name="login"]').on('submit', function() {
var user = $('#user').val();
var password = $('#password').val();
$.ajax({
type: 'POST',
url: OC.linkTo('files_encryption', 'ajax/getMigrationStatus.php'),
dataType: 'json',
data: {user: user, password: password},
async: false,
success: function(response) {
if (response.data.migrationCompleted === false) {
var message = t('files_encryption', 'Initial encryption started... This can take some time. Please wait.');
$('#messageText').text(message);
$('#message').removeClass('hidden').addClass('update');
}
}
});
});
});
+1
View File
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Heslo soukromého klíče úspěšně aktualizováno.",
"Could not update the private key password. Maybe the old password was not correct." => "Nelze aktualizovat heslo soukromého klíče. Možná nebylo staré heslo správně.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Aplikace pro šifrování není inicializována! Je možné, že aplikace byla znovu aktivována během vašeho přihlášení. Zkuste se prosím odhlásit a znovu přihlásit pro provedení inicializace šifrovací aplikace.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš soukromý klíč není platný! Pravděpodobně bylo vaše heslo změněno vně systému %s (např. ve vašem firemním adresáři). Heslo vašeho soukromého klíče můžete změnit ve svém osobním nastavení pro obnovení přístupu k vašim zašifrovaným souborům.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tento soubor se nepodařilo dešifrovat, pravděpodobně je sdílený. Požádejte prosím majitele souboru, aby jej s vámi znovu sdílel.",
"Unknown error please check your system settings or contact your administrator" => "Neznámá chyba, zkontrolujte vaše systémová nastavení nebo kontaktujte vašeho správce",
"Missing requirements." => "Nesplněné závislosti.",
+22 -1
View File
@@ -1,13 +1,34 @@
<?php
$TRANSLATIONS = array(
"Recovery key successfully enabled" => "Επιτυχής ενεργοποίηση κλειδιού ανάκτησης",
"Could not enable recovery key. Please check your recovery key password!" => "Αποτυχία ενεργοποίησης κλειδιού ανάκτησης. Παρακαλώ ελέγξτε τον κωδικό του κλειδιού ανάκτησής σας!",
"Recovery key successfully disabled" => "Επιτυχής απενεργοποίηση κλειδιού ανάκτησης",
"Could not disable recovery key. Please check your recovery key password!" => "Αποτυχία απενεργοποίησης κλειδιού ανάκτησης. Παρακαλώ ελέγξτε τον κωδικό του κλειδιού ανάκτησής σας!",
"Password successfully changed." => "Ο κωδικός αλλάχτηκε επιτυχώς.",
"Could not change the password. Maybe the old password was not correct." => "Αποτυχία αλλαγής κωδικού ίσως ο παλιός κωδικός να μην ήταν σωστός.",
"Private key password successfully updated." => "Το Προσωπικό κλειδί πρόσβασης ενημερώθηκε επιτυχώς",
"Could not update the private key password. Maybe the old password was not correct." => "Αποτυχία ενημέρωσης του κωδικού για το προσωπικό κλειδί. Ενδεχομένως ο παλιός κωδικός δεν ήταν σωστός.",
"Unknown error please check your system settings or contact your administrator" => "Άγνωστο σφάλμα, παρακαλώ ελέγξτε τις ρυθμίσεις συστήματος ή επικοινωνήστε με τον διαχειριστή σας ",
"Missing requirements." => "Προαπαιτούμενα που απουσιάζουν.",
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Παρακαλώ επιβεβαιώστε ότι η PHP 5.3.3 ή νεότερη είναι εγκατεστημένη και ότι το OpenSSL μαζί με το PHP extension είναι ενεργοποιήμένο και έχει ρυθμιστεί σωστά. Προς το παρόν, η εφαρμογή κρυπτογράφησης είναι απενεργοποιημένη.",
"Following users are not set up for encryption:" => "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:",
"Saving..." => "Γίνεται αποθήκευση...",
"Go directly to your " => "Πηγαίνε απευθείας στο ",
"personal settings" => "προσωπικές ρυθμίσεις",
"Encryption" => "Κρυπτογράφηση",
"Recovery key password" => "Επαναφορά κωδικού κλειδιού",
"Enabled" => "Ενεργοποιημένο",
"Disabled" => "Απενεργοποιημένο",
"New Recovery key password" => "Νέο κλειδί επαναφοράς κωδικού",
"Change Password" => "Αλλαγή Κωδικού Πρόσβασης",
"File recovery settings updated" => "Οι ρυθμίσεις επαναφοράς αρχείων ανανεώθηκαν"
"Your private key password no longer match your log-in password:" => "Ο κωδικός του προσωπικού κλειδιού δεν ταιριάζει πλέον με τον κωδικό σύνδεσής σας:",
" If you don't remember your old password you can ask your administrator to recover your files." => "Εάν δεν θυμάστε τον παλιό σας κωδικό μπορείτε να ζητήσετε από τον διαχειριστή σας να επανακτήσει τα αρχεία σας.",
"Old log-in password" => "Παλαιό συνθηματικό εισόδου",
"Current log-in password" => "Τρέχον συνθηματικό πρόσβασης",
"Update Private Key Password" => "Ενημέρωση Προσωπικού Κλειδού Πρόσβασης",
"Enable password recovery:" => "Ενεργοποιήστε την ανάκτηση κωδικού πρόσβασης",
"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Η ενεργοποίηση αυτής της επιλογής θα σας επιτρέψει να επανακτήσετε πρόσβαση στα κρυπτογραφημένα σας αρχεία σε περίπτωση απώλειας του κωδικού σας",
"File recovery settings updated" => "Οι ρυθμίσεις επαναφοράς αρχείων ανανεώθηκαν",
"Could not update file recovery" => "Αποτυχία ενημέρωσης ανάκτησης αρχείων"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
+1
View File
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "秘密鍵のパスワードが正常に更新されました。",
"Could not update the private key password. Maybe the old password was not correct." => "秘密鍵のパスワードを更新できませんでした。古いパスワードが正確でない場合があります。",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "暗号化アプリが初期化されていません。暗号化アプリが接続中に再度有効かされた可能性があります。暗号化アプリを初期化する為に、1回ログアウトしてログインしなおしてください。",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "プライベートキーが有効ではありません!パスワードが%sの外部で変更された(例: 共同ディレクトリ)と思われます。個人設定でプライベートキーのパスワードを更新して、暗号化ファイルへのアクセスを回復することができます。",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。",
"Unknown error please check your system settings or contact your administrator" => "不明なエラーです。システム設定を確認するか、管理者に問い合わせてください。",
"Missing requirements." => "必要要件が満たされていません。",
+1
View File
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Pomyślnie zaktualizowano hasło klucza prywatnego.",
"Could not update the private key password. Maybe the old password was not correct." => "Nie można zmienić prywatnego hasła. Może stare hasło nie było poprawne.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Szyfrowanie aplikacja nie została zainicjowane! Może szyfrowanie aplikacji zostało ponownie włączone podczas tej sesji. Spróbuj się wylogować i zalogować ponownie aby zainicjować szyfrowanie aplikacji.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Klucz prywatny nie jest poprawny! Prawdopodobnie Twoje hasło zostało zmienione poza %s (np. w katalogu firmy). Aby odzyskać dostęp do zaszyfrowanych plików można zaktualizować hasło klucza prywatnego w ustawieniach osobistych.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Nie można odszyfrować tego pliku, prawdopodobnie jest to plik udostępniony. Poproś właściciela pliku o ponowne udostępnianie pliku Tobie.",
"Unknown error please check your system settings or contact your administrator" => "Nieznany błąd proszę sprawdzić ustawienia systemu lub skontaktuj się z administratorem",
"Missing requirements." => "Brak wymagań.",
+1
View File
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Heslo súkromného kľúča je úspešne aktualizované.",
"Could not update the private key password. Maybe the old password was not correct." => "Nemožno aktualizovať heslo súkromného kľúča. Možno nebolo staré heslo správne.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Šifrovacia aplikácia nie je inicializovaná. Je možné, že aplikácia bola znova aktivovaná počas vášho prihlasovania. Pokúste sa odhlásiť a znova prihlásiť pre inicializáciu šifrovania.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš súkromný kľúč nie je platný! Možno bolo vaše heslo zmenené mimo %s (napr. firemný priečinok). Môžete si aktualizovať heslo svojho súkromného kľúča vo vašom osobnom nastavení, ak si chcete obnoviť prístup k šifrovaným súborom.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tento súbor sa nepodarilo dešifrovať, pravdepodobne je zdieľaný. Požiadajte majiteľa súboru, aby ho s vami znovu vyzdieľal.",
"Unknown error please check your system settings or contact your administrator" => "Neznáma chyba, skontrolujte si vaše systémové nastavenia alebo kontaktujte administrátora",
"Missing requirements." => "Chýbajúce požiadavky.",
+25 -18
View File
@@ -1,36 +1,43 @@
<?php
$TRANSLATIONS = array(
"Recovery key successfully enabled" => "Ključ za obnovitev gesla je bil uspešno nastavljen",
"Could not enable recovery key. Please check your recovery key password!" => "Ključa za obnovitev gesla ni bilo mogoče nastaviti. Preverite ključ!",
"Recovery key successfully disabled" => "Ključ za obnovitev gesla je bil uspešno onemogočen",
"Could not disable recovery key. Please check your recovery key password!" => "Ključa za obnovitev gesla ni bilo mogoče onemogočiti. Preverite ključ!",
"Password successfully changed." => "Geslo je bilo uspešno spremenjeno.",
"Could not change the password. Maybe the old password was not correct." => "Gesla ni bilo mogoče spremeniti. Morda vnos starega gesla ni bil pravilen.",
"Private key password successfully updated." => "Zasebni ključ za geslo je bil uspešno posodobljen.",
"Could not update the private key password. Maybe the old password was not correct." => "Zasebnega ključa za geslo ni bilo mogoče posodobiti. Morda vnos starega gesla ni bil pravilen.",
"Recovery key successfully enabled" => "Ključ za obnovitev gesla je uspešno nastavljen",
"Could not enable recovery key. Please check your recovery key password!" => "Ključa za obnovitev gesla ni mogoče nastaviti. Preverite ključ!",
"Recovery key successfully disabled" => "Ključ za obnovitev gesla je uspešno onemogočen",
"Could not disable recovery key. Please check your recovery key password!" => "Ključa za obnovitev gesla ni mogoče onemogočiti. Preverite ključ!",
"Password successfully changed." => "Geslo je uspešno spremenjeno.",
"Could not change the password. Maybe the old password was not correct." => "Gesla ni mogoče spremeniti. Morda vnos starega gesla ni pravilen.",
"Private key password successfully updated." => "Zasebni ključ za geslo je uspešno posodobljen.",
"Could not update the private key password. Maybe the old password was not correct." => "Zasebnega ključa za geslo ni mogoče posodobiti. Morda vnos starega gesla ni bil pravilen.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Program za šifriranje ni začet. Morda je bil program ponovno omogočen šele med zagonom trenutne seje. Odjavite se in se nato prijavite nazaj. S tem morda razrešite napako.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Zasebni ključ ni veljaven. Najverjetneje je bilo geslo spremenjeno izven %s (najverjetneje je to poslovna mapa). Geslo lahko posodobite med osebnimi nastavitvami in s tem obnovite dostop do šifriranih datotek.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Te datoteke ni mogoče šifrirati, ker je to najverjetneje datoteka v souporabi. Prosite lastnika datoteke, da jo da ponovno v souporabo.",
"Unknown error please check your system settings or contact your administrator" => "Prišlo je do neznane napake. Preverite nastavitve sistema ali pa stopite v stik s skrbnikom sistema.",
"Missing requirements." => "Manjkajoče zahteve",
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Preverite, da imate na strežniku nameščen paket PHP 5.3.3 ali novejši in da je omogočen in pravilno nastavljen PHP OpenSSL . Zaenkrat je šifriranje onemogočeno.",
"Following users are not set up for encryption:" => "Naslednji uporabniki še nimajo nastavljenega šifriranja:",
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Preverite, ali je na strežniku nameščen paket PHP 5.3.3 ali novejši, da je omogočen in pravilno nastavljen PHP OpenSSL. Z obstoječimi možnostmi šifriranje ni mogoče.",
"Following users are not set up for encryption:" => "Navedeni uporabniki še nimajo nastavljenega šifriranja:",
"Saving..." => "Poteka shranjevanje ...",
"Go directly to your " => "Skočite neposredno na",
"personal settings" => "osebne nastavitve",
"Encryption" => "Šifriranje",
"Enable recovery key (allow to recover users files in case of password loss):" => "Omogoči ključ za obnovitev datotek (v primeru izgube gesla)",
"Enable recovery key (allow to recover users files in case of password loss):" => "Omogoči ključ za obnovitev datotek (v primeru izgube gesla):",
"Recovery key password" => "Ključ za obnovitev gesla",
"Repeat Recovery key password" => "Ponovi ključ za obnovitev gesla",
"Enabled" => "Omogočeno",
"Disabled" => "Onemogočeno",
"Change recovery key password:" => "Spremeni ključ za obnovitev gesla:",
"Old Recovery key password" => "Stari ključ za obnovitev gesla",
"New Recovery key password" => "Nov ključ za obnovitev gesla",
"New Recovery key password" => "Novi ključ za obnovitev gesla",
"Repeat New Recovery key password" => "Ponovi novi ključ za obnovitev gesla",
"Change Password" => "Spremeni geslo",
"Your private key password no longer match your log-in password:" => "Vaš zasebni ključ za geslo se ne ujema z vnešenim geslom ob prijavi:",
"Set your old private key password to your current log-in password." => "Nastavite svoj star zasebni ključ v geslo, vnešeno ob prijavi.",
" If you don't remember your old password you can ask your administrator to recover your files." => "Če ste svoje geslo pozabili, lahko vaše datoteke obnovi skrbnik sistema.",
"Your private key password no longer match your log-in password:" => "Vaš zasebni ključ za geslo se ne ujema z geslom, vnesenim ob prijavi:",
"Set your old private key password to your current log-in password." => "Nastavite svoj star zasebni ključ v geslo, vneseno ob prijavi.",
" If you don't remember your old password you can ask your administrator to recover your files." => "Če ste pozabili svoje geslo, lahko vaše datoteke obnovi le skrbnik sistema.",
"Old log-in password" => "Staro geslo",
"Current log-in password" => "Trenutno geslo",
"Update Private Key Password" => "Posodobi zasebni ključ",
"Enable password recovery:" => "Omogoči obnovitev gesla:",
"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Nastavitev te možnosti omogoča ponovno pridobitev dostopa do šifriranih datotek, v primeru da boste geslo pozabili.",
"File recovery settings updated" => "Nastavitve obnavljanja dokumentov so bile posodobljene",
"Could not update file recovery" => "Nastavitev za obnavljanje dokumentov ni bilo mogoče posodobiti"
"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Nastavitev te možnosti omogoča ponovno pridobitev dostopa do šifriranih datotek, v primeru, da boste geslo pozabili.",
"File recovery settings updated" => "Nastavitve obnavljanja dokumentov so posodobljene",
"Could not update file recovery" => "Nastavitev za obnavljanje dokumentov ni mogoče posodobiti"
);
$PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);";
+1
View File
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Den privata nyckelns lösenord uppdaterades utan problem.",
"Could not update the private key password. Maybe the old password was not correct." => "Kunde inte uppdatera lösenordet för den privata nyckeln. Kanske var det gamla lösenordet fel.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.",
"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Din privata lösenordsnyckel är inte giltig! Troligen har ditt lösenord ändrats utanför %s (t.ex. i företagets katalogtjänst). Du kan uppdatera den privata lösenordsnyckeln under dina personliga inställningar för att återfå tillgång till dina filer.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.",
"Unknown error please check your system settings or contact your administrator" => "Oväntat fel, kolla dina system inställningar eller kontakta din administratör",
"Missing requirements." => "Krav som saknas",
+76 -15
View File
@@ -165,7 +165,7 @@ class Helper {
public static function isPartialFilePath($path) {
$extension = pathinfo($path, PATHINFO_EXTENSION);
if ( $extension === 'part' || $extension === 'etmp') {
if ( $extension === 'part') {
return true;
} else {
return false;
@@ -183,7 +183,7 @@ class Helper {
public static function stripPartialFileExtension($path) {
$extension = pathinfo($path, PATHINFO_EXTENSION);
if ( $extension === 'part' || $extension === 'etmp') {
if ( $extension === 'part') {
$newLength = strlen($path) - 5; // 5 = strlen(".part") = strlen(".etmp")
$fPath = substr($path, 0, $newLength);
@@ -225,10 +225,7 @@ class Helper {
* @return bool
*/
public static function isPublicAccess() {
if (\OCP\USER::getUser() === false
|| (isset($_GET['service']) && $_GET['service'] == 'files'
&& isset($_GET['t']))
) {
if (\OCP\User::getUser() === false) {
return true;
} else {
return false;
@@ -256,24 +253,88 @@ class Helper {
}
/**
* @brief get path to the correspondig file in data/user/files
* @brief try to get the user from the path if no user is logged in
* @param string $path
* @return mixed user or false if we couldn't determine a user
*/
public static function getUser($path) {
$user = \OCP\User::getUser();
// if we are logged in, then we return the userid
if ($user) {
return $user;
}
// if no user is logged in we try to access a publicly shared files.
// In this case we need to try to get the user from the path
$trimmed = ltrim($path, '/');
$split = explode('/', $trimmed);
// it is not a file relative to data/user/files
if (count($split) < 2 || $split[1] !== 'files') {
return false;
}
$user = $split[0];
if (\OCP\User::userExists($user)) {
return $user;
}
return false;
}
/**
* @brief get path to the corresponding file in data/user/files if path points
* to a version or to a file in cache
* @param string $path path to a version or a file in the trash
* @return string path to correspondig file relative to data/user/files
* @return string path to corresponding file relative to data/user/files
*/
public static function getPathToRealFile($path) {
$trimmed = ltrim($path, '/');
$split = explode('/', $trimmed);
$result = false;
if (count($split) < 3 || $split[1] !== "files_versions") {
return false;
if (count($split) >= 3 && ($split[1] === "files_versions" || $split[1] === 'cache')) {
$sliced = array_slice($split, 2);
$result = implode('/', $sliced);
if ($split[1] === "files_versions") {
// we skip user/files
$sliced = array_slice($split, 2);
$relPath = implode('/', $sliced);
//remove the last .v
$result = substr($relPath, 0, strrpos($relPath, '.v'));
}
if ($split[1] === "cache") {
// we skip /user/cache/transactionId
$sliced = array_slice($split, 3);
$result = implode('/', $sliced);
//prepare the folders
self::mkdirr($path, new \OC\Files\View('/'));
}
}
$sliced = array_slice($split, 2);
$realPath = implode('/', $sliced);
//remove the last .v
$realPath = substr($realPath, 0, strrpos($realPath, '.v'));
return $result;
}
return $realPath;
/**
* @brief create directory recursively
* @param string $path
* @param \OC\Files\View $view
*/
public static function mkdirr($path, $view) {
$dirname = \OC_Filesystem::normalizePath(dirname($path));
$dirParts = explode('/', $dirname);
$dir = "";
foreach ($dirParts as $part) {
$dir = $dir . '/' . $part;
if (!$view->file_exists($dir)) {
$view->mkdir($dir);
}
}
}
/**
+16 -23
View File
@@ -112,21 +112,18 @@ class Keymanager {
* @brief store file encryption key
*
* @param \OC_FilesystemView $view
* @param \OCA\Encryption\Util $util
* @param string $path relative path of the file, including filename
* @param $userId
* @param $catfile
* @internal param string $key
* @param string $catfile keyfile content
* @return bool true/false
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
public static function setFileKey(\OC_FilesystemView $view, $path, $userId, $catfile) {
public static function setFileKey(\OC_FilesystemView $view, $util, $path, $catfile) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
//here we need the currently logged in user, while userId can be a different user
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($path);
// in case of system wide mount points the keys are stored directly in the data directory
@@ -172,16 +169,15 @@ class Keymanager {
/**
* @brief retrieve keyfile for an encrypted file
* @param \OC_FilesystemView $view
* @param $userId
* @param \OCA\Encryption\Util $util
* @param $filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption
* of the keyfile must be performed by client code
*/
public static function getFileKey(\OC_FilesystemView $view, $userId, $filePath) {
public static function getFileKey($view, $util, $filePath) {
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($filePath);
$filename = Helper::stripPartialFileExtension($filename);
@@ -217,17 +213,17 @@ class Keymanager {
* @brief Delete a keyfile
*
* @param \OC_FilesystemView $view
* @param string $userId username
* @param string $path path of the file the key belongs to
* @return bool Outcome of unlink operation
* @note $path must be relative to data/user/files. e.g. mydoc.txt NOT
* /data/admin/files/mydoc.txt
*/
public static function deleteFileKey(\OC_FilesystemView $view, $userId, $path) {
public static function deleteFileKey(\OC_FilesystemView $view, $path) {
$trimmed = ltrim($path, '/');
$util = new Util($view, \OCP\User::getUser());
$userId = Helper::getUser($path);
$util = new Util($view, $userId);
if($util->isSystemWideMountPoint($path)) {
$keyPath = '/files_encryption/keyfiles/' . $trimmed;
@@ -316,16 +312,15 @@ class Keymanager {
/**
* @brief store multiple share keys for a single file
* @param \OC_FilesystemView $view
* @param $path
* @param \OCA\Encryption\Util $util
* @param string $path
* @param array $shareKeys
* @return bool
*/
public static function setShareKeys(\OC_FilesystemView $view, $path, array $shareKeys) {
public static function setShareKeys(\OC_FilesystemView $view, $util, $path, array $shareKeys) {
// $shareKeys must be an array with the following format:
// [userId] => [encrypted key]
// Here we need the currently logged in user, while userId can be a different user
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($path);
@@ -364,21 +359,18 @@ class Keymanager {
* @brief retrieve shareKey for an encrypted file
* @param \OC_FilesystemView $view
* @param string $userId
* @param \OCA\Encryption\Util $util
* @param string $filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The sharekey returned is encrypted. Decryption
* of the keyfile must be performed by client code
*/
public static function getShareKey(\OC_FilesystemView $view, $userId, $filePath) {
public static function getShareKey(\OC_FilesystemView $view, $userId, $util, $filePath) {
// try reusing key file if part file
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
//here we need the currently logged in user, while userId can be a different user
$util = new Util($view, \OCP\User::getUser());
list($owner, $filename) = $util->getUidAndFilename($filePath);
$filename = Helper::stripPartialFileExtension($filename);
// in case of system wide mount points the keys are stored directly in the data directory
@@ -445,8 +437,9 @@ class Keymanager {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
//here we need the currently logged in user, while userId can be a different user
$util = new Util($view, \OCP\User::getUser());
$userId = Helper::getUser($filePath);
$util = new Util($view, $userId);
list($owner, $filename) = $util->getUidAndFilename($filePath);
+20 -11
View File
@@ -47,8 +47,10 @@ class Proxy extends \OC_FileProxy {
*/
private static function shouldEncrypt($path) {
$userId = Helper::getUser($path);
if (\OCP\App::isEnabled('files_encryption') === false || Crypt::mode() !== 'server' ||
strpos($path, '/' . \OCP\User::getUser() . '/files') !== 0) {
strpos($path, '/' . $userId . '/files') !== 0) {
return false;
}
@@ -90,7 +92,13 @@ class Proxy extends \OC_FileProxy {
return true;
}
$handle = fopen('crypt://' . $path . '.etmp', 'w');
// create random cache folder
$cacheFolder = rand();
$path_slices = explode('/', \OC_Filesystem::normalizePath($path));
$path_slices[2] = "cache/".$cacheFolder;
$tmpPath = implode('/', $path_slices);
$handle = fopen('crypt://' . $tmpPath, 'w');
if (is_resource($handle)) {
// write data to stream
@@ -104,10 +112,10 @@ class Proxy extends \OC_FileProxy {
\OC_FileProxy::$enabled = false;
// get encrypted content
$data = $view->file_get_contents($path . '.etmp');
$data = $view->file_get_contents($tmpPath);
// remove our temp file
$view->unlink($path . '.etmp');
$view->deleteAll('/' . \OCP\User::getUser() . '/cache/' . $cacheFolder);
// re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
@@ -195,7 +203,7 @@ class Proxy extends \OC_FileProxy {
list($owner, $ownerPath) = $util->getUidAndFilename($relativePath);
// Delete keyfile & shareKey so it isn't orphaned
if (!Keymanager::deleteFileKey($view, $owner, $ownerPath)) {
if (!Keymanager::deleteFileKey($view, $ownerPath)) {
\OCP\Util::writeLog('Encryption library',
'Keyfile or shareKey could not be deleted for file "' . $ownerPath . '"', \OCP\Util::ERROR);
}
@@ -238,9 +246,6 @@ class Proxy extends \OC_FileProxy {
// split the path parts
$pathParts = explode('/', $path);
// get relative path
$relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
// FIXME: handling for /userId/cache used by webdav for chunking. The cache chunks are NOT encrypted
if (isset($pathParts[2]) && $pathParts[2] === 'cache') {
return $result;
@@ -254,7 +259,8 @@ class Proxy extends \OC_FileProxy {
$view = new \OC_FilesystemView('');
$util = new Util($view, \OCP\USER::getUser());
$userId = Helper::getUser($path);
$util = new Util($view, $userId);
// If file is already encrypted, decrypt using crypto protocol
if (
@@ -317,7 +323,7 @@ class Proxy extends \OC_FileProxy {
$view = new \OC_FilesystemView('/');
$userId = \OCP\User::getUser();
$userId = Helper::getUser($path);
$util = new Util($view, $userId);
// if encryption is no longer enabled or if the files aren't migrated yet
@@ -343,7 +349,10 @@ class Proxy extends \OC_FileProxy {
$fileInfo = false;
// get file info from database/cache if not .part file
if (!Helper::isPartialFilePath($path)) {
$proxyState = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$fileInfo = $view->getFileInfo($path);
\OC_FileProxy::$enabled = $proxyState;
}
// if file is encrypted return real file size
@@ -392,7 +401,7 @@ class Proxy extends \OC_FileProxy {
$view = new \OC_FilesystemView('/');
$session = new \OCA\Encryption\Session($view);
$userId = \OCP\User::getUser();
$userId = Helper::getUser($path);
$util = new Util($view, $userId);
// split the path parts
+35 -24
View File
@@ -55,6 +55,7 @@ class Stream {
private $rawPath; // The raw path relative to the data dir
private $relPath; // rel path to users file dir
private $userId;
private $keyId;
private $handle; // Resource returned by fopen
private $meta = array(); // Header / meta for source stream
private $writeCache;
@@ -67,6 +68,7 @@ class Stream {
* @var \OC\Files\View
*/
private $rootView; // a fsview object set to '/'
/**
* @var \OCA\Encryption\Session
*/
@@ -89,17 +91,22 @@ class Stream {
$this->rootView = new \OC_FilesystemView('/');
}
$this->session = new \OCA\Encryption\Session($this->rootView);
$this->privateKey = $this->session->getPrivateKey($this->userId);
$util = new Util($this->rootView, \OCP\USER::getUser());
$this->userId = $util->getUserId();
$this->privateKey = $this->session->getPrivateKey();
// rawPath is relative to the data directory
$this->rawPath = \OC\Files\Filesystem::normalizePath(str_replace('crypt://', '', $path));
$this->userId = Helper::getUser($this->rawPath);
$util = new Util($this->rootView, $this->userId);
// get the key ID which we want to use, can be the users key or the
// public share key
$this->keyId = $util->getKeyId();
// Strip identifier text from path, this gives us the path relative to data/<user>/files
$this->relPath = Helper::stripUserFilesPath($this->rawPath);
// if raw path doesn't point to a real file, check if it is a version or a file in the trash bin
@@ -108,7 +115,7 @@ class Stream {
}
if($this->relPath === false) {
\OCP\Util::writeLog('Encryption library', 'failed to open file "' . $this->rawPath . '" expecting a path to user/files or to user/files_versions', \OCP\Util::ERROR);
\OCP\Util::writeLog('Encryption library', 'failed to open file "' . $this->rawPath . '" expecting a path to "files", "files_versions" or "cache"', \OCP\Util::ERROR);
return false;
}
@@ -249,12 +256,13 @@ class Stream {
// Fetch and decrypt keyfile
// Fetch existing keyfile
$this->encKeyfile = Keymanager::getFileKey($this->rootView, $this->userId, $this->relPath);
$util = new \OCA\Encryption\Util($this->rootView, $this->userId);
$this->encKeyfile = Keymanager::getFileKey($this->rootView, $util, $this->relPath);
// If a keyfile already exists
if ($this->encKeyfile) {
$shareKey = Keymanager::getShareKey($this->rootView, $this->userId, $this->relPath);
$shareKey = Keymanager::getShareKey($this->rootView, $this->keyId, $util, $this->relPath);
// if there is no valid private key return false
if ($this->privateKey === false) {
@@ -484,13 +492,14 @@ class Stream {
}
// if private key is not valid redirect user to a error page
\OCA\Encryption\Helper::redirectToErrorPage();
\OCA\Encryption\Helper::redirectToErrorPage($this->session);
}
if (
$this->meta['mode'] !== 'r' &&
$this->meta['mode'] !== 'rb' &&
$this->size > 0
$this->size > 0 &&
$this->unencryptedSize > 0
) {
// only write keyfiles if it was a new file
@@ -501,7 +510,7 @@ class Stream {
\OC_FileProxy::$enabled = false;
// Fetch user's public key
$this->publicKey = Keymanager::getPublicKey($this->rootView, $this->userId);
$this->publicKey = Keymanager::getPublicKey($this->rootView, $this->keyId);
// Check if OC sharing api is enabled
$sharingEnabled = \OCP\Share::isEnabled();
@@ -519,29 +528,31 @@ class Stream {
$this->encKeyfiles = Crypt::multiKeyEncrypt($this->plainKey, $publicKeys);
// Save the new encrypted file key
Keymanager::setFileKey($this->rootView, $this->relPath, $this->userId, $this->encKeyfiles['data']);
Keymanager::setFileKey($this->rootView, $util, $this->relPath, $this->encKeyfiles['data']);
// Save the sharekeys
Keymanager::setShareKeys($this->rootView, $this->relPath, $this->encKeyfiles['keys']);
Keymanager::setShareKeys($this->rootView, $util, $this->relPath, $this->encKeyfiles['keys']);
// Re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
}
// we need to update the file info for the real file, not for the
// part file.
$path = Helper::stripPartialFileExtension($this->rawPath);
// get file info
$fileInfo = $this->rootView->getFileInfo($this->rawPath);
if (!is_array($fileInfo)) {
$fileInfo = array();
$fileInfo = $this->rootView->getFileInfo($path);
if (is_array($fileInfo)) {
// set encryption data
$fileInfo['encrypted'] = true;
$fileInfo['size'] = $this->size;
$fileInfo['unencrypted_size'] = $this->unencryptedSize;
// set fileinfo
$this->rootView->putFileInfo($path, $fileInfo);
}
// set encryption data
$fileInfo['encrypted'] = true;
$fileInfo['size'] = $this->size;
$fileInfo['unencrypted_size'] = $this->unencryptedSize;
// set fileinfo
$this->rootView->putFileInfo($this->rawPath, $fileInfo);
}
return fclose($this->handle);
+105 -100
View File
@@ -38,7 +38,8 @@ class Util {
const MIGRATION_OPEN = 0; // user still needs to be migrated
private $view; // OC_FilesystemView object for filesystem operations
private $userId; // ID of the currently logged-in user
private $userId; // ID of the user we use to encrypt/decrypt files
private $keyId; // ID of the key we want to manipulate
private $client; // Client side encryption mode flag
private $publicKeyDir; // Dir containing all public user keys
private $encryptionDir; // Dir containing user's files_encryption
@@ -58,47 +59,33 @@ class Util {
public function __construct(\OC_FilesystemView $view, $userId, $client = false) {
$this->view = $view;
$this->userId = $userId;
$this->client = $client;
$this->isPublic = false;
$this->userId = $userId;
$this->publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId');
$this->recoveryKeyId = \OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
// if we are anonymous/public
if (\OCA\Encryption\Helper::isPublicAccess()) {
$this->userId = $this->publicShareKeyId;
// only handle for files_sharing app
if (isset($GLOBALS['app']) && $GLOBALS['app'] === 'files_sharing') {
$this->userDir = '/' . $GLOBALS['fileOwner'];
$this->fileFolderName = 'files';
$this->userFilesDir = '/' . $GLOBALS['fileOwner'] . '/'
. $this->fileFolderName; // TODO: Does this need to be user configurable?
$this->publicKeyDir = '/' . 'public-keys';
$this->encryptionDir = '/' . $GLOBALS['fileOwner'] . '/' . 'files_encryption';
$this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
$this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
$this->publicKeyPath =
$this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
$this->privateKeyPath =
'/owncloud_private_key/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
$this->isPublic = true;
}
} else {
$this->userDir = '/' . $this->userId;
$this->fileFolderName = 'files';
$this->userFilesDir =
'/' . $this->userId . '/' . $this->fileFolderName; // TODO: Does this need to be user configurable?
$this->publicKeyDir = '/' . 'public-keys';
$this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
$this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
$this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
$this->publicKeyPath =
$this->userDir = '/' . $this->userId;
$this->fileFolderName = 'files';
$this->userFilesDir =
'/' . $userId . '/' . $this->fileFolderName; // TODO: Does this need to be user configurable?
$this->publicKeyDir = '/' . 'public-keys';
$this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
$this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
$this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
$this->publicKeyPath =
$this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
$this->privateKeyPath =
$this->privateKeyPath =
$this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
// make sure that the owners home is mounted
\OC\Files\Filesystem::initMountPoints($userId);
if (\OCA\Encryption\Helper::isPublicAccess()) {
$this->keyId = $this->publicShareKeyId;
$this->isPublic = true;
} else {
$this->keyId = $this->userId;
$this->isPublic = false;
}
}
@@ -114,15 +101,24 @@ class Util {
or !$this->view->file_exists($this->publicKeyPath)
or !$this->view->file_exists($this->privateKeyPath)
) {
return false;
} else {
return true;
}
}
/**
* @brief check if the users private & public key exists
* @return boolean
*/
public function userKeysExists() {
if (
$this->view->file_exists($this->privateKeyPath) &&
$this->view->file_exists($this->publicKeyPath)) {
return true;
} else {
return false;
}
}
/**
@@ -184,13 +180,13 @@ class Util {
// check if public-key exists but private-key is missing
if ($this->view->file_exists($this->publicKeyPath) && !$this->view->file_exists($this->privateKeyPath)) {
\OCP\Util::writeLog('Encryption library',
'public key exists but private key is missing for "' . $this->userId . '"', \OCP\Util::FATAL);
'public key exists but private key is missing for "' . $this->keyId . '"', \OCP\Util::FATAL);
return false;
} else {
if (!$this->view->file_exists($this->publicKeyPath) && $this->view->file_exists($this->privateKeyPath)
) {
\OCP\Util::writeLog('Encryption library',
'private key exists but public key is missing for "' . $this->userId . '"', \OCP\Util::FATAL);
'private key exists but public key is missing for "' . $this->keyId . '"', \OCP\Util::FATAL);
return false;
}
}
@@ -363,7 +359,7 @@ class Util {
// scanning every file like this
// will eat server resources :(
if (
Keymanager::getFileKey($this->view, $this->userId, $relPath)
Keymanager::getFileKey($this->view, $this, $relPath)
&& $isEncryptedPath
) {
@@ -468,22 +464,19 @@ class Util {
*/
public function isEncryptedPath($path) {
// Disable encryption proxy so data retrieved is in its
// original form
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$relPath = Helper::getPathToRealFile($path);
// we only need 24 byte from the last chunk
$data = '';
$handle = $this->view->fopen($path, 'r');
if (is_resource($handle) && !fseek($handle, -24, SEEK_END)) {
$data = fgets($handle);
if ($relPath === false) {
$relPath = Helper::stripUserFilesPath($path);
}
// re-enable proxy
\OC_FileProxy::$enabled = $proxyStatus;
$fileKey = Keymanager::getFileKey($this->view, $this, $relPath);
return Crypt::isCatfileContent($data);
if ($fileKey === false) {
return false;
}
return true;
}
@@ -717,17 +710,17 @@ class Util {
// Encrypt unencrypted files
foreach ($found['encrypted'] as $encryptedFile) {
//get file info
$fileInfo = \OC\Files\Filesystem::getFileInfo($encryptedFile['path']);
//relative to data/<user>/file
$relPath = Helper::stripUserFilesPath($encryptedFile['path']);
//get file info
$fileInfo = \OC\Files\Filesystem::getFileInfo($relPath);
//relative to /data
$rawPath = $encryptedFile['path'];
//get timestamp
$timestamp = $this->view->filemtime($rawPath);
$timestamp = $fileInfo['mtime'];
//enable proxy to use OC\Files\View to access the original file
\OC_FileProxy::$enabled = true;
@@ -768,16 +761,16 @@ class Util {
$this->view->rename($relPath . '.part', $relPath);
$this->view->chroot($fakeRoot);
//set timestamp
$this->view->touch($rawPath, $timestamp);
$this->view->touch($relPath, $timestamp);
$this->view->chroot($fakeRoot);
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(
'encrypted' => false,
'size' => $size,
'unencrypted_size' => $size,
'unencrypted_size' => 0,
'etag' => $fileInfo['etag']
));
@@ -839,7 +832,7 @@ class Util {
$rawPath = '/' . $this->userId . '/files/' . $plainFile['path'];
// keep timestamp
$timestamp = $this->view->filemtime($rawPath);
$timestamp = $fileInfo['mtime'];
// Open plain file handle for binary reading
$plainHandle = $this->view->fopen($rawPath, 'rb');
@@ -847,32 +840,35 @@ class Util {
// Open enc file handle for binary writing, with same filename as original plain file
$encHandle = fopen('crypt://' . $rawPath . '.part', 'wb');
// Move plain file to a temporary location
$size = stream_copy_to_stream($plainHandle, $encHandle);
if (is_resource($encHandle)) {
// Move plain file to a temporary location
$size = stream_copy_to_stream($plainHandle, $encHandle);
fclose($encHandle);
fclose($plainHandle);
fclose($encHandle);
fclose($plainHandle);
$fakeRoot = $this->view->getRoot();
$this->view->chroot('/' . $this->userId . '/files');
$fakeRoot = $this->view->getRoot();
$this->view->chroot('/' . $this->userId . '/files');
$this->view->rename($relPath . '.part', $relPath);
$this->view->rename($relPath . '.part', $relPath);
$this->view->chroot($fakeRoot);
// set timestamp
$this->view->touch($relPath, $timestamp);
// set timestamp
$this->view->touch($rawPath, $timestamp);
$encSize = $this->view->filesize($relPath);
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(
'encrypted' => true,
'size' => $size,
'unencrypted_size' => $size,
'etag' => $fileInfo['etag']
));
$this->view->chroot($fakeRoot);
$encryptedFiles[] = $relPath;
// Add the file to the cache
\OC\Files\Filesystem::putFileInfo($relPath, array(
'encrypted' => true,
'size' => $encSize,
'unencrypted_size' => $size,
'etag' => $fileInfo['etag']
));
$encryptedFiles[] = $relPath;
}
}
// Encrypt legacy encrypted files
@@ -1055,10 +1051,10 @@ class Util {
private function decryptKeyfile($filePath, $privateKey) {
// Get the encrypted keyfile
$encKeyfile = Keymanager::getFileKey($this->view, $this->userId, $filePath);
$encKeyfile = Keymanager::getFileKey($this->view, $this, $filePath);
// The file has a shareKey and must use it for decryption
$shareKey = Keymanager::getShareKey($this->view, $this->userId, $filePath);
$shareKey = Keymanager::getShareKey($this->view, $this->keyId, $this, $filePath);
$plainKeyfile = Crypt::multiKeyDecrypt($encKeyfile, $shareKey, $privateKey);
@@ -1109,8 +1105,8 @@ class Util {
// Save the recrypted key to it's owner's keyfiles directory
// Save new sharekeys to all necessary user directory
if (
!Keymanager::setFileKey($this->view, $filePath, $fileOwner, $multiEncKey['data'])
|| !Keymanager::setShareKeys($this->view, $filePath, $multiEncKey['keys'])
!Keymanager::setFileKey($this->view, $this, $filePath, $multiEncKey['data'])
|| !Keymanager::setShareKeys($this->view, $this, $filePath, $multiEncKey['keys'])
) {
\OCP\Util::writeLog('Encryption library',
@@ -1261,7 +1257,6 @@ class Util {
$sql = 'SELECT `migration_status` FROM `*PREFIX*encryption` WHERE `uid` = ?';
$args = array($this->userId);
$query = \OCP\DB::prepare($sql);
$result = $query->execute($args);
@@ -1282,20 +1277,23 @@ class Util {
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
// insert missing entry in DB with status open
$sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`,`migration_status`) VALUES (?,?,?,?)';
$args = array(
$this->userId,
'server-side',
0,
self::MIGRATION_OPEN
);
$query = \OCP\DB::prepare($sql);
$query->execute($args);
// insert missing entry in DB with status open if the user exists
if (\OCP\User::userExists($this->userId)) {
$sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`,`migration_status`) VALUES (?,?,?,?)';
$args = array(
$this->userId,
'server-side',
0,
self::MIGRATION_OPEN
);
$query = \OCP\DB::prepare($sql);
$query->execute($args);
return self::MIGRATION_OPEN;
// If a record is found
} else {
return self::MIGRATION_OPEN;
} else {
return false;
}
} else { // If a record is found
return (int)$migrationStatus[0];
}
@@ -1334,7 +1332,7 @@ class Util {
// handle public access
if ($this->isPublic) {
$filename = $path;
$fileOwnerUid = $GLOBALS['fileOwner'];
$fileOwnerUid = $this->userId;
return array(
$fileOwnerUid,
@@ -1559,6 +1557,13 @@ class Util {
return $this->userId;
}
/**
* @return string
*/
public function getKeyId() {
return $this->keyId;
}
/**
* @return string
*/
@@ -2,7 +2,7 @@
<fieldset class="personalblock">
<h2><?php p( $l->t( 'Encryption' ) ); ?></h2>
<?php if ( ! $_["privateKeySet"] && $_["initialized"] ): ?>
<?php if ( $_["initialized"] === '1' ): ?>
<p>
<a name="changePKPasswd" />
<label for="changePrivateKeyPasswd">
+15 -11
View File
@@ -157,6 +157,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$filename = 'tmp-' . time() . '.test';
$util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
// Test that data was successfully written
@@ -176,10 +178,10 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertNotEquals($this->dataShort, $retreivedCryptedFile);
// Get the encrypted keyfile
$encKeyfile = Encryption\Keymanager::getFileKey($this->view, $this->userId, $filename);
$encKeyfile = Encryption\Keymanager::getFileKey($this->view, $util, $filename);
// Attempt to fetch the user's shareKey
$shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $filename);
$shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $util, $filename);
// get session
$session = new \OCA\Encryption\Session($this->view);
@@ -199,7 +201,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Teardown
$this->view->unlink($this->userId . '/files/' . $filename);
Encryption\Keymanager::deleteFileKey($this->view, $this->userId, $filename);
Encryption\Keymanager::deleteFileKey($this->view, $filename);
}
/**
@@ -214,6 +216,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Generate a a random filename
$filename = 'tmp-' . time() . '.test';
$util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
@@ -244,16 +248,16 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$i = 0;
while ($i < count($r)-1) {
$e[] = $r[$i] . $r[$i+1];
$i = $i + 2;
$i = $i + 2;
}
//print_r($e);
// Get the encrypted keyfile
$encKeyfile = Encryption\Keymanager::getFileKey($this->view, $this->userId, $filename);
$encKeyfile = Encryption\Keymanager::getFileKey($this->view, $util, $filename);
// Attempt to fetch the user's shareKey
$shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $filename);
$shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $util, $filename);
// get session
$session = new \OCA\Encryption\Session($this->view);
@@ -283,7 +287,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->view->unlink($this->userId . '/files/' . $filename);
Encryption\Keymanager::deleteFileKey($this->view, $this->userId, $filename);
Encryption\Keymanager::deleteFileKey($this->view, $filename);
}
@@ -387,7 +391,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @brief test decryption using legacy blowfish method
*/
function testLegacyDecryptShort() {
$crypted = $this->legacyEncrypt($this->dataShort, $this->pass);
$decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
@@ -401,7 +405,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
* @brief test decryption using legacy blowfish method
*/
function testLegacyDecryptLong() {
$crypted = $this->legacyEncrypt($this->dataLong, $this->pass);
$decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
@@ -653,8 +657,8 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// tear down
$view->unlink($filename);
}
/**
* @brief encryption using legacy blowfish method
* @param $data string data to encrypt
+14 -1
View File
@@ -51,4 +51,17 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
$this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($filename));
}
}
function testGetPathToRealFile() {
// the relative path to /user/files/ that's what we want to get from getPathToRealFile()
$relativePath = "foo/bar/test.txt";
// test paths
$versionPath = "/user/files_versions/foo/bar/test.txt.v456756835";
$cachePath = "/user/cache/transferid636483/foo/bar/test.txt";
$this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($versionPath));
$this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($cachePath));
}
}
+3 -1
View File
@@ -145,13 +145,15 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$file = 'unittest-' . time() . '.txt';
$util = new Encryption\Util($this->view, $this->userId);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$this->view->file_put_contents($this->userId . '/files/' . $file, $this->dataShort);
Encryption\Keymanager::setFileKey($this->view, $file, $this->userId, $key);
Encryption\Keymanager::setFileKey($this->view, $util, $file, $key);
$this->assertTrue($this->view->file_exists('/' . $this->userId . '/files_encryption/keyfiles/' . $file . '.key'));
+58
View File
@@ -281,6 +281,64 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->assertFalse($this->util->isSharedPath($path));
}
function testEncryptAll() {
$filename = "/encryptAll" . time() . ".txt";
$util = new Encryption\Util($this->view, $this->userId);
// disable encryption to upload a unencrypted file
\OC_App::disable('files_encryption');
$this->view->file_put_contents($this->userId . '/files/' . $filename, $this->dataShort);
$fileInfoUnencrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename);
$this->assertTrue(is_array($fileInfoUnencrypted));
// enable file encryption again
\OC_App::enable('files_encryption');
// encrypt all unencrypted files
$util->encryptAll('/' . $this->userId . '/' . 'files');
$fileInfoEncrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename);
$this->assertTrue(is_array($fileInfoEncrypted));
// check if mtime and etags unchanged
$this->assertEquals($fileInfoEncrypted['mtime'], $fileInfoUnencrypted['mtime']);
$this->assertEquals($fileInfoEncrypted['etag'], $fileInfoUnencrypted['etag']);
$this->view->unlink($this->userId . '/files/' . $filename);
}
function testDecryptAll() {
$filename = "/decryptAll" . time() . ".txt";
$util = new Encryption\Util($this->view, $this->userId);
$this->view->file_put_contents($this->userId . '/files/' . $filename, $this->dataShort);
$fileInfoEncrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename);
$this->assertTrue(is_array($fileInfoEncrypted));
// encrypt all unencrypted files
$util->decryptAll('/' . $this->userId . '/' . 'files');
$fileInfoUnencrypted = $this->view->getFileInfo($this->userId . '/files/' . $filename);
$this->assertTrue(is_array($fileInfoUnencrypted));
// check if mtime and etags unchanged
$this->assertEquals($fileInfoEncrypted['mtime'], $fileInfoUnencrypted['mtime']);
$this->assertEquals($fileInfoEncrypted['etag'], $fileInfoUnencrypted['etag']);
$this->view->unlink($this->userId . '/files/' . $filename);
}
/**
* @large
*/
+25 -3
View File
@@ -127,6 +127,7 @@ class smb {
$old_locale = getenv('LC_ALL');
putenv('LC_ALL=en_US.UTF-8');
$output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r');
$gotInfo = false;
$info = array ();
$info['info']= array ();
$mode = '';
@@ -188,7 +189,12 @@ class smb {
}
trigger_error($regs[0].' params('.$params.')', E_USER_ERROR);
case 'error-connect':
return false;
// connection error can happen after obtaining share list if
// NetBIOS is disabled/blocked on the target server,
// in which case we keep the info and continue
if (!$gotInfo) {
return false;
}
}
if ($i) switch ($i[1]) {
case 'file':
@@ -196,6 +202,7 @@ class smb {
case 'disk':
case 'server':
case 'workgroup': $info[$i[1]][] = $i[0];
$gotInfo = true;
}
}
pclose($output);
@@ -295,6 +302,7 @@ class smb {
}
function rename ($url_from, $url_to) {
$replace = false;
list ($from, $to) = array (smb::parse_url($url_from), smb::parse_url($url_to));
if ($from['host'] <> $to['host'] ||
$from['share'] <> $to['share'] ||
@@ -307,7 +315,20 @@ class smb {
trigger_error('rename(): error in URL', E_USER_ERROR);
}
smb::clearstatcache ($url_from);
$result = smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
$cmd = '';
// check if target file exists
if (smb::url_stat($url_to)) {
// delete target file first
$cmd = 'del "' . $to['path'] . '"; ';
$replace = true;
}
$cmd .= 'rename "' . $from['path'] . '" "' . $to['path'] . '"';
$result = smb::execute($cmd, $to);
if ($replace) {
// clear again, else the cache will return the info
// from the old file
smb::clearstatcache ($url_to);
}
return $result !== false;
}
@@ -460,7 +481,8 @@ class smb_stream_wrapper extends smb {
function stream_tell () { return ftell($this->stream); }
function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence); }
// PATCH: the wrapper must return true when fseek succeeded by returning 0.
function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence) === 0; }
function stream_flush () {
if ($this->mode <> 'r' && $this->need_flush) {
+1
View File
@@ -1,6 +1,7 @@
<?php
$TRANSLATIONS = array(
"Folder name" => "اسم المجلد",
"Options" => "خيارات",
"All Users" => "كل المستخدمين",
"Groups" => "مجموعات",
"Users" => "المستخدمين",
+6
View File
@@ -0,0 +1,6 @@
<?php
$TRANSLATIONS = array(
"Options" => "Опции",
"Delete" => "Удалить"
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
+2 -2
View File
@@ -9,7 +9,7 @@ $TRANSLATIONS = array(
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Upozornenie:</b> Podpora FTP v PHP nie je povolená alebo nainštalovaná. Nie je možné pripojenie oddielov FTP. Požiadajte administrátora systému, nech ho nainštaluje.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Varovanie:</b> nie je nainštalovaná, alebo povolená, podpora Curl v PHP. Nie je možné pripojenie oddielov ownCloud, WebDAV, či GoogleDrive. Prosím požiadajte svojho administrátora systému, nech ju nainštaluje.",
"External Storage" => "Externé úložisko",
"Folder name" => "Meno priečinka",
"Folder name" => "Názov priečinka",
"External storage" => "Externé úložisko",
"Configuration" => "Nastavenia",
"Options" => "Možnosti",
@@ -21,7 +21,7 @@ $TRANSLATIONS = array(
"Users" => "Používatelia",
"Delete" => "Zmazať",
"Enable User External Storage" => "Povoliť externé úložisko",
"Allow users to mount their own external storage" => "Povoliť používateľom pripojiť ich vlastné externé úložisko",
"Allow users to mount their own external storage" => "Povoliť používateľom pripojiť si vlastné externé úložisko",
"SSL root certificates" => "Koreňové SSL certifikáty",
"Import Root Certificate" => "Importovať koreňový certifikát"
);
+7 -13
View File
@@ -81,9 +81,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
$this->test = isset($params['test']);
$this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout'];
$params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region'];
$params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname'];
if (!isset($params['port'])) {
$params['region'] = ( ! isset($params['region']) || $params['region'] === '' ) ? 'eu-west-1' : $params['region'];
$params['hostname'] = ( !isset($params['hostname']) || $params['hostname'] === '' ) ? 's3.amazonaws.com' : $params['hostname'];
if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
}
$base_url = $scheme.'://'.$params['hostname'].':'.$params['port'].'/';
@@ -300,14 +300,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return false;
}
public function isReadable($path) {
return true;
}
public function isUpdatable($path) {
return true;
}
public function unlink($path) {
$path = $this->normalizePath($path);
@@ -515,8 +507,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
public function test() {
$test = $this->s3->get_canonical_user_id();
if (isset($test['id']) && $test['id'] != '') {
$test = $this->connection->getBucketAcl(array(
'Bucket' => $this->bucket,
));
if (isset($test) && !is_null($test->getPath('Owner/ID'))) {
return true;
}
return false;
+9 -3
View File
@@ -50,9 +50,9 @@ class OC_Mount_Config {
'key' => 'Access Key',
'secret' => '*Secret Key',
'bucket' => 'Bucket',
'hostname' => 'Hostname (optional)',
'port' => 'Port (optional)',
'region' => 'Region (optional)',
'hostname' => '&Hostname (optional)',
'port' => '&Port (optional)',
'region' => '&Region (optional)',
'use_ssl' => '!Enable SSL',
'use_path_style' => '!Enable Path Style'));
@@ -244,6 +244,7 @@ class OC_Mount_Config {
$storage = new $class($options);
return $storage->test();
} catch (Exception $exception) {
\OCP\Util::logException('files_external', $exception);
return false;
}
}
@@ -266,6 +267,11 @@ class OC_Mount_Config {
$mountType,
$applicable,
$isPersonal = false) {
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
// can't mount at root or "Shared" folder
return false;
}
if ($isPersonal) {
// Verify that the mount point applies for the current user
// Prevent non-admin users from mounting local storage
+49 -21
View File
@@ -50,6 +50,22 @@ class Dropbox extends \OC\Files\Storage\Common {
}
}
private function deleteMetaData($path) {
$path = $this->root.$path;
if (isset($this->metaData[$path])) {
unset($this->metaData[$path]);
return true;
}
return false;
}
/**
* @brief Returns the path's metadata
* @param $path path for which to return the metadata
* @param $list if true, also return the directory's contents
* @return directory contents if $list is true, file metadata if $list is
* false, null if the file doesn't exist or "false" if the operation failed
*/
private function getMetaData($path, $list = false) {
$path = $this->root.$path;
if ( ! $list && isset($this->metaData[$path])) {
@@ -62,24 +78,35 @@ class Dropbox extends \OC\Files\Storage\Common {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
return false;
}
$contents = array();
if ($response && isset($response['contents'])) {
$contents = $response['contents'];
// Cache folder's contents
foreach ($contents as $file) {
$this->metaData[$path.'/'.basename($file['path'])] = $file;
foreach ($response['contents'] as $file) {
if (!isset($file['is_deleted']) || !$file['is_deleted']) {
$this->metaData[$path.'/'.basename($file['path'])] = $file;
$contents[] = $file;
}
}
unset($response['contents']);
}
if (!isset($response['is_deleted']) || !$response['is_deleted']) {
$this->metaData[$path] = $response;
}
$this->metaData[$path] = $response;
// Return contents of folder only
return $contents;
} else {
try {
$response = $this->dropbox->getMetaData($path, 'false');
$this->metaData[$path] = $response;
return $response;
if (!isset($response['is_deleted']) || !$response['is_deleted']) {
$this->metaData[$path] = $response;
return $response;
}
return null;
} catch (\Exception $exception) {
if ($exception instanceof \Dropbox_Exception_NotFound) {
// don't log, might be a file_exist check
return false;
}
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
return false;
}
@@ -108,7 +135,7 @@ class Dropbox extends \OC\Files\Storage\Common {
public function opendir($path) {
$contents = $this->getMetaData($path, true);
if ($contents) {
if ($contents !== false) {
$files = array();
foreach ($contents as $file) {
$files[] = basename($file['path']);
@@ -146,14 +173,6 @@ class Dropbox extends \OC\Files\Storage\Common {
return false;
}
public function isReadable($path) {
return $this->file_exists($path);
}
public function isUpdatable($path) {
return $this->file_exists($path);
}
public function file_exists($path) {
if ($path == '' || $path == '/') {
return true;
@@ -165,9 +184,9 @@ class Dropbox extends \OC\Files\Storage\Common {
}
public function unlink($path) {
$path = $this->root.$path;
try {
$this->dropbox->delete($path);
$this->dropbox->delete($this->root.$path);
$this->deleteMetaData($path);
return true;
} catch (\Exception $exception) {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
@@ -176,10 +195,14 @@ class Dropbox extends \OC\Files\Storage\Common {
}
public function rename($path1, $path2) {
$path1 = $this->root.$path1;
$path2 = $this->root.$path2;
try {
$this->dropbox->move($path1, $path2);
// overwrite if target file exists and is not a directory
$destMetaData = $this->getMetaData($path2);
if (isset($destMetaData) && $destMetaData !== false && !$destMetaData['is_dir']) {
$this->unlink($path2);
}
$this->dropbox->move($this->root.$path1, $this->root.$path2);
$this->deleteMetaData($path1);
return true;
} catch (\Exception $exception) {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
@@ -277,7 +300,12 @@ class Dropbox extends \OC\Files\Storage\Common {
}
public function touch($path, $mtime = null) {
return false;
if ($this->file_exists($path)) {
return false;
} else {
$this->file_put_contents($path, '');
}
return true;
}
}
+19
View File
@@ -35,6 +35,9 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
if ( ! $this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
if (substr($this->root, -1) !== '/') {
$this->root .= '/';
}
} else {
throw new \Exception();
}
@@ -58,6 +61,22 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
$url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
return $url;
}
/**
* Unlinks file or directory
* @param string @path
*/
public function unlink($path) {
if ($this->is_dir($path)) {
return $this->rmdir($path);
}
else {
$url = $this->constructUrl($path);
$result = unlink($url);
clearstatcache(true, $url);
return $result;
}
}
public function fopen($path,$mode) {
switch($mode) {
case 'r':
-4
View File
@@ -317,10 +317,6 @@ class Google extends \OC\Files\Storage\Common {
}
}
public function isReadable($path) {
return $this->file_exists($path);
}
public function isUpdatable($path) {
$file = $this->getDriveFile($path);
if ($file) {
+11 -14
View File
@@ -94,15 +94,17 @@ class SFTP extends \OC\Files\Storage\Common {
private function writeHostKeys($keys) {
try {
$keyPath = $this->hostKeysPath();
$fp = fopen($keyPath, 'w');
foreach ($keys as $host => $key) {
fwrite($fp, $host . '::' . $key . "\n");
if ($keyPath && file_exists($keyPath)) {
$fp = fopen($keyPath, 'w');
foreach ($keys as $host => $key) {
fwrite($fp, $host . '::' . $key . "\n");
}
fclose($fp);
return true;
}
fclose($fp);
return true;
} catch (\Exception $e) {
return false;
}
return false;
}
private function readHostKeys() {
@@ -178,14 +180,6 @@ class SFTP extends \OC\Files\Storage\Common {
return false;
}
public function isReadable($path) {
return true;
}
public function isUpdatable($path) {
return true;
}
public function file_exists($path) {
try {
return $this->client->stat($this->absPath($path)) !== false;
@@ -291,6 +285,9 @@ class SFTP extends \OC\Files\Storage\Common {
public function rename($source, $target) {
try {
if (!$this->is_dir($target) && $this->file_exists($target)) {
$this->unlink($target);
}
return $this->client->rename(
$this->absPath($source),
$this->absPath($target)
+24 -1
View File
@@ -47,8 +47,13 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
public function constructUrl($path) {
if (substr($path, -1)=='/') {
$path=substr($path, 0, -1);
$path = substr($path, 0, -1);
}
if (substr($path, 0, 1)=='/') {
$path = substr($path, 1);
}
// remove trailing dots which some versions of samba don't seem to like
$path = rtrim($path, '.');
$path = urlencode($path);
$user = urlencode($this->user);
$pass = urlencode($this->password);
@@ -76,6 +81,24 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
}
}
/**
* Unlinks file or directory
* @param string @path
*/
public function unlink($path) {
if ($this->is_dir($path)) {
$this->rmdir($path);
}
else {
$url = $this->constructUrl($path);
unlink($url);
clearstatcache(false, $url);
}
// smb4php still returns false even on success so
// check here whether file was really deleted
return !file_exists($path);
}
/**
* check if a file or folder has been updated since $time
* @param string $path
+10 -13
View File
@@ -25,8 +25,9 @@ abstract class StreamWrapper extends Common {
$this->unlink($path . '/' . $file);
}
}
$success = rmdir($this->constructUrl($path));
clearstatcache();
$url = $this->constructUrl($path);
$success = rmdir($url);
clearstatcache(false, $url);
return $success;
} else {
return false;
@@ -38,15 +39,7 @@ abstract class StreamWrapper extends Common {
}
public function filetype($path) {
return filetype($this->constructUrl($path));
}
public function isReadable($path) {
return true; //not properly supported
}
public function isUpdatable($path) {
return true; //not properly supported
return @filetype($this->constructUrl($path));
}
public function file_exists($path) {
@@ -54,8 +47,11 @@ abstract class StreamWrapper extends Common {
}
public function unlink($path) {
$success = unlink($this->constructUrl($path));
clearstatcache();
$url = $this->constructUrl($path);
$success = unlink($url);
// normally unlink() is supposed to do this implicitly,
// but doing it anyway just to be sure
clearstatcache(false, $url);
return $success;
}
@@ -76,6 +72,7 @@ abstract class StreamWrapper extends Common {
}
} else {
$this->file_put_contents($path, '');
return true;
}
}
+2 -10
View File
@@ -268,14 +268,6 @@ class Swift extends \OC\Files\Storage\Common {
}
}
public function isReadable($path) {
return true;
}
public function isUpdatable($path) {
return true;
}
public function unlink($path) {
$path = $this->normalizePath($path);
@@ -372,7 +364,7 @@ class Swift extends \OC\Files\Storage\Common {
'X-Object-Meta-Timestamp' => $mtime
)
);
$object->Update($settings);
return $object->Update($settings);
} else {
$object = $this->container->DataObject();
if (is_null($mtime)) {
@@ -385,7 +377,7 @@ class Swift extends \OC\Files\Storage\Common {
'X-Object-Meta-Timestamp' => $mtime
)
);
$object->Create($settings);
return $object->Create($settings);
}
}
+6 -15
View File
@@ -134,14 +134,6 @@ class DAV extends \OC\Files\Storage\Common{
}
}
public function isReadable($path) {
return true;//not properly supported
}
public function isUpdatable($path) {
return true;//not properly supported
}
public function file_exists($path) {
$this->init();
$path=$this->cleanPath($path);
@@ -242,6 +234,7 @@ class DAV extends \OC\Files\Storage\Common{
} else {
$this->file_put_contents($path, '');
}
return true;
}
public function getFile($path, $target) {
@@ -268,7 +261,7 @@ class DAV extends \OC\Files\Storage\Common{
public function rename($path1, $path2) {
$this->init();
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
$path2=$this->createBaseUri().$this->cleanPath($path2);
try {
$this->client->request('MOVE', $path1, null, array('Destination'=>$path2));
return true;
@@ -280,7 +273,7 @@ class DAV extends \OC\Files\Storage\Common{
public function copy($path1, $path2) {
$this->init();
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
$path2=$this->createBaseUri().$this->cleanPath($path2);
try {
$this->client->request('COPY', $path1, null, array('Destination'=>$path2));
return true;
@@ -323,11 +316,9 @@ class DAV extends \OC\Files\Storage\Common{
}
public function cleanPath($path) {
if ( ! $path || $path[0]=='/') {
return substr($path, 1);
} else {
return $path;
}
$path = \OC\Files\Filesystem::normalizePath($path);
// remove leading slash
return substr($path, 1);
}
private function simpleResponse($method, $path, $body, $expected) {
+1 -1
View File
@@ -60,7 +60,7 @@
class="optional"
data-parameter="<?php p($parameter); ?>"
value="<?php p($value); ?>"
placeholder="<?php p(substr($placeholder, 5)); ?>" />
placeholder="<?php p(substr($placeholder, 1)); ?>" />
<?php elseif (strpos($placeholder, '#') !== false): ?>
<input type="hidden"
data-parameter="<?php p($parameter); ?>"
+16
View File
@@ -21,6 +21,22 @@ class Dropbox extends Storage {
$this->instance = new \OC\Files\Storage\Dropbox($this->config['dropbox']);
}
public function directoryProvider() {
// doesn't support leading/trailing spaces
return array(array('folder'));
}
public function testDropboxTouchReturnValue() {
$this->assertFalse($this->instance->file_exists('foo'));
// true because succeeded
$this->assertTrue($this->instance->touch('foo'));
$this->assertTrue($this->instance->file_exists('foo'));
// false because not supported
$this->assertFalse($this->instance->touch('foo'));
}
public function tearDown() {
if ($this->instance) {
$this->instance->unlink('/');
+16 -4
View File
@@ -34,19 +34,31 @@ class FTP extends Storage {
'password' => 'ftp',
'root' => '/',
'secure' => false );
$instance = new OC_Filestorage_FTP($config);
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = true;
$instance = new OC_Filestorage_FTP($config);
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'false';
$instance = new OC_Filestorage_FTP($config);
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'true';
$instance = new OC_Filestorage_FTP($config);
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['root'] = '';
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftps://ftp:ftp@localhost/somefile.txt', $instance->constructUrl('somefile.txt'));
$config['root'] = '/abc';
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt'));
$config['root'] = '/abc/';
$instance = new \OC\Files\Storage\FTP($config);
$this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt'));
}
}
+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* ownCloud
*
* @author Vincent Petry
* Copyright (c) 2013 Vincent Petry <pvince81@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/>.
*
*/
require_once __DIR__ . '/../../../lib/base.php';
require __DIR__ . '/../lib/config.php';
class Test_Mount_Config_Dummy_Storage {
public function test() {
return true;
}
}
/**
* Class Test_Mount_Config
*/
class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
/**
* Test mount point validation
*/
public function testAddMountPointValidation() {
$storageClass = 'Test_Mount_Config_Dummy_Storage';
$mountType = 'user';
$applicable = 'all';
$isPersonal = false;
$this->assertEquals(false, OC_Mount_Config::addMountPoint('', $storageClass, array(), $mountType, $applicable, $isPersonal));
$this->assertEquals(false, OC_Mount_Config::addMountPoint('/', $storageClass, array(), $mountType, $applicable, $isPersonal));
$this->assertEquals(false, OC_Mount_Config::addMountPoint('Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
$this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
}
}
+5
View File
@@ -29,6 +29,11 @@ class SMB extends Storage {
}
}
public function directoryProvider() {
// doesn't support leading/trailing spaces
return array(array('folder'));
}
public function testRenameWithSpaces() {
$this->instance->mkdir('with spaces');
$result = $this->instance->rename('with spaces', 'foo bar');
@@ -0,0 +1,41 @@
<?php
/**
* Copyright (c) 2013 Vincent Petry <pvince81@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace Test\Files\Storage;
class SMBFunctions extends \PHPUnit_Framework_TestCase {
public function setUp() {
$id = uniqid();
// dummy config
$this->config = array(
'run'=>false,
'user'=>'test',
'password'=>'testpassword',
'host'=>'smbhost',
'share'=>'/sharename',
'root'=>'/rootdir/',
);
$this->instance = new \OC\Files\Storage\SMB($this->config);
}
public function tearDown() {
}
public function testGetId() {
$this->assertEquals('smb::test@smbhost//sharename//rootdir/', $this->instance->getId());
}
public function testConstructUrl() {
$this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc", $this->instance->constructUrl('/abc'));
$this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc", $this->instance->constructUrl('/abc/'));
$this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc%2F", $this->instance->constructUrl('/abc/.'));
$this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc%2Fdef", $this->instance->constructUrl('/abc/def'));
}
}
+7 -3
View File
@@ -9,6 +9,8 @@ if(!\OC_App::isEnabled('files_sharing')){
exit;
}
\OC_User::setIncognitoMode(true);
$file = array_key_exists('file', $_GET) ? (string) urldecode($_GET['file']) : '';
$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '36';
$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '36';
@@ -36,10 +38,12 @@ if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) {
$userId = $linkedItem['uid_owner'];
\OC_Util::setupFS($userId);
\OC\Files\Filesystem::initMountPoints($userId);
$view = new \OC\Files\View('/' . $userId . '/files');
$pathId = $linkedItem['file_source'];
$path = \OC\Files\Filesystem::getPath($pathId);
$pathInfo = \OC\Files\Filesystem::getFileInfo($path);
$path = $view->getPath($pathId);
$pathInfo = $view->getFileInfo($path);
$sharedFile = null;
if($linkedItem['item_type'] === 'folder') {
@@ -54,7 +58,7 @@ if($linkedItem['item_type'] === 'folder') {
if($linkedItem['item_type'] === 'file') {
$parent = $pathInfo['parent'];
$path = \OC\Files\Filesystem::getPath($parent);
$path = $view->getPath($parent);
$sharedFile = $pathInfo['name'];
}
+1
View File
@@ -14,6 +14,7 @@ OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
OCP\Util::addScript('files_sharing', 'share');
\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'postDeleteHook');
\OC_Hook::connect('OC_Filesystem', 'delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');
\OC_Hook::connect('OCP\Share', 'post_shared', '\OC\Files\Cache\Shared_Updater', 'shareHook');
+18 -11
View File
@@ -1,5 +1,5 @@
body {
background:#ddd;
height: auto;
}
#header {
@@ -22,7 +22,7 @@ body {
#public_upload,
#download {
font-weight:700;
margin: 0 0.4em 0 0;
margin: 0 0 0 .4em;
padding: 0 5px;
height: 32px;
float: left;
@@ -49,12 +49,14 @@ body {
vertical-align:text-bottom;
}
#controls {
left: 0;
}
#preview {
background:#eee;
border-bottom:1px solid #f8f8f8;
min-height:30em;
text-align:center;
margin:45px auto;
background: #fff;
text-align: center;
margin: 45px auto 0;
}
#noPreview {
@@ -62,11 +64,16 @@ body {
padding-top:5em;
}
footer {
margin-top: 45px;
}
p.info {
color:#777;
text-align:center;
width:22em;
margin:2em auto;
color: #777;
text-align: center;
width: 22em;
margin: 0 auto;
padding: 20px;
}
p.info a {
+2 -1
View File
@@ -14,6 +14,7 @@ $TRANSLATIONS = array(
"Download" => "Stáhnout",
"Upload" => "Odeslat",
"Cancel upload" => "Zrušit odesílání",
"No preview available for" => "Náhled není dostupný pro"
"No preview available for" => "Náhled není dostupný pro",
"Direct link" => "Přímý odkaz"
);
$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
+3 -1
View File
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
"This share is password-protected" => "Αυτός ο κοινόχρηστος φάκελος προστατεύεται με κωδικό",
"The password is wrong. Try again." => "Εσφαλμένο συνθηματικό. Προσπαθήστε ξανά.",
"Password" => "Συνθηματικό",
"Sorry, this link doesnt seem to work anymore." => "Συγγνώμη, αυτός ο σύνδεσμος μοιάζει να μην ισχύει πια.",
@@ -13,6 +14,7 @@ $TRANSLATIONS = array(
"Download" => "Λήψη",
"Upload" => "Μεταφόρτωση",
"Cancel upload" => "Ακύρωση αποστολής",
"No preview available for" => "Δεν υπάρχει διαθέσιμη προεπισκόπηση για"
"No preview available for" => "Δεν υπάρχει διαθέσιμη προεπισκόπηση για",
"Direct link" => "Άμεσος σύνδεσμος"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
+3 -1
View File
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
"This share is password-protected" => "Elkarbanatutako hau pasahitzarekin babestuta dago",
"The password is wrong. Try again." => "Pasahitza ez da egokia. Saiatu berriro.",
"Password" => "Pasahitza",
"Sorry, this link doesnt seem to work anymore." => "Barkatu, lotura ez dirudi eskuragarria dagoenik.",
@@ -13,6 +14,7 @@ $TRANSLATIONS = array(
"Download" => "Deskargatu",
"Upload" => "Igo",
"Cancel upload" => "Ezeztatu igoera",
"No preview available for" => "Ez dago aurrebista eskuragarririk hauentzat "
"No preview available for" => "Ez dago aurrebista eskuragarririk hauentzat ",
"Direct link" => "Lotura zuzena"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
+10 -1
View File
@@ -1,11 +1,20 @@
<?php
$TRANSLATIONS = array(
"This share is password-protected" => "To mesto je zaščiteno z geslom.",
"The password is wrong. Try again." => "Geslo je napačno. Poskusite znova.",
"Password" => "Geslo",
"Sorry, this link doesnt seem to work anymore." => "Povezava očitno ni več v uporabi.",
"Reasons might be:" => "Vzrok je lahko:",
"the item was removed" => "predmet je odstranjen,",
"the link expired" => "povezava je pretekla,",
"sharing is disabled" => "souporaba je onemogočena.",
"For more info, please ask the person who sent this link." => "Za več podrobnosti stopite v stik s pošiljateljem te povezave.",
"%s shared the folder %s with you" => "Oseba %s je določila mapo %s za souporabo",
"%s shared the file %s with you" => "Oseba %s je določila datoteko %s za souporabo",
"Download" => "Prejmi",
"Upload" => "Pošlji",
"Cancel upload" => "Prekliči pošiljanje",
"No preview available for" => "Predogled ni na voljo za"
"No preview available for" => "Predogled ni na voljo za",
"Direct link" => "Neposredna povezava"
);
$PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);";
+10 -1
View File
@@ -1,11 +1,20 @@
<?php
$TRANSLATIONS = array(
"This share is password-protected" => "Цей ресурс обміну захищений паролем",
"The password is wrong. Try again." => "Невірний пароль. Спробуйте ще раз.",
"Password" => "Пароль",
"Sorry, this link doesnt seem to work anymore." => "На жаль, посилання більше не працює.",
"Reasons might be:" => "Можливі причини:",
"the item was removed" => "цей пункт був вилучений",
"the link expired" => "посилання застаріло",
"sharing is disabled" => "обмін заборонений",
"For more info, please ask the person who sent this link." => "Для отримання додаткової інформації, будь ласка, зверніться до особи, яка надіслала це посилання.",
"%s shared the folder %s with you" => "%s опублікував каталог %s для Вас",
"%s shared the file %s with you" => "%s опублікував файл %s для Вас",
"Download" => "Завантажити",
"Upload" => "Вивантажити",
"Cancel upload" => "Перервати завантаження",
"No preview available for" => "Попередній перегляд недоступний для"
"No preview available for" => "Попередній перегляд недоступний для",
"Direct link" => "Пряме посилання"
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
+28 -10
View File
@@ -23,6 +23,9 @@ namespace OC\Files\Cache;
class Shared_Updater {
// shares which can be removed from oc_share after the delete operation was successful
static private $toRemove = array();
/**
* Correct the parent folders' ETags for all users shared the file at $target
*
@@ -58,15 +61,17 @@ class Shared_Updater {
* @param string $path
*/
private static function removeShare($path) {
$fileInfo = \OC\Files\Filesystem::getFileInfo($path);
$fileSource = $fileInfo['fileid'];
$fileSource = self::$toRemove[$path];
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?');
try {
\OC_DB::executeAudited($query, array($fileSource));
} catch (\Exception $e) {
\OCP\Util::writeLog('files_sharing', "can't remove share: " . $e->getMessage(), \OCP\Util::WARN);
if (!\OC\Files\Filesystem::file_exists($path)) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?');
try {
\OC_DB::executeAudited($query, array($fileSource));
} catch (\Exception $e) {
\OCP\Util::writeLog('files_sharing', "can't remove share: " . $e->getMessage(), \OCP\Util::WARN);
}
}
unset(self::$toRemove[$path]);
}
/**
@@ -89,17 +94,30 @@ class Shared_Updater {
*/
static public function deleteHook($params) {
self::correctFolders($params['path']);
self::removeShare($params['path']);
$fileInfo = \OC\Files\Filesystem::getFileInfo($params['path']);
// mark file as deleted so that we can clean up the share table if
// the file was deleted successfully
self::$toRemove[$params['path']] = $fileInfo['fileid'];
}
/**
* @param array $params
*/
static public function postDeleteHook($params) {
self::removeShare($params['path']);
}
/**
* @param array $params
*/
static public function shareHook($params) {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$uidOwner = \OCP\User::getUser();
$users = \OCP\Share::getUsersItemShared($params['itemType'], $params['fileSource'], $uidOwner, true);
if (isset($params['uidOwner'])) {
$uidOwner = $params['uidOwner'];
} else {
$uidOwner = \OCP\User::getUser();
}
$users = \OCP\Share::getUsersItemShared($params['itemType'], $params['fileSource'], $uidOwner, true, false);
if (!empty($users)) {
while (!empty($users)) {
$reshareUsers = array();
+8 -3
View File
@@ -149,11 +149,9 @@ if (isset($path)) {
$tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
$tmpl->assign('fileTarget', basename($linkItem['file_target']));
$tmpl->assign('dirToken', $linkItem['token']);
$tmpl->assign('sharingToken', $token);
$tmpl->assign('disableSharing', true);
$allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE);
if (\OCP\App::isEnabled('files_encryption')) {
$allowPublicUploadEnabled = false;
}
if (OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes') === 'no') {
$allowPublicUploadEnabled = false;
}
@@ -220,6 +218,8 @@ if (isset($path)) {
$breadcrumbNav->assign('breadcrumb', $breadcrumb);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
$maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
$fileHeader = (!isset($files) or count($files) > 0);
$emptyContent = ($allowPublicUploadEnabled and !$fileHeader);
$folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage());
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
@@ -233,6 +233,11 @@ if (isset($path)) {
$folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$folder->assign('usedSpacePercent', 0);
$folder->assign('fileHeader', $fileHeader);
$folder->assign('disableSharing', true);
$folder->assign('trash', false);
$folder->assign('emptyContent', $emptyContent);
$folder->assign('ajaxLoad', false);
$tmpl->assign('folder', $folder->fetchPage());
$maxInputFileSize = OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'));
$allowZip = OCP\Config::getSystemValue('allowZipDownload', true)
+1
View File
@@ -6,6 +6,7 @@
<input type="hidden" id="isPublic" name="isPublic" value="1">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
<header><div id="header">
+30 -9
View File
@@ -3,17 +3,36 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$files = $_POST['files'];
$dirlisting = $_POST['dirlisting'];
$list = json_decode($files);
// "empty trash" command
if (isset($_POST['allfiles']) and $_POST['allfiles'] === 'true'){
$deleteAll = true;
$folder = isset($_POST['dir']) ? $_POST['dir'] : '/';
if ($folder === '/' || $folder === '') {
OCA\Files_Trashbin\Trashbin::deleteAll();
$list = array();
} else {
$dirname = dirname($folder);
if ( $dirname !== '/' && $dirname !== '.' ) {
$dirlisting = '1';
} else {
$dirlisting = '0';
}
$list[] = $folder;
}
}
else {
$deleteAll = false;
$files = $_POST['files'];
$dirlisting = $_POST['dirlisting'];
$list = json_decode($files);
}
$error = array();
$success = array();
$i = 0;
foreach ($list as $file) {
if ( $dirlisting === '0') {
$file = ltrim($file, '/');
$delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2);
@@ -23,13 +42,15 @@ foreach ($list as $file) {
}
OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp);
if (!OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
if (OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
$error[] = $filename;
OC_Log::write('trashbin','can\'t delete ' . $filename . ' permanently.', OC_Log::ERROR);
}
// only list deleted files if not deleting everything
else if (!$deleteAll) {
$success[$i]['filename'] = $file;
$success[$i]['timestamp'] = $timestamp;
$i++;
} else {
$error[] = $filename;
OC_Log::write('trashbin','can\'t delete ' . $filename . ' permanently.', OC_Log::ERROR);
}
}
+8 -2
View File
@@ -29,8 +29,14 @@ if($maxX === 0 || $maxY === 0) {
}
try{
$preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files');
$preview->setFile($file);
$preview = new \OC\Preview(\OC_User::getUser(), 'files_trashbin/files', $file);
$view = new \OC\Files\View('/'.\OC_User::getUser(). '/files_trashbin/files');
if ($view->is_dir($file)) {
$mimetype = 'httpd/unix-directory';
} else {
$mimetype = \OC_Helper::getFileNameMimeType(pathinfo($file, PATHINFO_FILENAME));
}
$preview->setMimetype($mimetype);
$preview->setMaxX($maxX);
$preview->setMaxY($maxY);
$preview->setScalingUp($scalingUp);
+1
View File
@@ -13,6 +13,7 @@ $success = array();
$i = 0;
foreach ($list as $file) {
if ( $dirlisting === '0') {
$file = ltrim($file, '/');
$delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2);
+1 -1
View File
@@ -6,7 +6,7 @@
ownCloud keeps a copy of your deleted files in case you need them again.
To make sure that the user doesn't run out of memory the deleted files app
manages the size of the deleted files for the user. By default deleted files
stay in the trash bin for 180 days. ownCloud checks the age of the files
stay in the trash bin for 90 days. ownCloud checks the age of the files
every time a new files gets moved to the deleted files and remove all files
older than 180 days. The user can adjust this value in the config.php by
setting the "trashbin_retention_obligation" value.
+3
View File
@@ -0,0 +1,3 @@
#fileList td a.file, #fileList td a.file span {
cursor: default;
}
+1
View File
@@ -10,6 +10,7 @@ OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_trashbin', 'index', 'user');
OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('files_trashbin', 'trash');
OCP\Util::addScript('files', 'filelist');
// filelist overrides
OCP\Util::addScript('files_trashbin', 'filelist');
+7
View File
@@ -22,3 +22,10 @@ FileList.reload = function(){
FileList.linkTo = function(dir){
return OC.linkTo('files_trashbin', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
}
FileList.updateEmptyContent = function(){
var $fileList = $('#fileList');
var exists = $fileList.find('tr:first').exists();
$('#emptycontent').toggleClass('hidden', exists);
$('#filestable th').toggleClass('hidden', !exists);
}
+48 -48
View File
@@ -8,7 +8,7 @@ $(document).ready(function() {
deleteAction.removeClass('delete-icon').addClass('progress-icon');
disableActions();
$.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'),
{files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')},
{files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')},
function(result) {
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
@@ -19,6 +19,7 @@ $(document).ready(function() {
}
enableActions();
FileList.updateFileSummary();
FileList.updateEmptyContent();
}
);
@@ -34,7 +35,7 @@ $(document).ready(function() {
deleteAction.removeClass('delete-icon').addClass('progress-icon');
disableActions();
$.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'),
{files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')},
{files: JSON.stringify([$('#dir').val() + '/' +filename]), dirlisting: tr.attr('data-dirlisting')},
function(result) {
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
@@ -45,6 +46,7 @@ $(document).ready(function() {
}
enableActions();
FileList.updateFileSummary();
FileList.updateEmptyContent();
}
);
@@ -64,41 +66,6 @@ $(document).ready(function() {
procesSelection();
});
$('#fileList').on('click', 'td.filename a', function(event) {
if (event.shiftKey) {
event.preventDefault();
var last = $(lastChecked).parent().parent().prevAll().length;
var first = $(this).parent().parent().prevAll().length;
var start = Math.min(first, last);
var end = Math.max(first, last);
var rows = $(this).parent().parent().parent().children('tr');
for (var i = start; i < end; i++) {
$(rows).each(function(index) {
if (index == i) {
var checkbox = $(this).children().children('input:checkbox');
$(checkbox).attr('checked', 'checked');
$(checkbox).parent().parent().addClass('selected');
}
});
}
}
var checkbox = $(this).parent().children('input:checkbox');
lastChecked = checkbox;
if ($(checkbox).attr('checked')) {
$(checkbox).removeAttr('checked');
$(checkbox).parent().parent().removeClass('selected');
$('#select_all').removeAttr('checked');
} else {
$(checkbox).attr('checked', 'checked');
$(checkbox).parent().parent().toggleClass('selected');
var selectedCount = $('td.filename input:checkbox:checked').length;
if (selectedCount == $('td.filename input:checkbox').length) {
$('#select_all').attr('checked', 'checked');
}
}
procesSelection();
});
$('.undelete').click('click', function(event) {
event.preventDefault();
var files = getSelectedFiles('file');
@@ -122,39 +89,72 @@ $(document).ready(function() {
}
enableActions();
FileList.updateFileSummary();
FileList.updateEmptyContent();
}
);
});
$('.delete').click('click', function(event) {
event.preventDefault();
var files = getSelectedFiles('file');
var fileslist = JSON.stringify(files);
var dirlisting = getSelectedFiles('dirlisting')[0];
var allFiles = $('#select_all').is(':checked');
var files = [];
var params = {};
if (allFiles) {
params = {
allfiles: true,
dir: $('#dir').val()
};
}
else {
files = getSelectedFiles('file');
params = {
files: JSON.stringify(files),
dirlisting: getSelectedFiles('dirlisting')[0]
};
};
disableActions();
for (var i = 0; i < files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file', files[i]).children("td.date").children(".action.delete");
deleteAction.removeClass('delete-icon').addClass('progress-icon');
if (allFiles) {
FileList.showMask();
}
else {
for (var i = 0; i < files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file', files[i]).children("td.date").children(".action.delete");
deleteAction.removeClass('delete-icon').addClass('progress-icon');
}
}
$.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'),
{files: fileslist, dirlisting: dirlisting},
params,
function(result) {
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
row.parentNode.removeChild(row);
if (allFiles) {
FileList.hideMask();
// simply remove all files
$('#fileList').empty();
}
else {
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
row.parentNode.removeChild(row);
}
}
if (result.status !== 'success') {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
}
enableActions();
FileList.updateFileSummary();
FileList.updateEmptyContent();
}
);
});
$('#fileList').on('click', 'td.filename input', function() {
var checkbox = $(this).parent().children('input:checkbox');
$(checkbox).parent().parent().toggleClass('selected');
procesSelection();
});
$('#fileList').on('click', 'td.filename a', function(event) {
var mime = $(this).parent().parent().data('mime');
if (mime !== 'httpd/unix-directory') {
@@ -201,7 +201,7 @@ function getSelectedFiles(property){
elements.each(function(i,element){
var file={
name:$(element).attr('data-filename'),
file:$(element).attr('data-file'),
file:$('#dir').val() + "/" + $(element).attr('data-file'),
timestamp:$(element).attr('data-timestamp'),
type:$(element).attr('data-type'),
dirlisting:$(element).attr('data-dirlisting')
+2 -1
View File
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
"Error" => "Ошибка"
"Error" => "Ошибка",
"Delete" => "Удалить"
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
+2 -1
View File
@@ -1,8 +1,9 @@
<?php
$TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Datoteke %s ni mogoče dokončno izbrisati.",
"Couldn't delete %s permanently" => "Datoteke %s ni mogoče trajno izbrisati.",
"Couldn't restore %s" => "Ni mogoče obnoviti %s",
"Error" => "Napaka",
"restored" => "obnovljeno",
"Nothing in here. Your trash bin is empty!" => "Mapa smeti je prazna.",
"Name" => "Ime",
"Restore" => "Obnovi",
+2
View File
@@ -44,8 +44,10 @@ class Helper
}
$files = array();
$id = 0;
foreach ($result as $r) {
$i = array();
$i['id'] = $id++;
$i['name'] = $r['id'];
$i['date'] = \OCP\Util::formatDate($r['timestamp']);
$i['timestamp'] = $r['timestamp'];
+129 -39
View File
@@ -41,13 +41,7 @@ class Trashbin {
return array($uid, $filename);
}
/**
* move file to the trash bin
*
* @param $file_path path to the deleted file/directory relative to the files root directory
*/
public static function move2trash($file_path) {
$user = \OCP\User::getUser();
private static function setUpTrash($user) {
$view = new \OC\Files\View('/' . $user);
if (!$view->is_dir('files_trashbin')) {
$view->mkdir('files_trashbin');
@@ -64,6 +58,48 @@ class Trashbin {
if (!$view->is_dir('files_trashbin/share-keys')) {
$view->mkdir('files_trashbin/share-keys');
}
}
private static function copyFilesToOwner($sourcePath, $owner, $ownerPath, $timestamp, $type, $mime) {
self::setUpTrash($owner);
$ownerFilename = basename($ownerPath);
$ownerLocation = dirname($ownerPath);
$sourceFilename = basename($sourcePath);
$view = new \OC\Files\View('/');
$source = \OCP\User::getUser().'/files_trashbin/files/' . $sourceFilename . '.d' . $timestamp;
$target = $owner.'/files_trashbin/files/' . $ownerFilename . '.d' . $timestamp;
self::copy_recursive($source, $target, $view);
if ($view->file_exists($target)) {
$query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`type`,`mime`,`user`) VALUES (?,?,?,?,?,?)");
$result = $query->execute(array($ownerFilename, $timestamp, $ownerLocation, $type, $mime, $owner));
if (!$result) { // if file couldn't be added to the database than also don't store it in the trash bin.
$view->deleteAll($owner.'/files_trashbin/files/' . $ownerFilename . '.d' . $timestamp);
\OC_Log::write('files_trashbin', 'trash bin database couldn\'t be updated for the files owner', \OC_log::ERROR);
return;
}
}
}
/**
* move file to the trash bin
*
* @param $file_path path to the deleted file/directory relative to the files root directory
*/
public static function move2trash($file_path) {
$user = \OCP\User::getUser();
$size = 0;
list($owner, $ownerPath) = self::getUidAndFilename($file_path);
self::setUpTrash($user);
$view = new \OC\Files\View('/' . $user);
$path_parts = pathinfo($file_path);
$filename = $path_parts['basename'];
@@ -77,19 +113,20 @@ class Trashbin {
$type = 'file';
}
$trashbinSize = self::getTrashbinSize($user);
if ($trashbinSize === false || $trashbinSize < 0) {
$trashbinSize = self::calculateSize(new \OC\Files\View('/' . $user . '/files_trashbin'));
$userTrashSize = self::getTrashbinSize($user);
if ($userTrashSize === false || $userTrashSize < 0) {
$userTrashSize = self::calculateSize(new \OC\Files\View('/' . $user . '/files_trashbin'));
}
// disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$sizeOfAddedFiles = self::copy_recursive($file_path, 'files_trashbin/files/' . $filename . '.d' . $timestamp, $view);
$trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp;
$sizeOfAddedFiles = self::copy_recursive('/files/'.$file_path, $trashPath, $view);
\OC_FileProxy::$enabled = $proxyStatus;
if ($view->file_exists('files_trashbin/files/' . $filename . '.d' . $timestamp)) {
$trashbinSize += $sizeOfAddedFiles;
$size = $sizeOfAddedFiles;
$query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`type`,`mime`,`user`) VALUES (?,?,?,?,?,?)");
$result = $query->execute(array($filename, $timestamp, $location, $type, $mime, $user));
if (!$result) { // if file couldn't be added to the database than also don't store it in the trash bin.
@@ -100,15 +137,31 @@ class Trashbin {
\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)));
$trashbinSize += self::retainVersions($file_path, $filename, $timestamp);
$trashbinSize += self::retainEncryptionKeys($file_path, $filename, $timestamp);
$size += self::retainVersions($file_path, $filename, $timestamp);
$size += self::retainEncryptionKeys($file_path, $filename, $timestamp);
// if owner !== user we need to also add a copy to the owners trash
if ($user !== $owner) {
self::copyFilesToOwner($file_path, $owner, $ownerPath, $timestamp, $type, $mime);
}
} else {
\OC_Log::write('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OC_log::ERROR);
}
$trashbinSize -= self::expire($trashbinSize);
$userTrashSize += $size;
$userTrashSize -= self::expire($userTrashSize, $user);
self::setTrashbinSize($user, $userTrashSize);
self::setTrashbinSize($user, $trashbinSize);
// if owner !== user we also need to update the owners trash size
if($owner !== $user) {
$ownerTrashSize = self::getTrashbinSize($owner);
if ($ownerTrashSize === false || $ownerTrashSize < 0) {
$ownerTrashSize = self::calculateSize(new \OC\Files\View('/' . $owner . '/files_trashbin'));
}
$ownerTrashSize += $size;
$ownerTrashSize -= self::expire($ownerTrashSize, $owner);
self::setTrashbinSize($owner, $ownerTrashSize);
}
}
/**
@@ -135,10 +188,16 @@ class Trashbin {
if ($rootView->is_dir($owner . '/files_versions/' . $ownerPath)) {
$size += self::calculateSize(new \OC\Files\View('/' . $owner . '/files_versions/' . $ownerPath));
if ($owner !== $user) {
$rootView->copy($owner . '/files_versions/' . $ownerPath, $owner . '/files_trashbin/versions/' . basename($ownerPath) . '.d' . $timestamp);
}
$rootView->rename($owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . $filename . '.d' . $timestamp);
} else if ($versions = \OCA\Files_Versions\Storage::getVersions($owner, $ownerPath)) {
foreach ($versions as $v) {
$size += $rootView->filesize($owner . '/files_versions' . $v['path'] . '.v' . $v['version']);
if ($owner !== $user) {
$rootView->copy($owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $owner . '/files_trashbin/versions/' . $v['name'] . '.v' . $v['version'] . '.d' . $timestamp);
}
$rootView->rename($owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . $filename . '.v' . $v['version'] . '.d' . $timestamp);
}
}
@@ -187,9 +246,15 @@ class Trashbin {
// move keyfiles
if ($rootView->is_dir($keyfile)) {
$size += self::calculateSize(new \OC\Files\View($keyfile));
if ($owner !== $user) {
$rootView->copy($keyfile, $owner . '/files_trashbin/keyfiles/' . basename($ownerPath) . '.d' . $timestamp);
}
$rootView->rename($keyfile, $user . '/files_trashbin/keyfiles/' . $filename . '.d' . $timestamp);
} else {
$size += $rootView->filesize($keyfile . '.key');
if ($owner !== $user) {
$rootView->copy($keyfile . '.key', $owner . '/files_trashbin/keyfiles/' . basename($ownerPath) . '.key.d' . $timestamp);
}
$rootView->rename($keyfile . '.key', $user . '/files_trashbin/keyfiles/' . $filename . '.key.d' . $timestamp);
}
}
@@ -199,6 +264,9 @@ class Trashbin {
if ($rootView->is_dir($sharekeys)) {
$size += self::calculateSize(new \OC\Files\View($sharekeys));
if ($owner !== $user) {
$rootView->copy($sharekeys, $owner . '/files_trashbin/share-keys/' . basename($ownerPath) . '.d' . $timestamp);
}
$rootView->rename($sharekeys, $user . '/files_trashbin/share-keys/' . $filename . '.d' . $timestamp);
} else {
// get local path to share-keys
@@ -211,22 +279,23 @@ class Trashbin {
// get source file parts
$pathinfo = pathinfo($src);
// we only want to keep the owners key so we can access the private key
$ownerShareKey = $filename . '.' . $user . '.shareKey';
// we only want to keep the users key so we can access the private key
$userShareKey = $filename . '.' . $user . '.shareKey';
// if we found the share-key for the owner, we need to move it to files_trashbin
if ($pathinfo['basename'] == $ownerShareKey) {
if ($pathinfo['basename'] == $userShareKey) {
// calculate size
$size += $rootView->filesize($sharekeys . '.' . $user . '.shareKey');
// move file
$rootView->rename($sharekeys . '.' . $user . '.shareKey', $user . '/files_trashbin/share-keys/' . $ownerShareKey . '.d' . $timestamp);
$rootView->rename($sharekeys . '.' . $user . '.shareKey', $user . '/files_trashbin/share-keys/' . $userShareKey . '.d' . $timestamp);
} elseif ($owner !== $user) {
$ownerShareKey = basename($ownerPath) . '.' . $owner . '.shareKey';
if ($pathinfo['basename'] == $ownerShareKey) {
$rootView->rename($sharekeys . '.' . $owner . '.shareKey', $owner . '/files_trashbin/share-keys/' . $ownerShareKey . '.d' . $timestamp);
}
} else {
// calculate size
$size += filesize($src);
// don't keep other share-keys
unlink($src);
}
@@ -495,6 +564,21 @@ class Trashbin {
return $size;
}
/**
* @brief delete all files from the trash
*/
public static function deleteAll() {
$user = \OCP\User::getUser();
$view = new \OC\Files\View('/' . $user);
$view->deleteAll('files_trashbin');
self::setTrashbinSize($user, 0);
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
$query->execute(array($user));
return true;
}
/**
* @brief delete file from trash bin permanently
*
@@ -679,7 +763,7 @@ class Trashbin {
$freeSpace = self::calculateFreeSpace($size);
if ($freeSpace < 0) {
$newSize = $size - self::expire($size);
$newSize = $size - self::expire($size, $user);
if ($newSize !== $size) {
self::setTrashbinSize($user, $newSize);
}
@@ -688,13 +772,19 @@ class Trashbin {
/**
* clean up the trash bin
* @param current size of the trash bin
* @return size of expired files
* @param int $trashbinSize current size of the trash bin
* @param string $user
* @return int size of expired files
*/
private static function expire($trashbinSize) {
private static function expire($trashbinSize, $user) {
// let the admin disable auto expire
$autoExpire = \OC_Config::getValue('trashbin_auto_expire', true);
if ($autoExpire === false) {
return 0;
}
$user = \OCP\User::getUser();
$view = new \OC\Files\View('/' . $user);
$availableSpace = self::calculateFreeSpace($trashbinSize);
$size = 0;
@@ -742,23 +832,23 @@ class Trashbin {
*/
private static function copy_recursive($source, $destination, $view) {
$size = 0;
if ($view->is_dir('files' . $source)) {
if ($view->is_dir($source)) {
$view->mkdir($destination);
$view->touch($destination, $view->filemtime('files' . $source));
foreach (\OC_Files::getDirectoryContent($source) as $i) {
$view->touch($destination, $view->filemtime($source));
foreach ($view->getDirectoryContent($source) as $i) {
$pathDir = $source . '/' . $i['name'];
if ($view->is_dir('files' . $pathDir)) {
if ($view->is_dir($pathDir)) {
$size += self::copy_recursive($pathDir, $destination . '/' . $i['name'], $view);
} else {
$size += $view->filesize('files' . $pathDir);
$view->copy('files' . $pathDir, $destination . '/' . $i['name']);
$view->touch($destination . '/' . $i['name'], $view->filemtime('files' . $pathDir));
$size += $view->filesize($pathDir);
$view->copy($pathDir, $destination . '/' . $i['name']);
$view->touch($destination . '/' . $i['name'], $view->filemtime($pathDir));
}
}
} else {
$size += $view->filesize('files' . $source);
$view->copy('files' . $source, $destination);
$view->touch($destination, $view->filemtime('files' . $source));
$size += $view->filesize($source);
$view->copy($source, $destination);
$view->touch($destination, $view->filemtime($source));
}
return $size;
}
+1 -3
View File
@@ -4,9 +4,7 @@
</div>
<div id='notification'></div>
<?php if (isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false && !$_['ajaxLoad']):?>
<div id="emptycontent"><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div>
<?php endif; ?>
<div id="emptycontent" <?php if (!(isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false && !$_['ajaxLoad'])):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div>
<input type="hidden" name="ajaxLoad" id="ajaxLoad" value="<?php p($_['ajaxLoad']); ?>" />
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
+8 -5
View File
@@ -35,18 +35,21 @@
<?php endif; ?>
<?php endif; ?>
>
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
<?php if(!isset($_['readonly']) || !$_['readonly']): ?>
<input id="select-<?php p($file['id']); ?>" type="checkbox" />
<label for="select-<?php p($file['id']); ?>"></label>
<?php endif; ?>
<?php if($file['type'] === 'dir'): ?>
<?php if( $_['dirlisting'] ): ?>
<a class="name" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
<a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
<?php else: ?>
<a class="name" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
<a class="name dir" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
<?php endif; ?>
<?php else: ?>
<?php if( $_['dirlisting'] ): ?>
<a class="name" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
<a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
<?php else: ?>
<a class="name" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
<a class="name file" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
<?php endif; ?>
<?php endif; ?>
<span class="nametext">
+3 -2
View File
@@ -37,8 +37,9 @@ if($maxX === 0 || $maxY === 0) {
}
try{
$preview = new \OC\Preview($user, 'files_versions');
$preview->setFile($file.'.v'.$version);
$preview = new \OC\Preview($user, 'files_versions', $file.'.v'.$version);
$mimetype = \OC_Helper::getFileNameMimeType($file);
$preview->setMimetype($mimetype);
$preview->setMaxX($maxX);
$preview->setMaxY($maxY);
$preview->setScalingUp($scalingUp);
+1
View File
@@ -12,6 +12,7 @@ OCP\Util::addStyle('files_versions', 'versions');
OCP\Util::connectHook('OC_Filesystem', 'write', "OCA\Files_Versions\Hooks", "write_hook");
// Listen to delete and rename signals
OCP\Util::connectHook('OC_Filesystem', 'post_delete', "OCA\Files_Versions\Hooks", "remove_hook");
OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Versions\Hooks", "pre_remove_hook");
OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA\Files_Versions\Hooks", "rename_hook");
//Listen to delete user signal
OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Versions\Hooks", "deleteUser_hook");
+1 -1
View File
@@ -21,7 +21,7 @@ $(document).ready(function(){
// Action to perform when clicked
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
var file = $('#dir').val()+'/'+filename;
var file = $('#dir').val().replace(/(?!<=\/)$|\/$/, '/' + filename);
var createDropDown = true;
// Check if drop down is already visible for a different file
if (($('#dropdown').length > 0) ) {
+3
View File
@@ -2,6 +2,9 @@
$TRANSLATIONS = array(
"Could not revert: %s" => "Ni mogoče povrniti: %s",
"Versions" => "Različice",
"Failed to revert {file} to revision {timestamp}." => "Povrnitev datoteke {file} na objavo {timestamp} je spodletelo.",
"More versions..." => "Več različic",
"No other versions available" => "Ni drugih različic",
"Restore" => "Obnovi"
);
$PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);";
+3
View File
@@ -2,6 +2,9 @@
$TRANSLATIONS = array(
"Could not revert: %s" => "Не вдалося відновити: %s",
"Versions" => "Версії",
"Failed to revert {file} to revision {timestamp}." => "Не вдалося повернути {file} до ревізії {timestamp}.",
"More versions..." => "Більше версій ...",
"No other versions available" => "Інші версії недоступні",
"Restore" => "Відновити"
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";

Some files were not shown because too many files have changed in this diff Show More