source: trunk/LATMOS-Accounts/patchset/logas_in_cli.patch @ 2282

Last change on this file since 2282 was 2282, checked in by nanardon, 5 years ago

Ensure users cannot retrieve password, even encrypted

File size: 962 bytes
  • LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Base.pm

    diff --git a/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Base.pm b/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Base.pm
    index ddc4ce2..6c36ae7 100644
    a b sub BUILD { 
    6060        }, 
    6161    }); 
    6262 
     63=head3 logas 
     64 
     65    logas [username] 
     66 
     67Create an object alias named C<Name> for object C<Object>. 
     68 
     69=cut 
     70 
     71        $self->add_func( 
     72            'logas', { 
     73                code => sub { 
     74                    my ($self, $username) = @_; 
     75                    if ($self->base->SetConnectedUser($username)) { 
     76                        $username ||= ''; 
     77                        print $OUT "Connected as `$username'\n"; 
     78                    } 
     79                }, 
     80                completion => sub { 
     81                    return $_[0]->base->list_objects('user'); 
     82                } 
     83            }, 
     84        ); 
     85 
    6386=head3 unexported 
    6487 
    6588    unexported yes|no|show 
Note: See TracBrowser for help on using the repository browser.