summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-05 13:31:47 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-05 13:31:47 -0700
commit0280176ccddb9a1f142ad14a9a8a6e97686b0a4d (patch)
tree28f49f195686b6bfefa313754e4b5e76fea32977 /webclient
parentMerge branch 'develop' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-0280176ccddb9a1f142ad14a9a8a6e97686b0a4d.tar.xz
Added basic captcha, not hooked up
Diffstat (limited to 'webclient')
-rw-r--r--webclient/index.html3
-rw-r--r--webclient/login/register-controller.js14
-rw-r--r--webclient/login/register.html6
3 files changed, 20 insertions, 3 deletions
diff --git a/webclient/index.html b/webclient/index.html
index 91b6bf27be..fe62d95bb8 100644
--- a/webclient/index.html
+++ b/webclient/index.html
@@ -10,7 +10,8 @@
    
     <meta name="viewport" content="width=device-width">
    
-    <script type='text/javascript' src='js/jquery-1.8.3.min.js'></script> 
+    <script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
+    <script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> 
     <script src="js/angular.min.js"></script>
     <script src="js/angular-route.min.js"></script>
     <script src="js/angular-sanitize.min.js"></script>
diff --git a/webclient/login/register-controller.js b/webclient/login/register-controller.js
index 5a14964248..1c1f4c42f3 100644
--- a/webclient/login/register-controller.js
+++ b/webclient/login/register-controller.js
@@ -142,6 +142,20 @@ angular.module('RegisterController', ['matrixService'])
             }
         );
     };
+	
+	var setupCaptcha = function() {
+	    console.log("Setting up ReCaptcha")
+	    Recaptcha.create("6Le31_kSAAAAAK-54VKccKamtr-MFA_3WS1d_fGV",
+	    "regcaptcha",
+	    {
+	      theme: "red",
+	      callback: Recaptcha.focus_response_field
+	    });
+	};
 
+	$scope.init = function() {
+	    setupCaptcha();
+	};
+    
 }]);
 
diff --git a/webclient/login/register.html b/webclient/login/register.html
index 06a6526b70..a27f9ad4e8 100644
--- a/webclient/login/register.html
+++ b/webclient/login/register.html
@@ -12,7 +12,6 @@
                 
                 <div style="text-align: center">
                     <br/>
-
                     <input ng-show="!wait_3pid_code" id="email" size="32" type="text" ng-focus="true" ng-model="account.email" placeholder="Email address (optional)"/>
                     <div ng-show="!wait_3pid_code" class="smallPrint">Specifying an email address lets other users find you on Matrix more easily,<br/>
                         and will give you a way to reset your password in the future</div>
@@ -26,7 +25,10 @@
                     <input ng-show="!wait_3pid_code" id="displayName" size="32" type="text" ng-model="account.displayName" placeholder="Display name (e.g. Bob Obson)"/>
                     <br ng-show="!wait_3pid_code" />
                     <br ng-show="!wait_3pid_code" />
-                    
+
+
+                    <div id="regcaptcha" ng-init="init()" />
+
                     <button ng-show="!wait_3pid_code" ng-click="register()" ng-disabled="!account.desired_user_id || !account.homeserver || !account.pwd1 || !account.pwd2 || account.pwd1 !== account.pwd2">Sign up</button>
 
                     <div ng-show="wait_3pid_code">