Forums / Cotonti / Extensions / Cloudflare Turnstile Plugin

Cloudflare Turnstile CAPTCHA integration for Cotonti Siena (0.9.x). Protect your site effectively from spam, bots, and automated submissions with Cloudflare’s advanced CAPTCHA alternative.

Rootali
#1 2025-03-12 19:46

Cloudflare Turnstile Plugin for Cotonti Siena

Cloudflare Turnstile CAPTCHA integration for Cotonti Siena (0.9.x). Protect your site effectively from spam, bots, and automated submissions with Cloudflare’s advanced CAPTCHA alternative.

 

Installation

  1. Upload the plugin folder turnstile into your Cotonti plugins directory:
    plugins/turnstile/
  2. Go to your Cotonti admin panel and activate the plugin:
    Administration → Extensions → turnstile (Install)
  3. Configure the plugin by adding your Turnstile keys:
    Administration → Extensions → turnstile → Configuration
  4. Obtain keys from Cloudflare Turnstile.

Integration into Templates

Insert the following tags into your template files:

User Registration Form (users.register.tpl)

{USERS_REGISTER_VERIFYIMG}
{USERS_REGISTER_VERIFYINPUT}

User Login Form (users.auth.tpl)

{USERS_AUTH_VERIFYIMG}
{USERS_AUTH_VERIFYINPUT}

Comments Form (comments.tpl)

{COMMENTS_FORM_VERIFYIMG}
{COMMENTS_FORM_VERIFYINPUT}

To integrate it into your theme, you will need to add it to your login and register.tpl files

 

Direct download: Cloudflare Turnstile

Github: Cloudflare Turnstile

 

Note: I sent a request to add the plugin to the cotonti plugin repository, but it hasn't been approved yet, maybe it won't be approved. so I wanted to share it here.

The other day our dear Kabak friend told us to do something for Cotonti, I developed this plugin as well as Turkish language support, maybe you will like it, I love you...

 

my blog: https://rootali.net
Alex300
#2 2025-03-13 06:54

Thank you for the plugin. Its page has been approved.

Есть миры, не здесь, там, где небеса горят, и моря засыпают, и реки дремлют; люди сделаны из дыма, а города – из песен. Где-то опасность, где-то несправедливость, даже где-то остыл чай. Идем Эйс, у нас много работы!...
...Sorry for my english...
Бесплатные расширения для Cotonti: https://lily-software.com/free-scripts/
Kort
#3 2025-03-13 15:25
#48384 Rootali:

User Registration Form (users.register.tpl)

{USERS_REGISTER_VERIFYIMG}
{USERS_REGISTER_VERIFYINPUT}

User Login Form (users.auth.tpl)

{USERS_AUTH_VERIFYIMG}
{USERS_AUTH_VERIFYINPUT}

Comments Form (comments.tpl)

{COMMENTS_FORM_VERIFYIMG}
{COMMENTS_FORM_VERIFYINPUT}

Hi, thank you for the submission! Please, check the new format for CAPTCHA TPL-tags here.

SED.by - создание сайтов, разработка плагинов и тем для Котонти
Rootali
#4 2025-03-13 20:08

Files to Update & New Code

You need to add these codes to the following template files:

  • Login Formusers.auth.tpl
  • Registration Formusers.register.tpl
  • Comment Formcomments.tpl
  • Contact Formcontact.tpl

Login Form (users.auth.tpl)

Old code:

{USERS_AUTH_VERIFYIMG}
{USERS_AUTH_VERIFYINPUT}

Updated code:

<!-- Cloudflare Turnstile Captcha -->
<!-- IF {USERS_AUTH_VERIFY_IMG} -->
<tr>
    <td colspan="2" class="textcenter">
        {USERS_AUTH_VERIFY_IMG}
        {USERS_AUTH_VERIFY_INPUT}
    </td>
</tr>
<!-- ENDIF -->

Add this code at the bottom of the login form inside the users.auth.tpl file.


Registration Form (users.register.tpl)

Old code:

{USERS_REGISTER_VERIFYIMG}
{USERS_REGISTER_VERIFYINPUT}

Updated code:

<!-- Cloudflare Turnstile Captcha -->
<!-- IF {USERS_REGISTER_VERIFY_IMG} -->
<tr>
    <td colspan="2" class="textcenter">
        {USERS_REGISTER_VERIFY_IMG}
        {USERS_REGISTER_VERIFY_INPUT}
    </td>
</tr>
<!-- ENDIF -->

Add this code at the bottom of the registration form inside the users.register.tpl file.


Comment Form (comments.tpl)

Old code:

{COMMENTS_FORM_VERIFYIMG}
{COMMENTS_FORM_VERIFYINPUT}

Updated code:

<!-- Cloudflare Turnstile Captcha -->
<!-- IF {COMMENTS_FORM_VERIFY_IMG} -->
<tr>
    <td colspan="2" class="textcenter">
        {COMMENTS_FORM_VERIFY_IMG}
        {COMMENTS_FORM_VERIFY_INPUT}
    </td>
</tr>
<!-- ENDIF -->

Add this code inside the comment form inside the comments.tpl file.


Contact Form (contact.tpl)

Old code:

{CONTACT_FORM_VERIFY}

Updated code:

<!-- Cloudflare Turnstile Captcha -->
<!-- IF {CONTACT_FORM_VERIFY_INPUT} -->
<tr>
    <td colspan="2" class="textcenter">
        {CONTACT_FORM_VERIFY_INPUT}
    </td>
</tr>
<!-- ENDIF -->

Add this code at the bottom of the contact form inside the contact.tpl file.


 

File Name Old Tags New Tags
users.auth.tpl (Login Form) {USERS_AUTH_VERIFYIMG}, {USERS_AUTH_VERIFYINPUT} {USERS_AUTH_VERIFY_IMG}, {USERS_AUTH_VERIFY_INPUT}
users.register.tpl (Registration Form) {USERS_REGISTER_VERIFYIMG}, {USERS_REGISTER_VERIFYINPUT} {USERS_REGISTER_VERIFY_IMG}, {USERS_REGISTER_VERIFY_INPUT}
comments.tpl (Comment Form) {COMMENTS_FORM_VERIFYIMG}, {COMMENTS_FORM_VERIFYINPUT} {COMMENTS_FORM_VERIFY_IMG}, {COMMENTS_FORM_VERIFY_INPUT}
contact.tpl (Contact Form) {CONTACT_FORM_VERIFY} {CONTACT_FORM_VERIFY_INPUT}

 

Dear @Kort, I think this is what you wanted to say, did I understand correctly? I have updated the tags, I am uploading them to githuba now. if this tag system is correct.

Update plugin: https://github.com/SLW-CMS/Cotonti_Turnstile

 

my blog: https://rootali.net
This post was edited by Rootali (2025-03-13 20:20, 1 month ago)
Kort
#5 2025-03-14 06:41

Exactly. With the unified captcha tags you wont't need to update any tpl-files in the theme.

SED.by - создание сайтов, разработка плагинов и тем для Котонти
Rootali
#6 2025-03-14 08:43
#48390 Kort:

Exactly. With the unified captcha tags you wont't need to update any tpl-files in the theme.

Now I understand better, thank you. But this plugin now also needs to be updated from the plugins section, how can we do it :)

my blog: https://rootali.net
Kort
#7 2025-03-14 09:47

Done

SED.by - создание сайтов, разработка плагинов и тем для Котонти