summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-27 22:44:51 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-27 22:44:51 +0200
commit7505720350369943d4b1a8be5f3840ada424221b (patch)
tree3519804afd2b2780701d75094826c0f77d65ee0d /lib
parent606dec8da026d3aceb75abb64c936a09a3bd9133 (diff)
downloadnextcloud-server-7505720350369943d4b1a8be5f3840ada424221b.tar.gz
nextcloud-server-7505720350369943d4b1a8be5f3840ada424221b.zip
fix log when no tablename prefix is used
Diffstat (limited to 'lib')
-rw-r--r--lib/log.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/log.php b/lib/log.php
index 894575ef059..764c094c919 100644
--- a/lib/log.php
+++ b/lib/log.php
@@ -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;
}