diff options
author | jnew-gh <github@hazelden.ca> | 2021-04-18 23:24:45 +0300 |
---|---|---|
committer | jnew-gh <github@hazelden.ca> | 2021-04-18 23:24:45 +0300 |
commit | 8a1483f70bc4548f12caadf7c559473e1e17f5de (patch) | |
tree | 16658715d7b5e60d0e11a97e6ce411b03c1ffc82 /dmarcts-report-viewer-report-data.php | |
parent | 569a8b1525e2e4c8ac264fe269f697083707360d (diff) |
Implement cookie-based options
Implement cookie-based options on displayed pages
Includes some code section rearranging in dmarcts-reports-viewer.js that doesn't affect code logic.
Diffstat (limited to 'dmarcts-report-viewer-report-data.php')
-rw-r--r-- | dmarcts-report-viewer-report-data.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dmarcts-report-viewer-report-data.php b/dmarcts-report-viewer-report-data.php index beff179..a8aa711 100644 --- a/dmarcts-report-viewer-report-data.php +++ b/dmarcts-report-viewer-report-data.php @@ -38,6 +38,7 @@ function tmpl_reportData($reportnumber, $reports, $host_lookup = 1) { global $dmarc_where; + global $cookie_options; $title_message = "Click to toggle sort direction by this column"; @@ -60,7 +61,7 @@ function tmpl_reportData($reportnumber, $reports, $host_lookup = 1) { $reportdata[] = "<div id='report_desc_container' class='center reportdesc_container'>"; $reportdata[] = "<div id='report_desc' class='center reportdesc'>Report from ".$row['org']." for ".$row['domain']."<br>(". format_date($row['mindate'], "r" ). " - ".format_date($row['maxdate'], "r" ).")<br> Policies: adkim=" . $row['policy_adkim'] . ", aspf=" . $row['policy_aspf'] . ", p=" . $row['policy_p'] . ", sp=" . $row['policy_sp'] . ", pct=" . $row['policy_pct'] . "</div>"; - $reportdata[] = "<div style='display:inline-block;margin-left:20px;'><img src='xml.png' id='xml_html_img' width='30px' alt='Show Raw Report XML' title='Show Raw Report XML' onclick='showXML()'></div>"; + $reportdata[] = "<div style='display:inline-block;margin-left:20px;'><img src='xml.png' id='xml_html_img' width='30px' alt='Show Raw Report XML' title='Show Raw Report XML' onclick='report_data_xml_display_toggle()'></div>"; $reportdata[] = "</div>"; @@ -129,9 +130,6 @@ ORDER BY ip ASC "; -// Debug -// echo "<br><b>sql reportdata =</b> $sql<br>"; - $query = $mysqli->query($sql) or die("Query failed: ".$mysqli->error." (Error #" .$mysqli->errno.")"); while($row = $query->fetch_assoc()) { if ( $row['ip'] ) { @@ -172,7 +170,6 @@ ORDER BY $reportdata[] = "</div>"; - $reportdata[] = ""; #indent generated html by 2 extra spaces @@ -180,6 +177,7 @@ ORDER BY } function formatXML($xml) { + $dom = new DOMDocument(); // Initial block (must before load xml string) @@ -233,7 +231,7 @@ if(isset($_GET['sortorder']) && is_numeric($_GET['sortorder'])){ die('Invalid sortorder flag'); } -if($dmarc_results_matching_only && isset($_GET['dmarc'])){ +if( $cookie_options['dmarc_results_matching_only'] && isset($_GET['dmarc']) ) { $dmarc_select=$_GET['dmarc']; }else{ $dmarc_select= ''; |