PDO::ERRMODE_WARNING, PDO::ATTR_PERSISTENT=>PERSISTENT]); }catch(PDOException $e){ die('No Connection to MySQL database!'); } session_start(); $user=check_login(); if(isset($_POST['action']) && $_POST['action']==='add_db'){ if($error=check_csrf_error()){ die($error); } add_user_db($db, $user['id']); } if(isset($_POST['action']) && $_POST['action']==='del_db' && !empty($_POST['db'])){ if($error=check_csrf_error()){ die($error); } ?>
This will delete your database and all data asociated with it. It can't be un-done. Are you sure?
This will delete your onion domain .onion and all data asociated with it. It can't be un-done. Are you sure?
$data[message]"; $ok = false; } else { $check=$db->prepare('SELECT null FROM onions WHERE onion=?;'); $check->execute([$onion]); if($check->fetch(PDO::FETCH_NUM)){ $msg = 'Error onion already exists.
'; $ok = false; } } }else{ $onion_version = 3; if(isset($_REQUEST['onion_type']) && in_array($_REQUEST['onion_type'], [2, 3])){ $onion_version = $_REQUEST['onion_type']; } $check=$db->prepare('SELECT null FROM onions WHERE onion=?;'); do{ $data = generate_new_onion($onion_version); $priv_key = $data['priv_key']; $onion = $data['onion']; $onion_version = $data['version']; $check->execute([$onion]); }while($check->fetch(PDO::FETCH_NUM)); } $priv_key=trim(str_replace("\r", '', $priv_key)); $stmt = $db->prepare('SELECT COUNT(*) FROM onions WHERE user_id = ?;'); $stmt->execute([$user['id']]); $count = $stmt->fetch(PDO::FETCH_NUM); if($count[0]>=MAX_NUM_USER_ONIONS) { $ok = false; } if($ok){ $stmt=$db->prepare('INSERT INTO onions (user_id, onion, private_key, version, enabled) VALUES (?, ?, ?, ?, 2);'); $stmt->execute([$user['id'], $onion, $priv_key, $onion_version]); } } if(isset($_POST['action']) && $_POST['action']==='del_onion_2' && !empty($_POST['onion'])){ if($error=check_csrf_error()){ die($error); } del_user_onion($db, $user['id'], $_POST['onion']); } if(isset($_POST['action']) && $_POST['action']==='add_domain' && !empty($_POST['domain'])){ if($error=check_csrf_error()){ die($error); } $error = add_user_domain($db, $user['id'], $_POST['domain']); if(!empty($error)){ $msg = "$error
"; }else{ $stmt=$db->prepare('UPDATE service_instances SET reload = 1 WHERE id = ?'); $stmt->execute([substr($user['system_account'], 0, 1)]); } } if(isset($_POST['action']) && $_POST['action']==='del_domain' && !empty($_POST['domain'])){ if($error=check_csrf_error()){ die($error); } ?>This will delete your domain and all data asociated with it. It can't be un-done. Are you sure?
prepare('UPDATE service_instances SET reload = 1 WHERE id = ?'); $stmt->execute([substr($user['system_account'], 0, 1)]); } if(isset($_REQUEST['action']) && isset($_REQUEST['onion']) && $_REQUEST['action']==='edit_onion'){ if($error=check_csrf_error()){ die($error); } $stmt=$db->prepare('SELECT onions.version FROM onions INNER JOIN users ON (users.id=onions.user_id) WHERE onions.onion = ? AND users.id = ? AND onions.enabled IN (0, 1);'); $stmt->execute([$_REQUEST['onion'], $user['id']]); if($onion=$stmt->fetch(PDO::FETCH_NUM)){ $stmt=$db->prepare('UPDATE onions SET enabled = ?, enable_smtp = ?, num_intros = ?, max_streams = ? WHERE onion = ?;'); $enabled = isset($_REQUEST['enabled']) ? 1 : 0; $enable_smtp = isset($_REQUEST['enable_smtp']) ? 1 : 0; $num_intros = intval($_REQUEST['num_intros']); if($num_intros<3){ $num_intros = 3; }elseif($onion[0]==2 && $num_intros>10){ $num_intros = 10; }elseif($num_intros>20){ $num_intros = 20; } $max_streams = intval($_REQUEST['max_streams']); if($max_streams<0){ $max_streams = 0; }elseif($max_streams>65535){ $max_streams = 65535; } $stmt->execute([$enabled, $enable_smtp, $num_intros, $max_streams, $_REQUEST['onion']]); $stmt=$db->prepare('UPDATE service_instances SET reload = 1 WHERE id = ?'); $stmt->execute([substr($_REQUEST['onion'], 0, 1)]); } } if(isset($_REQUEST['action']) && isset($_POST['domain']) && $_POST['action']==='edit_domain'){ if($error=check_csrf_error()){ die($error); } $stmt=$db->prepare('SELECT null FROM domains WHERE domain = ? AND user_id = ? AND enabled IN (0, 1);'); $stmt->execute([$_POST['domain'], $user['id']]); if($onion=$stmt->fetch(PDO::FETCH_NUM)){ $stmt=$db->prepare('UPDATE domains SET enabled = ? WHERE domain = ?;'); $enabled = isset($_POST['enabled']) ? 1 : 0; $stmt->execute([$enabled, $_POST['domain']]); $stmt=$db->prepare('UPDATE service_instances SET reload = 1 WHERE id = ?'); $stmt->execute([substr($user['system_account'], 0, 1)]); } } header('Content-Type: text/html; charset=UTF-8'); echo ''; echo 'Logged in as $user[username] Logout | Change passwords | FileManager | Delete account
"; if(!empty($msg)){ echo $msg; } echo "Enter system account password to check your $user[system_account]@" . ADDRESS . " mail:
Onion | Private key | Enabled | SMTP enabled | Nr. of intros | Max streams per rend circuit | Action |
---|---|---|---|---|---|---|
Add additional hidden service: '; echo ''; echo ''; echo ' |
Domain | Enabled | Action |
---|---|---|
Add additional domain: '; echo ''; echo ' |
To enable your clearnet domain, edit your DNS settings and enter 116.202.17.147 as your A record and 2a01:4f8:c010:d56::1 as your AAAA record. Once you have modified your DNS settings, contact me to configure the SSL certificate. You may also use any subdomain of danwin1210.me, like yoursite.danwin1210.me
'; } echo 'Database | Host | User | Action |
---|
You can use PHPMyAdmin and Adminer for web based database administration.
'; echo 'Username | Host | FTP Port | SFTP Port | POP3 Port | IMAP Port | SMTP port |
---|---|---|---|---|---|---|
$user[system_account] | $server | $tmp[ftp] | $tmp[sftp] | $tmp[pop3] | $tmp[imap] | $tmp[smtp] |
Change system account password
'; echo 'You can use the FileManager for web based file management.
'; echo 'Date | access.log | error.log |
---|---|---|
Today | access.log | error.log |
Yesterday | access.log | error.log |