From 34f14be23bc7169d62e2c20eaffac873a64838ba Mon Sep 17 00:00:00 2001
From: Florencio Hernandez
Date: Wed, 9 Mar 2016 09:59:04 +0000
Subject: [PATCH 01/24] Adding spanish translation
---
src/Locale/es_ES.mo | Bin 0 -> 9620 bytes
src/Locale/es_ES.po | 539 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 539 insertions(+)
create mode 100644 src/Locale/es_ES.mo
create mode 100644 src/Locale/es_ES.po
diff --git a/src/Locale/es_ES.mo b/src/Locale/es_ES.mo
new file mode 100644
index 0000000000000000000000000000000000000000..865263d3bae9886c86f5886e82e58166f2938eb9
GIT binary patch
literal 9620
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
LX|SHLa{d1SB0sJA
literal 0
HcmV?d00001
diff --git a/src/Locale/es_ES.po b/src/Locale/es_ES.po
new file mode 100644
index 000000000..b77faeb4a
--- /dev/null
+++ b/src/Locale/es_ES.po
@@ -0,0 +1,539 @@
+# LANGUAGE translation of CakePHP Application
+# Copyright 2010 - 2015, Cake Development Corporation (http://cakedc.com)
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: CakeDC Users\n"
+"POT-Creation-Date: 2016-03-07 20:35+0000\n"
+"PO-Revision-Date: 2016-03-09 09:50+0000\n"
+"Language-Team: CakeDC \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 1.8.7\n"
+"Last-Translator: \n"
+"Language: es_ES\n"
+
+#: Auth/SimpleRbacAuthorize.php:132
+msgid ""
+"Missing configuration file: \"config/{0}.php\". Using default permissions"
+msgstr ""
+"Falta el archivo de configuración: \"config/{0}.php\". Utilizando permisos "
+"predeterminados"
+
+#: Controller/SocialAccountsController.php:52
+msgid "Account validated successfully"
+msgstr "Cuenta validada correctamente"
+
+#: Controller/SocialAccountsController.php:54
+msgid "Account could not be validated"
+msgstr "No se pudo validar la cuenta"
+
+#: Controller/SocialAccountsController.php:57
+msgid "Invalid token and/or social account"
+msgstr "Token o cuenta social incorrecta"
+
+#: Controller/SocialAccountsController.php:59
+msgid "SocialAccount already active"
+msgstr "Cuenta social ya activa"
+
+#: Controller/SocialAccountsController.php:61
+msgid "Social Account could not be validated"
+msgstr "No se pudo validar la cuenta social "
+
+#: Controller/SocialAccountsController.php:79
+msgid "Email sent successfully"
+msgstr "Email enviado correctamente"
+
+#: Controller/SocialAccountsController.php:81
+msgid "Email could not be sent"
+msgstr "No se puede enviar el email"
+
+#: Controller/SocialAccountsController.php:84
+msgid "Invalid account"
+msgstr "Cuenta inválida"
+
+#: Controller/SocialAccountsController.php:86
+msgid "Social Account already active"
+msgstr "Cuenta social ya activa"
+
+#: Controller/SocialAccountsController.php:88
+msgid "Email could not be resent"
+msgstr "No se puede reenviar el Email"
+
+#: Controller/Component/RememberMeComponent.php:70
+msgid "Invalid app salt, app salt must be at least 256 bits (32 bytes) long"
+msgstr "App salt inválido, debe contener al menos 256 bits (32 bytes)"
+
+#: Controller/Component/UsersAuthComponent.php:156
+msgid "You can't enable email validation workflow if use_email is false"
+msgstr ""
+"No es posible activar el flujo de trabajo para la validación de email si "
+"use_mail es falso"
+
+#: Controller/Traits/LoginTrait.php:55
+msgid ""
+"The social account is not active. Please check your email for instructions. "
+"{0}"
+msgstr ""
+"La cuenta social está inactiva. Por favor, compruebe las instrucciones en tu "
+"correo. {0}"
+
+#: Controller/Traits/LoginTrait.php:58 Template/Users/social_email.ctp:16
+msgid "Please enter your email"
+msgstr "Por favor, introduzca su email"
+
+#: Controller/Traits/LoginTrait.php:82
+msgid "Username or password is incorrect"
+msgstr "Usuario o contraseña incorrecta"
+
+#: Controller/Traits/LoginTrait.php:93
+msgid "There was an error associating your social network account"
+msgstr "Hubo un error al asociar su cuenta de la red social"
+
+#: Controller/Traits/LoginTrait.php:113
+msgid "You've successfully logged out"
+msgstr "Ha cerrado sesión correctamente"
+
+#: Controller/Traits/PasswordManagementTrait.php:53
+msgid "Password has been changed successfully"
+msgstr "Contraseña cambiada correctamente"
+
+#: Controller/Traits/PasswordManagementTrait.php:56;63
+msgid "Password could not be changed"
+msgstr "No es posible cambiar la contraseña"
+
+#: Controller/Traits/PasswordManagementTrait.php:59
+#: Controller/Traits/ProfileTrait.php:46
+msgid "User was not found"
+msgstr "Usuario no encontrado"
+
+#: Controller/Traits/PasswordManagementTrait.php:61
+msgid "The current password does not match"
+msgstr "La contraseña actual no coincide"
+
+#: Controller/Traits/PasswordManagementTrait.php:93
+msgid "Please check your email to continue with password reset process"
+msgstr ""
+"Por favor, compruebe su correo para continuar con el proceso de "
+"restablecimiento de contraseña"
+
+#: Controller/Traits/PasswordManagementTrait.php:96
+msgid "The password token could not be generated. Please try again"
+msgstr ""
+"No se pudo generar el token de contraseña. Por favor, inténtelo de nuevo"
+
+#: Controller/Traits/PasswordManagementTrait.php:101
+#: Controller/Traits/UserValidationTrait.php:94
+msgid "User {0} was not found"
+msgstr "Usuario {0} no encontrado"
+
+#: Controller/Traits/PasswordManagementTrait.php:103
+#: Controller/Traits/UserValidationTrait.php:90;98
+msgid "Token could not be reset"
+msgstr "No se puede restablecer el token"
+
+#: Controller/Traits/RegisterTrait.php:66
+msgid "The user could not be saved"
+msgstr "No se ha podido guardar el usuario"
+
+#: Controller/Traits/RegisterTrait.php:82
+msgid "You have registered successfully, please log in"
+msgstr "Se ha registrado correctamente, por favor ingrese"
+
+#: Controller/Traits/RegisterTrait.php:84
+msgid "Please validate your account before log in"
+msgstr "Por favor, valide su cuenta antes de ingresar"
+
+#: Controller/Traits/SimpleCrudTrait.php:75;103
+msgid "The {0} has been saved"
+msgstr "El {0} ha sido guardado"
+
+#: Controller/Traits/SimpleCrudTrait.php:78;106
+msgid "The {0} could not be saved"
+msgstr "El {0} no ha podido guardarse"
+
+#: Controller/Traits/SimpleCrudTrait.php:125
+msgid "The {0} has been deleted"
+msgstr "El {0} ha sido eliminado"
+
+#: Controller/Traits/SimpleCrudTrait.php:127
+msgid "The {0} could not be deleted"
+msgstr "El {0} no ha podido eliminarse"
+
+#: Controller/Traits/UserValidationTrait.php:43
+msgid "User account validated successfully"
+msgstr "Cuenta de usuario validada correctamente"
+
+#: Controller/Traits/UserValidationTrait.php:45
+msgid "User account could not be validated"
+msgstr "No se pudo validar la cuenta de usuario"
+
+#: Controller/Traits/UserValidationTrait.php:48
+msgid "User already active"
+msgstr "Usuario ya activo"
+
+#: Controller/Traits/UserValidationTrait.php:54
+msgid "Reset password token was validated successfully"
+msgstr "Restablecimiento del token de contraseña validado correctamente"
+
+#: Controller/Traits/UserValidationTrait.php:58
+msgid "Reset password token could not be validated"
+msgstr "Restablecimiento del token de contraseña no pudo validarse"
+
+#: Controller/Traits/UserValidationTrait.php:65
+msgid "Invalid token and/or email"
+msgstr "Token y/o email inválido"
+
+#: Controller/Traits/UserValidationTrait.php:67
+msgid "Token already expired"
+msgstr "Token ya expirado"
+
+#: Controller/Traits/UserValidationTrait.php:69
+msgid "Invalid validation type"
+msgstr "Tipo de validación inválido"
+
+#: Controller/Traits/UserValidationTrait.php:88
+msgid "Token has been reset successfully. Please check your email."
+msgstr ""
+"Se ha restablecido el token correctamente. Por favor compruebe su email."
+
+#: Controller/Traits/UserValidationTrait.php:96
+msgid "User {0} is already active"
+msgstr "El usuario {0} ya está activo"
+
+#: Model/Table/SocialAccountsTable.php:208
+msgid "{0}Your social account validation link"
+msgstr "{0} Enlace de validación de su cuenta social"
+
+#: Model/Table/SocialAccountsTable.php:235;263
+msgid "Account already validated"
+msgstr "Cuenta ya activada"
+
+#: Model/Table/SocialAccountsTable.php:238;266
+msgid "Account not found for the given token and email."
+msgstr "Cuenta no encontrada para el token y email proporcionado"
+
+#: Model/Table/UsersTable.php:84
+msgid "Your password does not match your confirm password. Please try again"
+msgstr ""
+"Su contraseña y la comprobación no concuerdan. Por favor inténtelo de nuevo"
+
+#: Model/Table/UsersTable.php:178
+msgid "Username already exists"
+msgstr "Nombre de usuario ya existente"
+
+#: Model/Table/UsersTable.php:184
+msgid "Email already exists"
+msgstr "Email ya existente"
+
+#: Model/Table/UsersTable.php:213
+msgid "The \"tos\" property is not present"
+msgstr "La propiedad \"tos\" no está presente"
+
+#: Model/Table/UsersTable.php:271
+msgid "Token has already expired user with no token"
+msgstr "El token ha expirado usuario sin token"
+
+#: Model/Table/UsersTable.php:274
+msgid "User not found for the given token and email."
+msgstr "Usuario no encontrado para el token y email proporcionado"
+
+#: Model/Table/UsersTable.php:341
+msgid "User not found"
+msgstr "Usuario no encontrado"
+
+#: Model/Table/UsersTable.php:368
+msgid "+ {0} secs"
+msgstr "+ {0} secs"
+
+#: Model/Table/UsersTable.php:420
+msgid "Unable to login user with reference {0}"
+msgstr "No se puede iniciar sesión con el usuario con referencia {0}"
+
+#: Model/Table/UsersTable.php:453
+msgid "Email not present"
+msgstr "Email no presente"
+
+#: Model/Table/UsersTable.php:541
+msgid "{0}Your account validation link"
+msgstr "{0} Enlace para validar su cuenta"
+
+#: Model/Table/UsersTable.php:561
+msgid "{0}Your reset password link"
+msgstr "{0} Enlace para restablecer su contraseña"
+
+#: Model/Table/UsersTable.php:585
+msgid "The old password does not match"
+msgstr "La antigua contraseña no coincide"
+
+#: Template/Email/html/reset_password.ctp:21
+#: Template/Email/html/social_account_validation.ctp:14
+#: Template/Email/html/validation.ctp:21
+#: Template/Email/text/reset_password.ctp:20
+#: Template/Email/text/social_account_validation.ctp:22
+#: Template/Email/text/validation.ctp:20
+msgid "Hi {0}"
+msgstr "Hola {0}"
+
+#: Template/Email/html/reset_password.ctp:24
+msgid "Reset your password here"
+msgstr "Restablezca su contraseña aquí"
+
+#: Template/Email/html/reset_password.ctp:27
+#: Template/Email/html/social_account_validation.ctp:32
+#: Template/Email/html/validation.ctp:27
+msgid ""
+"If the link is not correctly displayed, please copy the following address in "
+"your web browser {0}"
+msgstr ""
+"Si el enlace no se muestra correctamente, por favor copie la siguiente "
+"dirección en su navegador web {0}"
+
+#: Template/Email/html/reset_password.ctp:30
+#: Template/Email/html/social_account_validation.ctp:35
+#: Template/Email/html/validation.ctp:30
+#: Template/Email/text/reset_password.ctp:24
+#: Template/Email/text/social_account_validation.ctp:26
+#: Template/Email/text/validation.ctp:24
+msgid "Thank you"
+msgstr "Gracias"
+
+#: Template/Email/html/social_account_validation.ctp:18
+msgid "Activate your social login here"
+msgstr "Active su acceso social aquí"
+
+#: Template/Email/html/validation.ctp:24
+msgid "Activate your account here"
+msgstr "Active su cuenta aquí"
+
+#: Template/Email/text/reset_password.ctp:22
+#: Template/Email/text/validation.ctp:22
+msgid "Please copy the following address in your web browser {0}"
+msgstr "Por favor copie la siguiente dirección en su navegador web {0}"
+
+#: Template/Email/text/social_account_validation.ctp:24
+msgid ""
+"Please copy the following address in your web browser to activate your "
+"social login {0}"
+msgstr ""
+"Por favor copie la siguiente dirección en su navegador web para activar su "
+"acceso social {0}"
+
+#: Template/Users/add.ctp:13 Template/Users/edit.ctp:13
+#: Template/Users/index.ctp:13;26 Template/Users/view.ctp:13;77
+msgid "Actions"
+msgstr "Acciones"
+
+#: Template/Users/add.ctp:15 Template/Users/edit.ctp:21
+#: Template/Users/view.ctp:17
+msgid "List Users"
+msgstr "Listar Usuarios"
+
+#: Template/Users/add.ctp:16 Template/Users/edit.ctp:22
+#: Template/Users/view.ctp:19
+msgid "List Accounts"
+msgstr "Listar Cuentas"
+
+#: Template/Users/add.ctp:22 Template/Users/register.ctp:15
+msgid "Add User"
+msgstr "Añadir Usuario"
+
+#: Template/Users/add.ctp:32 Template/Users/change_password.ctp:13
+#: Template/Users/edit.ctp:42 Template/Users/register.ctp:26
+#: Template/Users/request_reset_password.ctp:8
+#: Template/Users/resend_token_validation.ctp:20
+#: Template/Users/social_email.ctp:19
+msgid "Submit"
+msgstr "Enviar"
+
+#: Template/Users/change_password.ctp:5
+msgid "Please enter the new password"
+msgstr "Por favor introduzca la nueva contraseña"
+
+#: Template/Users/change_password.ctp:7
+msgid "Current password"
+msgstr "Contraseña actual"
+
+#: Template/Users/edit.ctp:16 Template/Users/index.ctp:40
+#: Template/Users/view.ctp:99
+msgid "Delete"
+msgstr "Eliminar"
+
+#: Template/Users/edit.ctp:18 Template/Users/index.ctp:40
+#: Template/Users/view.ctp:16;99
+msgid "Are you sure you want to delete # {0}?"
+msgstr "¿Está seguro que quiere eliminar # {0}?"
+
+#: Template/Users/edit.ctp:28 Template/Users/view.ctp:15
+msgid "Edit User"
+msgstr "Editar Usuario"
+
+#: Template/Users/index.ctp:15
+msgid "New {0}"
+msgstr "Nuevo {0}"
+
+#: Template/Users/index.ctp:37 Template/Users/view.ctp:95
+msgid "View"
+msgstr "Ver"
+
+#: Template/Users/index.ctp:38
+msgid "Change password"
+msgstr "Cambiar contraseña"
+
+#: Template/Users/index.ctp:39 Template/Users/view.ctp:97
+msgid "Edit"
+msgstr "Editar"
+
+#: Template/Users/index.ctp:49
+msgid "previous"
+msgstr "anterior"
+
+#: Template/Users/index.ctp:51
+msgid "next"
+msgstr "siguiente"
+
+#: Template/Users/login.ctp:19
+msgid "Please enter your username and password"
+msgstr "Por favor introduzca su usuario y contraseña"
+
+#: Template/Users/login.ctp:26
+msgid "Remember me"
+msgstr "Recordarme"
+
+#: Template/Users/login.ctp:49
+msgid "Login"
+msgstr "Ingresar"
+
+#: Template/Users/profile.ctp:18
+msgid "{0} {1}"
+msgstr "{0} {1}"
+
+#: Template/Users/profile.ctp:23
+msgid "Change Password"
+msgstr "Cambiar contraseña"
+
+#: Template/Users/profile.ctp:26 Template/Users/view.ctp:28;68
+msgid "Username"
+msgstr "Usuario"
+
+#: Template/Users/profile.ctp:28 Template/Users/view.ctp:30
+msgid "Email"
+msgstr "Email"
+
+#: Template/Users/profile.ctp:33
+msgid "Social Accounts"
+msgstr "Cuentas sociales"
+
+#: Template/Users/profile.ctp:37 Template/Users/view.ctp:70
+msgid "Avatar"
+msgstr "Avatar"
+
+#: Template/Users/profile.ctp:38 Template/Users/view.ctp:67
+msgid "Provider"
+msgstr "Proveedor"
+
+#: Template/Users/profile.ctp:39
+msgid "Link"
+msgstr "Enlace"
+
+#: Template/Users/register.ctp:23
+msgid "Accept TOS conditions?"
+msgstr "¿Acepta las condiciones del servicios?"
+
+#: Template/Users/request_reset_password.ctp:5
+msgid "Please enter your email to reset your password"
+msgstr "Por favor introduzca su email para restablecer su contraseña"
+
+#: Template/Users/resend_token_validation.ctp:15
+msgid "Resend Validation email"
+msgstr "Reenviar email de validación"
+
+#: Template/Users/resend_token_validation.ctp:17
+msgid "Email or username"
+msgstr "Email o usuario"
+
+#: Template/Users/view.ctp:16
+msgid "Delete User"
+msgstr "Eliminar Usuario"
+
+#: Template/Users/view.ctp:18
+msgid "New User"
+msgstr "Nuevo Usuario"
+
+#: Template/Users/view.ctp:26;65
+msgid "Id"
+msgstr "Id"
+
+#: Template/Users/view.ctp:32
+msgid "First Name"
+msgstr "Nombre"
+
+#: Template/Users/view.ctp:34
+msgid "Last Name"
+msgstr "Apellidos"
+
+#: Template/Users/view.ctp:36;71
+msgid "Token"
+msgstr "Token"
+
+#: Template/Users/view.ctp:38
+msgid "Api Token"
+msgstr "Api Token"
+
+#: Template/Users/view.ctp:42;73
+msgid "Active"
+msgstr "Activo"
+
+#: Template/Users/view.ctp:46;72
+msgid "Token Expires"
+msgstr "Token caduca"
+
+#: Template/Users/view.ctp:48
+msgid "Activation Date"
+msgstr "Fecha de activación"
+
+#: Template/Users/view.ctp:50
+msgid "Tos Date"
+msgstr "Fecha Tos"
+
+#: Template/Users/view.ctp:52;75
+msgid "Created"
+msgstr "Creado"
+
+#: Template/Users/view.ctp:54;76
+msgid "Modified"
+msgstr "Modificado"
+
+#: Template/Users/view.ctp:61
+msgid "Related Accounts"
+msgstr "Cuentas relacionadas"
+
+#: Template/Users/view.ctp:66
+msgid "User Id"
+msgstr "Id Usuario"
+
+#: Template/Users/view.ctp:69
+msgid "Reference"
+msgstr "Referencia"
+
+#: Template/Users/view.ctp:74
+msgid "Data"
+msgstr "Datos"
+
+#: View/Helper/UserHelper.php:43
+msgid "Sign in with Facebook"
+msgstr "Ingresar con Facebook"
+
+#: View/Helper/UserHelper.php:57
+msgid "Sign in with Twitter"
+msgstr "Ingresar con Twitter"
+
+#: View/Helper/UserHelper.php:71
+msgid "Logout"
+msgstr "Salir"
+
+#: View/Helper/UserHelper.php:109
+msgid "Welcome, {0}"
+msgstr "Bienvenido, {0}"
From 821708347f38e858ee5db6fd590731c546216f9c Mon Sep 17 00:00:00 2001
From: florenciohernandez
Date: Wed, 9 Mar 2016 10:55:51 +0000
Subject: [PATCH 02/24] Ref feature/spanish-translation: Addin es folder and
rename .po and .mo files
---
src/Locale/{es_ES.mo => es/Users.mo} | Bin 9620 -> 9650 bytes
src/Locale/{es_ES.po => es/Users.po} | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
rename src/Locale/{es_ES.mo => es/Users.mo} (82%)
rename src/Locale/{es_ES.po => es/Users.po} (99%)
diff --git a/src/Locale/es_ES.mo b/src/Locale/es/Users.mo
similarity index 82%
rename from src/Locale/es_ES.mo
rename to src/Locale/es/Users.mo
index 865263d3bae9886c86f5886e82e58166f2938eb9..8e4f8f1c6d459a55f71483279b0ffad245793220 100644
GIT binary patch
delta 1022
zcmXZaOGwmF6vy#XgHIZ5%tzz%pN^)+q+;PCw8+Rvnqn$ytcV^{NlZg(2qpc4!e|jK
zYSAo$2zo#+BIzM0Mzj(tf}}-4M4JlR7_lbMO7%d(OG%e{c0Y?Rzrsb4Qn$
z9W6G?HM1`zW~=ch7GS|jvvRD(cHE2=cmcC9g&ehe-ufgKGXI2`xPbZi8*|VXG;2UV
z>U&$zTwB4Qn*|y5KAb=mkiZPQgi1Ju%kc&(z+KG4hp2teQRk*mg}%o!{DlF`DNPqt
zhFV`!>ZSwrvY-SJT#EZ}0Q*r1-(WY+A+fBG(+;jhCEAI)VFFdy2&%A)s1965#lM3p
z^Z~|j+-0EFXVPas22g>jFoX?QjS)PIXYmkzz>U~McC|E#m6*aVe2HQF;~CUKvGODF7a2Zac{`D+6IFEJs
z7q?-E;OayIyLf*#!ayx~hI;+4upYmo0tIT)H?P4C<{jRA2vy)U4B{iyO<#NKv*+NC2);#CSYDfcGsxQWD_*SFAKsOWA0HSF?@pc@JQnXcb!2cTKHTZ--Lo~^J~2}==l=)oRBYn_
delta 992
zcmXZaPe@cz6vy#nIx}icI+kOj{duKk2I3PZP)DtW3rk8RTnzpTK~Y*n+gv<|pg*7+
zh0?$v!j)h;P`EG%X;Wbv0~b=OKvFO?YE|_8IdAoO_q==WIrrSV)IQbzYBSU8&oCQ|
zn&q0=yJE9S{Dg)03r}F^xLG}x<4NqpY#c+D+I>I%439Bh#vra?K7PR*{Ek()>;I3%
z%(J5eoR}RLM=fka70`hJ97H7?!2-O4ns*P6;3L$$r>J$as6rR96hC7Gw^0TC_2c0Z
zFTGJ!NjiaxhnUcSqu7K>IEO9x23c#r(ZK?CSE5?f2|G}QB~gXlL?yh9I)H~N^dTm3
zLIJgY3&XgN+9-p*m*ZhPi!Kh}4eY}dUcw03)zU6Jg=5%^GgyrqzCnI!-#98?3+k%8
zD}JCKnQNn%zz294SJA<&(`H3jfm)bAo`-d!3LQapYTS>{qB`*!L%4#P_a4vS59DB;
ztbtJd_K@}Ed74OF4sKnQ>4u?=JoyI(Tj=Jl4bnq>n!*AGzK{h|Q
zDr_ddCHYWGo}ga;3p|e>P#f)|P97-ZU0^9{+>I*m7V1qrMxFGfAD>5u@kh+W9n@R+
zi9M)x)V5+T9}Z67bzDGI_z(4HvMbUXN038U3@=~;b;rZ0>5!Wra2pygx|3_sz0}v@
G_3(cuMq\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -14,6 +14,7 @@ msgstr ""
"X-Generator: Poedit 1.8.7\n"
"Last-Translator: \n"
"Language: es_ES\n"
+"X-Poedit-SourceCharset: UTF-8\n"
#: Auth/SimpleRbacAuthorize.php:132
msgid ""
From a8d9bde418aca0acfc3d001057c9e74e24eb1499 Mon Sep 17 00:00:00 2001
From: florenciohernandez
Date: Fri, 11 Mar 2016 06:52:27 +0000
Subject: [PATCH 03/24] fix spanish translations
---
src/Locale/es/Users.mo | Bin 9650 -> 9657 bytes
src/Locale/es/Users.po | 6 +++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Locale/es/Users.mo b/src/Locale/es/Users.mo
index 8e4f8f1c6d459a55f71483279b0ffad245793220..3cdcb7eb72785aedd845f1caf735aa4e74cb9fdf 100644
GIT binary patch
delta 791
zcmXZaODIH97{Kv^@eD(Gj2Vx^cx!5gOfh*ZMa>E|4DzVn@PPW#UKPOcrMODUDhJ%=i^C#eU{4a38Kq>=A7(olOFsGCc
zT_}lau^RnYg#$Q-OE`j0*o8r=H{c?c<34uaCHnB!wyE4qB#tmk3Qk}F#_V_%nX9%i
zgooITAE>dRLa9RRMOinF#khd7(M^<-I2IP)_0*)A7~hM<#w^B|3GYvjFxI_oJN1
z9!keQNNrWhWZ75<;Tb(=Xd^bUV8rHU
YquQ9##&mRY%5uAJ(~{<_cYW{p1D0i39RL6T
delta 784
zcmXZaODM!a9KiAMT2@|L-n-Udz4Ho*&7&kDt6a1m$zhYQ>s3nfKM*;%b8sYO53&hG
zNiGznIB}5+xjDEg-=F=TKJ%Mqe!uz6%z4jo&(Te^VN*(3vz1ClJKC`vE!c^1=)p)F
zzzH106uiL}e8wzHWwXXg%)vgi;xtOWMNGmKlzLlsW&9V|Wg>=&ee_}w8|cP8
zY{NIyn4hau8n&bC^I``2Q4YF}a#M%q`~}KQJYg)p7z||LJLX}W4tG|D-Nd~pH?ob=
z@i$UirLkBJR)?9`k5YINYjG9jMo%#TFHxTQ4mG}F5gNY?x)`{~{{L3kOuUG4BPUpl
zS6G4{D2Z$Z;m!-Nk+{)}=TQ#0iCK7n(&@E1e}|g*6QlS_DxUV`GbG^GM`8F=7NI1rLV8dQScYDdH(m?v#8xNA)KoXs*M=U_-BGrV>9L6^?GNagIp4g`
Szu*hyW#3vN7D8Y8A^HzM@l{^{
diff --git a/src/Locale/es/Users.po b/src/Locale/es/Users.po
index 4548ab00c..88cbcdae2 100644
--- a/src/Locale/es/Users.po
+++ b/src/Locale/es/Users.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CakeDC Users\n"
"POT-Creation-Date: 2016-03-07 20:35+0000\n"
-"PO-Revision-Date: 2016-03-09 10:53+0000\n"
+"PO-Revision-Date: 2016-03-09 21:06+0000\n"
"Language-Team: CakeDC \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -78,7 +78,7 @@ msgid ""
"The social account is not active. Please check your email for instructions. "
"{0}"
msgstr ""
-"La cuenta social está inactiva. Por favor, compruebe las instrucciones en tu "
+"La cuenta social está inactiva. Por favor, compruebe las instrucciones en su "
"correo. {0}"
#: Controller/Traits/LoginTrait.php:58 Template/Users/social_email.ctp:16
@@ -255,7 +255,7 @@ msgstr "No se puede iniciar sesión con el usuario con referencia {0}"
#: Model/Table/UsersTable.php:453
msgid "Email not present"
-msgstr "Email no presente"
+msgstr "No se encuentra el email"
#: Model/Table/UsersTable.php:541
msgid "{0}Your account validation link"
From 3c0fc9ffb0a9404a6838b96a289f50e19a8559d7 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 15 Mar 2016 15:41:56 -0300
Subject: [PATCH 04/24] Refs #306 ensuring user is active when trying to reset
password
---
.../Traits/PasswordManagementTrait.php | 4 ++++
src/Model/Behavior/PasswordBehavior.php | 6 +++++
.../Traits/PasswordManagementTraitTest.php | 22 +++++++++++++++++++
.../Model/Behavior/PasswordBehaviorTest.php | 14 ++++++++++++
4 files changed, 46 insertions(+)
diff --git a/src/Controller/Traits/PasswordManagementTrait.php b/src/Controller/Traits/PasswordManagementTrait.php
index b7045ce57..dafdba623 100644
--- a/src/Controller/Traits/PasswordManagementTrait.php
+++ b/src/Controller/Traits/PasswordManagementTrait.php
@@ -12,6 +12,7 @@
namespace CakeDC\Users\Controller\Traits;
use CakeDC\Users\Exception\UserNotFoundException;
+use CakeDC\Users\Exception\UserNotActiveException;
use CakeDC\Users\Exception\WrongPasswordException;
use Cake\Core\Configure;
use Exception;
@@ -101,6 +102,7 @@ public function requestResetPassword()
'expiration' => Configure::read('Users.Token.expiration'),
'checkActive' => false,
'sendEmail' => true,
+ 'ensureActive' => true
]);
if ($resetUser) {
$msg = __d('Users', 'Please check your email to continue with password reset process');
@@ -112,6 +114,8 @@ public function requestResetPassword()
return $this->redirect(['action' => 'login']);
} catch (UserNotFoundException $exception) {
$this->Flash->error(__d('Users', 'User {0} was not found', $reference));
+ } catch (UserNotActiveException $exception) {
+ $this->Flash->error(__d('Users', 'The user is not active'));
} catch (Exception $exception) {
$this->Flash->error(__d('Users', 'Token could not be reset'));
}
diff --git a/src/Model/Behavior/PasswordBehavior.php b/src/Model/Behavior/PasswordBehavior.php
index 4f13207f7..0bc19f2e5 100644
--- a/src/Model/Behavior/PasswordBehavior.php
+++ b/src/Model/Behavior/PasswordBehavior.php
@@ -14,6 +14,7 @@
use CakeDC\Users\Email\EmailSender;
use CakeDC\Users\Exception\UserAlreadyActiveException;
use CakeDC\Users\Exception\UserNotFoundException;
+use CakeDC\Users\Exception\UserNotActiveException;
use CakeDC\Users\Exception\WrongPasswordException;
use CakeDC\Users\Model\Behavior\Behavior;
use Cake\Datasource\EntityInterface;
@@ -71,6 +72,11 @@ public function resetToken($reference, array $options = [])
$user->active = false;
$user->activation_date = null;
}
+ if (Hash::Get($options, 'ensureActive')) {
+ if (!$user->active) {
+ throw new UserNotActiveException("User not active");
+ }
+ }
$user->updateToken($expiration);
$saveResult = $this->_table->save($user);
$template = !empty($options['emailTemplate']) ? $options['emailTemplate'] : 'CakeDC/Users.reset_password';
diff --git a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
index 3c64ebb75..a90a86c9e 100644
--- a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
+++ b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
@@ -157,4 +157,26 @@ public function testRequestPasswordHappy()
$this->Trait->requestResetPassword();
$this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
}
+
+ /**
+ * test requestResetPassword
+ *
+ * @return void
+ */
+ public function testRequestResetPasswordUserNotActive()
+ {
+ $this->assertEquals('ae93ddbe32664ce7927cf0c5c5a5e59d', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
+ $this->_mockRequestPost();
+ $this->_mockFlash();
+ $reference = 'user-1';
+ $this->Trait->request->expects($this->once())
+ ->method('data')
+ ->with('reference')
+ ->will($this->returnValue($reference));
+ $this->Trait->Flash->expects($this->any())
+ ->method('error')
+ ->with('The user is not active');
+ $this->Trait->requestResetPassword();
+ $this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
+ }
}
diff --git a/tests/TestCase/Model/Behavior/PasswordBehaviorTest.php b/tests/TestCase/Model/Behavior/PasswordBehaviorTest.php
index 238a7923d..18b4c3290 100644
--- a/tests/TestCase/Model/Behavior/PasswordBehaviorTest.php
+++ b/tests/TestCase/Model/Behavior/PasswordBehaviorTest.php
@@ -146,4 +146,18 @@ public function testResetTokenUserAlreadyActive()
'checkActive' => true,
]);
}
+
+ /**
+ * Test resetToken
+ *
+ * @expectedException CakeDC\Users\Exception\UserNotActiveException
+ */
+ public function testResetTokenUserNotActive()
+ {
+ $user = TableRegistry::get('CakeDC/Users.Users')->findAllByUsername('user-1')->first();
+ $this->Behavior->resetToken('user-1', [
+ 'ensureActive' => true,
+ 'expiration' => 3600
+ ]);
+ }
}
From c407d7fc9344949e9fa62b9b421ea148444355cd Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 15 Mar 2016 15:50:50 -0300
Subject: [PATCH 05/24] Refs #306 fixing PHPCS
---
src/Controller/Traits/PasswordManagementTrait.php | 2 +-
src/Model/Behavior/PasswordBehavior.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Controller/Traits/PasswordManagementTrait.php b/src/Controller/Traits/PasswordManagementTrait.php
index dafdba623..5c76767d1 100644
--- a/src/Controller/Traits/PasswordManagementTrait.php
+++ b/src/Controller/Traits/PasswordManagementTrait.php
@@ -11,8 +11,8 @@
namespace CakeDC\Users\Controller\Traits;
-use CakeDC\Users\Exception\UserNotFoundException;
use CakeDC\Users\Exception\UserNotActiveException;
+use CakeDC\Users\Exception\UserNotFoundException;
use CakeDC\Users\Exception\WrongPasswordException;
use Cake\Core\Configure;
use Exception;
diff --git a/src/Model/Behavior/PasswordBehavior.php b/src/Model/Behavior/PasswordBehavior.php
index 0bc19f2e5..f42e1a23b 100644
--- a/src/Model/Behavior/PasswordBehavior.php
+++ b/src/Model/Behavior/PasswordBehavior.php
@@ -13,8 +13,8 @@
use CakeDC\Users\Email\EmailSender;
use CakeDC\Users\Exception\UserAlreadyActiveException;
-use CakeDC\Users\Exception\UserNotFoundException;
use CakeDC\Users\Exception\UserNotActiveException;
+use CakeDC\Users\Exception\UserNotFoundException;
use CakeDC\Users\Exception\WrongPasswordException;
use CakeDC\Users\Model\Behavior\Behavior;
use Cake\Datasource\EntityInterface;
From 09f9cb6e166d6077aeeeea264c1b2eab6cd7a32f Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 15 Mar 2016 16:27:00 -0300
Subject: [PATCH 06/24] Refs #306 adding __d() and fixing mistype
---
src/Model/Behavior/PasswordBehavior.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Model/Behavior/PasswordBehavior.php b/src/Model/Behavior/PasswordBehavior.php
index f42e1a23b..044cb80b3 100644
--- a/src/Model/Behavior/PasswordBehavior.php
+++ b/src/Model/Behavior/PasswordBehavior.php
@@ -67,14 +67,14 @@ public function resetToken($reference, array $options = [])
}
if (Hash::get($options, 'checkActive')) {
if ($user->active) {
- throw new UserAlreadyActiveException("User account already validated");
+ throw new UserAlreadyActiveException(__d('Users', "User account already validated"));
}
$user->active = false;
$user->activation_date = null;
}
- if (Hash::Get($options, 'ensureActive')) {
+ if (Hash::get($options, 'ensureActive')) {
if (!$user->active) {
- throw new UserNotActiveException("User not active");
+ throw new UserNotActiveException(__d('Users', "User not active"));
}
}
$user->updateToken($expiration);
From a8e113f1ff9051cd964a114db43c06205f0d3eb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?=
Date: Wed, 16 Mar 2016 00:46:24 +0000
Subject: [PATCH 07/24] fix twitter blank page, fix twitter missing provider
issue, improve default login page display only configured providers
---
config/routes.php | 3 ---
config/users.php | 7 +++++-
src/Controller/Traits/LoginTrait.php | 5 ++--
src/Model/Behavior/SocialBehavior.php | 15 ++++++-----
src/Template/Users/login.ctp | 10 +-------
src/View/Helper/UserHelper.php | 36 +++++++++++++++++++++++----
6 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/config/routes.php b/config/routes.php
index 191175c95..6c4331798 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -15,9 +15,6 @@
$routes->fallbacks('DashedRoute');
});
-//if (!Configure::check('OAuth.path')) {
-// Configure::load('CakeDC/Users.users');
-//}
Router::connect('/auth/twitter', [
'plugin' => 'CakeDC/Users',
'controller' => 'Users',
diff --git a/config/users.php b/config/users.php
index 3bde0bae0..d297a207f 100644
--- a/config/users.php
+++ b/config/users.php
@@ -109,7 +109,12 @@
'className' => 'League\OAuth2\Client\Provider\Facebook',
'options' => [
'graphApiVersion' => 'v2.5',
- 'redirectUri' => Router::url('/auth/facebook', true)
+ 'redirectUri' => Router::url('/auth/facebook', true)
+ ]
+ ],
+ 'twitter' => [
+ 'options' => [
+ 'redirectUri' => Router::url('/auth/twitter', true)
]
],
'linkedIn' => [
diff --git a/src/Controller/Traits/LoginTrait.php b/src/Controller/Traits/LoginTrait.php
index bf00fca59..5c8eee0c8 100644
--- a/src/Controller/Traits/LoginTrait.php
+++ b/src/Controller/Traits/LoginTrait.php
@@ -70,10 +70,11 @@ public function twitterLogin()
} else {
$temporaryCredentials = $server->getTemporaryCredentials();
$this->request->session()->write('temporary_credentials', $temporaryCredentials);
- $server->authorize($temporaryCredentials);
- return $this->response;
+ $url = $server->getAuthorizationUrl($temporaryCredentials);
+ return $this->redirect($url);
}
}
+
/**
* @param Event $event event
* @return void
diff --git a/src/Model/Behavior/SocialBehavior.php b/src/Model/Behavior/SocialBehavior.php
index f2f50ca05..48adafda4 100644
--- a/src/Model/Behavior/SocialBehavior.php
+++ b/src/Model/Behavior/SocialBehavior.php
@@ -118,10 +118,10 @@ protected function _createSocialUser($data, $options = [])
* @param string $validateEmail email to validate.
* @param string $tokenExpiration token_expires data.
* @return EntityInterface
+ * @todo refactor
*/
protected function _populateUser($data, $existingUser, $useEmail, $validateEmail, $tokenExpiration)
{
- $accountData['provider'] = Hash::get($data, 'provider');
$accountData['username'] = Hash::get($data, 'username');
$accountData['reference'] = Hash::get($data, 'id');
$accountData['avatar'] = Hash::get($data, 'avatar');
@@ -140,6 +140,7 @@ protected function _populateUser($data, $existingUser, $useEmail, $validateEmail
}
$accountData['data'] = serialize(Hash::get($data, 'raw'));
$accountData['active'] = true;
+
$dataValidated = Hash::get($data, 'validated');
if (empty($existingUser)) {
@@ -181,18 +182,20 @@ protected function _populateUser($data, $existingUser, $useEmail, $validateEmail
$userData['validated'] = !empty($dataValidated);
$userData['tos_date'] = date("Y-m-d H:i:s");
$userData['gender'] = Hash::get($data, 'gender');
- //$userData['timezone'] = Hash::get($data, 'timezone');
$userData['social_accounts'][] = $accountData;
- $user = $this->_table->newEntity($userData, ['associated' => ['SocialAccounts']]);
+
+ $user = $this->_table->newEntity($userData);
$user = $this->_updateActive($user, false, $tokenExpiration);
} else {
if ($useEmail && empty($dataValidated)) {
$accountData['active'] = false;
}
- $user = $this->_table->patchEntity($existingUser, [
- 'social_accounts' => [$accountData]
- ], ['associated' => ['SocialAccounts']]);
+ $user = $existingUser;
}
+ $socialAccount = $this->_table->SocialAccounts->newEntity($accountData);
+ //ensure provider is present in Entity
+ $socialAccount['provider'] = Hash::get($data, 'provider');
+ $user['social_accounts'] = [$socialAccount];
return $user;
}
diff --git a/src/Template/Users/login.ctp b/src/Template/Users/login.ctp
index 3ea2712fc..1a0168514 100644
--- a/src/Template/Users/login.ctp
+++ b/src/Template/Users/login.ctp
@@ -43,15 +43,7 @@ use Cake\Core\Configure;
?>
-
-
- $options) : ?>
-
- = $this->User->socialLogin($provider); ?>
-
-
-
+ = implode(' ', $this->User->socialLoginList()); ?>
= $this->Form->button(__d('Users', 'Login')); ?>
= $this->Form->end() ?>
diff --git a/src/View/Helper/UserHelper.php b/src/View/Helper/UserHelper.php
index 735fe4047..fe4511716 100644
--- a/src/View/Helper/UserHelper.php
+++ b/src/View/Helper/UserHelper.php
@@ -58,11 +58,37 @@ public function socialLogin($name, $options = [])
if (empty($options['label'])) {
$options['label'] = 'Sign in with';
}
- return $this->Html->link($this->Html->tag('i', '', [
- 'class' => __d('Users', 'fa fa-{0}', strtolower($name)),
- ]) . __d('Users', '{0} {1}', Hash::get($options, 'label'), Inflector::camelize($name)), "/auth/$name", [
- 'escape' => false, 'class' => __d('Users', 'btn btn-social btn-{0} ' . Hash::get($options, 'class') ? :'', strtolower($name))
- ]);
+ $icon = $this->Html->tag('i', '', [
+ 'class' => __d('Users', 'fa fa-{0}', strtolower($name)),
+ ]);
+ $providerTitle = __d('Users', '{0} {1}', Hash::get($options, 'label'), Inflector::camelize($name));
+ $providerClass = __d('Users', 'btn btn-social btn-{0} ' . Hash::get($options, 'class') ?: '', strtolower($name));
+ return $this->Html->link($icon . $providerTitle, "/auth/$name", [
+ 'escape' => false, 'class' => $providerClass
+ ]);
+ }
+
+ /**
+ * All available Social Login Icons
+ *
+ * @return array Links to Social Login Urls
+ */
+ public function socialLoginList()
+ {
+ if (!Configure::read('Users.Social.login')) {
+ return [];
+ }
+ $outProviders = [];
+ $providers = Configure::read('OAuth.providers');
+ foreach ($providers as $provider => $options) {
+ if (!empty($options['options']['redirectUri']) &&
+ !empty($options['options']['clientId']) &&
+ !empty($options['options']['clientSecret'])) {
+ $outProviders[] = $this->socialLogin($provider);
+ }
+ }
+
+ return $outProviders;
}
/**
From f9b290f430b5e760d99d0bf3adf8ddef0f54cbc1 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Wed, 16 Mar 2016 14:32:10 -0300
Subject: [PATCH 08/24] Refs #306 using array access to enable not hydrated
finds
---
src/Model/Behavior/PasswordBehavior.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Model/Behavior/PasswordBehavior.php b/src/Model/Behavior/PasswordBehavior.php
index 044cb80b3..6eccdd182 100644
--- a/src/Model/Behavior/PasswordBehavior.php
+++ b/src/Model/Behavior/PasswordBehavior.php
@@ -73,7 +73,7 @@ public function resetToken($reference, array $options = [])
$user->activation_date = null;
}
if (Hash::get($options, 'ensureActive')) {
- if (!$user->active) {
+ if (!$user['active']) {
throw new UserNotActiveException(__d('Users', "User not active"));
}
}
From 89e0ea930623233c9df5b2d7a43d8d802a51ad82 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 22 Mar 2016 14:49:20 -0300
Subject: [PATCH 09/24] Refs #306 adding email config to enable it on tests
---
.../Controller/Traits/BaseTraitTest.php | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/TestCase/Controller/Traits/BaseTraitTest.php b/tests/TestCase/Controller/Traits/BaseTraitTest.php
index 131d58aa5..6f6abf63d 100644
--- a/tests/TestCase/Controller/Traits/BaseTraitTest.php
+++ b/tests/TestCase/Controller/Traits/BaseTraitTest.php
@@ -185,4 +185,21 @@ protected function _mockDispatchEvent(Event $event = null)
->method('dispatchEvent')
->will($this->returnValue($event));
}
+
+ /**
+ * Config email
+ *
+ * @return void
+ */
+ protected function _configEmail()
+ {
+ \Cake\Mailer\Email::configTransport('default', [
+ 'className' => 'Debug'
+ ]);
+ \Cake\Mailer\Email::config('default', [
+ 'transport' => 'default',
+ 'from' => 'test@test.com',
+ 'log' => true
+ ]);
+ }
}
From bf2564edd92b805d54d52aae9c299982b24ef395 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 22 Mar 2016 14:49:40 -0300
Subject: [PATCH 10/24] Refs #306 improving test coverage
---
.../Controller/Traits/PasswordManagementTraitTest.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
index a90a86c9e..564bcda66 100644
--- a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
+++ b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
@@ -142,20 +142,21 @@ public function testRequestResetPasswordGet()
*/
public function testRequestPasswordHappy()
{
- $this->assertEquals('ae93ddbe32664ce7927cf0c5c5a5e59d', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
+ $this->assertEquals('6614f65816754310a5f0553436dd89e9', $this->table->get('00000000-0000-0000-0000-000000000002')->token);
$this->_mockRequestPost();
$this->_mockAuthLoggedIn();
$this->_mockFlash();
- $reference = 'user-1';
+ $this->_configEmail();
+ $reference = 'user-2';
$this->Trait->request->expects($this->once())
->method('data')
->with('reference')
->will($this->returnValue($reference));
$this->Trait->Flash->expects($this->any())
->method('success')
- ->with('Password has been changed successfully');
+ ->with('Please check your email to continue with password reset process');
$this->Trait->requestResetPassword();
- $this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
+ $this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000002')->token);
}
/**
From 7347cddaf8f1b721beb47faefe4a1aff0db937b6 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 22 Mar 2016 15:08:24 -0300
Subject: [PATCH 11/24] Refs #306 removing email configuration and using the
existing one
---
.../Controller/Traits/BaseTraitTest.php | 17 -----------------
.../Traits/PasswordManagementTraitTest.php | 2 +-
2 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/tests/TestCase/Controller/Traits/BaseTraitTest.php b/tests/TestCase/Controller/Traits/BaseTraitTest.php
index 6f6abf63d..131d58aa5 100644
--- a/tests/TestCase/Controller/Traits/BaseTraitTest.php
+++ b/tests/TestCase/Controller/Traits/BaseTraitTest.php
@@ -185,21 +185,4 @@ protected function _mockDispatchEvent(Event $event = null)
->method('dispatchEvent')
->will($this->returnValue($event));
}
-
- /**
- * Config email
- *
- * @return void
- */
- protected function _configEmail()
- {
- \Cake\Mailer\Email::configTransport('default', [
- 'className' => 'Debug'
- ]);
- \Cake\Mailer\Email::config('default', [
- 'transport' => 'default',
- 'from' => 'test@test.com',
- 'log' => true
- ]);
- }
}
diff --git a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
index 564bcda66..dbcad9d41 100644
--- a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
+++ b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
@@ -27,6 +27,7 @@ public function setUp()
{
$this->traitClassName = 'CakeDC\Users\Controller\Traits\PasswordManagementTrait';
$this->traitMockMethods = ['set', 'redirect', 'validate'];
+ $this->mockDefaultEmail = true;
parent::setUp();
}
@@ -146,7 +147,6 @@ public function testRequestPasswordHappy()
$this->_mockRequestPost();
$this->_mockAuthLoggedIn();
$this->_mockFlash();
- $this->_configEmail();
$reference = 'user-2';
$this->Trait->request->expects($this->once())
->method('data')
From fb1b1ac925a1594b0df2d5225b95fd863ded9e31 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 22 Mar 2016 16:05:30 -0300
Subject: [PATCH 12/24] Refs #306 improving PasswordManagementTraitTest
coverage
---
src/Model/Behavior/PasswordBehavior.php | 11 ++-
.../Controller/Traits/BaseTraitTest.php | 6 +-
.../Traits/PasswordManagementTraitTest.php | 87 +++++++++++++++++++
3 files changed, 98 insertions(+), 6 deletions(-)
diff --git a/src/Model/Behavior/PasswordBehavior.php b/src/Model/Behavior/PasswordBehavior.php
index 6eccdd182..0169fabdf 100644
--- a/src/Model/Behavior/PasswordBehavior.php
+++ b/src/Model/Behavior/PasswordBehavior.php
@@ -18,6 +18,7 @@
use CakeDC\Users\Exception\WrongPasswordException;
use CakeDC\Users\Model\Behavior\Behavior;
use Cake\Datasource\EntityInterface;
+use Cake\Datasource\Exception\RecordNotFoundException;
use Cake\Mailer\Email;
use Cake\Utility\Hash;
use InvalidArgumentException;
@@ -106,9 +107,13 @@ protected function _getUser($reference)
*/
public function changePassword(EntityInterface $user)
{
- $currentUser = $this->_table->get($user->id, [
- 'contain' => []
- ]);
+ try {
+ $currentUser = $this->_table->get($user->id, [
+ 'contain' => []
+ ]);
+ } catch (RecordNotFoundException $e) {
+ throw new UserNotFoundException(__d('Users', "User not found"));
+ }
if (!empty($user->current_password)) {
if (!$user->checkPassword($user->current_password, $currentUser->password)) {
diff --git a/tests/TestCase/Controller/Traits/BaseTraitTest.php b/tests/TestCase/Controller/Traits/BaseTraitTest.php
index 131d58aa5..807c2652b 100644
--- a/tests/TestCase/Controller/Traits/BaseTraitTest.php
+++ b/tests/TestCase/Controller/Traits/BaseTraitTest.php
@@ -138,13 +138,13 @@ protected function _mockRequestPost($with = 'post')
*
* @return void
*/
- protected function _mockAuthLoggedIn()
+ protected function _mockAuthLoggedIn($user = array())
{
$this->Trait->Auth = $this->getMockBuilder('Cake\Controller\Component\AuthComponent')
->setMethods(['user', 'identify', 'setUser', 'redirectUrl'])
->disableOriginalConstructor()
->getMock();
- $user = [
+ $user += [
'id' => '00000000-0000-0000-0000-000000000001',
'password' => '12345',
];
@@ -154,7 +154,7 @@ protected function _mockAuthLoggedIn()
$this->Trait->Auth->expects($this->any())
->method('user')
->with('id')
- ->will($this->returnValue('00000000-0000-0000-0000-000000000001'));
+ ->will($this->returnValue($user['id']));
}
/**
diff --git a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
index dbcad9d41..0eb22ed74 100644
--- a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
+++ b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
@@ -69,6 +69,51 @@ public function testChangePasswordHappy()
$this->assertTrue($hasher->check('new', $this->table->get('00000000-0000-0000-0000-000000000001')->password));
}
+ /**
+ * test
+ *
+ * @return void
+ */
+ public function testChangePasswordWithError()
+ {
+ $this->assertEquals('12345', $this->table->get('00000000-0000-0000-0000-000000000001')->password);
+ $this->_mockRequestPost();
+ $this->_mockAuthLoggedIn();
+ $this->_mockFlash();
+ $this->Trait->request->expects($this->once())
+ ->method('data')
+ ->will($this->returnValue([
+ 'password' => 'new',
+ 'password_confirm' => 'wrong_new',
+ ]));
+ $this->Trait->Flash->expects($this->once())
+ ->method('error')
+ ->with('Password could not be changed');
+ $this->Trait->changePassword();
+ }
+
+ /**
+ * test
+ *
+ * @return void
+ */
+ public function testChangePasswordWithInvalidUser()
+ {
+ $this->_mockRequestPost();
+ $this->_mockAuthLoggedIn(['id' => 'invalid-id', 'password' => 'invalid-pass']);
+ $this->_mockFlash();
+ $this->Trait->request->expects($this->once())
+ ->method('data')
+ ->will($this->returnValue([
+ 'password' => 'new',
+ 'password_confirm' => 'new',
+ ]));
+ $this->Trait->Flash->expects($this->once())
+ ->method('error')
+ ->with('User was not found');
+ $this->Trait->changePassword();
+ }
+
/**
* test
*
@@ -159,6 +204,48 @@ public function testRequestPasswordHappy()
$this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000002')->token);
}
+ /**
+ * test
+ *
+ * @return void
+ */
+ public function testRequestPasswordInvalidUser()
+ {
+ $this->_mockRequestPost();
+ $this->_mockAuthLoggedIn(['id' => 'invalid-id', 'password' => 'invalid-pass']);
+ $this->_mockFlash();
+ $reference = 'invalid-id';
+ $this->Trait->request->expects($this->once())
+ ->method('data')
+ ->with('reference')
+ ->will($this->returnValue($reference));
+ $this->Trait->Flash->expects($this->any())
+ ->method('error')
+ ->with('User invalid-id was not found');
+ $this->Trait->requestResetPassword();
+ }
+
+ /**
+ * test
+ *
+ * @return void
+ */
+ public function testRequestPasswordEmptyReference()
+ {
+ $this->_mockRequestPost();
+ $this->_mockAuthLoggedIn(['id' => 'invalid-id', 'password' => 'invalid-pass']);
+ $this->_mockFlash();
+ $reference = '';
+ $this->Trait->request->expects($this->once())
+ ->method('data')
+ ->with('reference')
+ ->will($this->returnValue($reference));
+ $this->Trait->Flash->expects($this->any())
+ ->method('error')
+ ->with('Token could not be reset');
+ $this->Trait->requestResetPassword();
+ }
+
/**
* test requestResetPassword
*
From 51c5a2f30f86aa70d397a8748b0624fe47314245 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Thu, 24 Mar 2016 13:40:41 -0300
Subject: [PATCH 13/24] Refs #306 fixing phpcs issue
---
tests/TestCase/Controller/Traits/BaseTraitTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/TestCase/Controller/Traits/BaseTraitTest.php b/tests/TestCase/Controller/Traits/BaseTraitTest.php
index 807c2652b..e386973dd 100644
--- a/tests/TestCase/Controller/Traits/BaseTraitTest.php
+++ b/tests/TestCase/Controller/Traits/BaseTraitTest.php
@@ -138,7 +138,7 @@ protected function _mockRequestPost($with = 'post')
*
* @return void
*/
- protected function _mockAuthLoggedIn($user = array())
+ protected function _mockAuthLoggedIn($user = [])
{
$this->Trait->Auth = $this->getMockBuilder('Cake\Controller\Component\AuthComponent')
->setMethods(['user', 'identify', 'setUser', 'redirectUrl'])
From 97515bd4e6a4f3e2976d9e43c56206cc06356b23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?=
Date: Sun, 27 Mar 2016 18:28:11 +0100
Subject: [PATCH 14/24] refactor login() to use redirectUrl instead of referrer
---
src/Controller/Traits/LoginTrait.php | 12 ++++++------
tests/TestCase/Controller/Traits/LoginTraitTest.php | 6 +++++-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/Controller/Traits/LoginTrait.php b/src/Controller/Traits/LoginTrait.php
index 5c8eee0c8..cd851226d 100644
--- a/src/Controller/Traits/LoginTrait.php
+++ b/src/Controller/Traits/LoginTrait.php
@@ -152,17 +152,17 @@ public function login()
$socialLogin = $this->_isSocialLogin();
+ if ($this->request->is('post')) {
+ $user = $this->Auth->identify();
+ return $this->_afterIdentifyUser($user, $socialLogin);
+ }
if (!$this->request->is('post') && !$socialLogin) {
if ($this->Auth->user()) {
$msg = __d('Users', 'You are already logged in');
$this->Flash->error($msg);
- return $this->redirect($this->referer());
+ $url = $this->Auth->redirectUrl();
+ return $this->redirect($url);
}
- return;
- }
- if ($this->request->is('post')) {
- $user = $this->Auth->identify();
- return $this->_afterIdentifyUser($user, $socialLogin);
}
}
diff --git a/tests/TestCase/Controller/Traits/LoginTraitTest.php b/tests/TestCase/Controller/Traits/LoginTraitTest.php
index e60b6db8d..254d50f87 100644
--- a/tests/TestCase/Controller/Traits/LoginTraitTest.php
+++ b/tests/TestCase/Controller/Traits/LoginTraitTest.php
@@ -230,7 +230,11 @@ public function testLoginGet()
->setMethods(['is'])
->disableOriginalConstructor()
->getMock();
- $this->Trait->request->expects($this->once())
+ $this->Trait->request->expects($this->at(0))
+ ->method('is')
+ ->with('post')
+ ->will($this->returnValue(false));
+ $this->Trait->request->expects($this->at(1))
->method('is')
->with('post')
->will($this->returnValue(false));
From 6d304cc2a44fdaabfa3529f55e1faf002e06bd53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?=
Date: Sun, 27 Mar 2016 18:34:39 +0100
Subject: [PATCH 15/24] improve time based tests
---
tests/TestCase/Model/Entity/UserTest.php | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/tests/TestCase/Model/Entity/UserTest.php b/tests/TestCase/Model/Entity/UserTest.php
index d7028a87c..6c264460f 100644
--- a/tests/TestCase/Model/Entity/UserTest.php
+++ b/tests/TestCase/Model/Entity/UserTest.php
@@ -175,9 +175,7 @@ public function testUpdateTokenAdd()
$this->assertNull($this->User['token']);
$this->assertNull($this->User['token_expires']);
$this->User->updateToken(20);
- $nowModified = new Time('now');
- $nowModified->addSecond(20);
- $this->assertEquals($nowModified, $this->User['token_expires']);
+ $this->assertEquals('20 seconds', $this->User['token_expires']->diffForHumans($this->now));
$this->assertNotNull($this->User['token']);
}
@@ -191,9 +189,7 @@ public function testUpdateTokenExistingAdd()
$this->User['token'] = 'aaa';
$this->User['token_expires'] = $this->now;
$this->User->updateToken(20);
- $nowModified = new Time('now');
- $nowModified->addSecond(20);
- $this->assertEquals($nowModified, $this->User['token_expires']);
+ $this->assertEquals('20 seconds', $this->User['token_expires']->diffForHumans($this->now));
$this->assertNotEquals('aaa', $this->User['token']);
}
}
From 141e61001d87f7efc068760fd06cf65aa545ce3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?=
Date: Sun, 27 Mar 2016 18:49:53 +0100
Subject: [PATCH 16/24] fix tests
---
tests/TestCase/Controller/Traits/BaseTraitTest.php | 4 ++--
tests/TestCase/Model/Entity/UserTest.php | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/TestCase/Controller/Traits/BaseTraitTest.php b/tests/TestCase/Controller/Traits/BaseTraitTest.php
index 131d58aa5..f02c2edb5 100644
--- a/tests/TestCase/Controller/Traits/BaseTraitTest.php
+++ b/tests/TestCase/Controller/Traits/BaseTraitTest.php
@@ -95,7 +95,7 @@ public function tearDown()
protected function _mockRequestGet()
{
$this->Trait->request = $this->getMockBuilder('Cake\Network\Request')
- ->setMethods(['is', 'referer'])
+ ->setMethods(['is', 'referer', 'data'])
->getMock();
$this->Trait->request->expects($this->any())
->method('is')
@@ -125,7 +125,7 @@ protected function _mockFlash()
protected function _mockRequestPost($with = 'post')
{
$this->Trait->request = $this->getMockBuilder('Cake\Network\Request')
- ->setMethods(['is', 'data'])
+ ->setMethods(['is', 'data', 'allow'])
->getMock();
$this->Trait->request->expects($this->any())
->method('is')
diff --git a/tests/TestCase/Model/Entity/UserTest.php b/tests/TestCase/Model/Entity/UserTest.php
index 6c264460f..51894aa2e 100644
--- a/tests/TestCase/Model/Entity/UserTest.php
+++ b/tests/TestCase/Model/Entity/UserTest.php
@@ -175,7 +175,7 @@ public function testUpdateTokenAdd()
$this->assertNull($this->User['token']);
$this->assertNull($this->User['token_expires']);
$this->User->updateToken(20);
- $this->assertEquals('20 seconds', $this->User['token_expires']->diffForHumans($this->now));
+ $this->assertEquals('20 seconds after', $this->User['token_expires']->diffForHumans($this->now));
$this->assertNotNull($this->User['token']);
}
@@ -189,7 +189,7 @@ public function testUpdateTokenExistingAdd()
$this->User['token'] = 'aaa';
$this->User['token_expires'] = $this->now;
$this->User->updateToken(20);
- $this->assertEquals('20 seconds', $this->User['token_expires']->diffForHumans($this->now));
+ $this->assertEquals('20 seconds after', $this->User['token_expires']->diffForHumans($this->now));
$this->assertNotEquals('aaa', $this->User['token']);
}
}
From 65b9488843cbd4f15f791f09a8f6d21e0654e783 Mon Sep 17 00:00:00 2001
From: Pedro Fernandes Steimbruch
Date: Tue, 29 Mar 2016 11:19:13 -0300
Subject: [PATCH 17/24] Refs #306 fixing tests on pgsql
---
.../Controller/Traits/PasswordManagementTraitTest.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
index 0eb22ed74..bbd83d76c 100644
--- a/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
+++ b/tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php
@@ -100,7 +100,7 @@ public function testChangePasswordWithError()
public function testChangePasswordWithInvalidUser()
{
$this->_mockRequestPost();
- $this->_mockAuthLoggedIn(['id' => 'invalid-id', 'password' => 'invalid-pass']);
+ $this->_mockAuthLoggedIn(['id' => '12312312-0000-0000-0000-000000000002', 'password' => 'invalid-pass']);
$this->_mockFlash();
$this->Trait->request->expects($this->once())
->method('data')
@@ -214,14 +214,14 @@ public function testRequestPasswordInvalidUser()
$this->_mockRequestPost();
$this->_mockAuthLoggedIn(['id' => 'invalid-id', 'password' => 'invalid-pass']);
$this->_mockFlash();
- $reference = 'invalid-id';
+ $reference = '12312312-0000-0000-0000-000000000002';
$this->Trait->request->expects($this->once())
->method('data')
->with('reference')
->will($this->returnValue($reference));
$this->Trait->Flash->expects($this->any())
->method('error')
- ->with('User invalid-id was not found');
+ ->with('User 12312312-0000-0000-0000-000000000002 was not found');
$this->Trait->requestResetPassword();
}
From 2dde941aad1cd2448fb002d786e8ec287474ecc1 Mon Sep 17 00:00:00 2001
From: Alejandro Ibarra
Date: Sun, 3 Apr 2016 16:26:16 -0500
Subject: [PATCH 18/24] Get large avatar from facebook. Improve profile message
to consider username too.
---
src/Auth/Social/Mapper/Facebook.php | 2 +-
src/View/Helper/UserHelper.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Auth/Social/Mapper/Facebook.php b/src/Auth/Social/Mapper/Facebook.php
index 0a2193984..95f3c52c3 100644
--- a/src/Auth/Social/Mapper/Facebook.php
+++ b/src/Auth/Social/Mapper/Facebook.php
@@ -39,6 +39,6 @@ class Facebook extends AbstractMapper
*/
protected function _avatar()
{
- return self::FB_GRAPH_BASE_URL . Hash::get($this->_rawData, 'id') . '/picture?type=normal';
+ return self::FB_GRAPH_BASE_URL . Hash::get($this->_rawData, 'id') . '/picture?type=large';
}
}
diff --git a/src/View/Helper/UserHelper.php b/src/View/Helper/UserHelper.php
index fe4511716..977dab1c2 100644
--- a/src/View/Helper/UserHelper.php
+++ b/src/View/Helper/UserHelper.php
@@ -149,7 +149,7 @@ public function welcome()
}
$profileUrl = Configure::read('Users.Profile.route');
- $label = __d('Users', 'Welcome, {0}', $this->Html->link($this->request->session()->read('Auth.User.first_name'), $profileUrl));
+ $label = __d('Users', 'Welcome, {0}', $this->Html->link($this->request->session()->read('Auth.User.first_name') ?: $this->request->session()->read('Auth.User.username'), $profileUrl));
return $this->Html->tag('span', $label, ['class' => 'welcome']);
}
From 51b6b4962fbe2317dd6b21fa6387e6ba92e02a90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?=
Date: Sun, 10 Apr 2016 02:48:14 +0100
Subject: [PATCH 19/24] refs #351 improve reCaptcha, add documentation and some
cleanup
---
Docs/Documentation/Configuration.md | 10 +++++
Docs/Documentation/Installation.md | 11 ++++-
Docs/Documentation/Overview.md | 2 +-
Docs/Documentation/UserHelper.md | 8 ++--
config/users.php | 10 +++++
src/Auth/SocialAuthenticate.php | 7 +++-
src/Controller/Traits/LoginTrait.php | 21 ++++++++++
src/Controller/Traits/ReCaptchaTrait.php | 13 +++---
src/Controller/Traits/RegisterTrait.php | 11 ++---
src/Controller/UsersController.php | 2 +
src/Template/Users/login.ctp | 5 ++-
src/Template/Users/register.ctp | 4 +-
src/Template/Users/social_email.ctp | 1 -
src/View/Helper/UserHelper.php | 23 ++---------
.../Controller/Traits/RegisterTraitTest.php | 41 ++++++++++++++++++-
tests/TestCase/View/Helper/UserHelperTest.php | 10 ++---
16 files changed, 125 insertions(+), 54 deletions(-)
diff --git a/Docs/Documentation/Configuration.md b/Docs/Documentation/Configuration.md
index c4744b6c6..9307be00f 100644
--- a/Docs/Documentation/Configuration.md
+++ b/Docs/Documentation/Configuration.md
@@ -38,6 +38,16 @@ Configure::write('OAuth.providers.twitter.options.clientSecret', 'YOUR APP SECRE
Or use the config override option when loading the plugin (see above)
+Configuration for reCaptcha
+---------------------
+```
+Configure::write('Users.reCaptcha.key', 'YOUR RECAPTCHA KEY');
+Configure::write('Users.reCaptcha.secret', 'YOUR RECAPTCHA SECRET');
+Configure::write('Users.reCaptcha.registration', true); //enable on registration
+Configure::write('Users.reCaptcha.login', true); //enable on login
+```
+
+
Configuration options
---------------------
diff --git a/Docs/Documentation/Installation.md b/Docs/Documentation/Installation.md
index d90929a46..02a6c5f7c 100644
--- a/Docs/Documentation/Installation.md
+++ b/Docs/Documentation/Installation.md
@@ -8,7 +8,7 @@ Composer
composer require cakedc/users
```
-if you want to use social login features...
+If you want to use social login features...
```
composer require league/oauth2-facebook:@stable
@@ -25,6 +25,15 @@ login is disabled by default. Check the [Configuration](Configuration.md) page f
Configure::write('Users.Social.login', true); //to enable social login
```
+If you want to use reCaptcha features...
+
+```
+composer require google/recaptcha:@stable
+```
+
+NOTE: you'll need to configure the reCaptcha key and secret, check the [Configuration](Configuration.md)
+page for more details.
+
Creating Required Tables
------------------------
If you want to use the Users tables to store your users and social accounts:
diff --git a/Docs/Documentation/Overview.md b/Docs/Documentation/Overview.md
index 0e98fc30e..4e2e392ba 100644
--- a/Docs/Documentation/Overview.md
+++ b/Docs/Documentation/Overview.md
@@ -14,5 +14,5 @@ The plugin itself is already capable of:
* Simple roles management
* Simple Rbac and SuperUser Authorize
* RememberMe using cookie feature
-* reCaptcha for user registration
+* reCaptcha for user registration and login
diff --git a/Docs/Documentation/UserHelper.md b/Docs/Documentation/UserHelper.md
index 3d36e41df..2191f4c1f 100644
--- a/Docs/Documentation/UserHelper.md
+++ b/Docs/Documentation/UserHelper.md
@@ -57,12 +57,10 @@ It displays a welcome message for the user including the name and a link to the
$this->User->welcome();
```
-reCAPTCHA
+reCaptcha
-----------------
-If you have configured reCAPTCHA for registration and have the proper key/secret configured then you will see the reCAPTCHA in registration page automatically.
-
-You could also use it in another templates with the following methods:
+Handles the reCaptcha input display:
```php
$this->User->addReCaptchaScript();
@@ -70,4 +68,4 @@ $this->User->addReCaptchaScript();
$this->User->addReCaptcha();
```
-Note that the script is added automatically if the feature is enabled in config.
+Note reCaptcha script is added to script block when `addReCaptcha` method is called.
diff --git a/config/users.php b/config/users.php
index d297a207f..59a239ce8 100644
--- a/config/users.php
+++ b/config/users.php
@@ -34,6 +34,16 @@
//determines if the reCaptcha is enabled for registration
'reCaptcha' => true,
],
+ 'reCaptcha' => [
+ //reCaptcha key goes here
+ 'key' => null,
+ //reCaptcha secret
+ 'secret' => null,
+ //use reCaptcha in registration
+ 'registration' => false,
+ //use reCaptcha in login, valid values are false, true
+ 'login' => false,
+ ],
'Tos' => [
//determines if the user should include tos accepted
'required' => true,
diff --git a/src/Auth/SocialAuthenticate.php b/src/Auth/SocialAuthenticate.php
index a18c7e5e9..26cc411ed 100755
--- a/src/Auth/SocialAuthenticate.php
+++ b/src/Auth/SocialAuthenticate.php
@@ -354,7 +354,12 @@ public function getUser(Request $request)
}
$provider = $this->_getProviderName($request);
- $user = $this->_mapUser($provider, $rawData);
+ try {
+ $user = $this->_mapUser($provider, $rawData);
+ } catch (MissingProviderException $ex) {
+ $request->session()->delete(Configure::read('Users.Key.Session.social'));
+ throw $ex;
+ }
if ($user['provider'] === SocialAccountsTable::PROVIDER_TWITTER) {
$request->session()->write(Configure::read('Users.Key.Session.social'), $user);
}
diff --git a/src/Controller/Traits/LoginTrait.php b/src/Controller/Traits/LoginTrait.php
index cd851226d..9d9e0a19b 100644
--- a/src/Controller/Traits/LoginTrait.php
+++ b/src/Controller/Traits/LoginTrait.php
@@ -153,6 +153,10 @@ public function login()
$socialLogin = $this->_isSocialLogin();
if ($this->request->is('post')) {
+ if (!$this->_checkReCaptcha()) {
+ $this->Flash->error(__d('Users', 'Invalid reCaptcha'));
+ return;
+ }
$user = $this->Auth->identify();
return $this->_afterIdentifyUser($user, $socialLogin);
}
@@ -166,6 +170,23 @@ public function login()
}
}
+ /**
+ * Check reCaptcha if enabled for login
+ *
+ * @return bool
+ */
+ protected function _checkReCaptcha()
+ {
+ if (!Configure::read('Users.reCaptcha.login')) {
+ return true;
+ }
+
+ return $this->validateReCaptcha(
+ $this->request->data('g-recaptcha-response'),
+ $this->request->clientIp()
+ );
+ }
+
/**
* Update remember me and determine redirect url after user identified
* @param array $user user data after identified
diff --git a/src/Controller/Traits/ReCaptchaTrait.php b/src/Controller/Traits/ReCaptchaTrait.php
index 825e410f8..44359a202 100644
--- a/src/Controller/Traits/ReCaptchaTrait.php
+++ b/src/Controller/Traits/ReCaptchaTrait.php
@@ -12,7 +12,6 @@
namespace CakeDC\Users\Controller\Traits;
use Cake\Core\Configure;
-use ReCaptcha\ReCaptcha;
/**
* Covers registration features and email token validation
@@ -30,13 +29,12 @@ trait ReCaptchaTrait
*/
public function validateReCaptcha($recaptchaResponse, $clientIp)
{
- $validReCaptcha = true;
$recaptcha = $this->_getReCaptchaInstance();
if (!empty($recaptcha)) {
$response = $recaptcha->verify($recaptchaResponse, $clientIp);
- $validReCaptcha = $response->isSuccess();
+ return $response->isSuccess();
}
- return $validReCaptcha;
+ return false;
}
/**
@@ -46,10 +44,9 @@ public function validateReCaptcha($recaptchaResponse, $clientIp)
*/
protected function _getReCaptchaInstance()
{
- $useReCaptcha = (bool)Configure::read('Users.Registration.reCaptcha');
- $reCaptchaSecret = Configure::read('reCaptcha.secret');
- if ($useReCaptcha && !empty($reCaptchaSecret)) {
- return new ReCaptcha($reCaptchaSecret);
+ $reCaptchaSecret = Configure::read('Users.reCaptcha.secret');
+ if (!empty($reCaptchaSecret)) {
+ return new \ReCaptcha\ReCaptcha($reCaptchaSecret);
}
return null;
}
diff --git a/src/Controller/Traits/RegisterTrait.php b/src/Controller/Traits/RegisterTrait.php
index 822618cd9..1aa65882f 100644
--- a/src/Controller/Traits/RegisterTrait.php
+++ b/src/Controller/Traits/RegisterTrait.php
@@ -24,7 +24,6 @@
trait RegisterTrait
{
use PasswordManagementTrait;
- use ReCaptchaTrait;
/**
* Register a new user
@@ -70,9 +69,8 @@ public function register()
return;
}
- $validPost = $this->_validateRegisterPost();
- if (!$validPost) {
- $this->Flash->error(__d('Users', 'The reCaptcha could not be validated'));
+ if (!$this->_validateRegisterPost()) {
+ $this->Flash->error(__d('Users', 'Invalid reCaptcha'));
return;
}
@@ -92,14 +90,13 @@ public function register()
*/
protected function _validateRegisterPost()
{
- if (!Configure::read('Users.Registration.reCaptcha')) {
+ if (!Configure::read('Users.reCaptcha.registration')) {
return true;
}
- $validReCaptcha = $this->validateReCaptcha(
+ return $this->validateReCaptcha(
$this->request->data('g-recaptcha-response'),
$this->request->clientIp()
);
- return $validReCaptcha;
}
/**
diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php
index 45cd15827..72235a8fc 100644
--- a/src/Controller/UsersController.php
+++ b/src/Controller/UsersController.php
@@ -15,6 +15,7 @@
use CakeDC\Users\Controller\Component\UsersAuthComponent;
use CakeDC\Users\Controller\Traits\LoginTrait;
use CakeDC\Users\Controller\Traits\ProfileTrait;
+use CakeDC\Users\Controller\Traits\ReCaptchaTrait;
use CakeDC\Users\Controller\Traits\RegisterTrait;
use CakeDC\Users\Controller\Traits\SimpleCrudTrait;
use CakeDC\Users\Controller\Traits\SocialTrait;
@@ -31,6 +32,7 @@ class UsersController extends AppController
{
use LoginTrait;
use ProfileTrait;
+ use ReCaptchaTrait;
use RegisterTrait;
use SimpleCrudTrait;
use SocialTrait;
diff --git a/src/Template/Users/login.ctp b/src/Template/Users/login.ctp
index 1a0168514..24b791185 100644
--- a/src/Template/Users/login.ctp
+++ b/src/Template/Users/login.ctp
@@ -20,6 +20,9 @@ use Cake\Core\Configure;
= $this->Form->input('username', ['required' => true]) ?>
= $this->Form->input('password', ['required' => true]) ?>
User->addReCaptcha();
+ }
if (Configure::check('Users.RememberMe.active')) {
echo $this->Form->input(Configure::read('Users.Key.Data.rememberMe'), [
'type' => 'checkbox',
@@ -28,7 +31,6 @@ use Cake\Core\Configure;
]);
}
?>
-
Html->link(__d('users', 'Reset Password'), ['action' => 'requestResetPassword']);
}
?>
-
= implode(' ', $this->User->socialLoginList()); ?>
= $this->Form->button(__d('Users', 'Login')); ?>
diff --git a/src/Template/Users/register.ctp b/src/Template/Users/register.ctp
index f217de2f4..2c1467db3 100644
--- a/src/Template/Users/register.ctp
+++ b/src/Template/Users/register.ctp
@@ -24,7 +24,9 @@ use Cake\Core\Configure;
if (Configure::read('Users.Tos.required')) {
echo $this->Form->input('tos', ['type' => 'checkbox', 'label' => __d('Users', 'Accept TOS conditions?'), 'required' => true]);
}
- echo $this->User->addReCaptcha();
+ if (Configure::read('Users.reCaptcha.registration')) {
+ echo $this->User->addReCaptcha();
+ }
?>
= $this->Form->button(__d('Users', 'Submit')) ?>
diff --git a/src/Template/Users/social_email.ctp b/src/Template/Users/social_email.ctp
index 4ac0f9071..52cc6086e 100644
--- a/src/Template/Users/social_email.ctp
+++ b/src/Template/Users/social_email.ctp
@@ -16,7 +16,6 @@
= $this->Form->input('email') ?>
- = $this->User->addReCaptcha(); ?>
= $this->Form->button(__d('Users', 'Submit')); ?>
= $this->Form->end() ?>
diff --git a/src/View/Helper/UserHelper.php b/src/View/Helper/UserHelper.php
index fe4511716..049f053b4 100644
--- a/src/View/Helper/UserHelper.php
+++ b/src/View/Helper/UserHelper.php
@@ -33,19 +33,6 @@ class UserHelper extends Helper
*/
protected $_defaultConfig = [];
- /**
- * beforeLayout callback loads reCaptcha if enabled
- *
- * @param Event $event event
- * @return void
- */
- public function beforeLayout(Event $event)
- {
- if (Configure::read('Users.Registration.reCaptcha')) {
- $this->addReCaptchaScript();
- }
- }
-
/**
* Social login link
*
@@ -170,16 +157,14 @@ public function addReCaptchaScript()
*/
public function addReCaptcha()
{
- if (!Configure::read('Users.Registration.reCaptcha')) {
- return false;
- }
- if (!Configure::read('reCaptcha.key')) {
- return $this->Html->tag('p', __d('Users', 'reCaptcha is not configured! Please configure reCaptcha.key or set Users.Registration.reCaptcha to false'));
+ if (!Configure::read('Users.reCaptcha.key')) {
+ return $this->Html->tag('p', __d('Users', 'reCaptcha is not configured! Please configure Users.reCaptcha.key'));
}
+ $this->addReCaptchaScript();
$this->Form->unlockField('g-recaptcha-response');
return $this->Html->tag('div', '', [
'class' => 'g-recaptcha',
- 'data-sitekey' => Configure::read('reCaptcha.key')
+ 'data-sitekey' => Configure::read('Users.reCaptcha.key')
]);
}
}
diff --git a/tests/TestCase/Controller/Traits/RegisterTraitTest.php b/tests/TestCase/Controller/Traits/RegisterTraitTest.php
index 0ea8e721e..1454e212b 100644
--- a/tests/TestCase/Controller/Traits/RegisterTraitTest.php
+++ b/tests/TestCase/Controller/Traits/RegisterTraitTest.php
@@ -63,8 +63,40 @@ public function testValidateEmail()
*
* @return void
*/
- public function testRegisterHappy()
+ public function testRegister()
{
+ $this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
+ $this->_mockRequestPost();
+ $this->_mockAuth();
+ $this->_mockFlash();
+ $this->_mockDispatchEvent();
+ $this->Trait->Flash->expects($this->once())
+ ->method('success')
+ ->with('Please validate your account before log in');
+ $this->Trait->expects($this->once())
+ ->method('redirect')
+ ->with(['action' => 'login']);
+ $this->Trait->request->data = [
+ 'username' => 'testRegistration',
+ 'password' => 'password',
+ 'email' => 'test-registration@example.com',
+ 'password_confirm' => 'password',
+ 'tos' => 1
+ ];
+
+ $this->Trait->register();
+
+ $this->assertEquals(1, $this->table->find()->where(['username' => 'testRegistration'])->count());
+ }
+
+ /**
+ * test
+ *
+ * @return void
+ */
+ public function testRegisterReCaptcha()
+ {
+ Configure::write('Users.reCaptcha.registration', true);
$this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
$this->_mockRequestPost();
$this->_mockAuth();
@@ -90,6 +122,7 @@ public function testRegisterHappy()
$this->Trait->register();
$this->assertEquals(1, $this->table->find()->where(['username' => 'testRegistration'])->count());
+ Configure::write('Users.reCaptcha.registration', false);
}
/**
@@ -99,6 +132,7 @@ public function testRegisterHappy()
*/
public function testRegisterValidationErrors()
{
+ Configure::write('Users.reCaptcha.registration', true);
$this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
$this->_mockRequestPost();
$this->_mockAuth();
@@ -123,6 +157,7 @@ public function testRegisterValidationErrors()
$this->Trait->register();
$this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
+ Configure::write('Users.reCaptcha.registration', false);
}
/**
@@ -132,6 +167,7 @@ public function testRegisterValidationErrors()
*/
public function testRegisterRecaptchaNotValid()
{
+ Configure::write('Users.reCaptcha.registration', true);
$this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
$this->_mockRequestPost();
$this->_mockAuth();
@@ -139,7 +175,7 @@ public function testRegisterRecaptchaNotValid()
$this->_mockDispatchEvent();
$this->Trait->Flash->expects($this->once())
->method('error')
- ->with('The reCaptcha could not be validated');
+ ->with('Invalid reCaptcha');
$this->Trait->expects($this->once())
->method('validateRecaptcha')
->will($this->returnValue(false));
@@ -154,6 +190,7 @@ public function testRegisterRecaptchaNotValid()
$this->Trait->register();
$this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
+ Configure::write('Users.reCaptcha.registration', false);
}
/**
diff --git a/tests/TestCase/View/Helper/UserHelperTest.php b/tests/TestCase/View/Helper/UserHelperTest.php
index 6da81b94f..5e5038f70 100644
--- a/tests/TestCase/View/Helper/UserHelperTest.php
+++ b/tests/TestCase/View/Helper/UserHelperTest.php
@@ -206,11 +206,9 @@ public function testWelcomeNotLoggedInUser()
*/
public function testAddReCaptcha()
{
- $siteKey = Configure::read('reCaptcha.key');
- Configure::write('reCaptcha.key', 'testKey');
+ Configure::write('Users.reCaptcha.key', 'testKey');
$result = $this->User->addReCaptcha();
$this->assertEquals('', $result);
- Configure::write('reCaptcha.key', $siteKey);
}
/**
@@ -220,11 +218,11 @@ public function testAddReCaptcha()
*/
public function testAddReCaptchaEmpty()
{
- Configure::write('Users.Registration.reCaptcha', false);
$result = $this->User->addReCaptcha();
- $this->assertFalse($result);
+ $expected = 'reCaptcha is not configured! Please configure Users.reCaptcha.key
';
+ $this->assertEquals($expected, $result);
}
-
+
/**
* Test add ReCaptcha field
*
From 300d54157040ba1302d817708beed3327c520c61 Mon Sep 17 00:00:00 2001
From: Alejandro Ibarra
Date: Fri, 15 Apr 2016 08:17:24 -0500
Subject: [PATCH 20/24] Fix router initialization in config file. fixes #359
---
config/users.php | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/config/users.php b/config/users.php
index d297a207f..48496a0de 100644
--- a/config/users.php
+++ b/config/users.php
@@ -109,31 +109,31 @@
'className' => 'League\OAuth2\Client\Provider\Facebook',
'options' => [
'graphApiVersion' => 'v2.5',
- 'redirectUri' => Router::url('/auth/facebook', true)
+ 'redirectUri' => Router::fullBaseUrl() . '/auth/facebook',
]
],
'twitter' => [
'options' => [
- 'redirectUri' => Router::url('/auth/twitter', true)
+ 'redirectUri' => Router::fullBaseUrl() . '/auth/twitter',
]
],
'linkedIn' => [
'className' => 'League\OAuth2\Client\Provider\LinkedIn',
'options' => [
- 'redirectUri' => Router::url('/auth/linkedIn', true)
+ 'redirectUri' => Router::fullBaseUrl() . '/auth/linkedIn',
]
],
'instagram' => [
'className' => 'League\OAuth2\Client\Provider\Instagram',
'options' => [
- 'redirectUri' => Router::url('/auth/instagram', true)
+ 'redirectUri' => Router::fullBaseUrl() . '/auth/instagram',
]
],
'google' => [
'className' => 'League\OAuth2\Client\Provider\Google',
'options' => [
'userFields' => ['url', 'aboutMe'],
- 'redirectUri' => Router::url('/auth/google', true)
+ 'redirectUri' => Router::fullBaseUrl() . '/auth/google',
]
],
],
From 91796b6dba7d75aa4e97e7212c350c9ceb09b6bb Mon Sep 17 00:00:00 2001
From: Alejandro Ibarra
Date: Fri, 15 Apr 2016 08:25:37 -0500
Subject: [PATCH 21/24] Fix unit tests for facebook
---
tests/TestCase/Auth/SocialAuthenticateTest.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/TestCase/Auth/SocialAuthenticateTest.php b/tests/TestCase/Auth/SocialAuthenticateTest.php
index babfae221..80e40ab20 100644
--- a/tests/TestCase/Auth/SocialAuthenticateTest.php
+++ b/tests/TestCase/Auth/SocialAuthenticateTest.php
@@ -404,7 +404,7 @@ public function testMapUser($data, $mappedData)
$result = $mapUser->invoke($this->SocialAuthenticate, 'Facebook', $data);
unset($result['raw']);
- $this->assertEquals($result, $mappedData);
+ $this->assertEquals($mappedData, $result);
}
/**
@@ -432,7 +432,7 @@ public function providerMapper()
'first_name' => 'My first name',
'last_name' => 'My lastname.',
'email' => 'myemail@example.com',
- 'avatar' => 'https://graph.facebook.com/my-facebook-id/picture?type=normal',
+ 'avatar' => 'https://graph.facebook.com/my-facebook-id/picture?type=large',
'gender' => 'female',
'link' => 'https://www.facebook.com/app_scoped_user_id/my-facebook-id/',
'bio' => null,
From f42931d282c664d3ceb6668d923ddc51c2408537 Mon Sep 17 00:00:00 2001
From: Alejandro Ibarra
Date: Fri, 15 Apr 2016 08:35:51 -0500
Subject: [PATCH 22/24] Fix PHP CS issue
---
src/Model/Behavior/SocialBehavior.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/Model/Behavior/SocialBehavior.php b/src/Model/Behavior/SocialBehavior.php
index 48adafda4..319340c1f 100644
--- a/src/Model/Behavior/SocialBehavior.php
+++ b/src/Model/Behavior/SocialBehavior.php
@@ -68,7 +68,6 @@ public function socialLogin(array $data, array $options)
$existingAccount->$user
]);
}
-
} else {
throw new AccountNotActiveException([
$existingAccount->provider,
From f1402ef08c322c214d4c8e7790ebad195450e839 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rodrigo=20P=C3=A9rez?=
Date: Fri, 15 Apr 2016 17:53:30 +0100
Subject: [PATCH 23/24] refs #fix-translation-string fixed transaltion string
in pot file and spanish translation
---
src/Locale/Users.pot | 2 +-
src/Locale/es/Users.mo | Bin 9657 -> 9650 bytes
src/Locale/es/Users.po | 6 +++---
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Locale/Users.pot b/src/Locale/Users.pot
index 551c6cda2..3efabc9f5 100644
--- a/src/Locale/Users.pot
+++ b/src/Locale/Users.pot
@@ -243,7 +243,7 @@ msgid "Email not present"
msgstr ""
#: Model/Table/UsersTable.php:541
-msgid "{0}Your account validation link"
+msgid "Your account validation link"
msgstr ""
#: Model/Table/UsersTable.php:561
diff --git a/src/Locale/es/Users.mo b/src/Locale/es/Users.mo
index 3cdcb7eb72785aedd845f1caf735aa4e74cb9fdf..421ce4ba1bf00309b9e9566221553c1181222840 100644
GIT binary patch
delta 1173
zcmXZaT}YE*6u|MbmO8&?np0PrZ+=WGtdt`M1wkJd
z@j~4w5qVPtjs}6$MM6YD7*at&kT)SkQ8xv3)&ID6Fn-VXIp=wwg|0_ksX1q|QbguF
zA_s91*JE~>hzs*E2TO4?R-zAsc-A2@hH$cn0;{TgXpifn^C)cF8z#8%s5_IMaIfm4`;=THM)!VP#Gb^k27
zan75}EKD8y8SBeT`c2HzWti-jqqG8g+aZ>Oozo0eWy9_G1K3pay)2ZTJy6N-EfF
z;2zXC$CEU)!U@y^r%^Mzh^*vVG8x?^SI|i^q`(oi*?w9HQ0lLn7{#i
zkL}n@biL8!B#kXJW-)|Mu?hd#HZrLP_o4-Cgmy(y{dV8;u-2qd_aACpHVAX#jRLiWGdT-pCAU#eb04;$^WW
z7DWAoy{Li5uowk`o_#O2e
zPi?012HZzKWcN>_CU^t&{mDZbTImaWVhIiUKhTM8%GbA0g8f*7emsu`rcf(g#-sQX
zHPN>E%-iWiJ--{bV;|}#zKqsPPG|8H9sPA=kV)%zPS_E*`dqhjV~kDkPgs9lZyb_-
zmAjH(Zid5SiD=xIGDjmrW;`+$HAW-R5$m33$Z9B?EetgI_Zt3|{ehMpyZ!0qGN-%h
hP;}G`4;$lV%(S<~jLC!%P7FumruDXN+8VDv{2z0ji-!OJ
delta 1147
zcmXZaUr5tY6u|MbrfpW!wsOv9`AauTWiXXiCYnT$DEJT=jL2MzU}TeQldy0_)I-r9
z_yrLJNsM|a3I~B8^-vTNBtlS7QPfLGWe^cQM17CH-(Y<1pWi*_o_p^^&t%Voyfe2$
zMDpb#Mfern_yb+|2dnWP2C>>NQipAL(jjsHm(l-FA+iDI(1*T&NEL>03vS1?cmg&4
zb!4gB3P^5oVv>Q?47|pr_zlbO7nY#2QluU|sPmg~6?WL}vd0ghZr}(O<0;gH=Wr!n
zMqNLSrFf?@XMOmP0bMwSy3-ldioYX!kdiglhH6m9n^6Pxq9*9WCD@NCOrR!wfgSh`
z2_-=m8@LHI&z>9&tuTWca13>4XHie!Dr$l}YDM=jjs?`C_i)Z044}rT!w^QX2K#V7
z9>;z72Df31?0TZP5gO}gjAJ`K#t8nkZDdjd$59g|QLid(_s<}o$|Y>WyV!|e(7<{g
z5YI=tQP&M1&qT7wMssqJh91>~J@EwfB;KMv!cV9b&Ea}1Gpx#*u$%sF)DyXhTJZvs
zTdMe2H`a!Fg>lrx!`Oo7v6%ewh{g&Ao}w3L(ZJ7Ghebr~!bV)YDr~1ehI%4XsIUJy
zZp3-iIDuNL@&;_B-)Z+pQ8#!6_5I0x8d~YJJu!<0{h#PWFXii7D961R#wI+C1{Sav
zU!iWWHf+6_2x{CIQj2t80}h~G@dY$*xVpSqI{MpbA;acxSJH9JjJvOCJUPlgV=lO7
z93zG4l8?*HXXX7BiDYspo6Z;`iNVytL?$(qHU?Aa!)DNb+tU(>wi?Y%TcfeYXteOs
S?<_UvL!;*Vkk5>V\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -258,8 +258,8 @@ msgid "Email not present"
msgstr "No se encuentra el email"
#: Model/Table/UsersTable.php:541
-msgid "{0}Your account validation link"
-msgstr "{0} Enlace para validar su cuenta"
+msgid "Your account validation link"
+msgstr "Enlace para validar su cuenta"
#: Model/Table/UsersTable.php:561
msgid "{0}Your reset password link"
From 259a850db4186ca2a22cf93c987b808d69d25d28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jorge=20M=2E=20Gonz=C3=A1lez=20Mart=C3=ADn?=
Date: Mon, 18 Apr 2016 15:24:26 +0100
Subject: [PATCH 24/24] update version to 3.2.0
---
.semver | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.semver b/.semver
index 63e74f429..24895fae3 100644
--- a/.semver
+++ b/.semver
@@ -1,5 +1,5 @@
---
:major: 3
-:minor: 1
-:patch: 5
+:minor: 2
+:patch: 0
:special: ''