Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
75057203
Commit
75057203
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
fix log when no tablename prefix is used
parent
606dec8d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/log.php
+4
-4
4 additions, 4 deletions
lib/log.php
with
4 additions
and
4 deletions
lib/log.php
+
4
−
4
View file @
75057203
...
...
@@ -51,7 +51,7 @@ class OC_LOG {
* This function adds another entry to the log database
*/
public
static
function
add
(
$appid
,
$subject
,
$predicate
,
$object
=
' '
){
$query
=
OC_DB
::
prepare
(
"INSERT INTO *PREFIX*log(moment,appid,user,action,info) VALUES(NOW(),?,?,?,?)"
);
$query
=
OC_DB
::
prepare
(
"INSERT INTO
`
*PREFIX*log
`
(moment,appid,user,action,info) VALUES(NOW(),?,?,?,?)"
);
$result
=
$query
->
execute
(
array
(
$appid
,
$subject
,
$predicate
,
$object
));
// Die if we have an error
if
(
PEAR
::
isError
(
$result
))
{
...
...
@@ -79,7 +79,7 @@ class OC_LOG {
* - app: only entries for this app
*/
public
static
function
get
(
$filter
=
array
()){
$queryString
=
'SELECT * FROM *PREFIX*log WHERE 1=1 ORDER BY moment DESC'
;
$queryString
=
'SELECT * FROM
`
*PREFIX*log
`
WHERE 1=1 ORDER BY moment DESC'
;
$params
=
array
();
if
(
isset
(
$filter
[
'from'
])){
$queryString
.
=
'AND moment>? '
;
...
...
@@ -116,7 +116,7 @@ class OC_LOG {
* This function deletes all entries that are older than $date.
*/
public
static
function
deleteBefore
(
$date
){
$query
=
OC_DB
::
prepare
(
"DELETE FROM *PREFIX*log WHERE moment<?"
);
$query
=
OC_DB
::
prepare
(
"DELETE FROM
`
*PREFIX*log
`
WHERE moment<?"
);
$query
->
execute
(
array
(
$date
));
return
true
;
}
...
...
@@ -128,7 +128,7 @@ class OC_LOG {
* This function deletes all log entries.
*/
public
static
function
deleteAll
(){
$query
=
OC_DB
::
prepare
(
"DELETE FROM *PREFIX*log"
);
$query
=
OC_DB
::
prepare
(
"DELETE FROM
`
*PREFIX*log
`
"
);
$query
->
execute
();
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment