Refactoring

This commit is contained in:
Chris Mann 2023-07-26 11:16:52 +02:00
parent ba3fd90b10
commit 971d30f927
3 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,7 @@ func get(user User, config *ConfigFile, ldapConn *ldap.Conn) (*User, error) {
"sn", "sn",
"mail", "mail",
"description", "description",
"carLicense",
}, },
nil) nil)
searchRes, err := ldapConn.Search(searchReq) searchRes, err := ldapConn.Search(searchReq)

View file

@ -220,7 +220,7 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi
data.Common.Success = false data.Common.Success = false
data.Common.ErrorMessage = err.Error() data.Common.ErrorMessage = err.Error()
} }
http.Redirect(w, r, "/admin/activate", http.StatusFound) http.Redirect(w, r, "/user/wait", http.StatusFound)
} }
// tryCreateAccount(l, data, password1, password2, invitedBy) // tryCreateAccount(l, data, password1, password2, invitedBy)

View file

@ -11,7 +11,12 @@ import (
func handleUserWait(w http.ResponseWriter, r *http.Request) { func handleUserWait(w http.ResponseWriter, r *http.Request) {
templateProfile := getTemplate("user/wait.html") templateProfile := getTemplate("user/wait.html")
templateProfile.Execute(w, nil) templateProfile.Execute(w, HomePageData{
Common: NestedCommonTplData{
CanAdmin: false,
LoggedIn: false,
},
})
} }
func handleUser(w http.ResponseWriter, r *http.Request) { func handleUser(w http.ResponseWriter, r *http.Request) {