summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-07-11 07:19:15 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-07-11 07:19:15 (GMT)
commite84c0fe9d6eeeed9bbe758ebe6737e8e4b7e62fc (patch)
treef552f99b50430b4ebe9a065392e5d6ee1fd6a62c
parent6fd9f482ab37ed3cc16facf257047cbfdeaaaac4 (diff)
downloadkolab-wap-e84c0fe9d6eeeed9bbe758ebe6737e8e4b7e62fc.tar.gz
switched to AJAX based reCAPTCHA to support user type switching
-rw-r--r--lib/hosted/kolab_client_task_signup.php8
-rw-r--r--public_html/skins/default/templates/signup.html1
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/hosted/kolab_client_task_signup.php b/lib/hosted/kolab_client_task_signup.php
index bcb5154..8fe1bfc 100644
--- a/lib/hosted/kolab_client_task_signup.php
+++ b/lib/hosted/kolab_client_task_signup.php
@@ -77,7 +77,13 @@ class kolab_client_task_signup extends kolab_client_task
// add captcha
$publickey = $this->config->get('kolab_wap', 'recaptcha_public_key');
// TODO find a less dirty way to add captcha into form
- $form = preg_replace('/<div class="formbuttons">/', '<div class="formbuttons">'.recaptcha_get_html($publickey), $form);
+ $form = preg_replace('/<div class="formbuttons">/', '<div id="recaptcha_div"></div><div class="formbuttons">', $form);
+
+ // load captcha
+ $form .= '
+ <script type="text/javascript">
+ Recaptcha.create("'.$publickey.'", "recaptcha_div", {theme: "red"});
+ </script>';
$this->output->assign('form', $form);
$this->output->set_object('taskcontent', $form);
diff --git a/public_html/skins/default/templates/signup.html b/public_html/skins/default/templates/signup.html
index d68e61a..9eb22bc 100644
--- a/public_html/skins/default/templates/signup.html
+++ b/public_html/skins/default/templates/signup.html
@@ -7,6 +7,7 @@
<link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
<script src="js/jquery.min.js"></script>
<script src="js/kolab_admin.js"></script>
+ <script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
<script src="js/kolab_hosted.js"></script>
<script src="{$skin_path}ui.js"></script>
</head>