Make notification email configurable
This commit is contained in:
@ -11,6 +11,7 @@ const SERVERS=[ //servers and ports we are running on
|
|||||||
'dhosting4okcs22v.onion'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'110', 'imap'=>'143', 'smtp'=>'25'],
|
'dhosting4okcs22v.onion'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'110', 'imap'=>'143', 'smtp'=>'25'],
|
||||||
'danwin1210.me'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'', 'imap'=>'', 'smtp'=>'']
|
'danwin1210.me'=>['sftp'=>22, 'ftp'=>21, 'pop3'=>'', 'imap'=>'', 'smtp'=>'']
|
||||||
];
|
];
|
||||||
|
const EMAIL_TO=''; //Send email notifications about new registrations to this address
|
||||||
|
|
||||||
function get_onion($pkey){
|
function get_onion($pkey){
|
||||||
$keyData = openssl_pkey_get_details($pkey);
|
$keyData = openssl_pkey_get_details($pkey);
|
||||||
|
@ -131,10 +131,12 @@ if($_SERVER['REQUEST_METHOD']==='POST'){
|
|||||||
$db->exec('FLUSH PRIVILEGES;');
|
$db->exec('FLUSH PRIVILEGES;');
|
||||||
$stmt=$db->prepare('INSERT INTO new_account (onion, password) VALUES (?, ?);');
|
$stmt=$db->prepare('INSERT INTO new_account (onion, password) VALUES (?, ?);');
|
||||||
$stmt->execute([$onion, get_system_hash($_POST['pass'])]);
|
$stmt->execute([$onion, get_system_hash($_POST['pass'])]);
|
||||||
|
if(EMAIL_TO!==''){
|
||||||
$title="A new hidden service $onion has been created";
|
$title="A new hidden service $onion has been created";
|
||||||
$msg="A new hidden service http://$onion.onion has been created";
|
$msg="A new hidden service http://$onion.onion has been created";
|
||||||
$headers="From: www-data <www-data>\r\nContent-Type: text/plain; charset=UTF-8\r\n";
|
$headers="From: www-data <www-data>\r\nContent-Type: text/plain; charset=UTF-8\r\n";
|
||||||
mail('daniel@tt3j2x4k5ycaa5zt.onion', $title, $msg, $headers);
|
mail(EMAIL_TO, $title, $msg, $headers);
|
||||||
|
}
|
||||||
echo "<p style=\"color:green;\">Your onion domain <a href=\"http://$onion.onion\" target=\"_blank\">$onion.onion</a> has successfully been created. Please wait up to one minute until the changes have been processed. You can then login <a href=\"login.php\">here</a>.</p>";
|
echo "<p style=\"color:green;\">Your onion domain <a href=\"http://$onion.onion\" target=\"_blank\">$onion.onion</a> has successfully been created. Please wait up to one minute until the changes have been processed. You can then login <a href=\"login.php\">here</a>.</p>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user