LEMONLDAP::NG : Manager/Base.pm becomes Common/CGI.pm

This commit is contained in:
Xavier Guimard 2008-11-20 06:53:44 +00:00
parent 2718750aed
commit eea294ce3b
5 changed files with 13 additions and 29 deletions

View File

@ -1,14 +1,5 @@
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/_i18n.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/Help.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/Base.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/_HTML.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/_Response.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/Sessions.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/SOAPServer.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager/Restricted.pm
debian/tmp/usr/share/perl5/Lemonldap/NG/Manager*
debian/tmp/usr/share/perl5/auto/Lemonldap/NG/Manager
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager::Base.3pm
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager.3pm
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager::SOAPServer.3pm
debian/tmp/usr/share/man/man3/Lemonldap::NG::Manager::Restricted.3pm

View File

@ -1,4 +1,4 @@
package Lemonldap::NG::Manager::Base;
package Lemonldap::NG::Common::CGI;
use strict;
@ -6,7 +6,7 @@ use MIME::Base64;
use Time::Local;
use CGI;
our $VERSION = '0.2';
our $VERSION = '0.3';
our @ISA = qw(CGI);
@ -65,21 +65,21 @@ __END__
=head1 NAME
Lemonldap::NG::Manager::Base - Simple module to extend L<CGI> to manage
Lemonldap::NG::Common::CGI - Simple module to extend L<CGI> to manage
HTTP "If-Modified-Since / 304 Not Modified" system.
=head1 SYNOPSIS
use Lemonldap::NG::Manager::Base;
use Lemonldap::NG::Common::CGI;
my $cgi = Lemonldap::NG::Manager::Base->new();
my $cgi = Lemonldap::NG::Common::CGI->new();
$cgi->header_public($ENV{SCRIPT_FILENAME});
print "<html><head><title>Static page</title></head>";
...
=head1 DESCRIPTION
Lemonldap::NG::Manager::Base just add header_public subroutine to CGI module to
Lemonldap::NG::Common::CGI just add header_public subroutine to CGI module to
avoid printing HTML elements that can be cached.
=head1 METHODS

View File

@ -86,23 +86,16 @@ sub getConf {
return $res;
}
else {
$args->{cfgNum} ||= $self->lastCfg;
$args->{cfgNum} ||= $self->lastCfg;
unless ( ref( $self->{refLocalStorage} ) ) {
return $self->getDBConf($args);
}
my $r = $self->confTest;
$| = 1;
return $r if ($r);
my $r = $self->{refLocalStorage}->get('conf');
return $r if ($r->{cfgNum} == $args->{cfgNum});
return $self->getDBConf($args);
}
}
sub confTest {
my ( $self, $numConf ) = @_;
my $args = $self->{refLocalStorage}->get('conf');
return ( defined($args) and $numConf == $args->{numConf} ) ? $args : 0;
}
sub setLocalConf {
my ( $self, $conf ) = @_;
$self->{refLocalStorage}->set( "conf", $conf );

View File

@ -2,7 +2,7 @@ package Lemonldap::NG::Handler::CGI;
use strict;
use CGI;
use Lemonldap::NG::Common::CGI;
use CGI::Cookie;
use MIME::Base64;

View File

@ -4,7 +4,7 @@ use strict;
use XML::Simple;
use Lemonldap::NG::Manager::Base;
use Lemonldap::NG::Common::CGI;
use Lemonldap::NG::Common::Conf;
use Lemonldap::NG::Manager::_HTML;
require Lemonldap::NG::Manager::_Response;
@ -15,7 +15,7 @@ use LWP::UserAgent;
use Safe;
use MIME::Base64;
our @ISA = qw(Lemonldap::NG::Manager::Base);
our @ISA = qw(Lemonldap::NG::Common::CGI);
our $VERSION = '0.87';