diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-12-04 19:51:04 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-12-19 15:20:24 +0100 |
commit | 24993280edcf66f9daa5a5e82428fefef4a3ab56 (patch) | |
tree | ede7ca0417af874185588a845fe5f7f754076f60 /lib/private/security | |
parent | f671b232cc122cdb8e993c8b35bd5419b32a9ae4 (diff) | |
download | nextcloud-server-24993280edcf66f9daa5a5e82428fefef4a3ab56.tar.gz nextcloud-server-24993280edcf66f9daa5a5e82428fefef4a3ab56.zip |
Next step in server-to-server sharing next generation, see #12285
Beside some small improvements and bug fixes this will probably the final state for OC8.
To test this you need to set up two ownCloud instances. Let's say:
URL: myPC/firstOwnCloud user: user1
URL: myPC/secondOwnCloud user: user2
Now user1 can share a file with user2 by entering the username and the URL to the second ownCloud to the share-drop-down, in this case "user2@myPC/secondOwnCloud".
The next time user2 login he will get a notification that he received a server-to-server share with the option to accept/decline it. If he accept it the share will be mounted. In both cases a event will be send back to user1 and add a notification to the activity stream that the share was accepted/declined.
If user1 decides to unshare the file again from user2 the share will automatically be removed from the second ownCloud server and user2 will see a notification in his activity stream that user1@myPC/firstOwnCloud has unshared the file/folder from him.
Diffstat (limited to 'lib/private/security')
-rw-r--r-- | lib/private/security/certificatemanager.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php index a2a4c8b83d2..4a8ea170731 100644 --- a/lib/private/security/certificatemanager.php +++ b/lib/private/security/certificatemanager.php @@ -33,7 +33,7 @@ class CertificateManager implements ICertificateManager { * @return \OCP\ICertificate[] */ public function listCertificates() { - $path = $this->user->getHome() . '/files_external/uploads/'; + $path = $this->getPathToCertificates() . 'uploads/'; if (!is_dir($path)) { return array(); } @@ -57,7 +57,7 @@ class CertificateManager implements ICertificateManager { * create the certificate bundle of all trusted certificated */ protected function createCertificateBundle() { - $path = $this->user->getHome() . '/files_external/'; + $path = $this->getPathToCertificates(); $certs = $this->listCertificates(); $fh_certs = fopen($path . '/rootcerts.crt', 'w'); @@ -86,7 +86,7 @@ class CertificateManager implements ICertificateManager { return false; } - $dir = $this->user->getHome() . '/files_external/uploads/'; + $dir = $this->getPathToCertificates() . 'uploads/'; if (!file_exists($dir)) { //path might not exist (e.g. non-standard OC_User::getHome() value) //in this case create full path using 3rd (recursive=true) parameter. @@ -116,7 +116,7 @@ class CertificateManager implements ICertificateManager { if (!Filesystem::isValidPath($name)) { return false; } - $path = $this->user->getHome() . '/files_external/uploads/'; + $path = $this->getPathToCertificates() . 'uploads/'; if (file_exists($path . $name)) { unlink($path . $name); $this->createCertificateBundle(); @@ -130,6 +130,12 @@ class CertificateManager implements ICertificateManager { * @return string */ public function getCertificateBundle() { - return $this->user->getHome() . '/files_external/rootcerts.crt'; + return $this->getPathToCertificates() . 'rootcerts.crt'; + } + + private function getPathToCertificates() { + $path = $this->user ? $this->user->getHome() . '/files_external/' : '/files_external/'; + + return $path; } } |