Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
8a7bf857
Commit
8a7bf857
authored
Nov 09, 2020
by
Bastien Le Querrec
Browse files
log more information
parent
3185234b
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controller/admin.php
View file @
8a7bf857
...
...
@@ -1379,6 +1379,7 @@ class Admin extends Controller
public
function
banque_update
(
$f3
,
$filename
,
$testing
=
true
)
{
$log
=
new
\
Log
(
'/banque_update.log'
);
$log
->
write
(
'Processing recurrent donations (testing: '
.
(
$testing
?
'true'
:
'false'
)
.
')'
);
$separator
=
";"
;
$datas
=
array
();
...
...
@@ -1472,7 +1473,8 @@ class Admin extends Controller
if
(
$user
and
!
$testing
)
{
$db
->
query
(
"INSERT INTO identifiers(user_id, identifier) VALUES ('"
.
$user
[
'id'
]
.
"', '"
.
$identifier
.
"')"
);
$email
=
$user
[
'email'
];
}
else
{
}
elseif
(
!
$testing
)
{
$log
->
write
(
'Cannot find user for transaction id '
.
$identifier
.
', creating it...'
);
// No user, let's try to create the user
$email
=
''
;
$pseudo
=
''
;
...
...
@@ -1485,15 +1487,13 @@ class Admin extends Controller
}
//! hash seems to identify one email at one time
$hash
=
hash
(
'sha256'
,
date
(
"%Y-%m-%d %H:%i:%d"
)
.
$email
);
if
(
!
$testing
)
{
$log
->
write
(
'Insert user: email "'
.
$email
.
'" pseudo "'
.
$pseudo
.
'" identifier "'
.
$identifier
.
'"'
);
try
{
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserCreateCommand
(
$email
,
$hash
,
$pseudo
,
0
,
0
));
}
catch
(
InvalidEmailException
$e
)
{
// \Exception
$log
->
write
(
"exception: "
.
$e
);
throw
$e
;
}
};
$log
->
write
(
'Insert user: email "'
.
$email
.
'" pseudo "'
.
$pseudo
.
'" identifier "'
.
$identifier
.
'"'
);
try
{
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserCreateCommand
(
$email
,
$hash
,
$pseudo
,
0
,
0
));
}
catch
(
InvalidEmailException
$e
)
{
// \Exception
$log
->
write
(
"exception: "
.
$e
);
throw
$e
;
}
}
}
else
{
$email
=
$result
->
fetch
(
\
PDO
::
FETCH_ASSOC
);
...
...
@@ -1572,8 +1572,6 @@ class Admin extends Controller
'"
.
$user
[
'id'
]
.
"',
'"
.
$cumul
.
"',
'"
.
$identifier
.
"')"
;
}
if
(
!
$testing
)
{
$db
->
query
(
$query
);
// On met alors à jour le cumul et le total de l'utilisateur concerné
$result
=
$db
->
query
(
"UPDATE users
...
...
@@ -1593,6 +1591,7 @@ class Admin extends Controller
$datas
[
'update'
]
=
$update
;
//! recurrent transactions remisées just added
$datas
[
'comptabilise'
]
=
$comptabilise
;
//! recurrent transactions remisées already added
$datas
[
'sans_cumul'
]
=
$sans_cumul
;
//! empty
$log
->
write
(
'Processing recurrent donation finished.'
);
return
$datas
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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