Compare commits

..

4 Commits

Author SHA1 Message Date
57dc8aa2bb State in production 2023-07-18 16:09:10 +02:00
Chris Mann
684b62ad91 Personalisation pour lesgrandsvoisins 2023-07-18 15:59:46 +02:00
Chris Mann
75d524f1ab Personalisation pour lesgrandsvoisins 2023-07-18 15:48:02 +02:00
Chris Mann
7bee9941d3 Personalisation pour lesgrandsvoisins 2023-07-18 15:40:01 +02:00
5 changed files with 13 additions and 5 deletions

View File

@ -6,7 +6,6 @@ import (
"regexp"
"sort"
"strings"
"log"
"github.com/go-ldap/ldap/v3"
"github.com/gorilla/mux"

View File

@ -56,6 +56,8 @@ type ConfigFile struct {
S3SecretKey string `json:"s3_secret_key"`
S3Region string `json:"s3_region"`
S3Bucket string `json:"s3_bucket"`
Org string `json:"org"`
}
var configFlag = flag.String("config", "./config.json", "Configuration file path")
@ -80,6 +82,8 @@ func readConfig() ConfigFile {
InvitationNameAttr: "cn",
InvitedAutoGroups: []string{},
Org: "ResDigita",
}
_, err := os.Stat(*configFlag)
@ -321,6 +325,7 @@ func ldapOpen(w http.ResponseWriter) *ldap.Conn {
type HomePageData struct {
Login *LoginStatus
BaseDN string
Org string
}
func handleHome(w http.ResponseWriter, r *http.Request) {
@ -334,6 +339,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
data := &HomePageData{
Login: login,
BaseDN: config.BaseDN,
Org: config.Org,
}
templateHome.Execute(w, data)

View File

@ -3,8 +3,6 @@ package main
import (
"net/http"
"strings"
"log"
"fmt"
"github.com/go-ldap/ldap/v3"
)

View File

@ -16,8 +16,12 @@
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/profile">Modifier mon profil</a>
<a class="list-group-item list-group-item-action" href="/passwd">Modifier mon mot de passe</a>
<!--
<a class="list-group-item list-group-item-action" href="/directory">Annuaire</a>
</div>
-->
<a class="list-group-item list-group-item-action" href="/SOGo">Accéder à mes curriels, mon agenda et à mes contacts</a>
<a class="list-group-item list-group-item-action" href="https://www.lesgrandsvoisins.com/resdigita">Accéder au numérique des Grands Voisins .com</a>
</div>
</div>
</div>
<!--
@ -36,7 +40,7 @@
{{if .Login.CanInvite}}
<div class="card mt-3">
<div class="card-header">
Inviter des gens sur Deuxfleurs
Inviter des gens sur {{.Org}}
</div>
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/invite/send_code">Envoyer un code d'invitation</a>

View File

@ -11,6 +11,7 @@
<body>
<div class="container mb-4">
<h1>Guichet Les Grands Voisins</h1>
<ul></ul>
<hr />
{{template "body" .}}
</div>