cancel
Showing results for 
Search instead for 
Did you mean: 

user's homeFolder

litllel
Champ in-the-making
Champ in-the-making
Hi guys,
I have a problem, How can I do to disable the creation of a new user home folder for a same user when recreate it from my LDAP when I had erase him before.
For example
I have an user called toto.titi for login and he had an user homefolder toto.titi in the workspace
when i delete him from my ldap, I want to keep this workspace with all the documents and if I recreate my user toto.titi I dont want ti create a new user homefolder called toto.titi-1 but I want it to be the la user homefolder .

thks for help
2 REPLIES 2

douglascrp
World-Class Innovator
World-Class Innovator
That behaviour is because of the PortableHomeFolderManager:

    public HomeSpaceNodeRef getHomeFolder(HomeFolderProvider2 provider, NodeRef person, boolean referenceRootNode)
    {
        HomeSpaceNodeRef homeSpaceNodeRef = null;
        NodeRef existingHomeFolder = DefaultTypeConverter.INSTANCE.convert(
                NodeRef.class, nodeService.getProperty(
                person, ContentModel.PROP_HOMEFOLDER));
        if (existingHomeFolder != null)
        {
            homeSpaceNodeRef = new HomeSpaceNodeRef(existingHomeFolder,
                    HomeSpaceNodeRef.Status.VALID);
        }
        else if (referenceRootNode)
        {
            homeSpaceNodeRef = new HomeSpaceNodeRef(getRootPathNodeRef(provider),
                    HomeSpaceNodeRef.Status.REFERENCED);
        }
        else
        {
            // If the preferred home folder already exists, append "-N"
            NodeRef root = getRootPathNodeRef(provider);
            List<String> homeFolderPath = provider.getHomeFolderPath(person);
            modifyHomeFolderNameIfItExists(root, homeFolderPath);

            // Create folder
            FileInfo fileInfo = createTree(provider, getRootPathNodeRef(provider), homeFolderPath,
                    provider.getTemplateNodeRef(), fileFolderService);
            NodeRef homeFolderNodeRef = fileInfo.getNodeRef();
            return new HomeSpaceNodeRef(homeFolderNodeRef, HomeSpaceNodeRef.Status.CREATED);
        }
        return homeSpaceNodeRef;
    }

I believe you would have to rewrite that class and use it as the home folder provider.

By default, LDAP synchronized users' home folders are created using that class.
The OOTB config is defined here community-edition/root/projects/repository/config/alfresco/authentication-services-context.xml

litllel
Champ in-the-making
Champ in-the-making
Is it possible to change the cm:homeFolder value in /sys:system/sysSmiley Tongueeople/ to make it point on the first home folder in /app:company_home/app:user_homes/ thanks to the sys:node-uuid or this value is immutable.