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

View file

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

View file

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

View file

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

View file

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