Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fiat Tux
Hat softwares
Lufi
Commits
3bbe8000
Commit
3bbe8000
authored
Jun 14, 2016
by
Luc Didry
Committed by
Luc Didry
Jul 24, 2016
Browse files
Fix #50 Add users infos in log and db if using ldap
parent
6f3cf342
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Lufi.pm
View file @
3bbe8000
...
@@ -97,10 +97,13 @@ sub startup {
...
@@ -97,10 +97,13 @@ sub startup {
);
);
if
(
$mesg
->
code
)
{
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
;
return
undef
;
}
}
$c
->
app
->
log
->
info
("
[LDAP authentication successful] login:
$username
, IP:
"
.
$c
->
ip
);
return
$username
;
return
$username
;
}
}
}
}
...
...
lib/Lufi/Controller/Files.pm
View file @
3bbe8000
...
@@ -75,9 +75,13 @@ sub upload {
...
@@ -75,9 +75,13 @@ sub upload {
$delay
=
(
$json
->
{
delay
}
<=
$c
->
max_delay
||
$c
->
max_delay
==
0
)
?
$json
->
{
delay
}
:
$c
->
max_delay
;
$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
(
$f
=
Lufi::
File
->
new
(
record
=>
$c
->
get_empty
,
record
=>
$c
->
get_empty
,
created_by
=>
$c
->
ip
,
created_by
=>
$c
reator
,
delete_at_first_view
=>
(
$json
->
{
del_at_first_view
})
?
1
:
0
,
delete_at_first_view
=>
(
$json
->
{
del_at_first_view
})
?
1
:
0
,
delete_at_day
=>
$delay
,
delete_at_day
=>
$delay
,
mediatype
=>
$json
->
{
type
},
mediatype
=>
$json
->
{
type
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment