Add functionality to SMB share

With this change it's possible to use the variable "[USER]" when creating an external storage for users. This variable is replaced by the name of the user. In this way, with a single share, we share each one's personal folder only for that user.
This commit is contained in:
Rolan Benavent 2019-11-28 11:42:59 +01:00 committed by GitHub
commit ff05d2e86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,7 @@ class NativeShare extends AbstractShare {
private function buildUrl($path) { private function buildUrl($path) {
$this->verifyPath($path); $this->verifyPath($path);
$url = sprintf('smb://%s/%s', $this->server->getHost(), $this->name); $url = str_replace('[USER]', $this->server->getAuth()->getUserName(), sprintf('smb://%s/%s', $this->server->getHost(), $this->name));
if ($path) { if ($path) {
$path = trim($path, '/'); $path = trim($path, '/');
$url .= '/'; $url .= '/';