diff --git a/var/www/html/home.php b/var/www/html/home.php index 1a3fc23..f688727 100644 --- a/var/www/html/home.php +++ b/var/www/html/home.php @@ -131,10 +131,15 @@ if($error=check_csrf_error()){ die($error); } - $stmt=$db->prepare('SELECT onions.version, onions.instance FROM onions INNER JOIN users ON (users.id=onions.user_id) WHERE onions.onion = ? AND users.id = ? AND onions.enabled IN (0, 1);'); + //$stmt=$db->prepare('SELECT onions.version, onions.instance FROM onions INNER JOIN users ON (users.id=onions.user_id) WHERE onions.onion = ? AND users.id = ? AND onions.enabled IN (0, 1);'); + $stmt=$db->prepare('SELECT onions.version, onions.instance, onions.description FROM onions INNER JOIN users ON (users.id=onions.user_id) WHERE onions.onion = ? AND users.id = ? AND onions.enabled IN (0, 1);'); + $description = trim($_POST['description'] ?? $_REQUEST['description'] ?? ''); + $description = mb_substr($description, 0, 50); // Limit 50 + $stmt->execute([$_REQUEST['onion'], $user['id']]); if($onion=$stmt->fetch(PDO::FETCH_ASSOC)){ - $stmt=$db->prepare('UPDATE onions SET enabled = ?, enable_smtp = ?, num_intros = ?, max_streams = ? WHERE onion = ?;'); + //$stmt=$db->prepare('UPDATE onions SET enabled = ?, enable_smtp = ?, num_intros = ?, max_streams = ? WHERE onion = ?;'); + $stmt=$db->prepare('UPDATE onions SET enabled = ?,enable_smtp = ?,num_intros = ?,max_streams = ?,description = ?WHERE onion = ?;'); $enabled = isset($_REQUEST['enabled']) ? 1 : 0; $enable_smtp = isset($_REQUEST['enable_smtp']) ? 1 : 0; $num_intros = intval($_REQUEST['num_intros']); @@ -151,7 +156,8 @@ }elseif($max_streams>65535){ $max_streams = 65535; } - $stmt->execute([$enabled, $enable_smtp, $num_intros, $max_streams, $_REQUEST['onion']]); + //$stmt->execute([$enabled, $enable_smtp, $num_intros, $max_streams, $_REQUEST['onion']]); + $stmt->execute([$enabled,$enable_smtp,$num_intros,$max_streams,$description,$_REQUEST['onion']]); enqueue_instance_reload($onion['instance']); } } @@ -176,8 +182,10 @@ echo '
'.sprintf(_('Enter system account password to check your %s mail:'), $user['system_account'].'@' . ADDRESS).'
| '._('Onion').' | '._('Private key').' | '._('Enabled').' | '._('SMTP enabled').' | '._('Nr. of intros').' | '._('Max streams per rend circuit').' | '._('Action').' | |
|---|---|---|---|---|---|---|---|
| '._('Onion').' | '._('Private key').' | '._('Enabled').' | '._('SMTP enabled').' | '._('Nr. of intros').' | '._('Max streams per rend circuit').' | '._('Action').' | |
| '._('Onion').' | '._('Private key').' | '._('Enabled').' | '._('SMTP enabled').' | '._('Nr. of intros').' | '._('Max streams per rend circuit').' | '._('Description').' | '._('Action').' | '; echo ' | '; + //added description + echo ' | '; if(in_array($onion['enabled'], [0, 1])){ echo ' | '; echo ' | '; @@ -206,7 +216,8 @@ } if($count_onions
| '._('Add additional hidden service:').' '; + //echo ' | |||||||
| '._('Add additional hidden service:').' '; + echo ' | |||||||
| '._('Add additional hidden service:').' '; echo ''; | |||||||