aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-14 18:57:25 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-14 19:11:16 +0100
commit768f2de9162bbf3fd0a1005554f3fd595818f1b3 (patch)
tree2dc1372e23cd78a7ccdfe4628f4962b864ec2a68 /main.go
parentad00d0623e87817370de2ee28fef955290afd897 (diff)
downloadguichet-768f2de9162bbf3fd0a1005554f3fd595818f1b3.tar.gz
guichet-768f2de9162bbf3fd0a1005554f3fd595818f1b3.zip
Mechanism to create new account
Diffstat (limited to 'main.go')
-rw-r--r--main.go20
1 files changed, 13 insertions, 7 deletions
diff --git a/main.go b/main.go
index 0a8e2da..379a889 100644
--- a/main.go
+++ b/main.go
@@ -23,11 +23,15 @@ type ConfigFile struct {
LdapServerAddr string `json:"ldap_server_addr"`
LdapTLS bool `json:"ldap_tls"`
- BaseDN string `json:"base_dn"`
- UserBaseDN string `json:"user_base_dn"`
- UserNameAttr string `json:"user_name_attr"`
- GroupBaseDN string `json:"group_base_dn"`
- GroupNameAttr string `json:"group_name_attr"`
+ BaseDN string `json:"base_dn"`
+ UserBaseDN string `json:"user_base_dn"`
+ UserNameAttr string `json:"user_name_attr"`
+ GroupBaseDN string `json:"group_base_dn"`
+ GroupNameAttr string `json:"group_name_attr"`
+ InvitationBaseDN string `json:"invitation_base_dn"`
+ InvitationNameAttr string `json:"invitation_name_attr"`
+ InvitedMailFormat string `json:"invited_mail_format"`
+ InvitedAutoGroups []string `json:"invited_auto_groups"`
AdminAccount string `json:"admin_account"`
GroupCanInvite string `json:"group_can_invite"`
@@ -111,6 +115,9 @@ func main() {
r.HandleFunc("/profile", handleProfile)
r.HandleFunc("/passwd", handlePasswd)
+ r.HandleFunc("/invite/new_account", handleInviteNewAccount)
+ r.HandleFunc("/invite/send_code", handleInviteSendCode)
+
r.HandleFunc("/admin/users", handleAdminUsers)
r.HandleFunc("/admin/groups", handleAdminGroups)
r.HandleFunc("/admin/ldap/{dn}", handleAdminLDAP)
@@ -290,8 +297,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
func handleLogout(w http.ResponseWriter, r *http.Request) {
session, err := store.Get(r, SESSION_NAME)
if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
+ session, _ = store.New(r, SESSION_NAME)
}
delete(session.Values, "login_username")