Changeset 867


Ignore:
Timestamp:
12/21/11 16:01:54 (13 years ago)
Author:
nanardon
Message:
  • add tools to check information coherency
Location:
LATMOS-Accounts
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/MANIFEST

    r861 r867  
    3131bin/la-sql-loadatt 
    3232bin/la-sql-regatt 
     33bin/la-sql-sanity 
    3334bin/la-sync 
    3435bin/la-sync-list 
    3536bin/la-sync-manager 
    3637bin/la-warn-expire 
    37 bin/la-web-directory 
    3838etc/cron.d/latmos-accounts 
    3939etc/init.d/la-sync-manager 
  • LATMOS-Accounts/Makefile.PL

    r861 r867  
    2222        'Crypt::Cracklib' => undef, 
    2323        'Net::IP' => undef, 
     24        'Net::IPv4Addr' => undef, 
     25        'Net::IPv6Addr' => undef, 
    2426    }, # e.g., Module::Name => 1.1 
    2527    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm

    r861 r867  
    317317} 
    318318 
     319sub check_user_manager { 
     320    $_[0]->_handle_by_unexported('user', 'manager', 'active'); 
     321} 
     322 
     323sub check_group_manager { 
     324    $_[0]->_handle_by_unexported('group', 'managedBy'); 
     325} 
     326 
     327sub check_nethost_owner { 
     328    $_[0]->_handle_by_unexported('nethost', 'owner', 'active'); 
     329} 
     330 
     331sub _handle_by_unexported { 
     332    my ($self, $otype, $refattr, $chkattr) = @_; 
     333 
     334    my $ptrotype = $self->attribute($otype, $refattr)->reference(); 
     335 
     336    my %unhandle; 
     337    foreach my $objname ($self->search_objects($otype, 'active=1', 'exported=1', "$refattr=*")) { 
     338        my $obj = $self->get_object($otype, $objname) or next; 
     339        my $val = $obj->get_attributes($refattr) or next; 
     340        if (my $refobj = $self->get_object($ptrotype, $val)) { 
     341            if (!$refobj->get_attributes($chkattr || 'exported')) { 
     342                $unhandle{$objname} = $val; 
     343            } 
     344        } else { 
     345            $unhandle{$objname} = $val; 
     346        } 
     347    } 
     348    %unhandle; 
     349} 
     350 
    3193511; 
    320352 
Note: See TracChangeset for help on using the changeset viewer.