From 0e6b62928a2173ed1436b5265ca7346f161b99aa Mon Sep 17 00:00:00 2001 From: viktorKhan Date: Tue, 1 Dec 2020 20:52:20 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adidos=20campos=20de=20c=C3=B3digo=20al?= =?UTF-8?q?=20alta=20de=20usuarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/UserController.php | 10 ++ app/View/User/add.ctp | 147 +++++++++++++++--------------- app/webroot/css/User/add.css | 4 + 3 files changed, 89 insertions(+), 72 deletions(-) diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 677ad33a..ae124a86 100755 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -113,6 +113,16 @@ public function add() { if ($this->request->is('post')) { + /* + * Comprobamos si se ha introducido un codigo en el honeypot, y e ese caso, no continuamos + */ + if ($this->request->data["codigo"] != "5asdf45asdf4sa5df4asdf55as7df" || $this->request->data["codigo2"] != "") { + CakeLog::error('[' . __METHOD__ . '] Intento de creación de usuario fraudulento con email: ' . $this->request->data["User"]["email"]); + $this->Session->setFlash(__('Tu usuario ha sido creado. Para activarlo, te hemos enviado un email a tu dirección de correo electrónico. Por favor, sigue las instrucciones que en él se indican.'), "success"); + $this->redirect(array("action" => "login")); + return; + } + /* * Comprobamos si el usuario ya existe y está activo */ diff --git a/app/View/User/add.ctp b/app/View/User/add.ctp index 311aa64f..19bf8de8 100755 --- a/app/View/User/add.ctp +++ b/app/View/User/add.ctp @@ -1,4 +1,4 @@ -set('title_for_layout','Regístrate en el anuario'); @@ -21,7 +21,7 @@ $this->end();
- +
@@ -31,83 +31,86 @@ $this->end();
:
- +
- +
- - -
- -
-
- - - -
-
-
- - -
- -
-
- - - -
-
-
- - -
- -
-
- - - -
-
-
- - -
- -
-
- - - -
-
-
- -
- - - -
- -
- -
- -
-
+ + +
+ +
+
+ + + +
+
+
+ + +
+ +
+
+ + + +
+
+
+ + +
+ +
+
+ + + +
+
+
+ + +
+ +
+
+ + + +
+
+
+ +
+ + + +
+ + + + +
+ +
+ +
+
- +
@@ -117,4 +120,4 @@ $this->end(); $this->start('pie'); echo $this->element('/pie'); $this->end(); -?> \ No newline at end of file +?> diff --git a/app/webroot/css/User/add.css b/app/webroot/css/User/add.css index afd340c2..c6d6a6b8 100755 --- a/app/webroot/css/User/add.css +++ b/app/webroot/css/User/add.css @@ -9,6 +9,10 @@ border-radius: 5px; } +#codigo, #codigo2 { + display: none; +} + div.error-message { display: none; }