Changeset 640296
- Timestamp:
- 12/17/2012 01:57:21 AM (13 years ago)
- Location:
- better-wp-security/trunk/inc/admin
- Files:
-
- 3 edited
-
common.php (modified) (1 diff)
-
construct.php (modified) (1 diff)
-
content.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
better-wp-security/trunk/inc/admin/common.php
r640277 r640296 840 840 function log404csv() { 841 841 842 842 global $wpdb; 843 844 @header( 'Content-type: text/x-csv' ); 845 @header( 'Content-Transfer-Encoding: binary' ); 846 @header( 'Content-Disposition: attachment; filename=404errors.csv' ); 847 @header( 'Cache-Control: no-cache, must-revalidate' ); 848 @header( 'Expires: Thu, 22 Jun 1978 00:28:00 GMT' ); 849 850 @ini_set( 'auto_detect_line_endings', true ); 851 852 $headers = array( 853 'url', 854 'time', 855 'host', 856 'referrer' 857 ); 858 859 $errors = $wpdb->get_results( "SELECT url, timestamp, host, referrer, url FROM `" . $wpdb->base_prefix . "bwps_log` WHERE `type` = 2;", ARRAY_A ); 860 861 array_unshift( $errors, $headers ); 862 863 foreach ( $errors as $error ) { 864 865 foreach ( $error as $attr ) { 866 867 echo $attr . ','; 868 869 } 870 871 echo PHP_EOL; 872 873 } 874 875 exit; 843 876 844 877 } -
better-wp-security/trunk/inc/admin/construct.php
r571459 r640296 29 29 30 30 add_action( 'admin_init', array( &$this, 'awaycheck' ) ); 31 32 //Process 404 .csv file 33 if ( isset( $_GET['bit51_404_csv'] ) ) { 34 35 add_action( 'init', array( &$this, 'log404csv' ) ); 36 37 } 31 38 32 39 } -
better-wp-security/trunk/inc/admin/content.php
r640277 r640296 2331 2331 $log_content_4_table->prepare_items(); 2332 2332 $log_content_4_table->display(); 2333 2334 echo '<a href="admin.php?page=better-wp-security-logs&bit51_404_csv">' . __( 'Download 404 Log in .csv format', $this->hook ) . '</a>'; 2335 2336 //Process 404 .csv file 2337 if ( isset( $_GET['bit51_404_csv'] ) ) { 2338 $this->log404csv(); 2339 } 2333 2334 ?> 2335 2336 <p><a href="<?php echo admin_url(); ?><?php echo is_multisite() ? 'network/' : ''; ?>admin.php?page=better-wp-security-logs&bit51_404_csv" target="_blank" ><?php _e( 'Download 404 Log in .csv format', $this->hook ); ?></a></p> 2337 2338 <?php 2340 2339 2341 2340 } … … 2387 2386 ?> 2388 2387 2389 <p><a href="<?php echo admin_url(); ?><?php echo is_multisite() ? 'network/' : ''; ?>admin.php?page=better-wp-security-logs#file-change" ><?php _e( 'Return to Log', $this->hook ); ?></a></p>2388 <p><a href="<?php echo admin_url(); ?><?php echo is_multisite() ? 'network/' : ''; ?>admin.php?page=better-wp-security-logs#file-change" ><?php _e( 'Return to Log', $this->hook ); ?></a></p> 2390 2389 2391 2390 <?php
Note: See TracChangeset
for help on using the changeset viewer.