You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.8 KiB
103 lines
3.8 KiB
7 years ago
|
|
||
|
<?php
|
||
|
session_start();
|
||
|
|
||
|
@include '../cgi-bin/conn.conn';
|
||
|
@include '../cgi-bin/functions.inc';
|
||
|
@include '../cgi-bin/params.inc';
|
||
|
|
||
|
$GLOBALS['conn'];
|
||
|
|
||
|
$conn=@mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR");
|
||
|
mysqli_set_charset($conn, "utf8");
|
||
|
|
||
|
?>
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Ordine dei Farmacisti della Provincia di Salerno</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
|
<base href="<?php echo $BASE_URL;?>/">
|
||
|
<link href="<?php echo $BASE_URL;?>/css/styles.css" rel="stylesheet" type="text/css"/>
|
||
|
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="row no-gutters py-4">
|
||
|
|
||
|
<?php
|
||
|
|
||
|
|
||
|
if(sizeof($_GET)>0){
|
||
|
$err = 0;
|
||
|
$mess = "";
|
||
|
|
||
|
if(!$_GET['email'] || !filter_var($_GET['email'], FILTER_VALIDATE_EMAIL)){
|
||
|
$err += 1;
|
||
|
$mess .= "<p>Il campo \"Email\" è obbligatorio, controlla che l'indirizzo sia corretto.</p>";
|
||
|
}
|
||
|
if(!$_GET['board_id']){
|
||
|
$err += 1;
|
||
|
$mess .= "<p>Devi inserire il numero di iscrizione all'Albo.</p>";
|
||
|
}
|
||
|
|
||
|
|
||
|
if($err!=0){
|
||
|
echo "<div class=\"col-10 text-center text-red mx-auto\">".
|
||
|
"<p><i class=\"fa fa-exclamation-triangle font-alert p-4\"></i></p>".
|
||
|
$mess."</div>";
|
||
|
}else{
|
||
|
|
||
|
$q=mysqli_query($conn, "SELECT COUNT(id) FROM board WHERE
|
||
|
email='".trim($_GET['email'])."' AND
|
||
|
id='".trim($_GET['board_id'])."'
|
||
|
");
|
||
|
$r=mysqli_fetch_array($q);
|
||
|
|
||
|
if(!$r[0]){
|
||
|
echo "<div class=\"col-10 text-center text-red mx-auto\">".
|
||
|
"<p><i class=\"fa fa-exclamation-triangle font-alert p-4\"></i></p>".
|
||
|
"ATTENZIONE: L'utente non risulta presente in database, controlla i dati inseriti e riprova.".
|
||
|
"</div>";
|
||
|
}else{
|
||
|
|
||
|
$tmpUsr = explode('@',$_GET['email']);
|
||
|
$tmpPwd = substr(md5($_GET['email']),0,10);
|
||
|
|
||
|
$q=mysqli_query($conn, "UPDATE board SET
|
||
|
usr='".$tmpUsr[0]."',
|
||
|
pwd='".md5($tmpPwd)."',
|
||
|
enabled=0
|
||
|
WHERE id='".trim($_GET['board_id'])."'
|
||
|
");
|
||
|
|
||
|
$SM_email = $_GET['email'];
|
||
|
$SM_email2 = 0;
|
||
|
$SM_email_CC = 0;
|
||
|
$SM_subject = "Reset dei dati di accesso";
|
||
|
$SM_message = "Ricevi questa mail perchè hai richiesto il reset dei tuoi dati di accesso, ti sono stati assegnati dei nuovi dati di accesso, se vuoi modificarli accedi al tuo account e fai click sul tuo nome per accedere all'area personale.<br><br>";
|
||
|
$SM_message .= "<b>Riepilogo dati</b><br>".
|
||
|
"Username: ".$tmpUsr[0]."<br>".
|
||
|
"Password: ".$tmpPwd."<br>".
|
||
|
"Email: ".trim($_GET['email'])."<br>".
|
||
|
"N. iscrizione: ".trim($_GET['board_id'])."";
|
||
|
$SM_showalert = 0;
|
||
|
$SM_append = 0;
|
||
|
|
||
|
sendMail($SM_email,$SM_email2,$SM_email_CC,$SM_subject,$SM_messageH1."".$SM_message,$SM_showalert,$SM_append);
|
||
|
|
||
|
echo "<div class=\"col-10 text-center mx-auto\">".
|
||
|
"<p><i class=\"fa fa-check-circle font-alert p-4\"></i></p>".
|
||
|
"<b>Dati inviati correttamente.</b><br>".
|
||
|
"Ti abbiamo inviato una mail all'indirizzo da te indicato.".
|
||
|
"</div>";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|