1 |
<?php
|
1 |
<?php
|
2 |
|
2 |
|
3 |
/********************************************************************
|
3 |
/********************************************************************
|
4 |
* *
|
4 |
* *
|
5 |
* ALCASAR EMAIL INSCRIPTION *
|
5 |
* ALCASAR EMAIL INSCRIPTION *
|
6 |
* *
|
6 |
* *
|
7 |
* By K@M3L & T3RRY @ La Plateforme_ *
|
7 |
* By K@M3L & T3RRY @ La Plateforme_ *
|
8 |
* By Rexy *
|
8 |
* By Rexy *
|
9 |
* Partie front de la page d'inscription des utilisateurs *
|
9 |
* Partie front de la page d'inscription des utilisateurs *
|
10 |
* elle envoi les infos à traiter à la page de traitement *
|
10 |
* elle envoi les infos à traiter à la page de traitement *
|
11 |
* via AJAX (email_registration_back) *
|
11 |
* via AJAX (email_registration_back) *
|
12 |
* *
|
12 |
* *
|
13 |
/********************************************************************/
|
13 |
/********************************************************************/
|
14 |
|
14 |
|
- |
|
15 |
/****************************************************************
|
- |
|
16 |
* GLOBAL FILE PATHS *
|
- |
|
17 |
*****************************************************************/
|
- |
|
18 |
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
|
- |
|
19 |
|
15 |
$page = "email_registration";
|
20 |
$page = "email_registration";
|
16 |
$Language = 'en';
|
21 |
$Language = 'en';
|
17 |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
22 |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
18 |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
23 |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
19 |
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
|
24 |
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
|
20 |
}
|
25 |
}
|
21 |
if ($Language === 'es') { // Spanish
|
26 |
if ($Language === 'es') { // Spanish
|
22 |
$l_title = "Inscripción por e-mail";
|
27 |
$l_title = "Inscripción por e-mail";
|
23 |
$l_Email = "dirección de e-mail : *";
|
28 |
$l_Email = "dirección de e-mail : *";
|
24 |
$l_mandatory = "* Campos requeridos";
|
29 |
$l_mandatory = "* Campos requeridos";
|
25 |
$l_inscription = "Inscripción";
|
30 |
$l_inscription = "Inscripción";
|
26 |
$l_mail_success = "Se ha enviado una contraseña a su dirección de correo electrónico.\\nVRevise su correo no deseado o spam, si no ve este correo en su bandeja de entrada.";
|
31 |
$l_mail_success = "Se ha enviado una contraseña a su dirección de correo electrónico.\\nVRevise su correo no deseado o spam, si no ve este correo en su bandeja de entrada.";
|
27 |
$l_mail_error = "Se ha producido un error. Por favor, renueve su registro o póngase en contacto con su administrador.";
|
32 |
$l_mail_error = "Se ha producido un error. Por favor, renueve su registro o póngase en contacto con su administrador.";
|
28 |
} else if ($Language === 'pt') { // Portuguese
|
33 |
} else if ($Language === 'pt') { // Portuguese
|
29 |
$l_title = "inscrição de e-mail";
|
34 |
$l_title = "inscrição de e-mail";
|
30 |
$l_Email = "endereço de e-mail : *";
|
35 |
$l_Email = "endereço de e-mail : *";
|
31 |
$l_mandatory = "* Campos obrigatórios";
|
36 |
$l_mandatory = "* Campos obrigatórios";
|
32 |
$l_inscription = "Inscrição";
|
37 |
$l_inscription = "Inscrição";
|
33 |
$l_mail_success = "Foi enviada uma senha para o seu endereço electrónico.\\nVerifique o seu spam ou lixo electrónico, se não vir este e-mail na sua caixa de entrada.";
|
38 |
$l_mail_success = "Foi enviada uma senha para o seu endereço electrónico.\\nVerifique o seu spam ou lixo electrónico, se não vir este e-mail na sua caixa de entrada.";
|
34 |
$l_mail_error = "Ocorreu um erro. Por favor, renove o seu registo ou contacte o seu administrador.";
|
39 |
$l_mail_error = "Ocorreu um erro. Por favor, renove o seu registo ou contacte o seu administrador.";
|
35 |
} else if ($Language === 'de') { // German
|
40 |
} else if ($Language === 'de') { // German
|
36 |
$l_title = "E-Mail-Anschrift";
|
41 |
$l_title = "E-Mail-Anschrift";
|
37 |
$l_Email = "e-mail adress : *";
|
42 |
$l_Email = "e-mail adress : *";
|
38 |
$l_mandatory = "* Erforderliche Felder";
|
43 |
$l_mandatory = "* Erforderliche Felder";
|
39 |
$l_inscription = "Aufschrift";
|
44 |
$l_inscription = "Aufschrift";
|
40 |
$l_mail_success = "Ein Passwort wurde an Ihre E-Mail-Adresse gesendet.\\nPrüfen Sie Ihre Spam- oder Junk-Mail, wenn Sie diese E-Mail nicht in Ihrem Posteingang finden.";
|
45 |
$l_mail_success = "Ein Passwort wurde an Ihre E-Mail-Adresse gesendet.\\nPrüfen Sie Ihre Spam- oder Junk-Mail, wenn Sie diese E-Mail nicht in Ihrem Posteingang finden.";
|
41 |
$l_mail_error = "Es ist ein Fehler aufgetreten. Bitte erneuern Sie Ihre Registrierung oder kontaktieren Sie Ihren Administrator.";
|
46 |
$l_mail_error = "Es ist ein Fehler aufgetreten. Bitte erneuern Sie Ihre Registrierung oder kontaktieren Sie Ihren Administrator.";
|
42 |
} else if ($Language === 'nl') { // Dutch
|
47 |
} else if ($Language === 'nl') { // Dutch
|
43 |
$l_title = "e-mail inscriptie";
|
48 |
$l_title = "e-mail inscriptie";
|
44 |
$l_Email = "e-mailadres : *";
|
49 |
$l_Email = "e-mailadres : *";
|
45 |
$l_mandatory = "* Verplichte velden";
|
50 |
$l_mandatory = "* Verplichte velden";
|
46 |
$l_inscription = "Opschrift";
|
51 |
$l_inscription = "Opschrift";
|
47 |
$l_mail_success = "Er is een wachtwoord naar uw e-mail adres gestuurd.\\nControleer uw spam of junk mail, als u deze e-mail niet in uw inbox ziet.";
|
52 |
$l_mail_success = "Er is een wachtwoord naar uw e-mail adres gestuurd.\\nControleer uw spam of junk mail, als u deze e-mail niet in uw inbox ziet.";
|
48 |
$l_mail_error = "Er is een fout opgetreden. Vernieuw uw registratie of neem contact op met uw beheerder.";
|
53 |
$l_mail_error = "Er is een fout opgetreden. Vernieuw uw registratie of neem contact op met uw beheerder.";
|
49 |
} else if ($Language === 'zh') { // Chinese
|
54 |
} else if ($Language === 'zh') { // Chinese
|
50 |
$l_title = "电子邮件题词";
|
55 |
$l_title = "电子邮件题词";
|
51 |
$l_Email = "电子邮件地址 : *";
|
56 |
$l_Email = "电子邮件地址 : *";
|
52 |
$l_mandatory = "* 必须填写";
|
57 |
$l_mandatory = "* 必须填写";
|
53 |
$l_inscription = "铭文";
|
58 |
$l_inscription = "铭文";
|
54 |
$l_mail_success = "一个密码已经发送到你的邮箱。\\n如果你在收件箱中没有看到这封邮件,请检查你的垃圾邮件或垃圾邮件。";
|
59 |
$l_mail_success = "一个密码已经发送到你的邮箱。\\n如果你在收件箱中没有看到这封邮件,请检查你的垃圾邮件或垃圾邮件。";
|
55 |
$l_mail_error = "发生了一个错误。请更新您的注册或联系您的管理员。";
|
60 |
$l_mail_error = "发生了一个错误。请更新您的注册或联系您的管理员。";
|
56 |
} else if ($Language === 'ar') { // Arabic
|
61 |
} else if ($Language === 'ar') { // Arabic
|
57 |
$l_title = "تسجيل البريد الإلكتروني";
|
62 |
$l_title = "تسجيل البريد الإلكتروني";
|
58 |
$l_Email = "عنوان البريد الالكترونى : *";
|
63 |
$l_Email = "عنوان البريد الالكترونى : *";
|
59 |
$l_mandatory = "* الحقول المطلوبة";
|
64 |
$l_mandatory = "* الحقول المطلوبة";
|
60 |
$l_inscription = "التسجيل";
|
65 |
$l_inscription = "التسجيل";
|
61 |
$l_mail_success = "تم إرسال كلمة المرور إلى عنوان البريد الإلكتروني الخاص بك.\\nتحقق من البريد العشوائي أو البريد غير الهام ، إذا كنت لا ترى هذا البريد الإلكتروني في صندوق الوارد الخاص بك.";
|
66 |
$l_mail_success = "تم إرسال كلمة المرور إلى عنوان البريد الإلكتروني الخاص بك.\\nتحقق من البريد العشوائي أو البريد غير الهام ، إذا كنت لا ترى هذا البريد الإلكتروني في صندوق الوارد الخاص بك.";
|
62 |
$l_mail_error = "الرجاء تجديد التسجيل الخاص بك أو الاتصال بالمسؤول.";
|
67 |
$l_mail_error = "الرجاء تجديد التسجيل الخاص بك أو الاتصال بالمسؤول.";
|
63 |
} else if ($Language === 'fr') {
|
68 |
} else if ($Language === 'fr') {
|
64 |
$l_title = "Inscription par e-mail";
|
69 |
$l_title = "Inscription par e-mail";
|
65 |
$l_Email = "Adresse e-mail : *";
|
70 |
$l_Email = "Adresse e-mail : *";
|
66 |
$l_mandatory = "* Champs requis";
|
71 |
$l_mandatory = "* Champs requis";
|
67 |
$l_inscription = "Inscription";
|
72 |
$l_inscription = "Inscription";
|
68 |
$l_mail_success = "Un mot de passe vient d'être envoyé à votre adresse e-mail.\\nVérifier vos spams ou courriers indésirables, si vous ne voyez pas cet e-mail dans votre boîte de réception.";
|
73 |
$l_mail_success = "Un mot de passe vient d'être envoyé à votre adresse e-mail.\\nVérifier vos spams ou courriers indésirables, si vous ne voyez pas cet e-mail dans votre boîte de réception.";
|
69 |
$l_mail_error = "Une erreur s'est produite. Veuillez renouveler votre inscription ou contacter votre administrateur.";
|
74 |
$l_mail_error = "Une erreur s'est produite. Veuillez renouveler votre inscription ou contacter votre administrateur.";
|
70 |
} else { // english
|
75 |
} else { // english
|
71 |
$l_title = "e-mail inscription";
|
76 |
$l_title = "e-mail inscription";
|
72 |
$l_Email = "e-mail address : *";
|
77 |
$l_Email = "e-mail address : *";
|
73 |
$l_mandatory = "* Required fields";
|
78 |
$l_mandatory = "* Required fields";
|
74 |
$l_inscription = "Inscription";
|
79 |
$l_inscription = "Inscription";
|
75 |
$l_mail_success = "A password has been sent to your e-mail address.\\nCheck your spam or junk mail, if you don't see this e-mail in your inbox.";
|
80 |
$l_mail_success = "A password has been sent to your e-mail address.\\nCheck your spam or junk mail, if you don't see this e-mail in your inbox.";
|
76 |
$l_mail_error = "An error has occurred. Please renew your registration or contact your administrator.";
|
81 |
$l_mail_error = "An error has occurred. Please renew your registration or contact your administrator.";
|
77 |
}
|
82 |
}
|
- |
|
83 |
|
- |
|
84 |
/****************************************************************
|
- |
|
85 |
* Read CONF_FILE *
|
- |
|
86 |
*****************************************************************/
|
- |
|
87 |
$file_conf = fopen(CONF_FILE, 'r');
|
- |
|
88 |
if (!$file_conf) {
|
- |
|
89 |
exit('Error opening the file '.CONF_FILE);
|
- |
|
90 |
}
|
- |
|
91 |
while (!feof($file_conf)) {
|
- |
|
92 |
$buffer = fgets($file_conf, 4096);
|
- |
|
93 |
if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
|
- |
|
94 |
$tmp = explode('=', $buffer, 2);
|
- |
|
95 |
$conf[trim($tmp[0])] = trim($tmp[1]);
|
- |
|
96 |
}
|
- |
|
97 |
}
|
- |
|
98 |
fclose($file_conf);
|
- |
|
99 |
$whiteDomain = $conf['MAIL_WHITEDOMAIN'];
|
78 |
?>
|
100 |
?>
|
79 |
<!DOCTYPE html>
|
101 |
<!DOCTYPE html>
|
80 |
<html>
|
102 |
<html>
|
81 |
<head>
|
103 |
<head>
|
82 |
<meta charset="UTF-8">
|
104 |
<meta charset="UTF-8">
|
83 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
105 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
84 |
<title>ALCASAR - <?=$l_title ?></title>
|
106 |
<title>ALCASAR - <?=$l_title?></title>
|
85 |
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
107 |
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
86 |
<link rel="stylesheet" type="text/css" href="css/pass.css">
|
108 |
<link rel="stylesheet" type="text/css" href="css/pass.css">
|
87 |
<link rel="icon" href="images/favicon-48.ico" type="image/ico">
|
109 |
<link rel="icon" href="images/favicon-48.ico" type="image/ico">
|
88 |
<script type="text/javascript" src="js/jquery.min.js"></script>
|
110 |
<script type="text/javascript" src="js/jquery.min.js"></script>
|
89 |
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
111 |
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
90 |
</head>
|
112 |
</head>
|
91 |
<body>
|
113 |
<body>
|
92 |
<div class="col-12 col-lg-10 offset-lg-1">
|
114 |
<div class="col-12 col-lg-10 offset-lg-1">
|
93 |
<?php require_once(__DIR__.'/header.php'); ?>
|
115 |
<?php require_once(__DIR__.'/header.php'); ?>
|
94 |
<section id="inscription" class="row">
|
116 |
<section id="inscription" class="row">
|
95 |
<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
|
117 |
<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
|
96 |
<div class="row input_row">
|
118 |
<div class="row input_row">
|
97 |
<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
|
119 |
<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
|
98 |
<div class="col-6 col-lg-4">
|
120 |
<div class="col-6 col-lg-4">
|
99 |
<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
|
121 |
<input type="email" placeholder="@<?=$whiteDomain?>" id="email" name="email" required class="form-control"/>
|
100 |
</div>
|
122 |
</div>
|
101 |
<small id="output_email" class="row"></small>
|
123 |
<small id="output_email" class="row"></small>
|
102 |
</div>
|
124 |
</div>
|
103 |
<div id="status">
|
125 |
<div id="status">
|
104 |
<?=$l_mandatory?>
|
126 |
<?=$l_mandatory?>
|
105 |
</div>
|
127 |
</div>
|
106 |
<div class="row input_row">
|
128 |
<div class="row input_row">
|
107 |
<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
|
129 |
<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
|
108 |
<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
|
130 |
<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
|
109 |
</div>
|
131 |
</div>
|
110 |
<div class="col-5 col-md-4">
|
132 |
<div class="col-5 col-md-4">
|
111 |
<button type="submit" class="btn btn-primary btn-lg" id="buttons" ><?=$l_inscription?></button>
|
133 |
<button type="submit" class="btn btn-primary btn-lg" id="buttons" ><?=$l_inscription?></button>
|
112 |
</div>
|
134 |
</div>
|
113 |
</div>
|
135 |
</div>
|
114 |
</form>
|
136 |
</form>
|
115 |
</section>
|
137 |
</section>
|
116 |
<script>
|
138 |
<script>
|
117 |
jQuery(document).ready(function($){
|
139 |
jQuery(document).ready(function($){
|
118 |
$("#contenu_acces input").focus(function(){
|
140 |
$("#contenu_acces input").focus(function(){
|
119 |
$("#status").fadeOut(800);
|
141 |
$("#status").fadeOut(800);
|
120 |
});
|
142 |
});
|
121 |
$("#contenu_acces").submit(function(){
|
143 |
$("#contenu_acces").submit(function(){
|
122 |
var status = $("#status");
|
144 |
var status = $("#status");
|
123 |
var Fmail = $("#email").val();
|
145 |
var Fmail = $("#email").val();
|
124 |
$.ajax({
|
146 |
$.ajax({
|
125 |
type: "post",
|
147 |
type: "post",
|
126 |
url: "email_registration_back.php",
|
148 |
url: "email_registration_back.php",
|
127 |
data: {
|
149 |
data: {
|
128 |
'Fmail' : Fmail,
|
150 |
'Fmail' : Fmail,
|
129 |
},
|
151 |
},
|
130 |
beforeSend: function(){
|
152 |
beforeSend: function(){
|
131 |
$("#status").attr("value", "Traitement en cours...");
|
153 |
$("#status").attr("value", "Traitement en cours...");
|
132 |
},
|
154 |
},
|
133 |
success: function(data){
|
155 |
success: function(data){
|
134 |
if (data.match("success")) {
|
156 |
if (data.match("success")) {
|
135 |
status.html(data).fadeIn(400);
|
157 |
status.html(data).fadeIn(400);
|
136 |
alert("<?=$l_mail_success?>");
|
158 |
alert("<?=$l_mail_success?>");
|
137 |
document.location.href="index.php";
|
159 |
document.location.href="index.php";
|
138 |
} else {
|
160 |
} else {
|
139 |
console.log(data);
|
161 |
console.log(data);
|
140 |
alert("<?=$l_mail_error?>");
|
162 |
alert("<?=$l_mail_error?>");
|
141 |
status.css("color", "red").html(data).fadeIn(400);
|
163 |
status.css("color", "red").html(data).fadeIn(400);
|
142 |
}
|
164 |
}
|
143 |
}
|
165 |
}
|
144 |
});
|
166 |
});
|
145 |
});
|
167 |
});
|
146 |
});
|
168 |
});
|
147 |
</script>
|
169 |
</script>
|
148 |
</div>
|
170 |
</div>
|
149 |
</body>
|
171 |
</body>
|
150 |
</html>
|
172 |
</html>
|
151 |
|
173 |
|