admin: Also generate associations when generating dex.yaml
This commit is contained in:
parent
2ce95ccafc
commit
d09c1741a2
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"text/template"
|
||||
|
||||
|
@ -205,6 +206,14 @@ func genDexConfig() ([]byte, error) {
|
|||
}); err != nil {
|
||||
return nil, fmt.Errorf("An error occurs during template execution: %w", err)
|
||||
} else {
|
||||
// Also generate team associations
|
||||
for _, team := range teams {
|
||||
if err := os.Symlink(fmt.Sprintf("%d", team.Id), path.Join(TeamsDir, fmt.Sprintf("%02d", team.Id))); err != nil {
|
||||
log.Println("Unable to create association symlink:", err.Error())
|
||||
return nil, fmt.Errorf("Unable to create association symlink: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return b.Bytes(), nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,28 +9,7 @@
|
|||
<div class="theme-form-label">
|
||||
<label for="userid">Votre équipe</label>
|
||||
</div>
|
||||
<select tabindex="1" required id="login" name="login" class="theme-form-input" autofocus>
|
||||
<option value="team01">0verfl0wl</option>
|
||||
<option value="team02">TeamDLS</option>
|
||||
<option value="team03">ESNArcotrafiquants</option>
|
||||
<option value="team04">Ingénieur Cyberdéfense</option>
|
||||
<option value="team05">StrawHats</option>
|
||||
<option value="team06">PoC INNOVATION</option>
|
||||
<option value="team07">root42</option>
|
||||
<option value="team08">Les Pires Hat</option>
|
||||
<option value="team09">Esaip</option>
|
||||
<option value="team10">Hack In Provence</option>
|
||||
<option value="team11">Sogeti Aces of spades</option>
|
||||
<option value="team12">DéfendonsEnsemble</option>
|
||||
<option value="team13">Linkbynet Cybersecurity</option>
|
||||
<option value="team14">Evil-Minded</option>
|
||||
<option value="team15">ID-IoT</option>
|
||||
<option value="team16">199</option>
|
||||
<option value="team17">Équipe supplémentaire 1</option>
|
||||
<option value="team18">Équipe supplémentaire 2</option>
|
||||
<option value="team19">Équipe supplémentaire 3</option>
|
||||
<option value="team20">Équipe supplémentaire 4</option>
|
||||
</select>
|
||||
<input tabindex="1" required id="login" name="login" class="theme-form-input" placeholder="votre équipe" autofocus />
|
||||
</div>
|
||||
<div class="theme-form-row">
|
||||
<div class="theme-form-label">
|
||||
|
|
Loading…
Reference in New Issue