'.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.='
Email di invito
'.N; if (trim($inst['AdmDisplayName'])!='') $admname=$inst['AdmDisplayName']; elseif (trim($inst['AdmAccount'])!='') $admname=$inst['AdmAccount']; else $admname=''; $haddress=$inst['Email']; if ($admname!='') $haddress=$admname.' <'.$haddress.'>'; $madmname=''; if ($admname!='') $madmname=' '.$admname; if ($admname=='') $admname='Unknown'; $password=randstr(16); define('RN',"\r\n"); //('/%guestinsturi/','/%guestname/','/%guestemail/','/%guestpassword/','/%ourdomain/') $subj=parsetempline($templ[0],array($inst['URI'],$madmname,$inst['Email'],$password,$iniarr['site_domain'])); $message=''; for ($i=2; $i').''.N; $out.='
Destinatario: '.hspech($haddress).'
'.N; $out.='
Oggetto:
'.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.=''.N; $out.='
'.N; $out.=''.N; $insturi=$inst['URI']; } elseif (array_key_exists('id',$_POST) && preg_match('/^[0-9]+$/',$_POST['id'])===1 && array_key_exists('insturi',$_POST) && trim($_POST['insturi'])!='' && array_key_exists('subject',$_POST) && trim($_POST['subject'])!='' && array_key_exists('to',$_POST) && trim($_POST['to'])!='' && array_key_exists('message',$_POST) && trim($_POST['message'])!='' && array_key_exists('password',$_POST) && trim($_POST['password'])!='' && array_key_exists('guestaddr',$_POST) && trim($_POST['guestaddr'])!='' && array_key_exists('createacc',$_POST) && preg_match('/^true|false$/',$_POST['createacc'])===1) { $_POST['id']+=0; $from=$iniarr['ref_name'].' <'.$iniarr['ref_email'].'>'; $to=$_POST['to']; $dbchange=true; //questo per far provette d'invio mail senza toccare il db if ($iniarr['mail_test_address']==false || trim($iniarr['mail_test_address'])=='') { $to=$iniarr['mail_test_address']; $dbchange=false; } $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.
Puoi riprovare.'; } elseif ($dbchange) { 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); $accid=mysqli_insert_id($link); } else { $res=mysqli_query($link,'SELECT * FROM Admins WHERE Email=\''.myesc($link,$_POST['guestaddr']).'\'') or muoribene(__LINE__.': '.mysqli_error($link),true); if (mysqli_num_rows($res)==0) muoribene(__LINE__.': Non esiste alcun account con Email=“'.$_POST['guestaddr'].'”.',true); $row=mysqli_fetch_assoc($res); $accid=$row['ID']; } mysqli_query($link,'UPDATE Instances SET GuestID='.$accid.' WHERE ID='.$_POST['id']) or muoribene(__LINE__.': '.mysqli_error($link),true); $out='TUTT’OCCHEI!'; } else { $out='La mail è stata inviata correttamente all’indirizzo di test definito nella configurazione, «'.$to.'».
Nessuna modifica è stata apportata al database.'; } $insturi=$_POST['insturi']; } else { muoribene('Malformed input.',true); } mysqli_close($link); ?> Mustard - Invito admin di «<?php echo(hspech($insturi)); ?>»