Changeset 369

Show
Ignore:
Timestamp:
07/19/07 11:43:26 (1 year ago)
Author:
ludo
Message:

ACL to filter the view by group (from r4612)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/webmin/lbs_common/debian/changelog

    r237 r369  
    1 webmin-lbs-common (1.4.13) stable; urgency=low 
     1webmin-lbs-common (1.4.14) stable; urgency=low 
    22 
    33  * New release. See SVN logs for details 
  • trunk/webmin/lbs_common/lbs_common.pl

    r256 r369  
    540540sub print_machines_list($$$$) { 
    541541        my ($paramsref, $headcallbacksref, $bodycallbacksref, %in) = @_; 
    542  
     542        my %access = &get_module_acl(); 
    543543        my $home=$TFTPBOOT; 
    544544        my $text_wp = $text{'lab_wp'}; 
    545545        my $baseuri=$paramsref->{'baseuri'}; 
     546 
    546547        $baseuri = $ENV{'SCRIPT_NAME'} unless $baseuri; 
    547  
    548548        my $nowrap=$paramsref->{'nowrap'}; 
    549549        if ($nowrap == 1) { 
     
    614614        %profiles = get_all_profiles(%ether); 
    615615        #if ($LRS_HERE) { %profiles = get_all_profiles(%ether) }; 
     616 
     617 
     618        # Show only allowed groups 
     619        if ( $access{'group_rx'} ne "") { 
     620                foreach my $key (keys %ether) { 
     621                        if ($ether{$key}[1] =~ /:$access{'group_rx'}.*?\//i ) { 
     622                                # OK keep it 
     623                        } else { 
     624                                # remove this host 
     625                                delete $ether{$key}; 
     626                        } 
     627                } 
     628        } 
    616629 
    617630        # PROFILS parsing 
     
    900913 
    901914        # last line: the whole profile 
    902         $template->assign('ROWSTYLE', "style='background-color: ".oddorevenline(\$lineisodd).";'"); 
    903         $template->assign('CONTENT', "<i>$text_wp</i>"); 
    904         $template->assign('FIRSTCELLARGS', "$nowrap $firstcellwidth"); 
    905         $template->parse('mainlist.normalrow.firstcell'); 
    906         foreach my $bodycallback (@$bodycallbacksref) { 
    907                 foreach my $label (&$bodycallback({'name' => "ALLPROFILES", 'group' => "", 'profile' => $in{'profile'}, 'currentprofile' => $in{'profile'}, 'ether' => $ethero })) { 
    908                         if (defined($label) and $label) { 
    909                                 my %localhash=%$label;                                                                         
    910                                 $template->assign('CONTENT', $localhash{'content'}); 
    911                                 $template->assign('ATTRIBS', $localhash{'attribs'}); 
    912                                 $template->parse('mainlist.normalrow.normalcell'); 
    913                         } 
    914                 } 
    915         } 
    916         $template->parse('mainlist.normalrow'); 
    917          
     915        if ( $access{'group_rx'} eq "") { 
     916                $template->assign('ROWSTYLE', "style='background-color: ".oddorevenline(\$lineisodd).";'"); 
     917                $template->assign('CONTENT', "<i>$text_wp</i>"); 
     918                $template->assign('FIRSTCELLARGS', "$nowrap $firstcellwidth"); 
     919                $template->parse('mainlist.normalrow.firstcell'); 
     920                foreach my $bodycallback (@$bodycallbacksref) { 
     921                        foreach my $label (&$bodycallback({'name' => "ALLPROFILES", 'group' => "", 'profile' => $in{'profile'}, 'currentprofile' => $in{'profile'}, 'ether' => $ethero })) { 
     922                                if (defined($label) and $label) { 
     923                                        my %localhash=%$label;                                                                         
     924                                        $template->assign('CONTENT', $localhash{'content'}); 
     925                                        $template->assign('ATTRIBS', $localhash{'attribs'}); 
     926                                        $template->parse('mainlist.normalrow.normalcell'); 
     927                                } 
     928                        } 
     929                } 
     930                $template->parse('mainlist.normalrow'); 
     931        } 
     932         
    918933        $template->parse('mainlist.endtable'); 
    919934        $template->parse('mainlist'); 
  • trunk/webmin/lbs_common/module.info

    r237 r369  
    55name=lbs_common 
    66depends=0.94 
    7 version=1.4.13 
     7version=1.4.14