Index: main/plugin-user-directory/doc/user-populations.sample.xml
===================================================================
--- main/plugin-user-directory/doc/user-populations.sample.xml	(revision 40174)
+++ main/plugin-user-directory/doc/user-populations.sample.xml	(working copy)
@@ -17,6 +17,7 @@
 <populations>
     <population id="user.population.employee" class="org.ametys.plugins.userdirectory.population.LDAPPopulation" boSource="true" sourcePrevails="true">
         <label i18n="false">Annuaire du personnel</label>
+        <unlisted>unlisted</unlisted>
         <content-types>
             <content-type id="org.ametys.plugins.userdirectory.Content.employee"/>
         </content-types>
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/component/PopulationManager.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/component/PopulationManager.java	(revision 40205)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/component/PopulationManager.java	(working copy)
@@ -30,9 +30,12 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.components.LifecycleHelper;
+import org.apache.commons.lang.StringUtils;
 
 import org.ametys.cms.contenttype.ContentType;
 import org.ametys.cms.contenttype.ContentTypeExtensionPoint;
+import org.ametys.cms.contenttype.MetadataDefinition;
+import org.ametys.cms.contenttype.MetadataType;
 import org.ametys.cms.repository.ContentTypeHelper;
 import org.ametys.plugins.userdirectory.population.Population;
 
@@ -142,6 +145,7 @@
                 _checkSearchCriteriaMetadata(population);
                 _checkColumnResultsMetadata(population);
                 _checkMappingMetadata(population);
+                _checkUnlistedMetadata(population);
             }
         }
     }
@@ -217,4 +221,29 @@
             }
         }
     }
+    
+    /**
+     * Check if the unlisted metadata defined in the population exist and is boolean
+     * @param population the population
+     */
+    protected void _checkUnlistedMetadata(Population population)
+    {
+        String unlistedMetadataPath = population.getUnlistedMetadataPath();
+        if (StringUtils.isNotEmpty(unlistedMetadataPath))
+        {
+            for (String contentType : population.getContentTypes())
+            {
+                ContentType cType = _cTypeEP.getExtension(contentType);
+                MetadataDefinition unlistedMetadataDefinition = ContentTypeHelper.getMetadataDefinitionByPath(cType, unlistedMetadataPath);
+                if (unlistedMetadataDefinition == null)
+                {
+                    throw new IllegalArgumentException(String.format("The population of id '%s' declares a invalid unlisted attribute for metadata path '%s' and content type '%s'", population.getId(), unlistedMetadataPath, contentType));
+                }
+                else if (!unlistedMetadataDefinition.getType().equals(MetadataType.BOOLEAN))
+                {
+                    throw new IllegalArgumentException(String.format("The population of id '%s' declares a none boolean unlisted attribute for metadata path '%s' and content type '%s'", population.getId(), unlistedMetadataPath, contentType));
+                }
+            }
+        }
+    }
 }
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/generator/UserDirectorySearchGenerator.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/generator/UserDirectorySearchGenerator.java	(revision 40205)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/generator/UserDirectorySearchGenerator.java	(working copy)
@@ -52,8 +52,11 @@
 import org.ametys.plugins.userdirectory.population.Population;
 import org.ametys.runtime.util.I18nizableText;
 import org.ametys.runtime.util.parameter.Enumerator;
+import org.ametys.web.WebConstants;
 import org.ametys.web.frontoffice.SearchGenerator;
 import org.ametys.web.lucene.LuceneConstants;
+import org.ametys.web.renderingcontext.RenderingContext;
+import org.ametys.web.renderingcontext.RenderingContextHandler;
 import org.ametys.web.repository.page.ZoneItem;
 
 /**
@@ -70,12 +73,16 @@
     /** The content type extension point */
     protected ContentTypeExtensionPoint _ctypeEP;
     
+    /** The rendering context handler */
+    protected RenderingContextHandler _renderingContextHandler;
+    
     @Override
     public void service(ServiceManager serviceManager) throws ServiceException
     {
         super.service(serviceManager);
         _populationManager = (PopulationManager) serviceManager.lookup(PopulationManager.ROLE);
         _ctypeEP = (ContentTypeExtensionPoint) serviceManager.lookup(ContentTypeExtensionPoint.ROLE);
+        _renderingContextHandler = (RenderingContextHandler) serviceManager.lookup(RenderingContextHandler.ROLE);
     }
     
     @Override
@@ -257,6 +264,9 @@
         /* Population */
         _addPopulationQuery(query, request);
         
+        /* Unlisted */
+        _addUnlistedQuery(query, request);
+        
         return query;
     }
     
@@ -361,6 +371,32 @@
         }
     }
     
+    /**
+     * Add query for unlisted field
+     * @param query the initial query
+     * @param request the request
+     */
+    protected void _addUnlistedQuery(BooleanQuery query, Request request)
+    {
+        String login = null;
+        if (_renderingContextHandler.getRenderingContext().equals(RenderingContext.FRONT))
+        {
+            login = (String) request.getAttribute(WebConstants.FO_LOGIN);
+        }
+        
+        ZoneItem zoneItem = (ZoneItem) request.getAttribute(ZoneItem.class.getName());
+        String idPopulation = zoneItem.getServiceParameters().getString("population");
+        
+        Population population = _populationManager.getPopulations().get(idPopulation);
+        String unlistedMetadata = population.getUnlistedMetadataPath();
+        
+        if (StringUtils.isBlank(login) && StringUtils.isNotEmpty(unlistedMetadata))
+        {
+            TermQuery termQuery = new TermQuery(new Term(unlistedMetadata, "true"));
+            query.add(termQuery, BooleanClause.Occur.MUST_NOT);
+        }
+    }
+    
     @Override
     protected void saxFormValues (Request request, int start, int offset) throws SAXException
     {
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/StaticCompositeMetadata.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/StaticCompositeMetadata.java	(revision 40174)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/StaticCompositeMetadata.java	(working copy)
@@ -250,7 +250,7 @@
     {
         if (_metadata.containsKey(metadataName))
         {
-            return (String) _metadata.get(metadataName);
+            return String.valueOf(_metadata.get(metadataName));
         }
         return defaultValue;
     }
@@ -266,7 +266,7 @@
             }
             else
             {
-                return new String[] {(String) _metadata.get(metadataName)};
+                return new String[] {String.valueOf(_metadata.get(metadataName))};
             }
         }
         return null;
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/UserPage.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/UserPage.java	(revision 40174)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/page/UserPage.java	(working copy)
@@ -17,6 +17,8 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
@@ -30,7 +32,10 @@
 import org.ametys.plugins.repository.CollectionIterable;
 import org.ametys.plugins.repository.UnknownAmetysObjectException;
 import org.ametys.plugins.repository.metadata.CompositeMetadata;
+import org.ametys.plugins.repository.metadata.ModifiableCompositeMetadata;
 import org.ametys.plugins.userdirectory.component.UserDirectoryPageHandler;
+import org.ametys.plugins.userdirectory.population.Population;
+import org.ametys.web.pageaccess.PageAccessManager;
 import org.ametys.web.repository.page.Page;
 import org.ametys.web.repository.page.UnknownZoneException;
 import org.ametys.web.repository.page.Zone;
@@ -279,7 +284,18 @@
     @Override
     public CompositeMetadata getMetadataHolder()
     {
-        return new StaticCompositeMetadata();
+        Map<String, Object> metadata = new HashMap<String, Object>();
+        
+        Population population = _userDirectoryPageHandler.getPopulation(_root);
+        String unlistedMetadataPath = population.getUnlistedMetadataPath();
+        
+        ModifiableCompositeMetadata metadataHolder = _syncContent.getMetadataHolder();
+        if (StringUtils.isNotEmpty(unlistedMetadataPath) && metadataHolder.hasMetadata(unlistedMetadataPath))
+        {
+            metadata.put(PageAccessManager.GRANT_ANY_USER_METADATA, metadataHolder.getBoolean(unlistedMetadataPath));
+        }
+        
+        return new StaticCompositeMetadata(metadata);
     }
 
     @Override
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/AbstractPopulation.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/AbstractPopulation.java	(revision 40536)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/AbstractPopulation.java	(working copy)
@@ -94,6 +94,8 @@
     protected boolean _sourcePrevails;
     /** The population bo source */
     protected boolean _isBOSource;
+    /** The population unlisted metadata path */
+    protected String _unlistedMetadataPath;
     /** The context */
     protected Context _context;
     /** The language manager */
@@ -143,6 +145,7 @@
         _configureSearchCriteria(configuration);
         _configureResultColumns(configuration);
         _configureMapping(configuration);
+        _configureUnlisted(configuration);
     }
     
     @Override
@@ -193,6 +196,12 @@
         return _isBOSource;
     }
     
+    @Override
+    public String getUnlistedMetadataPath()
+    {
+        return _unlistedMetadataPath;
+    }
+    
     /**
      * Configure the label
      * @param configuration the configuration
@@ -350,6 +359,20 @@
         _mapping.setSynchronizeField(synchronizeField);
     }
     
+    /**
+     * Configure the unlisted metadata
+     * @param configuration the configuration
+     * @throws ConfigurationException if an error occurred
+     */
+    protected void _configureUnlisted(Configuration configuration) throws ConfigurationException
+    {
+        Configuration unlistedConf = configuration.getChild("unlisted");
+        if (unlistedConf != null)
+        {
+            _unlistedMetadataPath = unlistedConf.getValue(null);
+        }
+    }
+    
     @Override
     public void populate(Logger logger, SyncReport syncReport)
     {
Index: main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/Population.java
===================================================================
--- main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/Population.java	(revision 40205)
+++ main/plugin-user-directory/src/org/ametys/plugins/userdirectory/population/Population.java	(working copy)
@@ -91,6 +91,12 @@
     boolean isBOSource();
     
     /**
+     * Get the unlisted metadata path
+     * @return the unlisted metadata path
+     */
+    String getUnlistedMetadataPath();
+    
+    /**
      * Configure the population.
      * @param configuration the configuration
      * @throws ConfigurationException if an error occurred
