From ff05d2e86e3f977cd25f6816c124e8e706fff133 Mon Sep 17 00:00:00 2001 From: Rolan Benavent Date: Thu, 28 Nov 2019 11:42:59 +0100 Subject: [PATCH] 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. --- src/Native/NativeShare.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Native/NativeShare.php b/src/Native/NativeShare.php index bc734e3..544022e 100644 --- a/src/Native/NativeShare.php +++ b/src/Native/NativeShare.php @@ -68,7 +68,7 @@ class NativeShare extends AbstractShare { private function buildUrl($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) { $path = trim($path, '/'); $url .= '/';