Index: main/plugin-newsletter/pages/services/subscribe/subscribe.xsl
===================================================================
--- main/plugin-newsletter/pages/services/subscribe/subscribe.xsl	(revision 29736)
+++ main/plugin-newsletter/pages/services/subscribe/subscribe.xsl	(working copy)
@@ -131,7 +131,15 @@
 			</p>
 			<!-- email -->
 			<label for="subscribe-email"><i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_EMAIL"/></label><br/>
-			<input type="text" name="email" class="text" id="subscribe-email-{$uniqueId}" value="{FormResult/email}">
+			<input type="text" name="email" class="text" id="subscribe-email-{$uniqueId}">
+			<xsl:choose>
+               <xsl:when test="FormResult/email">
+                   <xsl:attribute name="value"><xsl:value-of select="FormResult/email"/></xsl:attribute>
+               </xsl:when>
+               <xsl:otherwise>
+                   <xsl:attribute name="value"><xsl:value-of select="user/email"/></xsl:attribute>
+               </xsl:otherwise>
+            </xsl:choose>
 				<xsl:if test="FormResult/msg = 'invalid-email'">
 					<xsl:attribute name="class">invalid</xsl:attribute>
 				</xsl:if>
@@ -147,29 +155,34 @@
 			<!-- category -->
 			<input type="hidden" name="category" value="{Categories/category/@id}"/>
 			
-			<!-- captcha -->
-			<label for="captcha"><i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA"/></label><br/>
-
-			<xsl:call-template name="captcha">
-				<xsl:with-param name="key-name" select="'captcha-key'"/>
-	
-				<xsl:with-param name="value-name" select="'captcha'"/>
-				<xsl:with-param name="value-id" select="concat('captcha-', $uniqueId)"/>
-				<xsl:with-param name="value-style">float: left; margin-top: <xsl:value-of select="(@height - 16) div 2"/>px; width: <xsl:value-of select="@width"/>px;</xsl:with-param>
-				<xsl:with-param name="value-class">
-                    <xsl:text>captcha</xsl:text>
-    				<xsl:if test="FormResult/msg = 'invalid-captcha'">
-                        <xsl:text> invalid</xsl:text>
-    				</xsl:if>
-				</xsl:with-param>
+			<!-- page id -->
+            <input type="hidden" name="page-id" value="{ametys:pageId()}"/>
+                
+			<xsl:if test="FormResult/has-captcha = 'true'">
+				<!-- captcha -->
+				<label for="captcha"><i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA"/></label><br/>
 	
-				<xsl:with-param name="image-alt"/>
-				<xsl:with-param name="image-alt-i18n" select="false()"/>
-				<xsl:with-param name="image-class">captcha-image</xsl:with-param>
-				<xsl:with-param name="image-style">float:left; margin: 3px 3px 0 10px</xsl:with-param>
-                        
-                <xsl:with-param name="contextPath"><xsl:value-of select="$contextPath"/></xsl:with-param>
-			</xsl:call-template> 
+				<xsl:call-template name="captcha">
+					<xsl:with-param name="key-name" select="'captcha-key'"/>
+		
+					<xsl:with-param name="value-name" select="'captcha'"/>
+					<xsl:with-param name="value-id" select="concat('captcha-', $uniqueId)"/>
+					<xsl:with-param name="value-style">float: left; margin-top: <xsl:value-of select="(@height - 16) div 2"/>px; width: <xsl:value-of select="@width"/>px;</xsl:with-param>
+					<xsl:with-param name="value-class">
+	                    <xsl:text>captcha</xsl:text>
+	    				<xsl:if test="FormResult/msg = 'invalid-captcha'">
+	                        <xsl:text> invalid</xsl:text>
+	    				</xsl:if>
+					</xsl:with-param>
+		
+					<xsl:with-param name="image-alt"/>
+					<xsl:with-param name="image-alt-i18n" select="false()"/>
+					<xsl:with-param name="image-class">captcha-image</xsl:with-param>
+					<xsl:with-param name="image-style">float:left; margin: 3px 3px 0 10px</xsl:with-param>
+	                        
+	                <xsl:with-param name="contextPath"><xsl:value-of select="$contextPath"/></xsl:with-param>
+				</xsl:call-template>
+		   </xsl:if>
 
 			<xsl:if test="FormResult/msg = 'invalid-captcha'">
 				<div class="error"><i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA_INVALID"/></div>
Index: main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl
===================================================================
--- main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl	(revision 29736)
+++ main/plugin-newsletter/pages/services/subscribe/subscribe_1.4.xsl	(working copy)
@@ -144,7 +144,10 @@
 			<div>
 	            <!-- category -->
 	            <input type="hidden" name="category" value="{/NewsletterService/Categories/category/@id}"/>
-	                        
+	            
+	            <!-- page id -->
+                <input type="hidden" name="page-id" value="{ametys:pageId()}"/>
+                
 	            <!-- email -->
 	            <div class="field">
 	                <div class="label">
@@ -161,40 +164,50 @@
 		                    </xsl:if>
 	                    </xsl:attribute>
 	                    
-	                    <input type="text" name="email" class="text" id="subscribe-email-{$uniqueId}" value="{/NewsletterService/FormResult/email}"/>
+	                    <xsl:choose>
+	                       <xsl:when test="/NewsletterService/FormResult/email">
+                               <input type="text" name="email" class="text" id="subscribe-email-{$uniqueId}" value="{/NewsletterService/FormResult/email}"/>
+                           </xsl:when>
+	                       <xsl:otherwise>
+           	                   <input type="text" name="email" class="text" id="subscribe-email-{$uniqueId}" value="{/NewsletterService/user/email}"/>
+                           </xsl:otherwise>
+	                    </xsl:choose>
 	                </div>
 	                <div class="field-end"></div>
 	            </div>
 				
-				<!-- captcha -->
-	            <div class="field">
-	                <div class="label">
-	                    <label for="captcha-{$uniqueId}">
-	                    	<i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA_LABEL"/>
-		                    <span class="mandatory-marker"><i18n:text i18n:key="PLUGINS_WEB_FRONTOFICE_MANDATORY_FIELD" i18n:catalogue="plugin.web"/></span>      
-	                    </label>
-	                </div>
-	                <div class="input">
-	                    <xsl:if test="FormResult/msg = 'invalid'">
-	                        <xsl:attribute name="class">invalid</xsl:attribute>
-	                    </xsl:if>
-	
-	                    <xsl:call-template name="captcha">
-	                        <xsl:with-param name="key-name" select="'captcha-key'"/>
-	            
-	                        <xsl:with-param name="value-name" select="'captcha'"/>
-	                        <xsl:with-param name="value-id" select="concat('captcha-', $uniqueId)"/>
-	                        <xsl:with-param name="value-class">captcha</xsl:with-param>
-	            
-	                        <xsl:with-param name="image-alt"/>
-	                        <xsl:with-param name="image-alt-i18n" select="false()"/>
-	                        <xsl:with-param name="image-class">captcha-image</xsl:with-param>
-	                        
-	                        <xsl:with-param name="contextPath"><xsl:value-of select="$uri-prefix"/></xsl:with-param>
-	                    </xsl:call-template>                
-	                </div>
-	                <div class="field-end"></div>
-	            </div>
+				
+				<xsl:if test="/NewsletterService/FormResult/has-captcha = 'true'">
+					<!-- captcha -->
+		            <div class="field">
+		                <div class="label">
+		                    <label for="captcha-{$uniqueId}">
+		                    	<i18n:text i18n:key="NEWSLETTERS_SERVICE_INPUT_CAPTCHA_LABEL"/>
+			                    <span class="mandatory-marker"><i18n:text i18n:key="PLUGINS_WEB_FRONTOFICE_MANDATORY_FIELD" i18n:catalogue="plugin.web"/></span>      
+		                    </label>
+		                </div>
+		                <div class="input">
+		                    <xsl:if test="FormResult/msg = 'invalid'">
+		                        <xsl:attribute name="class">invalid</xsl:attribute>
+		                    </xsl:if>
+		
+		                    <xsl:call-template name="captcha">
+		                        <xsl:with-param name="key-name" select="'captcha-key'"/>
+		            
+		                        <xsl:with-param name="value-name" select="'captcha'"/>
+		                        <xsl:with-param name="value-id" select="concat('captcha-', $uniqueId)"/>
+		                        <xsl:with-param name="value-class">captcha</xsl:with-param>
+		            
+		                        <xsl:with-param name="image-alt"/>
+		                        <xsl:with-param name="image-alt-i18n" select="false()"/>
+		                        <xsl:with-param name="image-class">captcha-image</xsl:with-param>
+		                        
+		                        <xsl:with-param name="contextPath"><xsl:value-of select="$uri-prefix"/></xsl:with-param>
+		                    </xsl:call-template>                
+		                </div>
+		                <div class="field-end"></div>
+		            </div>
+		        </xsl:if>
 	                        
 				<input type="hidden" name="subscribe"/>
 				<input type="hidden" name="siteName" value="{$site}"/>
Index: main/plugin-newsletter/src/org/ametys/plugins/newsletter/generators/NewsletterServiceGenerator.java
===================================================================
--- main/plugin-newsletter/src/org/ametys/plugins/newsletter/generators/NewsletterServiceGenerator.java	(revision 29736)
+++ main/plugin-newsletter/src/org/ametys/plugins/newsletter/generators/NewsletterServiceGenerator.java	(working copy)
@@ -18,6 +18,8 @@
 import java.io.IOException;
 import java.util.Set;
 
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
@@ -27,8 +29,14 @@
 import org.ametys.plugins.newsletter.category.Category;
 import org.ametys.plugins.newsletter.category.CategoryGenerator;
 import org.ametys.plugins.newsletter.category.CategoryProvider;
+import org.ametys.runtime.user.User;
+import org.ametys.runtime.user.UsersManager;
+import org.ametys.web.WebConstants;
+import org.ametys.web.pageaccess.PageAccessManager;
+import org.ametys.web.repository.page.Page;
 import org.ametys.web.repository.page.ZoneItem;
 import org.ametys.web.repository.page.ZoneItemException;
+import org.ametys.web.site.SiteConfigurationExtensionPoint;
 
 /**
  * Newsletter service
@@ -36,6 +44,22 @@
  */
 public class NewsletterServiceGenerator extends CategoryGenerator
 {
+    /** The page access manager */
+    protected PageAccessManager _accessManager;
+    /** The site configuration */
+    protected SiteConfigurationExtensionPoint _siteConfiguration;
+    /** The fo user manager */
+    protected UsersManager _foUserManager;
+    
+    @Override
+    public void service(ServiceManager smanager) throws ServiceException
+    {
+        super.service(smanager);
+        _accessManager = (PageAccessManager) smanager.lookup(PageAccessManager.ROLE);
+        _siteConfiguration = (SiteConfigurationExtensionPoint) smanager.lookup(SiteConfigurationExtensionPoint.ROLE);
+        _foUserManager = (UsersManager) smanager.lookup(UsersManager.ROLE + ".FO");
+    }
+    
     @Override
     public void generate() throws IOException, SAXException, ProcessingException
     {
@@ -108,9 +132,42 @@
             
         }
         
+        XMLUtils.createElement(contentHandler, "has-captcha", _hasCaptcha(request) ? "true" : "false");
+        
         XMLUtils.endElement(contentHandler, "FormResult");
         
+        _saxInfoUser(request);
+        
         XMLUtils.endElement(contentHandler, "NewsletterService");
         contentHandler.endDocument();
     }
+    
+    private void _saxInfoUser(Request request) throws SAXException
+    {
+        String login = (String) request.getAttribute(WebConstants.FO_LOGIN);
+        if (login != null)
+        {
+            _foUserManager.saxUser(login, contentHandler);
+        }
+    }
+    
+    private boolean _hasCaptcha(Request request)
+    {
+        Page page = (Page) request.getAttribute(Page.class.getName());        
+        String siteName = page.getSiteName();
+        
+        String displayCaptcha = _siteConfiguration.getValueAsString(siteName, "display-captcha");
+        boolean hasCaptcha;
+        
+        if (displayCaptcha.equals("restricted")) 
+        {
+            hasCaptcha = !_accessManager.getAccessInfo(page).isRestricted(); 
+        }
+        else 
+        {
+            hasCaptcha = displayCaptcha.equals("always");
+        }
+        
+        return hasCaptcha;
+    }
 }
Index: main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java
===================================================================
--- main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java	(revision 29736)
+++ main/plugin-newsletter/src/org/ametys/plugins/newsletter/subscribe/SubscribeAction.java	(working copy)
@@ -40,7 +40,11 @@
 import org.ametys.plugins.newsletter.category.CategoryProviderExtensionPoint;
 import org.ametys.plugins.newsletter.daos.Subscriber;
 import org.ametys.plugins.newsletter.daos.SubscribersDAO;
+import org.ametys.plugins.repository.AmetysObjectResolver;
 import org.ametys.runtime.captcha.CaptchaHelper;
+import org.ametys.web.pageaccess.PageAccessManager;
+import org.ametys.web.repository.page.Page;
+import org.ametys.web.site.SiteConfigurationExtensionPoint;
 
 /**
  * This action subscribes an email address to a newsletter
@@ -54,6 +58,12 @@
     protected SubscribersDAO _subscribersDao;
     /** The category providers manager */
     protected CategoryProviderExtensionPoint _categoryProviderEP;
+    /** The page access manager */
+    protected PageAccessManager _accessManager;
+    /** The site configuration */
+    protected SiteConfigurationExtensionPoint _siteConfiguration;
+    /** The Ametys object resolver */
+    protected AmetysObjectResolver _resolver;
     
     @Override
     public void service(ServiceManager smanager) throws ServiceException
@@ -61,6 +71,9 @@
         super.service(smanager);
         _subscribersDao = (SubscribersDAO) smanager.lookup(SubscribersDAO.ROLE);
         _categoryProviderEP = (CategoryProviderExtensionPoint) smanager.lookup(CategoryProviderExtensionPoint.ROLE);
+        _accessManager = (PageAccessManager) smanager.lookup(PageAccessManager.ROLE);
+        _siteConfiguration = (SiteConfigurationExtensionPoint) smanager.lookup(SiteConfigurationExtensionPoint.ROLE);
+        _resolver = (AmetysObjectResolver) smanager.lookup(AmetysObjectResolver.ROLE);
     }
     
     @Override
@@ -78,9 +91,6 @@
         {
             String siteName = request.getParameter("siteName");
             String[] categories = request.getParameterValues("category");
-            String captchaKey = request.getParameter("captcha-key");
-            String answer = request.getParameter("captcha");
-            
             
             // Validate email
             if (!_validEmail(email))
@@ -89,11 +99,17 @@
                 return result;
             }
             
-            // Validate captcha 
-            if (!CaptchaHelper.checkAndInvalidate(captchaKey, answer))
+            if (_hasCaptcha(request))
             {
-                result.put("msg", "invalid-captcha");
-                return result;
+                String captchaKey = request.getParameter("captcha-key");
+                String answer = request.getParameter("captcha");
+    
+                // Validate captcha 
+                if (!CaptchaHelper.checkAndInvalidate(captchaKey, answer))
+                {
+                    result.put("msg", "invalid-captcha");
+                    return result;
+                }
             }
             
             // Validate categories
@@ -212,5 +228,27 @@
         
         return null;
     }
+    
+    private boolean _hasCaptcha(Request request)
+    {
+        String pageId = request.getParameter("page-id");
+        
+        Page page = _resolver.resolveById(pageId);
+        String siteName = page.getSiteName();
+        
+        String displayCaptcha = _siteConfiguration.getValueAsString(siteName, "display-captcha");
+        boolean hasCaptcha;
+        
+        if (displayCaptcha.equals("restricted")) 
+        {
+            hasCaptcha = !_accessManager.getAccessInfo(page).isRestricted(); 
+        }
+        else 
+        {
+            hasCaptcha = displayCaptcha.equals("always");
+        }
+        
+        return hasCaptcha;
+    }
 
 }
