Changeset 1037 for trunk


Ignore:
Timestamp:
05/31/12 12:30:47 (12 years ago)
Author:
nanardon
Message:

Kill redondant and not generic _param function

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases
Files:
5 edited

Legend:

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

    r792 r1037  
    7979        _password => $options{password}, 
    8080        _ssl => $options{ssl}, 
    81         _param => { %options }, 
    8281    }; 
    8382 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Heimdal.pm

    r1036 r1037  
    7575    my ($class, %options) = @_; 
    7676     
    77     my $self = { 
    78         _param => { %options }, 
    79     }; 
    80  
    81     bless($self, $class); 
    82 } 
    83  
    84 sub _param { 
    85     my ($self, $var) = @_; 
    86     return $self->{_param}{$var} 
     77    bless({}, $class); 
    8778} 
    8879 
     
    9384    $self->{_heimdal} and return 1; 
    9485 
    95     if (!$self->_param('realm')) { 
    96         if ($self->_param('domain')) { 
    97             $self->{_param}{realm} = $self->_domain2realm or do { 
     86    if (!$self->options('realm')) { 
     87        if ($self->options('domain')) { 
     88            $self->{_options}{realm} = $self->_domain2realm or do { 
    9889                $self->log(LA_ERR, 
    9990                    'Cannot find kerberos TXT record for domain `%s\'', 
    100                     $self->_param('domain'), 
     91                    $self->options('domain'), 
    10192                ); 
    10293                return; 
    10394            }; 
    104             $self->log(LA_DEBUG, 'kerberos REALM is %s', $self->_param('realm')); 
     95            $self->log(LA_DEBUG, 'kerberos REALM is %s', $self->options('realm')); 
    10596        } else { 
    10697            # No way to find realm 
     
    10899        } 
    109100    } 
    110     my @servers = $self->_param('server') 
    111         ? ($self->_param('server')) 
    112         : $self->_param('domain') 
     101    my @servers = $self->options('server') 
     102        ? ($self->options('server')) 
     103        : $self->options('domain') 
    113104            ? $self->_domain2server 
    114105            : (); 
     
    127118            # Port   => '8899', 
    128119            # Required: 
    129             Principal => $self->_param('login'), 
    130             Realm  => $self->_param('realm'), 
     120            Principal => $self->options('login'), 
     121            Realm  => $self->options('realm'), 
    131122            # --- Either --- 
    132             Password => $self->_param('password'), 
     123            Password => $self->options('password'), 
    133124            # --- Or --- 
    134             # Keytab => $self->_param('keytab'), 
     125            # Keytab => $self->options('keytab'), 
    135126        ); 
    136127 
     
    159150 
    160151    my $resolver = Net::DNS::Resolver->new; 
    161     my $query = $resolver->query("_kerberos-adm._tcp." . $self->_param('domain'), 
     152    my $query = $resolver->query("_kerberos-adm._tcp." . $self->options('domain'), 
    162153        "SRV") or return; 
    163154    foreach my $rr ( 
     
    175166    my $resolver = Net::DNS::Resolver->new; 
    176167    my $query = $resolver->query( 
    177         "_kerberos." . $self->_param('domain'), 
     168        "_kerberos." . $self->options('domain'), 
    178169        "TXT") or return; 
    179170    foreach my $rr ($query->answer) { 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Heimdal/User.pm

    r1026 r1037  
    5858 
    5959    $uid eq 'default' and return 1; 
    60     grep { $uid eq $_ } split(/ *, */, $base->_param('ignoredusers')) 
     60    grep { $uid eq $_ } split(/ *, */, $base->options('ignoredusers')) 
    6161        and return 1; 
    6262 
     
    6767    my ($class, $base) = @_; 
    6868 
    69     my $realm = $base->_param('realm'); 
     69    my $realm = $base->options('realm'); 
    7070    my @uids; 
    7171    foreach ($base->heimdal->getPrincipals('*@' . $realm)) { 
     
    9090    my $ba = $base || $self->base; 
    9191    $uid ||= $self->id; 
    92     return $uid . '@' . $ba->_param('realm'); 
     92    return $uid . '@' . $ba->options('realm'); 
    9393} 
    9494 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ldap.pm

    r1032 r1037  
    7777        _password => $options{password}, 
    7878        _ssl => $options{ssl}, 
    79         _param => { %options }, 
    8079    }; 
    8180 
    8281    bless($self, $class); 
    83 } 
    84  
    85 sub _param { 
    86     my ($self, $var) = @_; 
    87     return $self->{_param}{$var} 
    8882} 
    8983 
     
    9791    my ($self, $otype) = @_; 
    9892    return join(',', 
    99         ($self->_param($otype . '_container') || 'cn=Users'), 
     93        ($self->options($otype . '_container') || 'cn=Users'), 
    10094        $self->top_dn, 
    10195    ); 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ldap/Onlyaddress.pm

    r1025 r1037  
    7979sub is_supported { 
    8080    my ($class, $base) = @_; 
    81     return $base->_param('onlyaddress_container') ? 1 : 0; 
     81    return $base->options('onlyaddress_container') ? 1 : 0; 
    8282} 
    8383 
Note: See TracChangeset for help on using the changeset viewer.