Fix subscription
This commit is contained in:
parent
59f59d2e88
commit
36a57c9bc0
@ -2,9 +2,14 @@
|
||||
|
||||
include("User.class.php");
|
||||
|
||||
if (count($_POST))
|
||||
{
|
||||
$email = $_POST['email'];
|
||||
$login = $_POST['login'];
|
||||
|
||||
if (empty($email) || empty($login))
|
||||
die("Veuillez remplir tous les champs avant de valider le formulaire.");
|
||||
|
||||
$user = User::new_User($email, $login);
|
||||
|
||||
function mail_utf8($to, $subject = '(No subject)',
|
||||
@ -28,7 +33,7 @@ $message = "Bonjour,\n"
|
||||
|
||||
. "http://".$_SERVER["SERVER_NAME"]
|
||||
. dirname($_SERVER["REQUEST_URI"]) . "/subscribeConfirmation.php?id="
|
||||
. $user->getId();
|
||||
. $user->getId()
|
||||
|
||||
."\n\n Si ce n'est pas le cas, merci de supprimer cet email\n"
|
||||
."Cordialement,\n\n"
|
||||
@ -36,11 +41,13 @@ $message = "Bonjour,\n"
|
||||
|
||||
if (mail_utf8($email, $subject, $message, $headers))
|
||||
{
|
||||
echo "email sent";
|
||||
echo "Un courrier électronique vient de vous être envoyé";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR";
|
||||
echo "Une erreur est survenue lors de l'envoi du courriel. Veuillez contacter l'administrateur";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
header("Location: ./");
|
||||
?>
|
||||
|
@ -2,13 +2,15 @@
|
||||
|
||||
include("User.class.php");
|
||||
|
||||
$user = User::getUser($_GET['id']);
|
||||
$users = User::getUsers();
|
||||
|
||||
if ($user == null)
|
||||
echo "Cet utilisateur n'existe pas"
|
||||
if (in_array($_GET['id'], $users))
|
||||
{
|
||||
echo "Cet utilisateur n'existe pas";
|
||||
}
|
||||
else
|
||||
{
|
||||
$user->set_validated(true);
|
||||
$users[$_GET['id']]->set_validated(true);
|
||||
echo "Utilisateur confirmé !"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user