/
list_databases.coretag
43 lines (38 loc) · 1.11 KB
/
list_databases.coretag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 2002-2005 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: list_databases.coretag,v 1.4 2005-11-08 18:14:40 jon Exp $
UserTag list-databases Order nohide extended
UserTag list-databases Version $Revision: 1.4 $
UserTag list-databases routine <<EOR
sub {
my $nohide = shift;
my $extended = shift || '';
$extended = "=$extended" if $extended;
my @dbs;
my $d = $Vend::Cfg->{Database};
@dbs = sort keys %$d;
GENDBLIST: {
last GENDBLIST if $nohide;
my @outdb;
my $record = ui_acl_enabled();
last GENDBLIST if $record and $record->{super};
undef $record
unless ref($record)
and $record->{yes_tables} || $record->{no_tables};
for(@dbs) {
if($record) {
next if $record->{no_tables}
and ui_check_acl($_, $record->{no_tables});
my $check = "$_$extended";
next if $record->{yes_tables}
and ! ui_check_acl($check, $record->{yes_tables});
}
push @outdb, $_;
}
@dbs = $nohide ? (@dbs) : (@outdb);
}
return @dbs if wantarray;
my $string = join " ", grep /\S/, @dbs;
return $string;
}
EOR