%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/p-inscription_coordinateur.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/init.php"); include_once("inc/phpmailer/class.phpmailer.php"); //edition en cours $actual_edition=$edition->getCurrentEdition("ins_front",$lang->getlangid()); if(isset($_POST['post']) && $_POST['post'] == 1) { $_POST['email']=trim($_POST['email']); $post_data = http_build_query( array( 'secret' => '6Len0VsUAAAAANt76oQqYwUyOOPBskrQAnNfsJ4r', 'response' => $_POST['g-recaptcha-response'], 'remoteip' => $_SERVER['REMOTE_ADDR'] ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $post_data ) ); $context = stream_context_create($opts); $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context); $result = json_decode($response); if (!$result->success) { $erreur = lang("captcha"); } else { $erreur = "ok"; } if($erreur == "ok") $erreur = $db->verif($_POST['civility'], "La civilité"); if($erreur == "ok") $erreur = $db->verif($_POST['firstname'], "Le prénom"); if($erreur == "ok") $erreur = $db->verif($_POST['lastname'], "Le nom de famille"); if($erreur == "ok") $erreur = verifie_email($_POST['email']); if($erreur == "ok") $erreur = $db->verif($_POST['function'], "La fonction"); if($erreur == "ok") $erreur = $db->verif($_POST['email'], "L'email"); if($erreur == "ok") { $queryverif = "SELECT * FROM `user` WHERE email = ".$db->qS($_POST['email']); if($db->isres($queryverif)) { $erreur = $admtext->getText("email_deja_pris",$lang->getlangid()).' <a href="'.$lang->getlang().'/admin/password.php">'.lang("passwoubli").'</a>'; } } if($erreur == "ok") { $next_id_user = $db->next_id("user"); $password=createRandomPassword(); //utilisateur $values = array( "id" => $next_id_user, "email" => $_POST['email'], "password" => md5("amicalesite".$password), "type" => 3, "section" => 0, "nom" => $_POST['lastname'], "prenom" => $_POST['firstname'], "civilite" => $_POST['civility'], "fonction" => $_POST['function'], "telephone" => $_POST['phone'], "lang" => $lang->getlangid(), "service" => "", "email_contact" => "", "id_country" => $_POST['id_country'], "active" => 0 ); $db->insert("user", $values); // envoi du mail de validation $message=''; $message.=stripslashes($admtext->getText("adm_mail_ins_coordinateur",$lang->getlangid())." <p>".$admtext->getText("info_con",$lang->getlangid())."</p> <p><strong>".$admtext->getText("ins_email",$lang->getlangid())."</strong> : ".$_POST['email']."</p> <p><strong>".$admtext->getText("password",$lang->getlangid())."</strong> : ".$password."</p> <br /><p></p>"); /*mail($_POST['email'], $subject, " <html> <head> <title>Contact letter</title> </head> <body> <br> ".$message." </body> </html>" , $headers);*/ $yes = true; $header = get_temp("templates/newsletter/header_page.php", $url_site); $footer = get_temp("templates/newsletter/header_page.php", $url_site); $message=$header.$message.$footer; $subject="=?UTF-8?B?".base64_encode(stripslashes("Confirmation de votre inscription"))."?="; $headers= "From: \"SEDL\" <".$email_contact.">\n"; $headers.='Content-type: text/html; charset=utf-8'; $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; $mail->From = "sedl@octomail.info"; $mail->FromName = "SEDL"; $mail->addReplyTo($email_contact); $mail->Subject =$subject; $mail->MsgHTML($message); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.octomail.info"; // sets the SMTP server $mail->Port = 587; // set the SMTP port for the GMAIL server $mail->Username = "sedl@octomail.info"; // SMTP account username $mail->Password = "2UFvaB1eqj5QeQv8"; $mail->MsgHTML($message); $mail->AddAddress($_POST['email']); $mail->Send(); $mail->ClearAddresses(); header("Location:inscriptioncoor-".$_POST['email'].".html"); exit(0); } else { $err = true; } } //affichage du html include("theme/html.php"); //affichage des metas include("theme/meta.php"); echo "\n<title>Inscription - ".$info_titresite."</title>\n"; //affichage du header include("theme/header.php"); //colonne de droite include("theme/droite.php"); ?> <?$actual_edition=$edition->getCurrentEdition("ins",$lang->getlangid());?> <div class="blanc padding mt10"> <h1><?=$admtext->getText("titre_inscription_coordinateur",$lang->getlangid());?></h1> <div class="presentation"><?=$admtext->getText("texte_inscription_coordinateur",$lang->getlangid());?><div> <div style="clear:both"></div> <div id="form_profil_1" class="form_profil"> <?php if(isset($err) && $err) { echo "<p class=\"erreurbloc\">".$erreur."</p>"; } if(isset($yes) && $yes) { echo $admtext->getText("ins_validation",$lang->getlangid()); echo "<p class=\"infobloc\">".lang("You will receive an email with our informations at :").$_POST['email']."</p>"; } ?> <form id="insc_form" method="post" action="<?=$lang->getlang();?>/inscription_coordinateur.html?type=3"><input type="hidden" name="type" value="1" /> <div class="title"><h3><?=$admtext->getText("contact_person",$lang->getlangid());?></h3></div> <div class=""><p><?=$admtext->getText("ins_identcon",$lang->getlangid());?></p></div> <input type="hidden" name="type" value="3" /> <div class="ligne"> <div class="label"><label for="email"><?=$admtext->getText("ins_email",$lang->getlangid());?></label> <span class="etoile">*</span></div> <div class="field"><input type="text" name="email" value="<?=(isset($_POST['email'])?$_POST['email']:'')?>" /></div> </div> <div class="ligne"> <div class="label"><label for="country"><?=lang("Country") ?> <span class="etoile">*</span></label></div> <div class="field"> <select name="id_country"> <?=$pays->getCountry($lang->getlangid(),$_POST['country'])?> </select> </div> </div> <div class="ligne"> <div class="label"><?=lang("Civility") ?> <span class="etoile">*</span></div> <div class="check"><input type="radio" name="civility" value="<?=lang("Mrs.") ?>"/> <?=lang("Mrs.") ?> <input type="radio" name="civility" value="<?=lang("Mr.") ?>"/> <?=lang("Mr.") ?></div> </div> <div class="ligne"> <div class="label"><label for="lastname"><?=lang("Last name") ?></label> <span class="etoile">*</span></div> <div class="field"><input type="text" name="lastname" value="<?=(isset($_POST['lastname'])?$_POST['lastname']:'')?>" /></div> </div> <div class="ligne"> <div class="label"><label for="firstname"><?=lang("First name") ?></label> <span class="etoile">*</span></div> <div class="field"><input type="text" name="firstname" value="<?=(isset($_POST['firstname'])?$_POST['firstname']:'')?>" /></div> </div> <div class="ligne"> <div class="label"><label for="function"><?=lang("Function") ?></label> <span class="etoile">*</span></div> <div class="field"><input type="text" name="function" value="<?=(isset($_POST['function'])?$_POST['function']:'')?>" /></div> </div> <div class="ligne"> <div class="label"><label for="phone"><?=lang("Phone") ?></label></div> <div class="field"><input type="text" name="phone" value="<?=(isset($_POST['phone'])?$_POST['phone']:'')?>" /></div> </div> <div class="form_bouton"> <div class="captchabox mt10"> <div class="captcha"> <div class="g-recaptcha" data-sitekey="6Len0VsUAAAAAM3_8GB1s3xDWWBbUvYhlXKN2LvC"></div> </div> </div> <input type="hidden" value="1" name="post"> <input id="maj_bouton" class="bouton mt10" type="submit" value="<?=$admtext->getText("Inscription",$lang->getlangid());?>"> </div> </form> </div> <script type="text/javascript"> $(document).ready(function() { $('#namefield').hide(); }); </script> </div> <?php //affichage du footer include("theme/footer.php"); ?>