Ignore:
Timestamp:
05/29/12 10:25:51 (12 years ago)
Author:
nanardon
Message:
  • complete POD

This patch a basic documentation to all functions.
It also add two test to ensure all POD syntax are correct and coverage is full.

File:
1 edited

Legend:

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

    r983 r1023  
    6060    $self->{_db} && $self->{_db}->rollback; 
    6161} 
     62 
     63=head2 db 
     64 
     65Return a L<DBI> handle over database, load it if need. 
     66 
     67=cut 
    6268 
    6369sub db { 
     
    8490        $self->{_db}->do(q{set DATESTYLE to 'DMY'}); 
    8591        $self->log(LA_DEBUG, 'New connection to DB'); 
     92        $self->{_db}->commit; 
    8693        return $self->{_db}; 
    8794    } 
     
    153160}  
    154161 
    155  
    156 # Extra non standard functions 
     162=head1 SPECIFICS FUNCTIONS 
     163 
     164=head2 get_global_value ($varname) 
     165 
     166Return global value set into base 
     167 
     168=cut 
    157169 
    158170sub get_global_value { 
     
    167179    $res->{val} 
    168180} 
     181 
     182=head2 set_global_value ($varname, $value) 
     183 
     184Set global value. 
     185 
     186=cut 
    169187 
    170188sub set_global_value { 
     
    181199} 
    182200 
     201=head2 generate_rsa_key ($password) 
     202 
     203Return public and private peer rsa keys 
     204 
     205=cut 
     206 
    183207sub generate_rsa_key { 
    184208    my ($self, $password) = @_; 
     
    195219} 
    196220 
     221=head2 private_key ($password) 
     222 
     223Load and return private rsa key 
     224 
     225=cut 
     226 
    197227sub private_key { 
    198228    my ($self, $password) = @_; 
     
    204234    $privkey 
    205235} 
     236 
     237=head2 get_rsa_password 
     238 
     239Return hash with peer username => encryptedPassword 
     240 
     241=cut 
    206242 
    207243sub get_rsa_password { 
     
    221257} 
    222258 
     259=head2 store_rsa_key ($public, $private) 
     260 
     261Store public and private RSA key info data base 
     262 
     263=cut 
     264 
    223265sub store_rsa_key { 
    224266    my ($self, $public, $private) = @_; 
     
    231273} 
    232274 
     275=head2 find_next_expire_users ($expire) 
     276 
     277Search user expiring in C<$expire> delay 
     278 
     279=cut 
    233280 
    234281sub find_next_expire_users { 
     
    252299} 
    253300 
     301=head2 find_expired_users ($expire) 
     302 
     303Return list of user going to expires in C<$expire> delay 
     304 
     305=cut 
     306 
    254307sub find_expired_users { 
    255308    my ($self, $expire) = @_; 
     
    271324} 
    272325 
     326=head2 rename_nethost ($nethostname, $to, %options) 
     327 
     328Facility function to rename computer to new name 
     329 
     330=cut 
     331 
    273332sub rename_nethost { 
    274333    my ($self, $nethostname, $to, %options) = @_; 
     
    287346    return 1; 
    288347} 
     348 
     349=head2 nethost_exchange_ip ($ip1, $ip2) 
     350 
     351Exchange ip1 with ip2 in base 
     352 
     353=cut 
    289354 
    290355sub nethost_exchange_ip { 
     
    316381} 
    317382 
     383=head1 ATTRIBUTES FUNCTIONS 
     384 
     385=head2 register_attribute ($otype, $attribute, $comment) 
     386 
     387Register a new attribute in base 
     388 
     389=cut 
     390 
    318391sub register_attribute { 
    319392    my ($self, $otype, $attribute, $comment) = @_; 
     
    322395} 
    323396 
     397=head2 is_registered_attribute ($otype, $attribute) 
     398 
     399Return true is attribute already exists 
     400 
     401=cut 
     402 
    324403sub is_registered_attribute { 
    325404    my ($self, $otype, $attribute) = @_; 
     
    328407} 
    329408 
     409=head2 get_attribute_comment ($otype, $attribute) 
     410 
     411Return the comment associated to attribute 
     412 
     413=cut 
     414 
    330415sub get_attribute_comment { 
    331416    my ($self, $otype, $attribute) = @_; 
     
    334419} 
    335420 
     421=head2 set_attribute_comment ($otype, $attribute, $comment) 
     422 
     423Set comment to attribute 
     424 
     425=cut 
     426 
    336427sub set_attribute_comment { 
    337428    my ($self, $otype, $attribute, $comment) = @_; 
     
    340431} 
    341432 
    342 sub check_user_manager { 
     433sub _check_user_manager { 
    343434    $_[0]->_handle_by_unexported('user', 'manager', 'active'); 
    344435} 
    345436 
    346 sub check_group_manager { 
     437sub _check_group_manager { 
    347438    $_[0]->_handle_by_unexported('group', 'managedBy'); 
    348439} 
    349440 
    350 sub check_nethost_owner { 
     441sub _check_nethost_owner { 
    351442    $_[0]->_handle_by_unexported('nethost', 'owner', 'active'); 
    352443} 
     
    372463} 
    373464 
     465=head2 get_datarequest ($id) 
     466 
     467Return user request C<$id> 
     468 
     469=cut 
     470 
    374471sub get_datarequest { 
    375472    my ($self, $id) = @_; 
     
    388485} 
    389486 
     487=head2 list_requests 
     488 
     489List user request currently waiting in base 
     490 
     491=cut 
     492 
    390493sub list_requests { 
    391494    my ($self) = @_; 
     
    404507    @ids 
    405508} 
     509 
     510=head2 list_pending_requests 
     511 
     512List user request to apply 
     513 
     514=cut 
    406515 
    407516sub list_pending_requests { 
     
    422531    @ids 
    423532} 
     533 
     534=head2 list_auto_pending_requests 
     535 
     536List automatic request 
     537 
     538=cut 
    424539 
    425540sub list_auto_pending_requests { 
Note: See TracChangeset for help on using the changeset viewer.