Commit a16188eb authored by Leigh B Stoller's avatar Leigh B Stoller

Print out vlan tag in list mode.

parent 6cd087cd
...@@ -133,13 +133,16 @@ if (!$this_user->IsAdmin()) { ...@@ -133,13 +133,16 @@ if (!$this_user->IsAdmin()) {
if ($list) { if ($list) {
my $query_result = my $query_result =
DBQueryFatal("select * from shared_vlans order by token"); DBQueryFatal("select * from shared_vlans as s ".
"left join vlans as v on v.id=s.lanid ".
"order by s.token");
exit(0) exit(0)
if (! $query_result->numrows); if (! $query_result->numrows);
printf("%-15s %-15s %-15s %-15s %s\n", printf("%-15s %-20s %-20s %-20s %-5s %s\n",
"PID", "EID", "Token", "Lan", "Who"); "PID", "EID", "Token", "Lan", "Tag", "Who");
print "-------------------------------------------------------------\n"; print "-------------------------------------------------------------";
print "------------------------------\n";
while (my $row = $query_result->fetchrow_hashref()) { while (my $row = $query_result->fetchrow_hashref()) {
my $pid = $row->{'pid'}; my $pid = $row->{'pid'};
...@@ -148,9 +151,10 @@ if ($list) { ...@@ -148,9 +151,10 @@ if ($list) {
my $lan = $row->{'vname'}; my $lan = $row->{'vname'};
my $created = $row->{'created'}; my $created = $row->{'created'};
my $creator = $row->{'creator'}; my $creator = $row->{'creator'};
my $tag = $row->{'tag'} || "";
printf("%-15s %-15s %-15s %-15s %s\n", printf("%-15s %-20s %-20s %-20s %-5s %s\n",
$pid, $eid, $token, $lan, $creator); $pid, $eid, $token, $lan, "$tag", $creator);
} }
exit(0); exit(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment