Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3037 → Rev 3038

//web/email_registration_back.php
52,6 → 52,7
$adminMail = $conf['MAIL_ADMIN'];
$typeMail = $conf['MAIL_TYPE'];
$fromMail = $conf['MAIL_ADDR'];
$organism = $conf['ORGANISM'];
 
/****************************************
* Choice of language *
62,17 → 63,16
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
}
if ($Language === 'fr') {
$l_invalid_Email = "L'adresse email est invalide";
$l_invalid_Email = "L'adresse e-mail est invalide";
$l_domain = "Le domaine";
$l_not_authorized = "n'est pas autorisé";
$l_Email_already_used = "Cette adresse email est déjà utilisée.";
$l_Email_already_used = "Cette adresse e-mail est déjà utilisée.";
$l_subject = "Activation de votre compte ALCASAR";
$l_hello = "Bonjour";
$l_automatic_mail = "Ceci est un e-mail automatique provenant d'un portail ALCASAR";
$l_login = "Vos indentifiants de connexion :";
$l_email = "Adresse e-mail";
$l_automatic_mail = "Ceci est un e-mail automatique provenant du portail ALCASAR : $organism";
$l_login = "Voici vos indentifiants de connexion :";
$l_password = "Mot de passe";
$l_go_home = "Rendez-vous sur la page d'accueil";
$l_mail_success = "Un mot de passe vient d'être envoyé à votre adresse e-mail.";
$l_mail_error = "Erreur lors de l'envoi du mail. Renouvelez votre inscription ou contactez votre administrateur.";
} else {
$l_invalid_Email = "Invalid Email address";
81,17 → 81,13
$l_Email_already_used = "This Email address is already used.";
$l_subject = "Activation of your ALCASAR account";
$l_hello = "Hello";
$l_automatic_mail = "This is an automatic e-mail from an ALCASAR portal";
$l_login = "Your login credentials :";
$l_email = "e-mail address";
$l_automatic_mail = "This is an automatic e-mail from ALCASAR portal : $organism";
$l_login = "Here are your login credentials :";
$l_password = "Password";
$l_go_home = "Go to the home page";
$l_mail_success = "A password has been sent to your e-mail address";
$l_mail_error = "Error while sending the email. Renew your registration or contact your administrator.";
}
 
if (is_file("acc/manager/lib/langues.php"))
include("acc/manager/lib/langues.php");
 
if(!isset($create)) $create=0;
if(!isset($show)) $show=0;
if(!isset($login)) $login = '';
260,51 → 256,6
else
echo "<b>Impossible d'ajouter l'utilisateur dans le groupe $Fgroup: " . da_sql_error($link,$config) . "</b><br />\n";
}
/*
if (!$da_abort){
if (isset($Fgroup) && $Fgroup != '')
require('acc/manager/lib/defaults.php');
foreach($show_attrs as $key => $attr){
if ($attrmap["$key"] == 'none')
continue;
if ($key == "Filter-Id" && $$attrmap["$key"] == "None")
continue;
if ($attrmap["$key"] == ''){
$attrmap["$key"] = $key;
$attr_type["$key"] = 'replyItem';
$rev_attrmap["$key"] = $key;
}
if (isset($attr_type["$key"]) && $attr_type["$key"] == 'checkItem'){
$table = "$config[sql_check_table]";
$type = 1;
}
else if (isset($attr_type["$key"]) && $attr_type["$key"] == 'replyItem'){
$table = "$config[sql_reply_table]";
$type = 2;
}
$val = (isset($_POST[$attrmap["$key"]])) ? $_POST[$attrmap["$key"]] : '';
$val = da_sql_escape_string($link, $val);
$op_name = $attrmap["$key"] . '_op';
$op_val = (isset($$op_name)) ? $$op_name : '';
if ($op_val != ''){
$op_val = da_sql_escape_string($link, $op_val);
if (check_operator($op_val,$type) == -1){
echo "<b>Invalid operator ($op_val) for attribute $key</b><br />\n";
continue;
}
$op_val2 = ",'$op_val'";
}
$chkdef = (isset($default_vals["$key"])) ? check_defaults($val,$op_val,$default_vals["$key"]) : 0;
if ($val == '' || $chkdef)
continue;
$sqlquery = "INSERT INTO $table (attribute,value,username $text)
VALUES ('$attrmap[$key]','$val','$login' $op_val2);";
$res = da_sql_query($link,$config,$sqlquery);
if (!$res || !da_sql_affected_rows($link,$res,$config))
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br />\n";
}
}
*/
// Creation of the email with the new user login & passwd
$ip = $_SERVER['REMOTE_ADDR'];
$time = date_create('now')->format('d-m-Y H:i:s');
318,55 → 269,45
}
$subject = $l_subject;
$message = "<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\" />
</head>
<body>
$l_hello,<br/><br/>
<p>$l_automatic_mail ($hostname.$domain)<br/>
<h4>$l_login</h4>
<pre>
$l_email : $Fmail
Login : $login
$l_password : $password
</pre>
<p>$l_go_home : <a href=\"https://$hostname.$domain\"></a></p>
</body>
</html>";
<html>
<head>
<meta charset=\"UTF-8\" />
</head>
<body>
$l_hello,<br/>
<p>$l_automatic_mail<br/>
<h3>$l_login</h3>
<pre>
Login : $login
$l_password : $password
</pre>
</body>
</html>";
$header = "From: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=utf-8\n";
if(mail($to, $subject, $message, $header)){
echo "<center>success : <b>Vous y êtes presque ! $l_user '$login' $l_created</b></center><br />";
echo "<center>success : <b>Un email contenant vos informations de connexion vient d'être envoyé.</b></center><br />";
echo "Info : to = $to ; header = $header<br />";
// Creation of the email for the administrator (if enabled)
if (!empty($adminMail)){
echo "<center>success : <b>$l_mail_success</b><br>";
if (!empty($adminMail)){ // Creation of the email for the administrator (if enabled)
$to = $adminMail;
$from = "administrator";
$subject = "New registration on ALCASAR";
$message = "<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\" />
</head>
<body>
Hello,<br/><br/>
<p>This is an automatic e-mail from an ALCASAR portal.<br/>
<h3>A new registration on <strong>$hostname.$domain</strong> has been made :</h3>
<pre>
@IP : $ip
Hour : $time
Login : $login
Email : $Fmail
</pre>
<p><a href=\"https://$hostname\">$domain</a></p>
</body>
</html>";
$header = "From: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=utf-8\n";
<html>
<head>
<meta charset=\"UTF-8\" />
</head>
<body>
Hello,<br/>
<p>$l_automatic_mail<br/>
<h3>A new registration on ALCASAR '$organism' has been made :</h3>
<pre>
@IP : $ip
Hour : $time
Login : $login
Email : $Fmail
</pre>
</body>
</html>";
mail($to, $subject, $message, $header);
}
} else {