Add a new user

This commit is contained in:
Bertrand 2012-06-19 18:30:51 +02:00
parent 63e14532f8
commit 664dc99ece
3 changed files with 27 additions and 1 deletions

View File

@ -36,6 +36,9 @@
<label for="email">Votre email : </label> <label for="email">Votre email : </label>
<input id="email" name="email" type="text" /> <input id="email" name="email" type="text" />
<label for="login">Login : </label>
<input id="login" name="login" type="text" />
<input type="submit" name="send" value="Envoyer"/> <input type="submit" name="send" value="Envoyer"/>
</form> </form>
</article> </article>

View File

@ -1,5 +1,12 @@
<?php <?php
include("User.class.php");
$email = $_POST['email'];
$login = $_POST['login'];
$user = User::new_User($email, $login);
function mail_utf8($to, $subject = '(No subject)', function mail_utf8($to, $subject = '(No subject)',
$message = '', $header = '') $message = '', $header = '')
{ {
@ -20,7 +27,8 @@ $message = "Bonjour,\n"
."pour confirmer :\n" ."pour confirmer :\n"
. "http://".$_SERVER["SERVER_NAME"] . "http://".$_SERVER["SERVER_NAME"]
. dirname($_SERVER["REQUEST_URI"]) . "subscribeConfirmation.php" . dirname($_SERVER["REQUEST_URI"]) . "/subscribeConfirmation.php?id="
. $user->getId();
."\n\n Si ce n'est pas le cas, merci de supprimer cet email\n" ."\n\n Si ce n'est pas le cas, merci de supprimer cet email\n"
."Cordialement,\n\n" ."Cordialement,\n\n"

View File

@ -0,0 +1,15 @@
<?php
include("User.class.php");
$user = User::getUser($_GET['id']);
if ($user == null)
echo "Cet utilisateur n'existe pas"
else
{
$user->set_validated(true);
echo "Utilisateur confirmé !"
}
?>