| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
|
2 |
|
| 3 |
/************************************************************************
|
3 |
/************************************************************************
|
| 4 |
* ALCASAR INSCRIPTION *
|
4 |
* ALCASAR INSCRIPTION *
|
| 5 |
* *
|
5 |
* *
|
| 6 |
* By K@M3L & T3RRY LaPlateforme *
|
6 |
* By K@M3L & T3RRY LaPlateforme
|
| - |
|
7 |
* By Rexy *
|
| 7 |
* *
|
8 |
* *
|
| 8 |
* Partie back de la page d'inscription des utilisateurs *
|
9 |
* Partie back de la page d'inscription des utilisateurs *
|
| 9 |
* Récupère les infos de "email_registration_front.php *
|
10 |
* Récupère les infos de "email_registration_front.php *
|
| 10 |
* - Lit le fichier de configuration /usr/local/etc/alcasar.conf *
|
11 |
* - Lit le fichier de configuration /usr/local/etc/alcasar.conf *
|
| 11 |
* - Verifie si le login est déjà présent dans la table "radcheck" *
|
12 |
* - Verifie si le login est déjà présent dans la table "radcheck" *
|
| Line 14... |
Line 15... |
| 14 |
* - Crée l'utilisateur avec un mot de passe aléatoire *
|
15 |
* - Crée l'utilisateur avec un mot de passe aléatoire *
|
| 15 |
* - Envoi l'email à l'utilisaeur et à l'admin avec date et IP *
|
16 |
* - Envoi l'email à l'utilisaeur et à l'admin avec date et IP *
|
| 16 |
* *
|
17 |
* *
|
| 17 |
*************************************************************************/
|
18 |
*************************************************************************/
|
| 18 |
|
19 |
|
| - |
|
20 |
/****************************************************************
|
| - |
|
21 |
* GLOBAL FILE PATHS *
|
| - |
|
22 |
*****************************************************************/
|
| - |
|
23 |
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
|
| - |
|
24 |
/****************************************************************
|
| - |
|
25 |
* Conf files reading test *
|
| - |
|
26 |
*****************************************************************/
|
| - |
|
27 |
$conf_files = array(CONF_FILE);
|
| - |
|
28 |
foreach ($conf_files as $file) {
|
| - |
|
29 |
if (!file_exists($file)) {
|
| - |
|
30 |
exit("Fichier $file non présent");
|
| - |
|
31 |
}
|
| - |
|
32 |
if (!is_readable($file)) {
|
| - |
|
33 |
exit("Vous n'avez pas les droits de lecture sur le fichier $file");
|
| - |
|
34 |
}
|
| - |
|
35 |
}
|
| - |
|
36 |
/****************************************************************
|
| - |
|
37 |
* Read CONF_FILE *
|
| - |
|
38 |
*****************************************************************/
|
| - |
|
39 |
$file_conf = fopen(CONF_FILE, 'r');
|
| - |
|
40 |
if (!$file_conf) {
|
| - |
|
41 |
exit('Error opening the file '.CONF_FILE);
|
| - |
|
42 |
}
|
| - |
|
43 |
while (!feof($file_conf)) {
|
| - |
|
44 |
$buffer = fgets($file_conf, 4096);
|
| - |
|
45 |
if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
|
| - |
|
46 |
$tmp = explode('=', $buffer, 2);
|
| - |
|
47 |
$conf[trim($tmp[0])] = trim($tmp[1]);
|
| - |
|
48 |
}
|
| - |
|
49 |
}
|
| - |
|
50 |
fclose($file_conf);
|
| - |
|
51 |
$whiteDomain = explode(" ", strtolower(trim($conf['MAIL_WHITEDOMAIN'])));
|
| - |
|
52 |
$adminMail = $conf['MAIL_ADMIN'];
|
| - |
|
53 |
|
| - |
|
54 |
/****************************************
|
| - |
|
55 |
* Choice of language *
|
| - |
|
56 |
*****************************************/
|
| 19 |
$Language = 'en';
|
57 |
$Language = 'en';
|
| 20 |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
58 |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
| 21 |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
59 |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
| 22 |
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
|
60 |
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
|
| 23 |
}
|
61 |
}
|
| 24 |
if ($Language === 'fr') {
|
62 |
if ($Language === 'fr') {
|
| 25 |
$l_invalid_Email = "L'adresse email est invalide";
|
63 |
$l_invalid_Email = "L'adresse email est invalide";
|
| 26 |
$l_domain = "Le domaine";
|
64 |
$l_domain = "Le domaine";
|
| 27 |
$l_not_authorized = "n'est pas autorisé";
|
65 |
$l_not_authorized = "n'est pas autorisé";
|
| 28 |
$l_Email_already_used = "Cette adresse email est déjà utilisée.";
|
66 |
$l_Email_already_used = "Cette adresse email est déjà utilisée.";
|
| - |
|
67 |
$l_subject = "Activation de votre compte ALCASAR";
|
| - |
|
68 |
$l_hello = "Bonjour";
|
| - |
|
69 |
$l_automatic_mail = "Ceci est un e-mail automatique provenant d'un portail ALCASAR";
|
| - |
|
70 |
$l_login = "Vos indentifiants de connexion :";
|
| - |
|
71 |
$l_email = "Adresse e-mail";
|
| - |
|
72 |
$l_password = "Mot de passe";
|
| - |
|
73 |
$l_go_home = "Rendez-vous sur la page d'accueil";
|
| - |
|
74 |
$l_mail_error = "Erreur lors de l'envoi du mail. Renouvelez votre inscription ou contactez votre administrateur.";
|
| 29 |
} else {
|
75 |
} else {
|
| 30 |
$l_invalid_Email = "Invalid Email address";
|
76 |
$l_invalid_Email = "Invalid Email address";
|
| 31 |
$l_domain = "The domain";
|
77 |
$l_domain = "The domain";
|
| 32 |
$l_not_authorized = "is not authorized";
|
78 |
$l_not_authorized = "is not authorized";
|
| 33 |
$l_Email_already_used = "This Email address is already used.";
|
79 |
$l_Email_already_used = "This Email address is already used.";
|
| - |
|
80 |
$l_subject = "Activation of your ALCASAR account";
|
| - |
|
81 |
$l_hello = "Hello";
|
| - |
|
82 |
$l_automatic_mail = "This is an automatic e-mail from an ALCASAR portal";
|
| - |
|
83 |
$l_login = "Your login credentials :";
|
| - |
|
84 |
$l_email = "e-mail address";
|
| - |
|
85 |
$l_password = "Password";
|
| - |
|
86 |
$l_go_home = "Go to the home page";
|
| - |
|
87 |
$l_mail_error = "Error while sending the email. Renew your registration or contact your administrator.";
|
| 34 |
}
|
88 |
}
|
| 35 |
|
89 |
|
| 36 |
if (is_file("acc/manager/lib/langues.php"))
|
90 |
if (is_file("acc/manager/lib/langues.php"))
|
| 37 |
include("acc/manager/lib/langues.php");
|
91 |
include("acc/manager/lib/langues.php");
|
| 38 |
|
92 |
|
| Line 89... |
Line 143... |
| 89 |
$nb_car--;
|
143 |
$nb_car--;
|
| 90 |
}
|
144 |
}
|
| 91 |
return $password;
|
145 |
return $password;
|
| 92 |
}
|
146 |
}
|
| 93 |
|
147 |
|
| 94 |
// Lecture du fichier de configuration, récupération des listes WLD et l'email de l'admin
|
- |
|
| 95 |
$alcasar_Conf_File = "/usr/local/etc/alcasar.conf";
|
- |
|
| 96 |
if (is_file ($alcasar_Conf_File)){
|
- |
|
| 97 |
$tab=file($alcasar_Conf_File);
|
- |
|
| 98 |
if ($tab){
|
- |
|
| 99 |
foreach ($tab as $line){
|
- |
|
| 100 |
$field=explode("=", $line);
|
- |
|
| 101 |
switch ($field[0]){
|
- |
|
| 102 |
case 'MAIL_WHITEDOMAIN':
|
- |
|
| 103 |
$whiteDomain = explode(" ", strtolower(trim($field[1])));
|
- |
|
| 104 |
break;
|
- |
|
| 105 |
case 'MAIL_ADMIN':
|
- |
|
| 106 |
$adminMail = $field[1];
|
- |
|
| 107 |
break;
|
- |
|
| 108 |
}
|
- |
|
| 109 |
}
|
- |
|
| 110 |
}
|
- |
|
| 111 |
}
|
- |
|
| 112 |
|
- |
|
| 113 |
if(isset($_POST['Fmail'])){
|
148 |
if(isset($_POST['Fmail'])){
|
| 114 |
|
- |
|
| 115 |
extract($_POST);
|
149 |
extract($_POST);
|
| 116 |
|
- |
|
| 117 |
$Fmail = htmlentities(strtolower(trim($Fmail)));
|
150 |
$Fmail = htmlentities(strtolower(trim($Fmail)));
|
| 118 |
|
- |
|
| 119 |
if(!filter_var($Fmail, FILTER_VALIDATE_EMAIL)){
|
151 |
if(!filter_var($Fmail, FILTER_VALIDATE_EMAIL)){
|
| 120 |
echo "<b>$l_invalid_Email</b><br />\n";
|
152 |
echo "<b>$l_invalid_Email</b><br />\n";
|
| 121 |
exit();
|
153 |
exit();
|
| 122 |
}
|
154 |
}
|
| 123 |
|
155 |
|
| 124 |
// on récupère le nom de domaine du mail@domain.com
|
156 |
// Retrieve the domainName of the new user
|
| 125 |
list($user, $domain) = explode('@', $Fmail);
|
157 |
list($user, $domain) = explode('@', $Fmail);
|
| 126 |
|
158 |
|
| 127 |
// on vérifie si le domaine est dans la WLD, sinon on bloque
|
159 |
// check if the domainName is in the whitelist
|
| 128 |
if (!empty($whiteDomain)){
|
160 |
if (!empty($whiteDomain)){
|
| 129 |
if (!in_array($domain, $whiteDomain)){
|
161 |
if (!in_array($domain, $whiteDomain)){
|
| 130 |
echo "$l_domain $domain $l_not_authorized";
|
162 |
echo "$l_domain $domain $l_not_authorized";
|
| 131 |
exit();
|
163 |
exit();
|
| 132 |
}
|
164 |
}
|
| 133 |
}
|
165 |
}
|
| 134 |
|
- |
|
| 135 |
$login = $Fmail;
|
166 |
$login = $Fmail;
|
| 136 |
|
167 |
|
| 137 |
// si le login est présent
|
168 |
// check if the new user already exist
|
| 138 |
$link = @da_sql_pconnect($config);
|
169 |
$link = @da_sql_pconnect($config);
|
| 139 |
if ($link) {
|
170 |
if ($link) {
|
| 140 |
$sql = "SELECT id FROM $config[sql_check_table] WHERE username = '$login';";
|
171 |
$sql = "SELECT id FROM $config[sql_check_table] WHERE username = '$login';";
|
| 141 |
$res = @da_sql_query($link,$config, $sql);
|
172 |
$res = @da_sql_query($link,$config, $sql);
|
| 142 |
}
|
173 |
}
|
| - |
|
174 |
$login_check = da_sql_num_rows($res,$config);
|
| - |
|
175 |
da_sql_close($link,$config);
|
| 143 |
|
176 |
|
| 144 |
$login_check = da_sql_num_rows($res,$config);
|
177 |
// check if the new user is already in the profile of an existing user
|
| 145 |
|
- |
|
| 146 |
// da_sql_close($link,$config)
|
- |
|
| 147 |
|
- |
|
| 148 |
// si le mail est présent
|
- |
|
| 149 |
$link = @da_sql_pconnect($config);
|
178 |
$link = @da_sql_pconnect($config);
|
| 150 |
if ($link) {
|
179 |
if ($link) {
|
| 151 |
$sql = "SELECT id FROM $config[sql_user_info_table] WHERE mail = '$Fmail';";
|
180 |
$sql = "SELECT id FROM $config[sql_user_info_table] WHERE mail = '$Fmail';";
|
| 152 |
$res = @da_sql_query($link,$config, $sql);
|
181 |
$res = @da_sql_query($link,$config, $sql);
|
| 153 |
}
|
182 |
}
|
| 154 |
|
- |
|
| 155 |
$email_check = da_sql_num_rows($res,$config);
|
183 |
$email_check = da_sql_num_rows($res,$config);
|
| 156 |
|
- |
|
| 157 |
// da_sql_close($link,$config)
|
184 |
da_sql_close($link,$config);
|
| 158 |
|
- |
|
| 159 |
|
- |
|
| 160 |
if($login_check > 0) { //Adresse email utilisée en tant que login
|
185 |
if($login_check > 0) { // user already exist
|
| 161 |
echo "<b>$l_Email_already_used</b><br />\n";
|
186 |
echo "<b>$l_Email_already_used</b><br />\n";
|
| 162 |
} else if($email_check > 0) { //Adresse email utilisée dans les infos utilisateur
|
187 |
} else if($email_check > 0) { // email already used
|
| 163 |
echo "<b>$l_Email_already_used</b><br />\n";
|
188 |
echo "<b>$l_Email_already_used</b><br />\n";
|
| 164 |
} else {
|
189 |
} else {
|
| 165 |
$password = GenPassword();
|
190 |
$password = GenPassword();
|
| 166 |
|
191 |
|
| 167 |
// si on ajoute des inputs pour les infos user
|
192 |
// if we want to enrich the new user profile
|
| 168 |
/* $Fcn = "$prenom".".$nom";
|
193 |
/* $Fcn = "$prenom".".$nom";
|
| 169 |
$Fou = "";
|
194 |
$Fou = "";
|
| 170 |
$Fhomephone = "";
|
195 |
$Fhomephone = "";
|
| 171 |
$Ftelephonenumber = "";
|
196 |
$Ftelephonenumber = "";
|
| 172 |
$Fmobile = "";
|
197 |
$Fmobile = "";
|
| Line 206... |
Line 231... |
| 206 |
if (!$res || !da_sql_affected_rows($link,$res,$config))
|
231 |
if (!$res || !da_sql_affected_rows($link,$res,$config))
|
| 207 |
// Erreur sql à supprimer : l'info ne devrait pas être communiquer au client.
|
232 |
// Erreur sql à supprimer : l'info ne devrait pas être communiquer au client.
|
| 208 |
echo "<b>Une erreur s'est produite lors de la création du compte : " . da_sql_error($link,$config) . "</b><br />\n";
|
233 |
echo "<b>Une erreur s'est produite lors de la création du compte : " . da_sql_error($link,$config) . "</b><br />\n";
|
| 209 |
}
|
234 |
}
|
| 210 |
else
|
235 |
else
|
| 211 |
echo "<b>L'utilisateur existe déjà</b><br />\n";
|
236 |
echo "<b>User already exist</b><br />\n";
|
| 212 |
}
|
237 |
}
|
| 213 |
else
|
238 |
else
|
| 214 |
echo "<b>Une erreur s'est produite lors de la création du compte : " . da_sql_error($link,$config) . "</b><br />\n";
|
239 |
echo "<b>Une erreur s'est produite lors de la création du compte : " . da_sql_error($link,$config) . "</b><br />\n";
|
| 215 |
}
|
240 |
}
|
| 216 |
// si on veut ajouter les nouveau utilisateurs a un groupe par défaut, autre que celui par défaut d'alcasar
|
241 |
// if the new user must be in a group
|
| 217 |
if (isset($Fgroup) && $Fgroup != ''){
|
242 |
if (isset($Fgroup) && $Fgroup != ''){
|
| 218 |
$Fgroup = da_sql_escape_string($link, $Fgroup);
|
243 |
$Fgroup = da_sql_escape_string($link, $Fgroup);
|
| 219 |
$res = da_sql_query($link,$config,
|
244 |
$res = da_sql_query($link,$config,
|
| 220 |
"SELECT username FROM $config[sql_usergroup_table]
|
245 |
"SELECT username FROM $config[sql_usergroup_table]
|
| 221 |
WHERE username = '$login' AND groupname = '$Fgroup';");
|
246 |
WHERE username = '$login' AND groupname = '$Fgroup';");
|
| Line 231... |
Line 256... |
| 231 |
echo "<b>L'utilisateur est déjà présent dans le groupe $Fgroup</b><br />\n";
|
256 |
echo "<b>L'utilisateur est déjà présent dans le groupe $Fgroup</b><br />\n";
|
| 232 |
}
|
257 |
}
|
| 233 |
else
|
258 |
else
|
| 234 |
echo "<b>Impossible d'ajouter l'utilisateur dans le groupe $Fgroup: " . da_sql_error($link,$config) . "</b><br />\n";
|
259 |
echo "<b>Impossible d'ajouter l'utilisateur dans le groupe $Fgroup: " . da_sql_error($link,$config) . "</b><br />\n";
|
| 235 |
}
|
260 |
}
|
| - |
|
261 |
/*
|
| 236 |
if (!$da_abort){
|
262 |
if (!$da_abort){
|
| 237 |
if (isset($Fgroup) && $Fgroup != '')
|
263 |
if (isset($Fgroup) && $Fgroup != '')
|
| 238 |
require('acc/manager/lib/defaults.php');
|
264 |
require('acc/manager/lib/defaults.php');
|
| 239 |
foreach($show_attrs as $key => $attr){
|
265 |
foreach($show_attrs as $key => $attr){
|
| 240 |
if ($attrmap["$key"] == 'none')
|
266 |
if ($attrmap["$key"] == 'none')
|
| Line 274... |
Line 300... |
| 274 |
$res = da_sql_query($link,$config,$sqlquery);
|
300 |
$res = da_sql_query($link,$config,$sqlquery);
|
| 275 |
if (!$res || !da_sql_affected_rows($link,$res,$config))
|
301 |
if (!$res || !da_sql_affected_rows($link,$res,$config))
|
| 276 |
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br />\n";
|
302 |
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br />\n";
|
| 277 |
}
|
303 |
}
|
| 278 |
}
|
304 |
}
|
| 279 |
// L'utilisateur est ajouter dans la radcheck, ses info dans la userinfo, on envoi le mail avec identifiant et passwd
|
- |
|
| 280 |
|
305 |
*/
|
| - |
|
306 |
// Creation of the email with the new user login & passwd
|
| 281 |
$ip = $_SERVER['REMOTE_ADDR'];
|
307 |
$ip = $_SERVER['REMOTE_ADDR'];
|
| 282 |
$time = date_create('now')->format('d-m-Y H:i:s');
|
308 |
$time = date_create('now')->format('d-m-Y H:i:s');
|
| 283 |
$domain = $conf["DOMAIN"];
|
309 |
$domain = $conf["DOMAIN"];
|
| 284 |
$hostname = $conf["HOSTNAME"].'.'.$domain;
|
310 |
$hostname = $conf["HOSTNAME"];
|
| 285 |
|
- |
|
| 286 |
$to = $Fmail;
|
311 |
$to = $Fmail;
|
| 287 |
$from = "alcasar@$domain";
|
312 |
$from = "administrator";
|
| 288 |
$subject = "Activation de votre compte ALCASAR";
|
313 |
$subject = $l_subject;
|
| 289 |
$message = "<!DOCTYPE html>
|
314 |
$message = "<!DOCTYPE html>
|
| 290 |
<html>
|
315 |
<html>
|
| 291 |
<head>
|
316 |
<head>
|
| 292 |
<meta charset=\"UTF-8\" />
|
317 |
<meta charset=\"UTF-8\" />
|
| 293 |
</head>
|
318 |
</head>
|
| 294 |
<body>
|
319 |
<body>
|
| 295 |
Bonjour,<br/><br/>
|
320 |
$l_hello,<br/><br/>
|
| 296 |
<h3>Bienvenue sur ALCASAR @ $domain</h3>
|
321 |
<p>$l_automatic_mail ($hostname.$domain)<br/>
|
| 297 |
<p>Ceci est un email automatique avec vos identifiants, veuillez changer votre mot de passe.<br/>
|
- |
|
| 298 |
<h4>Indentifiants de connexion:</h4>
|
322 |
<h4>$l_login</h4>
|
| 299 |
<pre>
|
323 |
<pre>
|
| 300 |
Adresse e-mail : $Fmail
|
324 |
$l_email : $Fmail
|
| 301 |
Login : $login
|
325 |
Login : $login
|
| 302 |
Mot de passe : $password
|
326 |
$l_password : $password
|
| 303 |
</pre>
|
327 |
</pre>
|
| 304 |
<p>Rendez-vous sur le portail <a href=\"https://$hostname\">$domain</a></p>
|
328 |
<p>$l_go_home : <a href=\"https://$hostname.$domain\"></a></p>
|
| 305 |
</body>
|
329 |
</body>
|
| 306 |
</html>";
|
330 |
</html>";
|
| 307 |
|
- |
|
| 308 |
$header = "From: $from\n";
|
331 |
$header = "From: $from\n";
|
| 309 |
$header .= "MIME-Version: 1.0\n";
|
332 |
$header .= "MIME-Version: 1.0\n";
|
| 310 |
$header .= "Content-type: text/html; charset=utf-8\n";
|
333 |
$header .= "Content-type: text/html; charset=utf-8\n";
|
| 311 |
|
- |
|
| 312 |
if(mail($to, $subject, $message, $header)){
|
334 |
if(mail($to, $subject, $message, $header)){
|
| 313 |
echo "<center>success : <b>Vous y êtes presque ! $l_user '$login' $l_created</b></center><br />";
|
335 |
echo "<center>success : <b>Vous y êtes presque ! $l_user '$login' $l_created</b></center><br />";
|
| 314 |
echo "<center>success : <b>Un email contenant vos informations de connexion vient de vous être envoyé.</b></center><br />";
|
336 |
echo "<center>success : <b>Un email contenant vos informations de connexion vient de vous être envoyé.</b></center><br />";
|
| 315 |
|
- |
|
| 316 |
// le mail pour l'uitilisateur est envoyé, si l'admin a configuré son mail, on lui envoi
|
- |
|
| 317 |
// une notification d'inscription avec l'ip, l'heure, et le login de l'utilisateur
|
337 |
// Creation of the email for the administrator (if enabled)
|
| 318 |
if (!empty($adminMail)){
|
338 |
if (!empty($adminMail)){
|
| 319 |
$to = $adminMail;
|
339 |
$to = $adminMail;
|
| 320 |
$from = "alcasar@$domain";
|
340 |
$from = "administrator";
|
| 321 |
$subject = "Nouvelle inscription sur ALCASAR";
|
341 |
$subject = "New registration on ALCASAR";
|
| 322 |
$message = "<!DOCTYPE html>
|
342 |
$message = "<!DOCTYPE html>
|
| 323 |
<html>
|
343 |
<html>
|
| 324 |
<head>
|
344 |
<head>
|
| 325 |
<meta charset=\"UTF-8\" />
|
345 |
<meta charset=\"UTF-8\" />
|
| 326 |
</head>
|
346 |
</head>
|
| 327 |
<body>
|
347 |
<body>
|
| 328 |
Bonjour,<br/><br/>
|
348 |
Hello,<br/><br/>
|
| 329 |
|
- |
|
| 330 |
<p>Ceci est un mail automatique.<br/>
|
349 |
<p>This is an automatic e-mail from an ALCASAR portal.<br/>
|
| 331 |
<h3>Une nouvelle inscription à <strong>ALCASR $domain</strong> a été faite.</h3>
|
350 |
<h3>A new registration on <strong>$hostname.$domain</strong> has been made :</h3>
|
| 332 |
|
- |
|
| 333 |
<h4>Indentifiants de connexion:</h4>
|
- |
|
| 334 |
<pre>
|
351 |
<pre>
|
| 335 |
Adresse IP : $ip
|
352 |
@IP : $ip
|
| 336 |
Heure : $time;
|
353 |
Hour : $time
|
| 337 |
Login : $login
|
354 |
Login : $login
|
| 338 |
Email : $Fmail
|
355 |
Email : $Fmail
|
| 339 |
</pre>
|
356 |
</pre>
|
| 340 |
<p>ALCASAR <a href=\"https://$hostname\">$domain</a></p>
|
357 |
<p><a href=\"https://$hostname\">$domain</a></p>
|
| 341 |
</body>
|
358 |
</body>
|
| 342 |
</html>";
|
359 |
</html>";
|
| 343 |
$header = "From: $from\n";
|
360 |
$header = "From: $from\n";
|
| 344 |
$header .= "MIME-Version: 1.0\n";
|
361 |
$header .= "MIME-Version: 1.0\n";
|
| 345 |
$header .= "Content-type: text/html; charset=utf-8\n";
|
362 |
$header .= "Content-type: text/html; charset=utf-8\n";
|
| 346 |
mail($to, $subject, $message, $header);
|
363 |
mail($to, $subject, $message, $header);
|
| 347 |
}
|
364 |
}
|
| 348 |
|
- |
|
| 349 |
} else {
|
365 |
} else {
|
| 350 |
//Le mot de passe est généré aléatoirement, si le mail n'est pas envoyé, on supprime le compte de la bdd ou on lui demande d'utiliser la page reset
|
366 |
// On smtp error, we remove the new user
|
| 351 |
/* $link = da_sql_pconnect($config);
|
367 |
$link = da_sql_pconnect($config);
|
| 352 |
|
- |
|
| 353 |
$res2 = da_sql_query($link,$config,
|
368 |
$res2 = da_sql_query($link,$config,
|
| 354 |
"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
|
369 |
"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
|
| 355 |
|
- |
|
| 356 |
$res3 = da_sql_query($link,$config,
|
370 |
$res3 = da_sql_query($link,$config,
|
| 357 |
"DELETE FROM $config[sql_check_table] WHERE username = '$login';");
|
371 |
"DELETE FROM $config[sql_check_table] WHERE username = '$login';");
|
| 358 |
|
- |
|
| 359 |
// da_sql_close($link,$config)
|
372 |
echo "<b>$l_mail_error</b><br />\n";
|
| 360 |
*/
|
- |
|
| 361 |
echo "<b>Erreur lors de l'envoi du mail, veuillez renouveler votre inscription. Utilisez le formulaire de réinitialisation, ou contactez votre administrateur.</b><br />\n";
|
- |
|
| 362 |
}
|
373 |
}
|
| 363 |
}
|
374 |
}
|
| 364 |
else // Could not open encryption library file
|
375 |
else // Could not open encryption library file
|
| 365 |
echo "<b>Erreur lors de la création du compte</b><br />\n";
|
376 |
echo "<b>Error during the account creation process</b><br />\n";
|
| 366 |
}
|
377 |
}
|
| 367 |
else // Could not connect to SQL database
|
378 |
else // Could not connect to SQL database
|
| 368 |
echo "<b>Erreur lors de la création du compte</b><br />\n";
|
379 |
echo "<b>Error during the account creation process</b><br />\n";
|
| - |
|
380 |
da_sql_close($link,$config);
|
| 369 |
}
|
381 |
}
|
| 370 |
}
|
382 |
}
|
| 371 |
?>
|
383 |
?>
|