Browse Source

Commit initial

master
nemesis 4 years ago
parent
commit
c684eed707
  1. 37
      index.php
  2. 14
      liste.php
  3. 19
      process.sh

37
index.php

@ -0,0 +1,37 @@
<html>
<body>
<?php
if (isset($_GET['message'])) {
echo $_GET['message'];
}
?>
<form method="post" action="liste.php">
<label for="pseudo">
Entrez votre pseudo :
</label>
<br />
<input type="text" name="pseudo" id="pseudo" />
<br />
<label for="pass">
Entrez votre mot de passe :
</label>
<br />
<input type="password" name="pass" id="pass" />
<br />
<label for="mail">
Entrez votre mail :
</label>
<br />
<input type="email" name="mail" id="mail" />
<br />
<input type="submit" value="Envoyer" />
</form>
</body>
</html>

14
liste.php

@ -0,0 +1,14 @@
<?php
$pseudo=$_POST['pseudo'];
$pass=$_POST['pass'];
$mail=$_POST['mail'];
if (isset($pseudo) && isset($pass) && isset($mail) ) {
$txt = $pseudo . ":" . $pass . ":" . $mail;
$myfile = file_put_contents('requests', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
header('Location: index.php?message="Demande enregistree"');
} else {
header('Location: index.php?message="Parametres incorrects"');
}
?>

19
process.sh

@ -0,0 +1,19 @@
#!/bin/bash
if [[ -f requests ]]
then
source ~/.synapse/bin/activate
while read ligne
do
user=$(echo $ligne | cut -d":" -f1)
pass=$(echo $ligne | cut -d":" -f2)
mail=$(echo $ligne | cut -d":" -f3)
# register_new_matrix_user -c homeserver.yaml -u ${user} -p ${pass} -a "notadmin" https://localhost:8008
echo register_new_matrix_user -c homeserver.yaml -u ${user} -p ${pass} -a "notadmin" https://localhost:8008
# echo "$user / $pass" | mailx -s "Vos identifiants de connexion Matrix" $mail
done < requests
else
echo "Fichier requests introuvable"
exit 1
fi
Loading…
Cancel
Save