websites.concatenative: add a recaptcha to the pastebin
parent
1f593f6bbc
commit
0d0f1a92a8
|
@ -11,11 +11,7 @@
|
|||
<tr><th class="field-label">Author: </th><td><t:field t:name="author" /></td></tr>
|
||||
<tr><th class="field-label">Mode: </th><td><t:choice t:name="mode" t:choices="modes" /></td></tr>
|
||||
<tr><th class="field-label big-field-label">Body: </th><td><t:textarea t:name="contents" t:rows="20" t:cols="60" /></td></tr>
|
||||
<tr><th class="field-label">Captcha: </th><td><t:field t:name="captcha" /></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Leave the captcha blank. Spam-bots will fill it indiscriminantly, so their attempts to register will be blocked.</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><t:recaptcha /></td></tr>
|
||||
</table>
|
||||
|
||||
<p> <button type="submit">Submit</button> </p>
|
||||
|
|
|
@ -47,11 +47,7 @@
|
|||
<tr><th class="field-label">Author: </th><td><t:field t:name="author" /></td></tr>
|
||||
<tr><th class="field-label">Mode: </th><td><t:choice t:name="mode" t:choices="modes" /></td></tr>
|
||||
<tr><th class="field-label big-field-label">Body: </th><td><t:textarea t:name="contents" t:rows="20" t:cols="60" /></td></tr>
|
||||
<tr><th class="field-label">Captcha: </th><td><t:field t:name="captcha" /></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Leave the captcha blank. Spam-bots will fill it indiscriminantly, so their attempts to register will be blocked.</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><t:recaptcha /></td></tr>
|
||||
</table>
|
||||
|
||||
<p> <button type="submit">Done</button> </p>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
! Copyright (C) 2007, 2008 Slava Pestov
|
||||
! Copyright (C) 2007, 2010 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: namespaces assocs sorting sequences kernel accessors
|
||||
hashtables db.types db.tuples db combinators
|
||||
|
@ -17,7 +17,9 @@ furnace.redirection
|
|||
furnace.auth
|
||||
furnace.auth.login
|
||||
furnace.boilerplate
|
||||
furnace.syndication ;
|
||||
furnace.recaptcha
|
||||
furnace.syndication
|
||||
furnace.conversations ;
|
||||
IN: webapps.pastebin
|
||||
|
||||
TUPLE: pastebin < dispatcher ;
|
||||
|
@ -156,8 +158,11 @@ M: annotation entity-url
|
|||
{ "author" [ v-one-line ] }
|
||||
{ "mode" [ v-mode ] }
|
||||
{ "contents" [ v-required ] }
|
||||
{ "captcha" [ v-captcha ] }
|
||||
} validate-params ;
|
||||
} validate-params
|
||||
|
||||
begin-conversation
|
||||
validate-recaptcha
|
||||
recaptcha-valid? cget [ validation-failed ] unless ;
|
||||
|
||||
: deposit-entity-slots ( tuple -- )
|
||||
now >>date
|
||||
|
|
|
@ -19,6 +19,7 @@ furnace.auth.features.registration
|
|||
furnace.auth.features.deactivate-user
|
||||
furnace.boilerplate
|
||||
furnace.redirection
|
||||
furnace.recaptcha
|
||||
webapps.pastebin
|
||||
webapps.planet
|
||||
webapps.wiki
|
||||
|
@ -54,6 +55,12 @@ TUPLE: factor-website < dispatcher ;
|
|||
allow-edit-profile
|
||||
allow-deactivation ;
|
||||
|
||||
: <factor-recaptcha> ( responder -- responder' )
|
||||
<recaptcha>
|
||||
"concatenative.org" >>domain
|
||||
"6LeJWQgAAAAAAFlYV7SuBClE9uSpGtV_ZS-qVON7" >>public-key
|
||||
"6LeJWQgAAAAAALh-XJgSSQ6xKygRgJ8-029Ip2Xv" >>private-key ;
|
||||
|
||||
: <factor-website> ( -- responder )
|
||||
factor-website new-dispatcher
|
||||
URL" /wiki/view/Front Page" <redirect-responder> "" add-responder ;
|
||||
|
@ -77,7 +84,7 @@ SYMBOL: dh-file
|
|||
<factor-website>
|
||||
<wiki> <login-config> <factor-boilerplate> "wiki" add-responder
|
||||
<user-admin> <login-config> <factor-boilerplate> "user-admin" add-responder
|
||||
<pastebin> <login-config> <factor-boilerplate> "pastebin" add-responder
|
||||
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> "pastebin" add-responder
|
||||
<planet> <login-config> <factor-boilerplate> "planet" add-responder
|
||||
<mason-app> <login-config> "mason" add-responder
|
||||
"/tmp/docs/" <help-webapp> "docs" add-responder
|
||||
|
@ -96,7 +103,7 @@ SYMBOL: dh-file
|
|||
<wiki> "wiki" add-responder
|
||||
<user-admin> "user-admin" add-responder
|
||||
<login-config> <factor-boilerplate> test-db <alloy> "concatenative.org" add-responder
|
||||
<pastebin> <login-config> <factor-boilerplate> test-db <alloy> "paste.factorcode.org" add-responder
|
||||
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> test-db <alloy> "paste.factorcode.org" add-responder
|
||||
<planet> <login-config> <factor-boilerplate> test-db <alloy> "planet.factorcode.org" add-responder
|
||||
<mason-app> <login-config> test-db <alloy> "builds.factorcode.org" add-responder
|
||||
home "docs" append-path <help-webapp> "docs.factorcode.org" add-responder
|
||||
|
|
Loading…
Reference in New Issue