Menu system conform / propagation CanAdmin

This commit is contained in:
Chris Mann 2023-07-24 11:05:05 +02:00
parent ffff54ed1e
commit 9bbbfbe91a
5 changed files with 24 additions and 8 deletions

View file

@ -43,6 +43,7 @@ type AdminUsersTplData struct {
UserNameAttr string
UserBaseDN string
Users EntryList
CanAdmin bool
}
func handleAdminActivateUsers(w http.ResponseWriter, r *http.Request) {
@ -153,6 +154,7 @@ type AdminGroupsTplData struct {
GroupNameAttr string
GroupBaseDN string
Groups EntryList
CanAdmin bool
}
func handleAdminGroups(w http.ResponseWriter, r *http.Request) {
@ -192,6 +194,7 @@ type AdminMailingTplData struct {
MailingNameAttr string
MailingBaseDN string
MailingLists EntryList
CanAdmin bool
}
func handleAdminMailing(w http.ResponseWriter, r *http.Request) {
@ -236,8 +239,9 @@ type AdminMailingListTplData struct {
PossibleNewMembers EntryList
AllowGuest bool
Error string
Success bool
Error string
Success bool
CanAdmin bool
}
func handleAdminMailingList(w http.ResponseWriter, r *http.Request) {
@ -451,8 +455,9 @@ type AdminLDAPTplData struct {
ListMemGro map[string]string
Error string
Success bool
Error string
Success bool
CanAdmin bool
}
type EntryName struct {
@ -926,7 +931,8 @@ type CreateData struct {
ObjectClass string
SN string
Error string
Error string
CanAdmin bool
}
func handleAdminCreate(w http.ResponseWriter, r *http.Request) {

View file

@ -7,9 +7,10 @@ package main
import "net/http"
type HomePageData struct {
Login *LoginStatus
BaseDN string
Org string
Login *LoginStatus
BaseDN string
Org string
CanAdmin bool
}
func handleHome(w http.ResponseWriter, r *http.Request) {

View file

@ -44,6 +44,7 @@ type PasswordFoundData struct {
Username string
Mail string
OtherMailbox string
CanAdmin bool
}
type PasswordLostData struct {
@ -52,6 +53,7 @@ type PasswordLostData struct {
Username string
Mail string
OtherMailbox string
CanAdmin bool
}
func openNewUserLdap(config *ConfigFile) (*ldap.Conn, error) {
@ -204,6 +206,7 @@ type NewAccountData struct {
ErrorMessage string
WarningMessage string
Success bool
CanAdmin bool
}
func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invitedBy string) bool {
@ -349,6 +352,7 @@ type SendCodeData struct {
CodeDisplay string
CodeSentTo string
WebBaseAddress string
CanAdmin bool
}
type CodeMailFields struct {
@ -357,6 +361,7 @@ type CodeMailFields struct {
Code string
InviteFrom string
WebBaseAddress string
CanAdmin bool
}
func handleInviteSendCode(w http.ResponseWriter, r *http.Request) {

View file

@ -221,6 +221,7 @@ type LoginFormData struct {
WrongPass bool
ErrorMessage string
Login bool
CanAdmin bool
}
func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo {

View file

@ -20,6 +20,7 @@ type ProfileTplData struct {
Surname string
Description string
Login *LoginStatus
CanAdmin bool
}
//ProfilePicture string
@ -38,6 +39,7 @@ func handleProfile(w http.ResponseWriter, r *http.Request) {
Login: login,
ErrorMessage: "",
Success: false,
CanAdmin: false,
}
data.Mail = login.UserEntry.GetAttributeValue("mail")
@ -127,6 +129,7 @@ type PasswdTplData struct {
TooShortError bool
NoMatchError bool
Success bool
CanAdmin bool
}
func handleFoundPassword(w http.ResponseWriter, r *http.Request) {