| 1 | package Net::Gnats::Command::DBLS; | ||||||||||
| 2 | 40 | ▶ | use parent 'Net::Gnats::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 40 | ▶ | use strictures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 40 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 40 | $Net::Gnats::Command::DBLS::VERSION = '0.22'; | |||||||||
| 6 | } | ||||||||||
| 7 | 40 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 40 | ▶ | use Net::Gnats::Constants qw(CODE_TEXT_READY); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | Net::Gnats::Command::DBLS | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | Lists the known set of databases. | ||||||||||
| 18 | |||||||||||
| 19 | The gnatsd access level listdb denies access until the user has | ||||||||||
| 20 | authenticated with the USER command. The only other command | ||||||||||
| 21 | available at this access level is DBLS. This access level provides a | ||||||||||
| 22 | way for a site to secure its gnats databases while still providing a | ||||||||||
| 23 | way for client tools to obtain a list of the databases for use on | ||||||||||
| 24 | login screens etc. | ||||||||||
| 25 | |||||||||||
| 26 | The list of databases follows, one per line, using the standard | ||||||||||
| 27 | quoting mechanism. Only the database names are sent. | ||||||||||
| 28 | |||||||||||
| 29 | =head1 PROTOCOL | ||||||||||
| 30 | |||||||||||
| 31 | DBLS | ||||||||||
| 32 | |||||||||||
| 33 | =head1 RESPONSES | ||||||||||
| 34 | |||||||||||
| 35 | The possible responses are: | ||||||||||
| 36 | |||||||||||
| 37 | 6xx (internal error) An internal error was encountered while trying | ||||||||||
| 38 | to obtain the list of available databases, usually due to lack of | ||||||||||
| 39 | permissions or other filesystem-related problems, or the list of | ||||||||||
| 40 | databases is empty. | ||||||||||
| 41 | |||||||||||
| 42 | 301 (CODE_TEXT_READY) | ||||||||||
| 43 | |||||||||||
| 44 | =cut | ||||||||||
| 45 | |||||||||||
| 46 | 40 | my $c = 'DBLS'; | |||||||||
| 47 | |||||||||||
| 48 | 7 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 49 | 7 | my ( $class ) = @_; | |||||||||
| 50 | 7 | ▶ | my %options = shift if $_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 7 | my $self = bless \%options, $class; | |||||||||
| 52 | 7 | return $self; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 18 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 56 | 18 | return $c; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 4 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 60 | 4 | my ($self) = @_; | |||||||||
| 61 | 4 | ▶ | return 1 if $self->response->code == CODE_TEXT_READY; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 1 | return 0; | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 40 | 1; | |||||||||