How to use external_storage user as share path

Nextcloud version (eg, 20.0.5): 21.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): NGINX
PHP version (eg, 7.4): 7.4

The issue you are facing:
We’re having an external SMB drive, which has home individual home folders for each user.
User1 has the share path /user1 and User2 has the Share Path /user2

The documentation states that you can use $user for replacing a path with the nextcloud login name.

The problem is, that for this connection, the nextcloud login name is not and cannot be changed to the user name required for the external SMB connection, so we set this to “User entered, store in database”.

Problem with this is, there is no variable to use the connection username inside the connection path - how to archive that?

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create global external “SMB / CIFS” connection.
  2. Set authentication to “User entered”
  3. Try to use the user entered username in share or remote subfolder.

Hi, the $user variable only works if you have ldap configured for Nextcloud, afaik.

Yes, but that is not the problem.
I do not want to use the ldap user - I need to use the username used for authenticating to the external storage - in this case the “User entered, store in database” user.

I understand but the variable doesn’t work without ldap configured. So there is currently no way to do what you want to do, afaik.

1 Like

There must for sure be another way to use other variables. Maybe I’ll dig into the code tomorrow.

1 Like