$timestamp = strtotime($entry['date']); if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to && (in_array('*', $filter_users) || in_array($entry['username'], $filter_users))) { $tmp_entries[] = array('id' => $id, 'timestamp' => $timestamp, 'username' => $entry['username'], 'statement' => $entry['statement']); } $id++; } return $tmp_entries; } $entries = array(); // Filtering data definition statements if ($_REQUEST['logtype'] == 'schema' || $_REQUEST['logtype'] == 'schema_and_data') { $entries = array_merge($entries, PMA_filter_tracking($data['ddlog'], $filter_ts_from, $filter_ts_to, $filter_users)); } // Filtering data manipulation statements if ($_REQUEST['logtype'] == 'data' || $_REQUEST['logtype'] == 'schema_and_data') { $entries = array_merge($entries, PMA_filter_tracking($data['dmlog'], $filter_ts_from, $filter_ts_to, $filter_users)); } // Sort it foreach ($entries as $key => $row) { $ids[$key] = $row['id']; $timestamps[$key] = $row['timestamp']; $usernames[$key] = $row['username']; $statements[$key] = $row['statement']; } array_multisort($timestamps, SORT_ASC, $ids, SORT_ASC, $usernames, SORT_ASC, $statements, SORT_ASC, $entries); } // Export as file download if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile') { @ini_set('url_rewriter.tags', ''); $dump = "# " . sprintf($strTrackingReportForTable, htmlspecialchars($_REQUEST['table'])) . "\n" . "# " . date('Y-m-d H:i:s') . "\n"; foreach ($entries as $entry) {
$entries = array_merge( $entries, PMA_filter_tracking( $data['ddlog'], $filter_ts_from, $filter_ts_to, $filter_users ) ); } // Filtering data manipulation statements if ($_REQUEST['logtype'] == 'data' || $_REQUEST['logtype'] == 'schema_and_data' ) { $entries = array_merge( $entries, PMA_filter_tracking( $data['dmlog'], $filter_ts_from, $filter_ts_to, $filter_users ) ); } // Sort it foreach ($entries as $key => $row) { $ids[$key] = $row['id']; $timestamps[$key] = $row['timestamp']; $usernames[$key] = $row['username']; $statements[$key] = $row['statement']; } array_multisort( $timestamps, SORT_ASC, $ids, SORT_ASC, $usernames, SORT_ASC, $statements, SORT_ASC, $entries