From 30f98a097556fa36a0d485cc6db8dc6cb3e9043d Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 29 Aug 2007 04:50:51 +0000 Subject: Show ACL names instead of IDs when displaying objects. --- perl/Wallet/Object/Base.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm index 0980aed..566dbfd 100644 --- a/perl/Wallet/Object/Base.pm +++ b/perl/Wallet/Object/Base.pm @@ -323,6 +323,12 @@ sub show { my $output = ''; for (my $i = 0; $i < @data; $i++) { next unless defined $data[$i]; + if ($attrs[$i][0] =~ /^ob_acl_/) { + my $acl = eval { Wallet::ACL->new ($data[$i], $self->{dbh}) }; + if ($acl and not $@) { + $data[$i] = $acl->name || $data[$i]; + } + } $output .= sprintf ("%15s: %s\n", $attrs[$i][1], $data[$i]); } return $output; -- cgit v1.2.3