Skip to content

Commit

Permalink
Added Invisible reCAPTCHA support for Modern Curve theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Dec 2, 2017
1 parent 8aaad51 commit 63215f9
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 28 deletions.
32 changes: 16 additions & 16 deletions plugins/recaptcha/functions.inc
Expand Up @@ -619,52 +619,52 @@ function RECAPTCHA_getIP()
*/
function RECAPTCHA_getFormId($type) {
switch ($type) {
case 'comment': // OK
case 'comment':
$formId = 'commentform';
break;

case 'story': // OK
case 'story':
$formId = 'submitstory';
break;

case 'registration': // OK
case 'registration':
$formId = 'registrationform';
break;

case 'loginform': // OK
case 'loginform':
$formId = 'userloginform';
break;

case 'getpassword': // OK
case 'getpassword':
$formId = 'getpasswordform';
break;

case 'contact': // OK
case 'contact':
$formId = 'contactuserform';
break;

case 'emailstory': // OK
case 'emailstory':
$formId = 'contactauthorform';
break;

case 'forum':
$formId = '';
case 'links':
$formId = 'submitlink';
break;

case 'mediagallery':
$formId = '';
case 'calendar':
$formId = 'submit_event_form';
break;

case 'rating':
case 'forum':
$formId = '';
break;

case 'links': // OK
$formId = 'submitlink';
case 'rating':
$formId = '';
break;

case 'calendar':
$formId = 'submit_event_form';
case 'mediagallery':
$formId = '';
break;

default:
Expand Down
10 changes: 8 additions & 2 deletions public_html/layout/modern_curve/comment/commentform.thtml
Expand Up @@ -54,9 +54,15 @@
<li><input type="submit" name="{nprefix}mode" value="{lang_preview}" class="submit"{xhtml}></li>
<li>
<input type="hidden" name="formtype" value="{formtype}"{xhtml}>
{save_option}
{!if allow_save}
<button type="submit" name="{nprefix}mode" value="{lang_save}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_save}</button>
<input type="hidden" name="{nprefix}mode" value="{lang_save}"{xhtml}>
{!endif}
<input type="submit" value="{lang_cancel}" name="{nprefix}mode"{xhtml}>
{delete_option}
{!if allow_delete}
<button type="submit" name="mode" value="{lang_delete}" class="uk-button uk-button-danger g-recaptcha" onclick="return confirm('{confirm_message}');"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_delete}</button>
<input type="hidden" name="mode" value="{lang_delete}"{xhtml}>
{!endif}
{notification}
</li>
</ul>
Expand Down
Expand Up @@ -61,9 +61,15 @@
<li><input type="submit" name="{nprefix}mode" value="{lang_preview}" class="submit"{xhtml}></li>
<li>
<input type="hidden" name="formtype" value="{formtype}"{xhtml}>
{save_option}
{!if allow_save}
<button type="submit" name="{nprefix}mode" value="{lang_save}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_save}</button>
<input type="hidden" name="{nprefix}mode" value="{lang_save}"{xhtml}>
{!endif}
<input type="submit" value="{lang_cancel}" name="{nprefix}mode"{xhtml}>
{delete_option}
{!if allow_delete}
<button type="submit" name="mode" value="{lang_delete}" class="uk-button uk-button-danger g-recaptcha" onclick="return confirm('{confirm_message}');"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_delete}</button>
<input type="hidden" name="mode" value="{lang_delete}"{xhtml}>
{!endif}
{notification}
</li>
</ul>
Expand Down
Expand Up @@ -35,7 +35,7 @@
<li>
<input type="hidden" name="sid" value="{story_id}"{xhtml}>
<input type="hidden" name="what" value="sendstory"{xhtml}>
<input type="submit" value="{lang_sendmessage}" onclick="return postconfirm();" onkeypress="return postconfirm();" class="submit"{xhtml}>
<button type="submit" value="{lang_sendmessage}" onclick="return postconfirm();" onkeypress="return postconfirm();" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_sendmessage}</button>
</li>
</ul>
</div>
Expand Down
Expand Up @@ -30,7 +30,7 @@
<li>
<input type="hidden" name="what" value="contact"{xhtml}>
<input type="hidden" name="uid" value="{uid}"{xhtml}>
<input type="submit" value="{lang_submit}" onclick="return postconfirm();" onkeypress="return postconfirm();" class="submit"{xhtml}>
<button type="submit" value="{lang_submit}" onclick="return postconfirm();" onkeypress="return postconfirm();" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_submit}</button>
</li>
</ul>
</div>
Expand Down
5 changes: 4 additions & 1 deletion public_html/layout/modern_curve/submit/submitarticle.thtml
Expand Up @@ -48,7 +48,10 @@
<input type="hidden" name="uid" value="{story_uid}"{xhtml}>
<input type="hidden" name="sid" value="{story_sid}"{xhtml}>
<input type="hidden" name="date" value="{story_date}"{xhtml}>
{save_button}
{!if allow_save}
<button type="submit" value="{lang_save}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_save}</button>
<input type="hidden" name="mode" value="{lang_save}">
{!endif}
</li>
</ul>
</div>
Expand Down
Expand Up @@ -54,7 +54,10 @@
<input type="hidden" name="uid" value="{story_uid}"{xhtml}>
<input type="hidden" name="sid" value="{story_sid}"{xhtml}>
<input type="hidden" name="date" value="{story_date}"{xhtml}>
{save_button}
{!if allow_save}
<button type="submit" name="mode" value="{lang_save}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_save}</button>
<input type="hidden" name="mode" value="{lang_save}">
{!endif}
</li>
</ul>
</div>
Expand Down
Expand Up @@ -20,7 +20,7 @@
<ul class="submit">
<li>
<input type="hidden" name="mode" value="emailpasswd"{xhtml}>
<input type="submit" value="{lang_emailpassword}" class="submit"{xhtml}>
<button type="submit" value="{lang_emailpassword}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_emailpassword}</button>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public_html/layout/modern_curve/users/loginform.thtml
Expand Up @@ -20,8 +20,8 @@
{!if captcha}
{captcha}
<div style="clear:both"></div>
{!endif}
<input type="submit" value="{lang_login}" class="submit"{xhtml}>
{!endif}
<button type="submit" value="{lang_login}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_login}</button>
<div style="clear:both"></div>

<ul class="navi">
Expand Down
Expand Up @@ -24,7 +24,7 @@
<ul class="submit">
<li>
<input type="hidden" name="mode" value="create"{xhtml}>
<input type="submit" value="{lang_register}" class="submit"{xhtml}>
<button type="submit" value="{lang_register}" class="g-recaptcha"{!if invisible_recaptcha}{invisible_recaptcha}{!endif}>{lang_register}</button>
</li>
</ul>
</fieldset>
Expand Down

0 comments on commit 63215f9

Please sign in to comment.