Commit 3bbe8000 authored by Luc Didry's avatar Luc Didry Committed by Luc Didry
Browse files

Fix #50 Add users infos in log and db if using ldap

parent 6f3cf342
......@@ -97,10 +97,13 @@ sub startup {
);
if ($mesg->code) {
$c->app->log->error($mesg->error);
$c->app->log->info("[LDAP authentication failed] login: $username, IP: ".$c->ip);
$c->app->log->error("[LDAP authentication failed] ".$mesg->error);
return undef;
}
$c->app->log->info("[LDAP authentication successful] login: $username, IP: ".$c->ip);
return $username;
}
}
......
......@@ -75,9 +75,13 @@ sub upload {
$delay = ($json->{delay} <= $c->max_delay || $c->max_delay == 0) ? $json->{delay} : $c->max_delay;
}
my $creator = $c->ip;
if (defined($c->config('ldap'))) {
$creator = 'User: '.$c->current_user.', IP: '.$creator;
}
$f = Lufi::File->new(
record => $c->get_empty,
created_by => $c->ip,
created_by => $creator,
delete_at_first_view => ($json->{del_at_first_view}) ? 1 : 0,
delete_at_day => $delay,
mediatype => $json->{type},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment