cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Home Folder

dsupina
Champ in-the-making
Champ in-the-making
How to set up system to provide auto login to home folder (eg. Alfresco/User Homes/username/) when users acces Alfresco via FTP?
I tried to activate homeFolder in file-servers.xml like bellow, but with no sucess. Users still get in root folder, not in home folder.
Alfresco 3.4.a on CentOS 5.5.

Thanks!


config evaluator="string-compare" condition="Filesystems">
   
   <homeFolder>
    <store>workspace://SpacesStore</store>
    <rootPath>/app:company_home/app:user_homes</rootPath>
    <urlFile>
        <filename>__Alfresco.url</filename>
        <webpath>http://${localname}:8080/alfresco/</webpath>
    </urlFile>
    <offlineFiles/>
    <desktopActions>
        <global>
            <path>alfresco/desktop/Alfresco.exe</path>
            <webpath>http://${localname}:8080/alfresco/</webpath>
        </global>
        <action>
            <class>org.alfresco.filesys.smb.server.repo.desk.CheckInOutDesktopAction</class>
            <name>CheckInOut</name>
            <filename>__CheckInOut.exe</filename>
        </action>
        <action>
            <class>org.alfresco.filesys.smb.server.repo.desk.JavaScriptDesktopAction</class>
            <name>JavaScriptURL</name>
            <filename>__ShowDetails.exe</filename>
            <script>alfresco/desktop/showDetails.js</script>
            <attributes>anyFiles</attributes>
            <preprocess>copyToTarget</preprocess>
        </action>
    </desktopActions>
</homeFolder>
    
    <filesystems>
         
         <!– Alfresco repository access shared filesystem –>
         <filesystem name="${filesystem.name}">
            <store>workspace://SpacesStore</store>
            <rootPath>/app:company_home</rootPath>

            <!– Add a URL file to each folder that links back to the web client –>
            <urlFile>
               <filename>__Alfresco.url</filename>
               <webpath>http://${localname}:8080/alfresco/</webpath>
            </urlFile>

            <!– Mark locked files as offline –>
            <offlineFiles/>

            <!– Desktop actions –>
            <!– Uses a client-side application to trigger a server-side action                         –>
            <!–   Echo - displays a message echoed from the server                                     –>
            <!–   URL  - launches a URL via the Windows shell                                          –>
            <!–   CmdLine - launches the Notepad application                                           –>
            <!–   CheckInOut - checks files in/out, drag and drop files onto the application           –>
            <!–   JavaScript - run a server-side script                                                –>
            <!–   JavaScriptURL - server-side script that generates a URL to the folder using a ticket –>
            <!–                   to avoid having to logon                                             –>
            <desktopActions>
               <global>
                  <path>alfresco/desktop/Alfresco.exe</path>
                  <webpath>http://${localname}:8080/alfresco/</webpath>
               </global>
               <action>
                  <class>org.alfresco.filesys.repo.desk.CheckInOutDesktopAction</class>
                  <name>CheckInOut</name>
                  <filename>__CheckInOut.exe</filename>
               </action>
               <action>
                  <class>org.alfresco.filesys.repo.desk.JavaScriptDesktopAction</class>
                  <name>JavaScriptURL</name>
                  <filename>__ShowDetails.exe</filename>
                  <script>alfresco/desktop/showDetails.js</script>
                  <attributes>anyFiles</attributes>
                  <preprocess>copyToTarget</preprocess>
               </action>

               <!– Other desktop actions which may be enabled –>
               <!–
                <action>
                    <class>org.alfresco.filesys.repo.desk.EchoDesktopAction</class>
                    <name>Echo</name>
                    <filename>__AlfrescoEcho.exe</filename>
                </action>
                <action>
                    <class>org.alfresco.filesys.repo.desk.URLDesktopAction</class>
                    <name>URL</name>
                    <filename>__AlfrescoURL.exe</filename>
                </action>
                <action>
                    <class>org.alfresco.filesys.repo.desk.CmdLineDesktopAction</class>
                    <name>CmdLine</name>
                    <filename>__AlfrescoCmd.exe</filename>
                </action>
                <action>
                    <class>org.alfresco.filesys.repo.desk.JavaScriptDesktopAction</class>
                    <name>JavaScript</name>
                    <filename>__AlfrescoScript.exe</filename>
                    <script>alfresco/desktop/dumpRequest.js</script>
                    <attributes>anyFiles, multiplePaths , allowNoParams</attributes>
                    <preprocess>confirm, copyToTarget</preprocess>
                </action>
                –>                             
            </desktopActions>

            <!– Additional access control of the filesystem –>
            <!– Access type of 'none' will stop the filesystem from showing up for that user/address/protocol –>             
            <!–
            <accessControl default="Write">
               <user name="admin" access="Write"/>
               <address subnet="192.168.1.0" mask="255.255.255.0" access="Write"/>
            </accessControl>
            –>
         </filesystem>
          
           <!– AVM virtualization view of all stores/versions for WCM –>
           <!– virtual view stores filter can be any of the following: normal, site, staging, author, preview –>
         <avmfilesystem name="AVM">
            <virtualView stores="site,staging,author"/>
         </avmfilesystem>
          
      </filesystems>
   </config>

   <config evaluator="string-compare" condition="Filesystem Security">
   <authenticator type="alfresco">
   </authenticator>     
<!– Domain mappings used for passthru authentication routing              –>
      <!– Used when the client does not provide a domain name in the NTLM logon –>
      <!–
      <DomainMappings>
          <Domain name="ALFRESCO" subnet="192.168.1.0" mask="192.168.1.255"/>
      </DomainMappings>
      –>
     
      <!– Custom share mapper when multi-tenancy is enabled –>
      <!–
      <shareMapper type="multi-tenant">
        <debug/>
      </shareMapper>
      –>
     
      <!– Global access control list                                                                    –>
      <!– Applied to all filesystems that do not have an <accessControl> block                          –>
      <!– Access type of 'none' will stop the filesystem from showing up for that user/address/protocol –>             
      <!–
      <globalAccessControl default="None">
         <user name="admin" access="Write"/>
         <address ip="192.168.1.2" access="Write"/>
      </globalAccessControl>
      –>
   </config>

</alfresco-config>
10 REPLIES 10

moisei
Champ in-the-making
Champ in-the-making
I have a similar issue with Alfresco 3.4d.
Did you find a way to resolve it?

romschn
Star Collaborator
Star Collaborator
You can specify the default directory, to be displayed to the user when he logs in through FTP, in file-servers-context.xml.

Search for the bean ftpServerConfig in file-servers-context.xml and put an entry as shown in the example below :
<property name="rootDirectory">
     <value>/Alfresco/Test</value>
</property>
The first part of the path should be the file system name, optionally followed by one or more folder names.

It will navigate the user to the specified folder.

You may want to do the customization in java code to navigate to specific user's home space as per your requirement.

Hope this helps

Thanks,

moisei
Champ in-the-making
Champ in-the-making
Thanks! This worked apparently.
Can you please clarify which java code I supposed to change to make user going directly to home space?
And how can I configure the permissions, so the user can't browse anything outside of the home space?

Thanks again!

romschn
Star Collaborator
Star Collaborator
You may need to customize the setRootDirectory() method of FTPConfigBean.java.

You will first have to identify how the path to the users home space looks and do the modification in above method accordingly, which will read the initial path till User Home directory (e.g. /Alfresco/User Homes/) from the XML and file and append the user's home directory in above method.

I think, there is no need to handle permission separately as the user will only be able to see his space using above mechanism. This should work hopefully.

Hope this helps.

Thanks,

moisei
Champ in-the-making
Champ in-the-making
is there some way to have a variable which refers a current user name?
something like:
      <property name="rootDirectory">
         <value>/Alfresco/Home Users/${current_user_name}</value>
      </property>


Also, I don't see how it helps to prohibit user from browsing other folders?
For example, once I setup rootDirectory to /Alfresco/Test, the user is still able to cd .. and
get to the common root folder.

romschn
Star Collaborator
Star Collaborator
I don't think it would be possible to have a variable you can put in context.xml file. Instead as i mentioned earlier you will have to customize the setRootDirectory method of FTPConfigBean.java.

Also, you are not required to handle permission at FTP side. You will require it to handle from alfresco side.

By default, all the spaces created under compay home will have read permission for every user as inherit Parent space permission checkbox is checked by default when you create a new space.

This checkbox can be found at - go to view detail of space/Under Action secion, click on Manage Space Users.

You can go to each space, click on manage space users and uncheck the above checkbox and only invite the uesrs to whom you want to have access to that space.

This way, user can only see/access the spaces he is permitted to.

Hope this helps.

Thanks,

moisei
Champ in-the-making
Champ in-the-making
Great! I'll review the permissions of the user.

As for a customizing a code of the setRootDirectory method of FTPConfigBean.java,
I am just wondering is it a normal practice, to edit the code of alfresco on production platforms?
Right now, I am installing it from the setup and I don't compile it myself.
Once I change the code, I'll have to support it also in the next versions,
after every upgrade, will I not? Is there some guides on that?

Thanks,
Moisei.

romschn
Star Collaborator
Star Collaborator
You do not directly customize the code in alfresco classes.It should be avoided to directly adding our customization in existing alfresco classes. You can extend the required classes and override the required code to put your own behavior.

Alfresco has provided the very good implementation in which you can have your customized code to be part of extensions. All your customized configuration should be part of your extension folder.

Hope this helps.

Thanks,

romschn
Star Collaborator
Star Collaborator
I don't think customizing FTPConfigBean class would help us here. Sorry for it.

As setting up of FTPConfigBean would be one time activity in which we can specify root directory to refer till "User homes" space. And as per my understanding, this would not get initialized on each user login.

To dynamically add the username part to it, FTPConfigBean doesn't seem right place to me.

I think, when user logs in through FTP that time after authentication, the root path should be appended with the user name. Will have to identify the correct location to do so.

Hope this helps.

Thanks,