Fix subscription
This commit is contained in:
parent
59f59d2e88
commit
36a57c9bc0
@ -2,25 +2,30 @@
|
||||
|
||||
include("User.class.php");
|
||||
|
||||
$email = $_POST['email'];
|
||||
$login = $_POST['login'];
|
||||
|
||||
$user = User::new_User($email, $login);
|
||||
|
||||
function mail_utf8($to, $subject = '(No subject)',
|
||||
$message = '', $header = '')
|
||||
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)',
|
||||
$message = '', $header = '')
|
||||
{
|
||||
$header_ = 'MIME-Version: 1.0' . "\r\n" .
|
||||
'Content-type: text/plain; charset=UTF-8' . "\r\n";
|
||||
return (mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=',
|
||||
$message, $header_ . $header));
|
||||
}
|
||||
}
|
||||
|
||||
$email = $_POST['email'];
|
||||
echo $email;
|
||||
$subject = "[Nemubot] Confirmation d'inscription";
|
||||
$headers = "From: Nemubot <bot@nemunai.re>\n";
|
||||
$message = "Bonjour,\n"
|
||||
$email = $_POST['email'];
|
||||
echo $email;
|
||||
$subject = "[Nemubot] Confirmation d'inscription";
|
||||
$headers = "From: Nemubot <bot@nemunai.re>\n";
|
||||
$message = "Bonjour,\n"
|
||||
."Vous avez demandé à être ajouté à la liste des participants "
|
||||
."sur le site AskWeb.\n"
|
||||
."Si c'est le cas, vous pouvez cliquer sur le lien suivant "
|
||||
@ -28,19 +33,21 @@ $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"
|
||||
."-- \nNemubot";
|
||||
|
||||
if (mail_utf8($email, $subject, $message, $headers))
|
||||
{
|
||||
echo "email sent";
|
||||
if (mail_utf8($email, $subject, $message, $headers))
|
||||
{
|
||||
echo "Un courrier électronique vient de vous être envoyé";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Une erreur est survenue lors de l'envoi du courriel. Veuillez contacter l'administrateur";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR";
|
||||
}
|
||||
|
||||
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