added SearchHideShare regex to config
[BackupPC.git] / lib / BackupPC / Search.pm
index e9b9220..1c3007f 100644 (file)
@@ -45,7 +45,7 @@ sub get_dbh {
        return $dbh;
 }
 
-sub getUnits() {
+sub getShares {
        my @ret;
 
        my $dbh = get_dbh();
@@ -61,6 +61,9 @@ sub getUnits() {
        push @ret, { 'id' => '', 'share' => '-'};       # dummy any
 
        while ( my $row = $sth->fetchrow_hashref() ) {
+               if ( my $hide = $Conf{SearchHideShare} ) {
+                       next if $row->{share} =~ m/$hide/;
+               }
                push @ret, $row;
        }
        return @ret;