From b9b2e0269a2816d8708dcbaf82467d6200c830af Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 23 Apr 2013 14:39:28 +0200 Subject: [PATCH 1/3] fix logical issue while retrieving log via ajax --- settings/ajax/getlog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php index 141457e72a..02f4f37fd6 100644 --- a/settings/ajax/getlog.php +++ b/settings/ajax/getlog.php @@ -15,4 +15,4 @@ $data = array(); OC_JSON::success(array( "data" => $entries, - "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $offset)) != 0) ? true : false)); + "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $count)) != 0) ? true : false)); From e78a4640022c9b5ce833f34de118dea4608cc560 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 23 Apr 2013 14:56:33 +0200 Subject: [PATCH 2/3] remove log sort in admin section doesn't work anymore, because now the datetime is saved as string (ref #2975) --- settings/admin.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/settings/admin.php b/settings/admin.php index c784880309..035cef5bf9 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -20,11 +20,6 @@ $htaccessworking=OC_Util::ishtaccessworking(); $entries=OC_Log_Owncloud::getEntries(3); $entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false; -function compareEntries($a, $b) { - return $b->time - $a->time; -} -usort($entries, 'compareEntries'); - $tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 )); $tmpl->assign('entries', $entries); $tmpl->assign('entriesremain', $entriesremain); From 8fab7d5afb099a99aab81df7b0f44e3a1eb0016f Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 23 Apr 2013 17:59:31 +0200 Subject: [PATCH 3/3] fix syntax layout --- settings/ajax/getlog.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php index 02f4f37fd6..da69a2863b 100644 --- a/settings/ajax/getlog.php +++ b/settings/ajax/getlog.php @@ -13,6 +13,9 @@ $offset=(isset($_GET['offset']))?$_GET['offset']:0; $entries=OC_Log_Owncloud::getEntries($count, $offset); $data = array(); -OC_JSON::success(array( - "data" => $entries, - "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $count)) != 0) ? true : false)); +OC_JSON::success( + array( + "data" => $entries, + "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $count)) != 0) ? true : false + ) +);