summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2011-06-07 15:48:21 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2011-06-07 15:48:21 -0400
commit86dd023448a1aed54a076df9533ecdf50c4dcd97 (patch)
tree2a2e198dddbf3b3ee0d5f4cf8deff667511b185b /lib
parentd65f8bba73971e33a93e99d21ba791dec8056a28 (diff)
downloadnextcloud-server-86dd023448a1aed54a076df9533ecdf50c4dcd97.tar.gz
nextcloud-server-86dd023448a1aed54a076df9533ecdf50c4dcd97.zip
Adding clear logs functions
Diffstat (limited to 'lib')
-rw-r--r--lib/log.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/log.php b/lib/log.php
index aebeba7d4b3..894575ef059 100644
--- a/lib/log.php
+++ b/lib/log.php
@@ -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 ';
+ $queryString='SELECT * FROM *PREFIX*log WHERE 1=1 ORDER BY moment DESC';
$params=array();
if(isset($filter['from'])){
$queryString.='AND moment>? ';
@@ -120,6 +120,18 @@ class OC_LOG {
$query->execute(array($date));
return true;
}
+
+ /**
+ * @brief removes all log entries
+ * @returns true/false
+ *
+ * This function deletes all log entries.
+ */
+ public static function deleteAll(){
+ $query=OC_DB::prepare("DELETE FROM *PREFIX*log");
+ $query->execute();
+ return true;
+ }
/**
* @brief filter an array of log entries on action