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
typo3
qfq
Commits
43773895
Commit
43773895
authored
Jul 09, 2017
by
Carsten Rose
Browse files
Dirty.php: save SIP in dirty record
parent
3648bf36
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
43773895
...
...
@@ -14,6 +14,8 @@ const API_DIR = 'typo3conf/ext/qfq/qfq/api';
const
QFQ_LOG
=
'qfq.log'
;
const
MAX_LENGTH_IPV6
=
45
;
const
SESSION_LIFETIME_SECONDS
=
86400
;
const
SESSION_NAME
=
'qfq'
;
const
SESSION_FE_USER_UID
=
'feUserUid'
;
...
...
extension/qfq/qfq/form/Dirty.php
View file @
43773895
...
...
@@ -96,7 +96,7 @@ class Dirty {
if
(
count
(
$recordDirty
)
==
0
)
{
// No dirty record found.
$answer
=
$this
->
writeDirty
(
$recordId
,
$tableName
,
$formDirtyMode
,
$feUser
);
$answer
=
$this
->
writeDirty
(
$this
->
client
[
SIP_SIP
],
$recordId
,
$tableName
,
$formDirtyMode
,
$feUser
);
}
else
{
$answer
=
$this
->
checkConflict
(
$recordDirty
,
$formDirtyMode
,
$feUser
);
}
...
...
@@ -142,14 +142,16 @@ class Dirty {
/**
* Write a 'Dirty'-Record.
*
* @param $s
* @param $recordId
* @param $tableName
* @param $formDirtyMode
* @param $feUser
* @return array
* @throws CodeException
* @throws DbException
*/
private
function
writeDirty
(
$recordId
,
$tableName
,
$formDirtyMode
,
$feUser
)
{
private
function
writeDirty
(
$s
,
$recordId
,
$tableName
,
$formDirtyMode
,
$feUser
)
{
$record
=
$this
->
db
->
sql
(
"SELECT * FROM
$tableName
WHERE id=?"
,
ROW_EXPECT_1
,
[
$recordId
],
"Record to tag 'dirty' not found."
);
...
...
@@ -157,8 +159,8 @@ class Dirty {
$recordModified
=
empty
(
$record
[
COLUMN_MODIFIED
])
?
0
:
$record
[
COLUMN_MODIFIED
];
// Write 'dirty' record
$this
->
db
->
sql
(
"INSERT INTO Dirty (`tableName`, `recordId`, `recordModified`, `feUser`, `qfqUserSessionCookie`, `dirtyMode`, `remoteAddress`, `created`) "
.
"VALUES ( ?,?,?,?,?,?,?,? )"
,
ROW_REGULAR
,
[
$tableName
,
$recordId
,
$recordModified
,
$feUser
,
$this
->
client
[
CLIENT_COOKIE_QFQ
],
$formDirtyMode
,
$this
->
client
[
CLIENT_REMOTE_ADDRESS
],
date
(
'YmdHis'
)]);
$this
->
db
->
sql
(
"INSERT INTO Dirty (
`sip`,
`tableName`, `recordId`, `recordModified`, `feUser`, `qfqUserSessionCookie`, `dirtyMode`, `remoteAddress`, `created`) "
.
"VALUES ( ?,?,?,?,?,?,?,?
,?
)"
,
ROW_REGULAR
,
[
$s
,
$tableName
,
$recordId
,
$recordModified
,
$feUser
,
$this
->
client
[
CLIENT_COOKIE_QFQ
],
$formDirtyMode
,
$this
->
client
[
CLIENT_REMOTE_ADDRESS
],
date
(
'YmdHis'
)]);
return
[
API_STATUS
=>
API_ANSWER_STATUS_SUCCESS
,
API_MESSAGE
=>
''
];
...
...
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