Commit Graph

144 Commits

Author SHA1 Message Date
Robin McCorkell da03ef25d9 Add priority overriding comments 2014-05-21 22:29:16 +01:00
Robin McCorkell 0a8a319915 Fix priority merging logic and add unit test 2014-05-21 22:18:22 +01:00
Robin McCorkell eae45dca71 Add unit tests 2014-05-21 22:18:22 +01:00
Robin McCorkell 2254678a0c Use constants for priority type and add comments 2014-05-21 22:17:21 +01:00
Robin McCorkell a0ccb060fa Use more strict type comparisons 2014-05-21 22:17:21 +01:00
Robin McCorkell e4d3ee7866 Preserve priority if already set 2014-05-21 22:17:21 +01:00
Robin McCorkell 9151d72507 Treat 'all users' as 'global'
A mount applicable to all users is as good a definition of global as can be
2014-05-21 22:17:21 +01:00
Robin McCorkell 05642733a3 Add storage priority support
Each storage backend has a default priority, assigned to any system mounts
created in ownCloud. mount.json can be manually modified to change these
priorities.

The priority order is as follows:
 * Personal
 * User
 * Group
 * Global

Within each mount type, the mount with the highest priority is active.

The storage backend defaults were chosen to be the following:
 * Local - 150
 * Remote storage - 100
 * SMB / CIFS with OC login - 90
2014-05-21 22:17:21 +01:00
Robin McCorkell 6930ae22e4 Fix more missing or broken PHPDoc 2014-05-16 22:21:57 +01:00
Robin McCorkell c4f1de63a8 Fix PHPDoc in /apps 2014-05-16 22:21:57 +01:00
Robin McCorkell 08a8a409d6 Extract mount point merging logic into separate function 2014-05-13 00:14:30 +01:00
Vincent Petry af2b7634ee Merge pull request #8293 from owncloud/files_external_fix_readData
Fix issue with personal mount points and sharing
2014-05-08 11:01:54 +02:00
Bjoern Schiessle 22e0a4b9a8 external storages: allow to mount a folder called "Shared", it is no longer a reserved name 2014-04-23 12:54:25 +02:00
Robin McCorkell abfd7ecb72 Permit personal mount points to be used for sharing
An issue existed where `readData` used `OCP\User::getUser()` to get the user
for personal mount points, which worked in all situations apart from when a
personal mount point was used for sharing, so the return from `getUser()` is
not the user that owns the share. As such, any personal mount points would not
work correctly when shared.

`readData` and `writeData` have been changed from using a `$isPersonal`
boolean to using a `$user` string|null. `$isPersonal = false` can now be
written as `$user = NULL` (or left out in the case of `readData`), and
`$isPersonal = true` can be written as `$user = OCP\User::getUser()`.
2014-04-21 21:42:35 +01:00
Lukas Reschke 2454759af7 Check whether the user has permissions to add personal storage backends 2014-04-13 11:01:50 +02:00
Thomas Müller 3ac009c2b4 unit tests for dynamic backend registration 2014-04-07 20:18:57 +02:00
Philipp Kapfer 730bca98b4 Moved dependency checks to end of class files
Dependency messages now appear below the configuration options instead of above
Reworked dependency check method to support consolidated messages for multiple backends

Conflicts:
	apps/files_external/lib/google.php
	apps/files_external/lib/swift.php
	apps/files_external/templates/settings.php
2014-04-03 16:46:22 +02:00
Philipp Kapfer 46379113a1 Changed dependency check messages from warnings to notes
Added check for duplicate dependency check messages to display only the first
2014-04-03 16:31:54 +02:00
Philipp Kapfer 8ca897df76 Added cURL dependency check to Google Drive and WebDAV backend
Added check for backend's checkDependencies method to OC_Mount_Config::getBackends() when backend is configured to have some instead of blindly calling it and crashing

Conflicts:
	apps/files_external/lib/config.php
	apps/files_external/lib/google.php
2014-04-03 16:30:48 +02:00
Philipp Kapfer f7da4280ca Modified app to dynamically register backends instead of hard-coding them
Moved dependency check to the individual backends instead of the config

Conflicts:
	apps/files_external/appinfo/app.php
	apps/files_external/lib/config.php
2014-04-03 16:21:52 +02:00
Robin McCorkell cd5ebac7c4 Fix error in $isPersonal setting 2014-03-26 14:37:29 +00:00
Robin McCorkell b077528087 Perform proper checking for share availability
To check for shares, the code attempts to connect anonymously to the share.
In most cases this will fail with NT_STATUS_ACCESS_DENIED, so the regex array
used for parsing the output of smbclient in smb4php has been overridden to
treat such output as success.

The 'test' method for storage classes can now take a single parameter,
$isPersonal, which allows the storage to adjust the tests performed based on
if they are being configured as personal shares or as system shares.
2014-03-26 14:36:45 +00:00
Robin McCorkell cac4aaa8c4 Rename SMB_Auto to SMB_OC and change visible name
SMB_Auto is now SMB_OC, and the name has been changed from
"SMB / CIFS Auto" to "SMB / CIFS using OC login"
2014-03-26 14:35:07 +00:00
Robin McCorkell ba63e46b5e SMB/CIFS mount using OwnCloud logon credentials
Selecting 'SMB/CIFS Auto' in the mounts configuration allows an SMB/CIFS
mount to be configured that uses the credentials of the user logging in to
authenticate to the server.

Optionally, the username can be used as the share name, permitting home shares
to be dynamically mounted.
2014-03-26 14:35:07 +00:00
Vincent Petry b656c68ede Merge pull request #7888 from owncloud/extstorage-multiplemountpointconfig
Fix merging of external storage configurations
2014-03-26 14:30:35 +01:00
Vincent Petry e002b7242c Fix merging of external storage configurations
Merging of configurations is whenever the same config is available for
multiple users/groups, in which case the config is considered as a
single one by the UI, and shows multiple users/groups selected.

Fixed merging logic to make sure that class, mount point and options are
the same before merging them.

Fixed merging to work correctly when the same mount point path is used
for separate users and configs. These are now correctly shows in the UI
as separate entries.
2014-03-26 12:41:25 +01:00
Vincent Petry 8d95c0d013 Pretty print mount.json when possible 2014-03-26 11:32:03 +01:00
Vincent Petry d95fde3924 Removed comment 2014-03-20 15:24:05 +01:00
Vincent Petry 1e4e0cfcd5 Lazy load phpseclib in ext storage config 2014-03-20 13:21:34 +01:00
Robin Appelman cf23defa52 Fix typo in mount loading 2014-03-20 12:52:09 +01:00
Vincent Petry 9116c39a82 Fixed ext storage password field order issue
The old password field is now preserved in the JSON structure to make
sure that the order is preserved.
This is a quick fix until the UI is fixed to not rely on the PHP array
key order.
2014-03-19 17:56:36 +01:00
Vincent Petry 8e0a5ed5df Added tests to check mount point list for a target user 2014-03-19 15:21:54 +01:00
Vincent Petry 4cb53f77b2 Moved external storage mounting code to files_external app
Moved the mounting code for external storage from
OC\Filesystem::initMountPoint to files_external using the
post_initMountPoints hook
2014-03-19 12:45:38 +01:00
Vincent Petry 80180bea32 Added IV for ext storage password encryption 2014-03-19 11:42:22 +01:00
Vincent Petry 40a70ecf79 Added password obfuscation for external storage config
Added obfuscation for all "password" options from external storages.
Added unit tests for reading/writing the configuration.
2014-03-19 10:52:22 +01:00
Vincent Petry 1f79f368ef Added unit tests for when adding ext storage mount points
- test config was written correctly (global and local)
- test that personal mount points can be added for allowed backends
- test that personal mount points cannot be added for disallowed backends
- added $skipTest flag to make it possible add mount points without
  doing an actual check/connection (note: this is necessary because the
  static class OC_Mount_Config cannot be mocked)
2014-03-18 18:29:08 +01:00
Vincent Petry 8ababef4cd Fix validation of allowed personal backend 2014-03-18 17:54:14 +01:00
Lukas Reschke e3156fa5ad Merge pull request #7354 from pschmitt/master
Use 'command -v' to detect whether and where software is installed (instead of 'which')
2014-03-05 19:25:09 +01:00
Jan-Christoph Borchardt bd86642747 Merge pull request #7261 from owncloud/issue/6793
Allow admins to disable certain external storages for users
2014-03-05 14:41:36 +01:00
Thomas Müller f42b6f1a4e Merge pull request #7525 from owncloud/fix_S3string
fix https://github.com/owncloud/core/issues/6825
2014-03-04 14:30:30 +01:00
Frank Karlitschek 0bca969e99 fix https://github.com/owncloud/core/issues/6825 2014-03-04 12:38:56 +01:00
Joas Schilling 932c4ee927 Allow admins to disable certain external storages for users
Fix issue #6793
2014-02-26 15:02:41 +01:00
Vincent Petry 7f7d674c2a Merge pull request #7335 from owncloud/fix-7333
Fix code to search for mount.json in custom data folders
2014-02-25 15:27:47 +01:00
Vincent Petry 539ea0882b Fixed mount config path 2014-02-24 10:35:24 +01:00
Robin Appelman f1475671ab Merge branch 'master' into extstorage-configclass 2014-02-21 15:51:41 +01:00
Philipp Schmitt 43b1d81f77 Use 'command -v' to detect whether and where software is installed (instead of 'which') 2014-02-21 13:45:57 +01:00
Lukas Reschke 6cb64a4fce Fix code to search for mount.json in custom data folders 2014-02-20 18:34:27 +01:00
Lukas Reschke c869e0116b Merge pull request #6999 from kofemann/mount-config
mount: make location of mount.json configurable
2014-02-20 15:15:00 +01:00
Vincent Petry b060a17b59 Added extra checks for ext storage class 2014-02-20 10:40:10 +01:00
Vincent Petry 49f2014e0c Revert "Added extra checks for ext storage class"
This reverts commit 9e9a5b9ea1.

Unit tests weren't ready, need further tweaking.
2014-02-20 10:01:49 +01:00