|
@@ -105,16 +105,16 @@ if (array_key_exists('id',$_GET) && preg_match('/^[0-9]+$/',$_GET['id'])===1) {
|
|
|
$from=$iniarr['ref_name'].' <'.$iniarr['ref_email'].'>';
|
|
|
//questo per far provette d'invio mail senza toccare il db
|
|
|
if ($iniarr['mail_test_address']!=false && trim($iniarr['mail_test_address'])!='') {
|
|
|
+ $test=true;
|
|
|
$to=$iniarr['mail_test_address'];
|
|
|
- $dbchange=false;
|
|
|
} else {
|
|
|
+ $test=false;
|
|
|
$to=$_POST['to'];
|
|
|
- $dbchange=true;
|
|
|
}
|
|
|
$mail=mail($to,'=?utf-8?B?'.base64_encode($_POST['subject']).'?=',wordwrap($_POST['message'],76,"\r\n",false),array('From'=>$from,'Content-Type'=>'text/plain; charset=UTF-8','Content-Transfer-Encoding'=>'8bit'));
|
|
|
if (!$mail) {
|
|
|
- $out='Errori nell’invio della mail.<br>Puoi <a href="invite.php?id='.$_POST['id'].'">riprovare</a>.';
|
|
|
- } elseif ($dbchange) {
|
|
|
+ $out='Errori nell’invio della mail.<br>Puoi <a href="invite.php?id='.$_POST['id'].'">riprovare</a>.'.N;
|
|
|
+ } elseif (!$test) {
|
|
|
if ($_POST['createacc']=='true') {
|
|
|
mysqli_query($link,'INSERT INTO Admins (ID, Username, Email, Password, Level, Page, MaxLocalities, MaxLanguages, MaxFinancing, MaxPolicies, MaxTags, Enabled) VALUES (NULL, \''.myesc($link,$_POST['guestname']).'\', \''.myesc($link,$_POST['guestaddr']).'\', \''.myesc($link,password_hash($_POST['password'],PASSWORD_DEFAULT)).'\', \'guest\', \'0\', \'1\', \'0\', \'3\', \'3\', \'3\', \'1\')')
|
|
|
or muoribene(__LINE__.': '.mysqli_error($link),true);
|
|
@@ -129,9 +129,9 @@ if (array_key_exists('id',$_GET) && preg_match('/^[0-9]+$/',$_GET['id'])===1) {
|
|
|
}
|
|
|
mysqli_query($link,'UPDATE Instances SET GuestID='.$accid.' WHERE ID='.$_POST['id'])
|
|
|
or muoribene(__LINE__.': '.mysqli_error($link),true);
|
|
|
- $out='TUTT’OCCHEI!';
|
|
|
+ $out='La mail è stata inviata correttamente all’indirizzo «'.$to.'».<br>L’account relativo è stato creato/aggiornato correttamente.'.N;
|
|
|
} else {
|
|
|
- $out='La mail è stata inviata correttamente all’indirizzo di test definito nella configurazione, «'.$to.'».<br>Nessuna modifica è stata apportata al database.';
|
|
|
+ $out='<p>La mail è stata inviata correttamente all’indirizzo di test «'.$to.'».<br>Nessun account è stato creato/aggiornato.<br>Se vuoi abilitare l’invio ai destinatari reali e la creazione o l’aggiornamento degli account relativi devi editare il file di configurazione di Mustard.</p>'.N;
|
|
|
}
|
|
|
$insturi=$_POST['insturi'];
|
|
|
} else {
|