Ignore:
Timestamp:
03/02/09 22:02:23 (15 years ago)
Author:
nanardon
Message:
  • add set/get functions to unix objects
Location:
LATMOS-Accounts/lib/LATMOS/Accounts/Bases
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Unix.pm

    r10 r13  
    5454} 
    5555 
     56sub _canonicals_fields { 
     57    my ($self, $type) = @_; 
     58    $type = lc($type); 
     59    { 
     60        user => { 
     61            uidNumber       => 'uid', 
     62            gidNumber       => 'gid', 
     63            gecos           => 'gecos', 
     64            homeDirectory   => 'home', 
     65            loginShell      => 'shell', 
     66            userPassword    => ($self->{use_shadow} ? 'spassword' : 'password'), 
     67        }, 
     68        group => { 
     69            gidNumber       => 'gid', 
     70            memberUID       => 'user_list', 
     71        }, 
     72    }->{$type} 
     73} 
     74 
     75sub list_canonicals_fields { 
     76    my ($self, $type) = @_; 
     77    keys %{ $self->_canonicals_fields($type) || {} } 
     78} 
     79 
     80sub get_field_name { 
     81    my ($self, $type, $cfield) = @_; 
     82    ($self->_canonicals_fields($type) || {})->{$cfield} 
     83} 
     84 
     85 
    5686my @password_fields = qw(account password uid gid gecos home shell); 
    5787my @shadow_fields =   qw(account spassword last_changed before_ch after_ch exp_warn exp_disable disable res); 
Note: See TracChangeset for help on using the changeset viewer.