First commit

First commit
This commit is contained in:
Erreur32 2016-09-25 11:17:13 +02:00
commit 32ac1977df
25 changed files with 889 additions and 0 deletions

160
back.index.php Normal file
View File

@ -0,0 +1,160 @@
<?php
require_once './vendor/autoload.php';
$helperLoader = new SplClassLoader('Helpers', './vendor');
$mailLoader = new SplClassLoader('SimpleMail', './vendor');
$helperLoader->register();
$mailLoader->register();
use Helpers\Config;
use SimpleMail\SimpleMail;
$config = new Config;
$config->load('./config/config.php');
//check secu code
$number_1 = rand(1, 9);
$number_2 = rand(1, 9);
$answer = substr(md5($number_1+$number_2),5,10);
//
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = stripslashes(trim($_POST['form-name']));
$email = stripslashes(trim($_POST['form-email']));
$phone = stripslashes(trim($_POST['form-phone']));
$subject = stripslashes(trim($_POST['form-subject']));
$message = stripslashes(trim($_POST['form-message']));
$pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i';
if (preg_match($pattern, $name) || preg_match($pattern, $email) || preg_match($pattern, $subject)) {
die("Header injection detected");
}
$emailIsValid = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($name && $email && $emailIsValid && $subject && $message) {
$mail = new SimpleMail();
$mail->setTo($config->get('emails.to'));
$mail->setFrom($config->get('emails.from'));
$mail->setSender($name);
$mail->setSubject($config->get('subject.prefix') . ' ' . $subject);
$body = "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<meta charset=\"utf-8\">
</head>
<body>
<h1>{$subject}</h1>
<p><strong>{$config->get('fields.name')}:</strong> {$name}</p>
<p><strong>{$config->get('fields.email')}:</strong> {$email}</p>
<p><strong>{$config->get('fields.phone')}:</strong> {$phone}</p>
<p><strong>{$config->get('fields.message')}:</strong> {$message}</p>
</body>
</html>";
$mail->setHtml($body);
$mail->send();
$emailSent = true;
} else {
$hasError = true;
}
}
?><!DOCTYPE html>
<html>
<head>
<title>Echosystem.fr Contact Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link rel="shortcut icon" type="image/x-icon" href="https://echosystem.fr/favicon.png" />
</head>
<body>
<div class="jumbotron">
<h1> Contact Form</h1>
<p> Echosystem.fr.</p>
</div>
<?php if(!empty($emailSent)): ?>
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-success text-center"><?php echo $config->get('messages.success'); ?></div>
</div>
<?php else: ?>
<?php if(!empty($hasError)): ?>
<div class="col-md-5 col-md-offset-4">
<div class="alert alert-danger text-center"><?php echo $config->get('messages.error'); ?></div>
</div>
<?php endif; ?>
<div class="col-md-6 col-md-offset-3">
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" enctype="application/x-www-form-urlencoded" id="contact-form" class="form-horizontal" method="post">
<div class="form-group">
<label for="form-name" class="col-lg-2 control-label"><?php echo $config->get('fields.name'); ?></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="form-name" name="form-name" placeholder="<?php echo $config->get('fields.name'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="form-email" class="col-lg-2 control-label"><?php echo $config->get('fields.email'); ?></label>
<div class="col-lg-10">
<input type="email" class="form-control" id="form-email" name="form-email" placeholder="<?php echo $config->get('fields.email'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="form-phone" class="col-lg-2 control-label"><?php echo $config->get('fields.phone'); ?></label>
<div class="col-lg-10">
<input type="tel" class="form-control" id="form-phone" name="form-phone" placeholder="<?php echo $config->get('fields.phone'); ?>">
</div>
</div>
<div class="form-group">
<label for="form-subject" class="col-lg-2 control-label"><?php echo $config->get('fields.subject'); ?></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="form-subject" name="form-subject" placeholder="<?php echo $config->get('fields.subject'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="form-message" class="col-lg-2 control-label"><?php echo $config->get('fields.message'); ?></label>
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="form-message" name="form-message" placeholder="<?php echo $config->get('fields.message'); ?>" required></textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
To help prevent spam, please enter the answer to this question:</p>
<span><?php echo $number_1; ?> + <?php echo $number_2; ?> = </span><input type="text" required placeholder="?" name="user_answer" /><input type="hidden" name="answer" value="<?php echo $answer; ?>" />
<button type="submit" class="btn btn-default"><?php echo $config->get('fields.btn-send'); ?></button>
</div>
</div>
</form>
<footer>
<br>
<font size="-2"> Your IP :
<b>
<?php
echo $_SERVER['REMOTE_ADDR']; // Show IP
?></b> is registered.</font>
<br>
<p><font size="-2"> | Last Modif:<?php setlocale(LC_ALL,'french'); echo " ".date("m/d/y H:i", getlastmod()); ?></font></p>
</footer>
</div>
<?php endif; ?>
<!--[if lt IE 9]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!--<![endif]-->
<script type="text/javascript" src="public/js/contact-form.js"></script>
</body>
</html>

27
config/config.php Normal file
View File

@ -0,0 +1,27 @@
<?php
return [
'subject' => [
'prefix' => '[EchoSystem Contact Form]'
],
'emails' => [
'to' => 'contact@echosystem.fr',
'from' => 'contact@echosystem.fr'
],
'emails.sender' => [
'to' => '.$email',
'from' => 'contact@echosystem.fr'
],
'messages' => [
'error' => 'There was an error sending ! (check the addition?)',
'success' => 'Your message has been sent successfully. (you are good in Math.)'
],
'fields' => [
'name' => 'Name',
'email' => 'Email',
'answer' => 'Operation',
'subject' => 'Subject',
'message' => 'Message',
'btn-send' => 'Send'
]
];

6
css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

BIN
favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/Google_Play_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/appstore2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/bg-tile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/contact.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
images/contact_large.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
images/hero-block.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
images/hero-grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
images/hero-wide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
images/list-item.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/logo-black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

BIN
images/logo-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

BIN
images/tracker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

193
index.php Normal file
View File

@ -0,0 +1,193 @@
<?php
require_once './vendor/autoload.php';
$helperLoader = new SplClassLoader('Helpers', './vendor');
$mailLoader = new SplClassLoader('SimpleMail', './vendor');
$helperLoader->register();
$mailLoader->register();
use Helpers\Config;
use SimpleMail\SimpleMail;
$config = new Config;
$config->load('./config/config.php');
//check secu code
$number_1 = rand(1, 9);
$number_2 = rand(1, 9);
$answer = substr(md5($number_1+$number_2),5,10);
//--
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = stripslashes(trim($_POST['form-name']));
$email = stripslashes(trim($_POST['form-email']));
//--
$user_answer = htmlspecialchars(trim($_POST['user_answer']));
$answer = htmlspecialchars(trim($_POST['answer']));
//--
$subject = stripslashes(trim($_POST['form-subject']));
$message = stripslashes(trim($_POST['form-message']));
$pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i';
if (preg_match($pattern, $name) || preg_match($pattern, $email) || preg_match($pattern, $subject)) {
die("Header injection detected");
}
$emailIsValid = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($name && $email && $emailIsValid && $subject && $message && substr(md5($user_answer),5,10) === $answer) {
$mail = new SimpleMail();
// $headers = "From: contact@echosystem.fr";
$mailpage = file_get_contents("mail.txt.html");
// $mail->setHtml($);
// $mailpage2 = "<html>". $mailpage. "</html>";
// $subject = "confirmation: message enregistrer";
// mail($email,$subject,$mailpage2,$headers);
$mail->setTo($email);
$mail->setFrom("contact@echosystem.fr");
$mail->setSender($name);
$mail->setSubject("confirmation: message enregistrer");
$mail->setHtml($mailpage);
$mail->send();
$mail = new SimpleMail();
$mail->setTo($config->get('emails.to'));
$mail->setFrom($config->get('emails.from'));
$mail->setSender($name);
$mail->setSubject($config->get('subject.prefix') . ' ' . $subject);
$body = "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<meta charset=\"utf-8\">
</head>
<body>
<h1>{$subject}</h1>
<h1> Contact Form</h1>
<p> Echosystem.fr.</p>
<p><strong>{$config->get('fields.name')}:</strong> {$name}</p>
<p><strong>{$config->get('fields.email')}:</strong> {$email}</p>
<p><strong>{$config->get('fields.message')}:</strong> {$message}</p>
</body>
</html>";
$mail->setHtml($body);
$mail->send();
$emailSent = true;
} else {
$hasError = true;
}
}
?><!DOCTYPE html>
<html>
<head>
<title>Echosystem.fr Contact Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link rel="shortcut icon" type="image/x-icon" href="https://echosystem.fr/favicon.png" />
</head>
<body>
<div class="jumbotron">
<table>
<tr>
<thead>
<th><a target="_blank" style="text-decoration: none;" href="/"><img border="0" vspace="0" hspace="0" src="https://echosystem.fr/UpFile/Yq.png" alt="Please enable images to view this content" title="echosystem Image" width="540" style="max-width: 540px; color: #FFFFFF; font-size: 13px; margin: 50px; padding: 0; outline: none; text-decoration: none; -ms-interpolation-mode:bicubic; border: none; display: block;"/></a></th>
<th><h1> Contact Form</h1><br><img border="0" vspace="0" hspace="0" src="images/contact.png" /><h2> Echosystem.fr</h2></th>
<thead>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<?php if(!empty($emailSent)): ?>
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-success text-center"><?php echo $config->get('messages.success'); ?></div>
</div>
<?php else: ?>
<?php if(!empty($hasError)): ?>
<div class="col-md-5 col-md-offset-4">
<div class="alert alert-danger text-center"><?php echo $config->get('messages.error'); ?></div>
</div>
<?php endif; ?>
<div class="col-md-6 col-md-offset-3">
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" enctype="application/x-www-form-urlencoded" id="contact-form" class="form-horizontal" method="post">
<div class="form-group">
<label for="form-name" class="col-lg-2 control-label"><?php echo $config->get('fields.name'); ?></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="form-name" name="form-name" placeholder="<?php echo $config->get('fields.name'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="form-email" class="col-lg-2 control-label"><?php echo $config->get('fields.email'); ?></label>
<div class="col-lg-10">
<input type="email" class="form-control" id="form-email" name="form-email" placeholder="<?php echo $config->get('fields.email'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="answer" class="col-lg-2 control-label"><?php echo $number_1; ?> + <?php echo $number_2; ?> = </label>
<div class="col-lg-10">
<input type="tel" class="form-control" id="form-phone" name="user_answer" required placeholder="? (To help prevent spam, please enter the answer to this question)" />
<input type="hidden" name="answer" value="<?php echo $answer; ?>">
</div>
</div>
<div class="form-group">
<label for="form-subject" class="col-lg-2 control-label"><?php echo $config->get('fields.subject'); ?></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="form-subject" name="form-subject" placeholder="<?php echo $config->get('fields.subject'); ?>" required>
</div>
</div>
<div class="form-group">
<label for="form-message" class="col-lg-2 control-label"><?php echo $config->get('fields.message'); ?></label>
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="form-message" name="form-message" placeholder="<?php echo $config->get('fields.message'); ?>" required></textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button type="submit" class="btn btn-default"><?php echo $config->get('fields.btn-send'); ?></button>
</div>
</div>
</form>
<footer>
<br>
<font size="3px"> Your IP :
<b>
<?php
echo $_SERVER['REMOTE_ADDR']; // Show IP
?></b> is registered.</font>
<br>
<p><font size="1px"> Last Modif:<?php setlocale(LC_ALL,'french'); echo " ".date("m/d/y H:i", getlastmod()); ?></font></p>
</footer>
</div>
<?php endif; ?>
<!--[if lt IE 9]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!--<![endif]-->
<script type="text/javascript" src="public/js/contact-form.js"></script>
</body>
</html>

144
mail.txt.html Normal file
View File

@ -0,0 +1,144 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0;">
<meta name="format-detection" content="telephone=no"/>
<style> /* Reset styles */
body { margin: 0; padding: 0; min-width: 100%; width: 100% !important; height: 100% !important;} body, table, td, div, p, a { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%; } table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; border-spacing: 0; } img { border: 0; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; } #outlook a { padding: 0; }
.ReadMsgBody { width: 100%; } .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font,
.ExternalClass td, .ExternalClass div { line-height: 100%; } /* Rounded corners for advanced mail clients only */ @media all and (min-width: 560px) {
.container { border-radius: 8px; -webkit-border-radius: 8px; -moz-border-radius: 8px; -khtml-border-radius: 8px; }
}
/* Set color for auto links (addresses, dates, etc.) */ a, a:hover {
color: #FFFFFF;
}
.footer a, .footer a:hover {
color: #828999;
}
</style>
<!-- MESSAGE SUBJECT -->
<title>Reply email from Echosystem.fr</title>
</head>
<!-- BODY -->
<!-- Set message background color (twice) and text color (twice) -->
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0" marginwidth="0" marginheight="0" width="100%" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; height: 100%; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%; background-color: #2D3445; color: #FFFFFF;" bgcolor="#2D3445" text="#FFFFFF">
<!-- SECTION / BACKGROUND --> <!-- Set message background color one again -->
<td align="center" class="w640" width="640" height="20"> <a style="color:#ffffff; font-size:12px;" href="https://contact.echosystem.fr/mail.txt.html"><span style="color:#ffffff; font-size:12px;">Voir le contenu de ce mail en ligne</span></a>
</td> <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%;" class="background"><tr><td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;" bgcolor="#2D3445">
<!-- WRAPPER -->
<!-- Set wrapper width (twice) -->
<table border="0" cellpadding="0" cellspacing="0" align="center" width="500" style="border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit; max-width: 500px;" class="wrapper">
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; padding-top: 20px; padding-bottom: 20px;">
<!-- PREHEADER -->
<!-- Set text color to background color -->
<div style="display: none; visibility: hidden; overflow: hidden; opacity: 0; font-size: 1px; line-height: 1px; height: 0;
max-height: 0; max-width: 0; color: #2D3445;" class="preheader"> Blaaa blasa blaa car ???? </div>
<!-- LOGO -->
<a target="_blank" style="text-decoration: none;" href="https://echosystem.fr/"><img border="0" vspace="0" hspace="0" src="https://s.como.com/Mobile/fa/06/fab11687-ee06-4a3a-97f2-edfa40734418/Images/0b33b361-1839-41f5-b5cc-0e270d1ca7ff.png" height="50" ; alt="App Echosystem" title="App EchoSystem" style="color: #FFFFFF;font-size: 10px; margin: 0; padding: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none; display: block;" /></a>
<article>
Application EchoSystem available on the store of your choice:
<br>
<a href="http://mob.echosystem.fr/landing/Desktop#.V0byeulS7cs"><img src="images/Google_Play_3.png"> <img src="images/appstore2.png"></a>
<br><br><br>
<b>We are also on own IRC:</b><br>
<a href="irc://irc.echosystem.fr">irc.echosystem.fr</a> 6667 / 6690 (ssl)
<br> salon/channel: #Taverne (auto join)
</article>
</td>
</tr>
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;
padding-top: 0px;" class="hero"><a target="_blank" style="text-decoration: none;"
href="/"><img border="0" vspace="0" hspace="0"
src="https://echosystem.fr/UpFile/Yq.png"
alt="Please enable images to view this content" title="Hero Image"
width="540" style="
max-width: 540px;
color: #FFFFFF; font-size: 13px; margin: 0; padding: 0; outline: none; text-decoration: none; -ms-interpolation-mode:
bicubic; border: none; display: block;"/></a></td>
</tr>
<!-- SUPHEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%; font-size: 14px; font-weight: 400; line-height: 150%; letter-spacing: 2px;
padding-top: 27px;
padding-bottom: 0;
color: #FFFFFF;
font-family: sans-serif;" class="supheader">
Information
</td>
</tr>
<!-- HEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%; font-size: 24px; font-weight: bold; line-height: 130%;
padding-top: 5px;
color: #FFFFFF;
font-family: sans-serif;" class="header">
Echosystem may help you
</td>
</tr>
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 160%;
padding-top: 15px;
color: #FFFFFF;
font-family: sans-serif;" class="paragraph">
Votre mail attend la validation d'un humain, <br>
il vous repondra dans les meilleurs delais, <br>
D'autres sections sont à votre dispositions: <br>
WIKI | Blog | RSS
</td>
</tr>
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%;
padding-top: 25px;
padding-bottom: 5px;" class="button"><a
href="http://echosystem.fr" target="_blank" style="text-decoration: underline;">
<table border="0" cellpadding="0" cellspacing="0" align="center" style="max-width: 240px; min-width: 120px;
border-collapse: collapse; border-spacing: 0; padding: 0;"><tr><td align="center" valign="middle" style="padding: 12px 24px; margin: 0;
text-decoration: underline; border-collapse: collapse; border-spacing: 0; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px;
-khtml-border-radius: 4px;" bgcolor="#E9703E">
<a target="_blank" style="text-decoration: underline;
color: #FFFFFF; font-family: sans-serif; font-size: 17px; font-weight: 400; line-height: 120%;"
href="https://echosystem.fr">
Merci.
</a>
</td></tr></table></a>
</td>
</tr>
<!-- LINE -->
<!-- Set line color -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%;
padding-top: 30px;" class="line"><hr
color="#565F73" align="center" width="100%" size="1" noshade style="margin: 0; padding: 0;" />
</td>
</tr>
<!-- FOOTER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif"). Duplicate all text styles in links, including line-height -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%;
padding-right: 6.25%; width: 87.5%; font-size: 13px; font-weight: 400; line-height: 150%;
padding-top: 10px;
padding-bottom: 20px;
color: #828999;
font-family: sans-serif;" class="footer">
This email was sent to&nbsp;you becouse you&nbsp;want to&nbsp;talk with &nbsp;someone. You&nbsp;could change your <a
href="https://echosystem.fr/" target="_blank" style="text-decoration: underline; color: #828999; font-family: sans-serif; font-size: 13px;
font-weight: 400; line-height: 150%;">subscription settings</a> anytime.
<img width="1" height="1" border="0" vspace="0" hspace="0" style="margin: 0; padding: 0; outline: none;
text-decoration: none; -ms-interpolation-mode: bicubic; border: none; display: block;"
src="https://echosystem.fr/Contact/tracker.png" />
</td>
</tr> <!-- End of WRAPPER --> </table> <!-- End of SECTION / BACKGROUND --> </td></tr></table> </body> </html>

7
merci.htm Normal file
View File

@ -0,0 +1,7 @@
<!DOCTYPE html> <html lang="fr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Votre message est bien envoyer.</title> <link href="style.css" rel="stylesheet"
type="text/css" media="screen" /> </head> <body> <div class="wrapper">
<div id="contact_form">
<h1>Merci Votre Message est bien Envoyer!</h1>
<a href="#">Accieul de notre site</a>
</div> </div>
</body></html>

59
public/js/contact-form.js Normal file
View File

@ -0,0 +1,59 @@
(function ($, window, document, undefined) {
'use strict';
function isSafari() {
return /^((?!chrome).)*safari/i.test(navigator.userAgent);
}
function addError (el) {
return el.parent().addClass('has-error');
};
var inputElem = document.createElement('input');
if (!('required' in inputElem) || isSafari()) {
$('#contact-form').submit(function () {
var hasError = false,
name = $('#form-name'),
mail = $('#form-email'),
answer = $('#form-control'),
subject = $('#form-subject'),
message = $('#form-message'),
testmail = /^[^0-9][A-z0-9._%+-]+([.][A-z0-9_]+)*[@][A-z0-9_-]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/,
$this = $(this);
$this.find('div').removeClass('has-error');
if (name.val() === '') {
hasError = true;
addError(name);
}
if (!testmail.test(mail.val())) {
hasError = true;
addError(mail);
}
if (subject.val() === '') {
hasError = true;
addError(subject);
}
if (message.val() === '') {
hasError = true;
addError(answer);
}
if (message.val() === '') {
hasError = true;
addError(message);
}
if (hasError === false) {
return true;
}
return false;
});
}
}(jQuery, window, document));

BIN
tracker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

48
vendor/Helpers/Config.class.php vendored Normal file
View File

@ -0,0 +1,48 @@
<?php
namespace Helpers;
/**
* Powerful And Easy Configuration with PHP.
*
* @package Config
* @author Pedro Rogério <pinceladasdaweb@hotmail.com>
* @copyright 2015 Pedro Rogério <pinceladasdaweb@hotmail.com>
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License 3.0
* @version Release: 0.0.1
* @link https://github.com/pinceladasdaweb/Config
*/
class Config
{
protected $data;
protected $default = null;
public function load($file)
{
$this->data = include $file;
}
public function get($key, $default = null)
{
$this->default = $default;
$segments = explode('.', $key);
$data = $this->data;
foreach ($segments as $segment) {
if (isset($data[$segment])) {
$data = $data[$segment];
} else {
$data = $this->default;
break;
}
}
return $data;
}
public function exists($key)
{
return $this->get($key) !== $this->default;
}
}

78
vendor/SimpleMail/SimpleMail.class.php vendored Normal file
View File

@ -0,0 +1,78 @@
<?php
namespace SimpleMail;
/**
* Powerful Class to send emails with PHP.
*
* @package SimpleMail
* @author Pedro Rogério <pinceladasdaweb@hotmail.com>
* @copyright 2016 Pedro Rogério <pinceladasdaweb@hotmail.com>
*/
class SimpleMail
{
protected $to;
protected $from;
protected $sender;
protected $subject;
protected $html;
public function setTo($to)
{
$this->to = $to;
}
public function setFrom($from)
{
$this->from = $from;
}
public function setSender($sender)
{
$this->sender = $sender;
}
public function setSubject($subject)
{
$this->subject = $subject;
}
public function setHtml($html)
{
$this->html = $html;
}
public function send()
{
$boundary = '----=_NextPart_' . md5(time());
$header = 'MIME-Version: 1.0' . PHP_EOL;
$header .= 'To: <' . $this->to . '>' . PHP_EOL;
$header .= 'Date: ' . date('D, d M Y H:i:s O') . PHP_EOL;
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->from . PHP_EOL;
$header .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
$header .= 'X-Priority: 3' . PHP_EOL;
$header .= 'MIME-Version: 1.0' . PHP_EOL;
$header .= 'Message-ID: ' . '<' . md5(uniqid(rand(), true )) . '@' . $_SERVER[ 'HTTP_HOST' ] . '>' . PHP_EOL;
$header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . PHP_EOL . PHP_EOL;
$message = '--' . $boundary . PHP_EOL;
$message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . PHP_EOL . PHP_EOL;
$message .= '--' . $boundary . '_alt' . PHP_EOL;
$message .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL;
$message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;
$message .= '--' . $boundary . '_alt' . PHP_EOL;
$message .= 'Content-Type: text/html; charset="utf-8"' . PHP_EOL;
$message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;
$message .= $this->html . PHP_EOL;
$message .= '--' . $boundary . '_alt--' . PHP_EOL;
ini_set('sendmail_from', $this->from);
mail($this->to, '=?UTF-8?B?' . base64_encode($this->subject) . '?=', $message, $header);
}
}

167
vendor/autoload.php vendored Normal file
View File

@ -0,0 +1,167 @@
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
* https://github.com/keradus/SplClassLoader
*
* Example which loads classes for the Doctrine Common package in the
* Doctrine\Common namespace.
* $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
* $classLoader->register();
*
* @author Jonathan H. Wage <jonwage@gmail.com>
* @author Roman S. Borschel <roman@code-factory.org>
* @author Matthew Weier O'Phinney <matthew@zend.com>
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
* @author Dariusz Ruminski <dariusz.ruminski@gmail.com>
*/
class SplClassLoader
{
private $_fileExtension = '.class.php';
private $_namespace;
private $_includePath;
private $_namespaceSeparator = '\\';
public $debug = false;
/**
* Creates a new <tt>SplClassLoader</tt> that loads classes of the
* specified namespace.
*
* @param string $ns The namespace to use.
* @param string $includePath The include path for all class files in the namespace.
*/
public function __construct($ns = null, $includePath = null)
{
$this->_namespace = $ns;
$this->_includePath = $includePath;
}
/**
* Sets the namespace separator used by classes in the namespace of this class loader.
*
* @param string $sep The separator to use.
*/
public function setNamespaceSeparator($sep)
{
$this->_namespaceSeparator = $sep;
}
/**
* Gets the namespace separator used by classes in the namespace of this class loader.
*
* @return string $_namespaceSeparator
*/
public function getNamespaceSeparator()
{
return $this->_namespaceSeparator;
}
/**
* Sets the base include path for all class files in the namespace of this class loader.
*
* @param string $includePath
*/
public function setIncludePath($includePath)
{
$this->_includePath = $includePath;
}
/**
* Gets the base include path for all class files in the namespace of this class loader.
*
* @return string $includePath
*/
public function getIncludePath()
{
return $this->_includePath;
}
/**
* Sets the file extension of class files in the namespace of this class loader.
*
* @param string $fileExtension
*/
public function setFileExtension($fileExtension)
{
$this->_fileExtension = $fileExtension;
}
/**
* Gets the file extension of class files in the namespace of this class loader.
*
* @return string $fileExtension
*/
public function getFileExtension()
{
return $this->_fileExtension;
}
/**
* Installs this class loader on the SPL autoload stack.
*/
public function register()
{
spl_autoload_register(array($this, 'loadClass'));
}
/**
* Uninstalls this class loader from the SPL autoloader stack.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $className The name of the class to load.
* @return bool whether the loading was successful
*/
public function loadClass($className)
{
if ($this->debug) {
var_dump("loadClass ($this->_namespace) $className");
}
if ($className[0] === "\\") {
$className = substr ($className, 1);
}
if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
$fileName = '';
$namespace = '';
if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
$filePathName = ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
if ($this->debug) {
var_dump("loading ($this->_namespace) $filePathName ...");
}
if (file_exists($filePathName)) {
include $filePathName;
$loaded = true;
} else {
$loaded = false;
}
if ($this->debug) {
var_dump("loading ($this->_namespace) $filePathName " . ($loaded ? "OK" : "ERR"));
}
return $loaded;
}
return false;
}
}