Manager logging in progress

Logging works now for protection => 'manager||authenticate'
environments/ppa-mbqj77/deployments/1
Xavier Guimard 10 years ago
parent 4645600eda
commit 9261cf2836
  1. 1
      lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Request.pm
  2. 4
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI.pm
  3. 2
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/ConfParser.pm

@ -46,7 +46,6 @@ has 'psgi.errors' => ( is => 'rw', reader => 'stderr' );
has REMOTE_USER => (
is => 'ro',
isa => 'Int',
reader => 'user',
trigger => sub {
$_[0]->{userData} = { _whatToTrace => $_[0]->{REMOTE_USER}, };

@ -20,10 +20,10 @@ sub _run {
$rule =
$rule eq "authenticate" ? "accept" : $rule eq "manager" ? "" : $rule;
return sub {
$_[0]->{REMOTE_USER} = $self->userId();
my $req = Lemonldap::NG::Common::PSGI::Request->new( $_[0] );
Lemonldap::NG::Handler::API->newRequest($req);
my $res = Lemonldap::NG::Handler::SharedConf->run($rule);
$req->userData($datas);
# TODO: Userdata
#print STDERR Dumper( \@_, $res ); use Data::Dumper;
@ -81,7 +81,7 @@ sub user {
## @method string userId()
# @return user identifier to log
sub userId {
return $datas->{ $tsv->{whatToTrace} }
return $datas->{ $tsv->{whatToTrace} } // '';
}
## @method boolean group(string group)

@ -42,7 +42,7 @@ sub scanTree {
# Set cfgNum to ref cfgNum (will be changed when saving), set other
# metadatas and set a value to the key if empty
$self->newConf->{cfgNum} = $self->refConf->{cfgNum};
$self->newConf->{cfgAuthor} = $self->req->user;
$self->newConf->{cfgAuthor} = $self->req->userData->{_whatToTrace};
$self->newConf->{cfgAuthorIP} = $self->req->remote_ip;
$self->newConf->{cfgDate} = time;
$self->newConf->{key} ||=

Loading…
Cancel
Save