Move captcha registration to its own captcha.zcml file. Fix captcha registration for Plone 3/Zope 2.10
svn path=/plone.app.discussion/trunk/; revision=37140
This commit is contained in:
		
							parent
							
								
									2767f52bf0
								
							
						
					
					
						commit
						ac6865311d
					
				@ -4,6 +4,9 @@ Changelog
 | 
			
		||||
1.0b5 (unreleased)
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
* Move captcha registration to its own captcha.zcml file.
 | 
			
		||||
  [timo]
 | 
			
		||||
 | 
			
		||||
* Akismet (http://akismet.com/) spam protection plugin (collective.akismet)
 | 
			
		||||
  support added.
 | 
			
		||||
  [timo]
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										45
									
								
								plone/app/discussion/browser/captcha.zcml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								plone/app/discussion/browser/captcha.zcml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
			
		||||
<configure
 | 
			
		||||
    xmlns="http://namespaces.zope.org/zope"
 | 
			
		||||
    xmlns:meta="http://namespaces.zope.org/meta"	
 | 
			
		||||
    xmlns:zcml="http://namespaces.zope.org/zcml"
 | 
			
		||||
    i18n_domain="plone.app.discussion">
 | 
			
		||||
 | 
			
		||||
	<!-- 
 | 
			
		||||
	  Plone 3 fixes
 | 
			
		||||
	 
 | 
			
		||||
	  Plone 3 / Zope 2.10 does not recognize the meta:provides feature. 
 | 
			
		||||
      Therefore we claim to provide this feature when a suitable package is
 | 
			
		||||
      installed. 
 | 
			
		||||
	-->
 | 
			
		||||
    <configure zcml:condition="installed plone.formwidget.captcha">
 | 
			
		||||
        <meta:provides feature="plone.app.discussion-captcha" />
 | 
			
		||||
    </configure>
 | 
			
		||||
 | 
			
		||||
    <configure zcml:condition="installed plone.formwidget.recaptcha">
 | 
			
		||||
        <meta:provides feature="plone.app.discussion-captcha" />
 | 
			
		||||
    </configure>
 | 
			
		||||
 | 
			
		||||
    <configure zcml:condition="installed collective.akismet">
 | 
			
		||||
        <meta:provides feature="plone.app.discussion-captcha" />
 | 
			
		||||
    </configure>
 | 
			
		||||
 | 
			
		||||
    <!-- Captcha comment form extender -->
 | 
			
		||||
    <configure zcml:condition="have plone.app.discussion-captcha">
 | 
			
		||||
        <!-- 
 | 
			
		||||
          Register the Captcha form extender and validator only if there are
 | 
			
		||||
          plugins installed that declare to implement a Captcha solution for
 | 
			
		||||
          plone.app.discussion (e.g. plone.formwidget.captcha and 
 | 
			
		||||
          plone.formwidget.recaptcha, collective.akismet). 
 | 
			
		||||
        -->
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.Captcha"
 | 
			
		||||
            provides="plone.app.discussion.interfaces.ICaptcha" />
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.CaptchaExtender"
 | 
			
		||||
            provides="plone.z3cform.fieldsets.interfaces.IFormExtender" />
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.CaptchaValidator"
 | 
			
		||||
            />
 | 
			
		||||
    </configure>
 | 
			
		||||
 | 
			
		||||
</configure>
 | 
			
		||||
@ -1,11 +1,13 @@
 | 
			
		||||
<configure
 | 
			
		||||
    xmlns="http://namespaces.zope.org/zope"
 | 
			
		||||
    xmlns:browser="http://namespaces.zope.org/browser"
 | 
			
		||||
    xmlns:zcml="http://namespaces.zope.org/zcml"    
 | 
			
		||||
    xmlns:zcml="http://namespaces.zope.org/zcml"
 | 
			
		||||
    i18n_domain="plone.app.discussion">
 | 
			
		||||
 | 
			
		||||
    <include package="plone.app.registry" />
 | 
			
		||||
 | 
			
		||||
    <include file="captcha.zcml" />
 | 
			
		||||
 | 
			
		||||
    <!-- Traversal adapter -->
 | 
			
		||||
    <adapter factory=".traversal.ConversationNamespace" name="conversation" />
 | 
			
		||||
 | 
			
		||||
@ -81,25 +83,6 @@
 | 
			
		||||
        permission="zope2.View"
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
    <!-- Comment form extender -->
 | 
			
		||||
    <configure zcml:condition="have plone.app.discussion-captcha">
 | 
			
		||||
        <!-- 
 | 
			
		||||
          Register the Captcha form extender and validator only if there are
 | 
			
		||||
          plugins installed that declare to implement a Captcha solution for
 | 
			
		||||
          plone.app.discussion (e.g. plone.formwidget.captcha and 
 | 
			
		||||
          plone.formwidget.recaptcha). 
 | 
			
		||||
        -->
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.Captcha"
 | 
			
		||||
            provides="plone.app.discussion.interfaces.ICaptcha" />
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.CaptchaExtender"
 | 
			
		||||
            provides="plone.z3cform.fieldsets.interfaces.IFormExtender" />
 | 
			
		||||
        <adapter
 | 
			
		||||
            factory=".captcha.CaptchaValidator"
 | 
			
		||||
            />
 | 
			
		||||
    </configure>
 | 
			
		||||
 | 
			
		||||
    <!-- Comment view -->
 | 
			
		||||
    <browser:view
 | 
			
		||||
        name="view"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user