Refactoring

This commit is contained in:
Chris Mann 2023-07-25 22:00:07 +02:00
parent d4900b3501
commit f585c02d2c
11 changed files with 36 additions and 36 deletions

View file

@ -87,7 +87,7 @@ func makeGVRouter() (*mux.Router, error) {
r.HandleFunc("/admin-users", handleAdminUsers) r.HandleFunc("/admin-users", handleAdminUsers)
r.HandleFunc("/admin-groups", handleAdminGroups) r.HandleFunc("/admin-groups", handleAdminGroups)
r.HandleFunc("/admin-mailing", handleAdminMailing) // r.HandleFunc("/admin-mailing", handleAdminMailing)
// r.HandleFunc("/admin/mailing/{id}", handleAdminMailingList) // r.HandleFunc("/admin/mailing/{id}", handleAdminMailingList)
r.HandleFunc("/admin-ldap/{dn}", handleAdminLDAP) r.HandleFunc("/admin-ldap/{dn}", handleAdminLDAP)
r.HandleFunc("/admin-create/{template}/{super_dn}", handleAdminCreate) r.HandleFunc("/admin-create/{template}/{super_dn}", handleAdminCreate)

View file

@ -19,12 +19,12 @@
{{range $user := $root.Users}} {{range $user := $root.Users}}
<tr> <tr>
<td> <td>
<a href="/admin/activate/{{ $user.GetAttributeValue "cn" }}"> <a href="/admin-activate/{{ $user.GetAttributeValue "cn" }}">
Activer Activer
</a> </a>
</td> </td>
<td> <td>
<a href="/admin/ldap/{{$user.DN}}">{{$user.GetAttributeValue "cn"}}</a> <a href="/admin-ldap/{{$user.DN}}">{{$user.GetAttributeValue "cn"}}</a>
</td> </td>
<td>{{$user.GetAttributeValue "mail"}}</td> <td>{{$user.GetAttributeValue "mail"}}</td>
<td>{{$user.GetAttributeValue "displayName"}}</td> <td>{{$user.GetAttributeValue "displayName"}}</td>

View file

@ -13,7 +13,7 @@
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
{{range .Path}} {{range .Path}}
<li class="breadcrumb-item"><a href="/admin/ldap/{{.DN}}">{{.Identifier}}</a></li> <li class="breadcrumb-item"><a href="/admin-ldap/{{.DN}}">{{.Identifier}}</a></li>
{{end}} {{end}}
<li class="breadcrumb-item active" aria-current="page">Nouvel objet</li> <li class="breadcrumb-item active" aria-current="page">Nouvel objet</li>
</ol> </ol>

View file

@ -8,12 +8,12 @@
<div class="d-flex"> <div class="d-flex">
<h2>Liste des groupes</h2> <h2>Liste des groupes</h2>
<a class="ml-auto btn btn-success" href="/admin/create/group/{{.GroupBaseDN}}">Nouveau groupe</a> <a class="ml-auto btn btn-success" href="/admin-create/group/{{.GroupBaseDN}}">Nouveau groupe</a>
</div> </div>
<div class="alert alert-warning mt-4"> <div class="alert alert-warning mt-4">
Les groupes servent uniquement à contrôler l'accès à différentes fonctionalités de Deuxfleurs. Les groupes servent uniquement à contrôler l'accès à différentes fonctionalités de Deuxfleurs.
Ce ne sont pas des <a href="/admin/mailing">mailing lists</a>. Ce ne sont pas des <a href="/admin-mailing">mailing lists</a>.
</div> </div>
<table class="table mt-4"> <table class="table mt-4">
@ -26,7 +26,7 @@
{{range $group := $root.Groups}} {{range $group := $root.Groups}}
<tr> <tr>
<td> <td>
<a href="/admin/ldap/{{$group.DN}}"> <a href="/admin-ldap/{{$group.DN}}">
{{$group.GetAttributeValue $root.GroupNameAttr}} {{$group.GetAttributeValue $root.GroupNameAttr}}
</a> </a>
</td> </td>

View file

@ -17,7 +17,7 @@
{{if .Active}} {{if .Active}}
<li class="breadcrumb-item active" aria-current="page">{{.Identifier}}</li> <li class="breadcrumb-item active" aria-current="page">{{.Identifier}}</li>
{{else}} {{else}}
<li class="breadcrumb-item"><a href="/admin/ldap/{{.DN}}">{{.Identifier}}</a></li> <li class="breadcrumb-item"><a href="/admin-ldap/{{.DN}}">{{.Identifier}}</a></li>
{{end}} {{end}}
{{end}} {{end}}
</ol> </ol>
@ -29,7 +29,7 @@
{{range .ChildrenOU}} {{range .ChildrenOU}}
<tr> <tr>
<td> <td>
<a href="/admin/ldap/{{.DN}}"> <a href="/admin-ldap/{{.DN}}">
🗀 {{.Identifier}} 🗀 {{.Identifier}}
</a> </a>
</td> </td>
@ -39,7 +39,7 @@
{{range .ChildrenOther}} {{range .ChildrenOther}}
<tr> <tr>
<td> <td>
<a href="/admin/ldap/{{.DN}}"> <a href="/admin-ldap/{{.DN}}">
{{.Identifier}} {{.Identifier}}
</a> </a>
</td> </td>
@ -51,10 +51,10 @@
{{if .CanAddChild}} {{if .CanAddChild}}
<div class="mt-2"> <div class="mt-2">
<a class="btn btn-sm btn-success" href="/admin/create/user/{{.DN}}">+utilisateur</a> <a class="btn btn-sm btn-success" href="/admin-create/user/{{.DN}}">+utilisateur</a>
<a class="ml-4 btn btn-sm btn-success" href="/admin/create/group/{{.DN}}">+groupe</a> <a class="ml-4 btn btn-sm btn-success" href="/admin-create/group/{{.DN}}">+groupe</a>
<a class="ml-4 btn btn-sm btn-success" href="/admin/create/ou/{{.DN}}">+ou</a> <a class="ml-4 btn btn-sm btn-success" href="/admin-create/ou/{{.DN}}">+ou</a>
<a class="ml-4 btn btn-sm btn-success" href="/admin/create/generic/{{.DN}}">+objet</a> <a class="ml-4 btn btn-sm btn-success" href="/admin-create/generic/{{.DN}}">+objet</a>
</div> </div>
<hr class="mt-4" /> <hr class="mt-4" />
{{end}} {{end}}
@ -108,7 +108,7 @@
<div class="col-md-9"> <div class="col-md-9">
{{range $value.Values}} {{range $value.Values}}
{{if eq $key "creatorsname" "modifiersname" }} {{if eq $key "creatorsname" "modifiersname" }}
<div><a href="/admin/ldap/{{.}}">{{.}}</a></div> <div><a href="/admin-ldap/{{.}}">{{.}}</a></div>
{{else}} {{else}}
<div>{{.}}</div> <div>{{.}}</div>
{{end}} {{end}}
@ -145,7 +145,7 @@
<strong>{{.Name}}</strong> <strong>{{.Name}}</strong>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<a href="/admin/ldap/{{.DN}}">{{.DN}}</a> <a href="/admin-ldap/{{.DN}}">{{.DN}}</a>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<form method="POST" onsubmit="return confirm('Supprimer du groupe ?');"> <form method="POST" onsubmit="return confirm('Supprimer du groupe ?');">
@ -187,7 +187,7 @@
<strong>{{.Name}}</strong> <strong>{{.Name}}</strong>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<a href="/admin/ldap/{{.DN}}">{{.DN}}</a> <a href="/admin-ldap/{{.DN}}">{{.DN}}</a>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<form method="POST" onsubmit="return confirm('Supprimer du groupe ?');"> <form method="POST" onsubmit="return confirm('Supprimer du groupe ?');">

View file

@ -7,7 +7,7 @@
<div class="d-flex"> <div class="d-flex">
<h4>Mailing lists</h4> <h4>Mailing lists</h4>
<a class="ml-auto btn btn-success" href="/admin/create/ml/{{.MailingBaseDN}}">Nouvelle mailing list</a> <a class="ml-auto btn btn-success" href="/admin-create/ml/{{.MailingBaseDN}}">Nouvelle mailing list</a>
<a class="ml-4 btn btn-info" href="/">Menu principal</a> <a class="ml-4 btn btn-info" href="/">Menu principal</a>
</div> </div>
@ -21,7 +21,7 @@
{{range $ml := $root.MailingLists}} {{range $ml := $root.MailingLists}}
<tr> <tr>
<td> <td>
<a href="/admin/mailing/{{$ml.GetAttributeValue $root.MailingNameAttr}}"> <a href="/admin-mailing/{{$ml.GetAttributeValue $root.MailingNameAttr}}">
{{$ml.GetAttributeValue $root.MailingNameAttr}} {{$ml.GetAttributeValue $root.MailingNameAttr}}
</a> </a>
</td> </td>

View file

@ -5,9 +5,9 @@
<div class="d-flex"> <div class="d-flex">
<h2>ML {{.MailingList.GetAttributeValue .MailingNameAttr}} <h2>ML {{.MailingList.GetAttributeValue .MailingNameAttr}}
<a class="ml-auto btn btn-sm btn-dark" href="/admin/ldap/{{.MailingList.DN}}">Vue avancée</a> <a class="ml-auto btn btn-sm btn-dark" href="/admin-ldap/{{.MailingList.DN}}">Vue avancée</a>
</h2> </h2>
<a class="ml-auto btn btn-dark" href="/admin/mailing">Liste des ML</a> <a class="ml-auto btn btn-dark" href="/admin-mailing">Liste des ML</a>
</div> </div>
{{if .Common.Success}} {{if .Common.Success}}
@ -35,7 +35,7 @@
{{range $member := $root.Members}} {{range $member := $root.Members}}
<tr> <tr>
<td> <td>
<a href="/admin/ldap/{{$member.DN}}"> <a href="/admin-ldap/{{$member.DN}}">
{{$member.GetAttributeValue "mail"}} {{$member.GetAttributeValue "mail"}}
</a> </a>
</td> </td>

View file

@ -8,7 +8,7 @@
<div class="d-flex"> <div class="d-flex">
<h2>Liste des utilisateurs</h2> <h2>Liste des utilisateurs</h2>
<a class="ml-auto btn btn-success" href="/admin/create/user/{{.UserBaseDN}}">Nouvel utilisateur</a> <a class="ml-auto btn btn-success" href="/admin-create/user/{{.UserBaseDN}}">Nouvel utilisateur</a>
</div> </div>
<table class="table mt-4"> <table class="table mt-4">
@ -23,12 +23,12 @@
{{range $user := $root.Users}} {{range $user := $root.Users}}
<tr> <tr>
<td> <td>
<a href="/admin/unactivate/{{ $user.GetAttributeValue "cn" }}"> <a href="/admin-unactivate/{{ $user.GetAttributeValue "cn" }}">
Dèsactiver Dèsactiver
</a> </a>
</td> </td>
<td> <td>
<a href="/admin/ldap/{{$user.DN}}"> <a href="/admin-ldap/{{$user.DN}}">
{{$user.GetAttributeValue $root.UserNameAttr}} {{$user.GetAttributeValue $root.UserNameAttr}}
</a> </a>
</td> </td>

View file

@ -55,11 +55,11 @@
Administration Administration
</div> </div>
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/admin/activate">Activer des Utilisateur·ices</a> <a class="list-group-item list-group-item-action" href="/admin-activate">Activer des Utilisateur·ices</a>
<a class="list-group-item list-group-item-action" href="/admin/users">Utilisateur·ices</a> <a class="list-group-item list-group-item-action" href="/admin-users">Utilisateur·ices</a>
<a class="list-group-item list-group-item-action" href="/admin/groups">Groupes</a> <a class="list-group-item list-group-item-action" href="/admin-groups">Groupes</a>
<a class="list-group-item list-group-item-action" href="/admin/mailing">Mailing lists</a> <a class="list-group-item list-group-item-action" href="/admin-mailing">Mailing lists</a>
<a class="list-group-item list-group-item-action" href="/admin/ldap/{{.BaseDN}}">Explorateur LDAP</a> <a class="list-group-item list-group-item-action" href="/admin-ldap/{{.BaseDN}}">Explorateur LDAP</a>
</div> </div>
</div> </div>
{{end}} {{end}}

View file

@ -58,10 +58,10 @@
{{if .Common.CanAdmin}} {{if .Common.CanAdmin}}
<li>&lt;&nbsp;<a href="#">Administration</a> <li>&lt;&nbsp;<a href="#">Administration</a>
<ul class="submenu"> <ul class="submenu">
<!-- <li><a href="/admin/activate">Administrer LDAP</a> --> <!-- <li><a href="/admin-activate">Administrer LDAP</a> -->
<li><a href="/admin/activate">Activer des Utilisateur·ices</a></li> <li><a href="/admin-activate">Activer des Utilisateur·ices</a></li>
<li><a href="/admin/users">Utilisateur·ices</a></li> <li><a href="/admin-users">Utilisateur·ices</a></li>
<!-- <li><a href="/admin/groups">Groupes</a></li> --> <!-- <li><a href="/admin-groups">Groupes</a></li> -->
</ul> </ul>
</li> </li>
{{end}} {{end}}
@ -75,7 +75,7 @@
{{else}} {{else}}
<li><a href="/">Se connecter</a></li> <li><a href="/">Se connecter</a></li>
<li><a href="/gpas">Mal de passe oublié</a></li> <li><a href="/gpas">Mal de passe oublié</a></li>
<li><a href="/invite/new_account">S'enregistrer</a></li> <li><a href="/inscription">S'enregistrer</a></li>
{{end}} {{end}}
</ul></li> </ul></li>
<li> &nbsp;&lt;&nbsp;<a href="#" class="jour-nuit" id="jour-nuit">Jour et nuit</a></li> <li> &nbsp;&lt;&nbsp;<a href="#" class="jour-nuit" id="jour-nuit">Jour et nuit</a></li>

View file

@ -35,6 +35,6 @@
<p><strong><a href="/gpas">Mot de passe perdu</a></strong></p> <p><strong><a href="/gpas">Mot de passe perdu</a></strong></p>
<p><strong><a href="/invite/new_account">S'enregistrer</a></strong></p> <p><strong><a href="/inscription">S'enregistrer</a></strong></p>
{{end}} {{end}}