Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #142 from bakape/fix-getid-args

Fix captcha.GetID() args
Cette révision appartient à :
Eliot Whalan 2017-05-07 23:50:31 +10:00 révisé par GitHub
révision 6e33a2fe7f

Voir le fichier

@ -18,7 +18,7 @@ import (
func UserRegisterFormHandler(w http.ResponseWriter, r *http.Request) {
b := form.RegistrationForm{}
modelHelper.BindValueForm(&b, r)
b.CaptchaID = captcha.GetID(r.RemoteAddr)
b.CaptchaID = captcha.GetID()
languages.SetTranslation("en-us", viewRegisterTemplate)
htv := UserRegisterTemplateVariables{b, NewSearchForm(), Navigation{}, r.URL, mux.CurrentRoute(r)}
err := viewRegisterTemplate.ExecuteTemplate(w, "index.html", htv)
@ -53,9 +53,9 @@ func UserProfileFormHandler(w http.ResponseWriter, r *http.Request) {
func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
// Check same Password
if !captcha.Authenticate(captcha.Extract(r)) {
// TODO: Prettier passing of mistyoed captcha errors
http.Error(w, captcha.ErrInvalidCaptcha.Error(), 403)
return
// TODO: Prettier passing of mistyoed captcha errors
http.Error(w, captcha.ErrInvalidCaptcha.Error(), 403)
return
}
if (r.PostFormValue("password") == r.PostFormValue("password_confirm")) && (r.PostFormValue("password") != "") {
if (form.EmailValidation(r.PostFormValue("email"))) && (form.ValidateUsername(r.PostFormValue("username"))) {