révision
e1e1aac37b
5 fichiers modifiés avec 7 ajouts et 5 suppressions
|
@ -181,7 +181,6 @@ func UserProfileFormHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// Post Registration controller, we do some check on the form here, the rest on user service
|
// Post Registration controller, we do some check on the form here, the rest on user service
|
||||||
func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
|
func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
// Check same Password
|
|
||||||
b := form.RegistrationForm{}
|
b := form.RegistrationForm{}
|
||||||
err := form.NewErrors()
|
err := form.NewErrors()
|
||||||
if !captcha.Authenticate(captcha.Extract(r)) {
|
if !captcha.Authenticate(captcha.Extract(r)) {
|
||||||
|
|
|
@ -116,6 +116,9 @@ func SetCookieHandler(w http.ResponseWriter, email string, pass string) (int, er
|
||||||
// RegisterHanderFromForm sets cookie from a RegistrationForm.
|
// RegisterHanderFromForm sets cookie from a RegistrationForm.
|
||||||
func RegisterHanderFromForm(w http.ResponseWriter, registrationForm formStruct.RegistrationForm) (int, error) {
|
func RegisterHanderFromForm(w http.ResponseWriter, registrationForm formStruct.RegistrationForm) (int, error) {
|
||||||
email := registrationForm.Email
|
email := registrationForm.Email
|
||||||
|
if email == "" {
|
||||||
|
email = registrationForm.Username
|
||||||
|
}
|
||||||
pass := registrationForm.Password
|
pass := registrationForm.Password
|
||||||
log.Debugf("RegisterHandler UserEmail : %s", email)
|
log.Debugf("RegisterHandler UserEmail : %s", email)
|
||||||
log.Debugf("RegisterHandler UserPassword : %s", pass)
|
log.Debugf("RegisterHandler UserPassword : %s", pass)
|
||||||
|
|
|
@ -49,7 +49,7 @@ func IsAgreed(termsAndConditions string) bool { // TODO: Inline function
|
||||||
// RegistrationForm is used when creating a user.
|
// RegistrationForm is used when creating a user.
|
||||||
type RegistrationForm struct {
|
type RegistrationForm struct {
|
||||||
Username string `form:"username" needed:"true" len_min:"3" len_max:"20"`
|
Username string `form:"username" needed:"true" len_min:"3" len_max:"20"`
|
||||||
Email string `form:"email" needed:"true"`
|
Email string `form:"email"`
|
||||||
Password string `form:"password" needed:"true" len_min:"6" len_max:"25" equalInput:"ConfirmPassword"`
|
Password string `form:"password" needed:"true" len_min:"6" len_max:"25" equalInput:"ConfirmPassword"`
|
||||||
ConfirmPassword string `form:"password_confirmation" omit:"true" needed:"true"`
|
ConfirmPassword string `form:"password_confirmation" omit:"true" needed:"true"`
|
||||||
CaptchaID string `form:"captchaID" omit:"true" needed:"true"`
|
CaptchaID string `form:"captchaID" omit:"true" needed:"true"`
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<form class="form-horizontal" role="form" method="POST">
|
<form class="form-horizontal" role="form" method="POST">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-lg-3 control-label">{{ T "email" }}:</label>
|
<label class="col-lg-3 control-label">{{ T "email_address" }}:</label>
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<input class="form-control" type="text" name="email" id="email" value="{{.Email}}">
|
<input class="form-control" type="text" name="email" id="email" value="{{.Email}}">
|
||||||
{{ range (index $.FormErrors "email")}}
|
{{ range (index $.FormErrors "email")}}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"signup_box_title",
|
"id":"signup_box_title",
|
||||||
"translation": "Registrier dich <small>Es ist kostenlos und wird immer so bleiben.</small>"
|
"translation": "Registriere dich <small>Es ist kostenlos und wird immer so bleiben.</small>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"username",
|
"id":"username",
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"sign_in_box_title",
|
"id":"sign_in_box_title",
|
||||||
"translation": "Bitte logge dich zuerst ein"
|
"translation": "Bitte logge dich ein"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"sign_in_title",
|
"id":"sign_in_title",
|
||||||
|
|
Référencer dans un nouveau ticket