Trace in progress (cfgAuthor)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 10 years ago
parent 4e9245a8b1
commit 4645600eda
  1. 7
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI.pm
  2. 2
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/ConfParser.pm

@ -20,6 +20,7 @@ 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);
@ -77,6 +78,12 @@ sub user {
return $datas;
}
## @method string userId()
# @return user identifier to log
sub userId {
return $datas->{ $tsv->{whatToTrace} }
}
## @method boolean group(string group)
# @param $group name of the Lemonldap::NG group to test
# @return boolean : true if user is in this 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} = 'TODO';
$self->newConf->{cfgAuthor} = $self->req->user;
$self->newConf->{cfgAuthorIP} = $self->req->remote_ip;
$self->newConf->{cfgDate} = time;
$self->newConf->{key} ||=

Loading…
Cancel
Save