/var/www/(Del)hsihk.com/wp-content/plugins/backupbuddy/controllers/ajax/remotesend_details.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
if ( ! is_admin() ) { die( 'Access denied.' ); }

// Display backup integrity status.
/* remotesend_details()
 *
 * View log for a remote destination file transfer. Outputs HTML and information and die()'s.
 *
 */


$send_id pb_backupbuddy::_GET'send_id' );
$send_id str_replace'/\\'''$send_id );

pb_backupbuddy::$ui->ajax_header();

$log_file backupbuddy_core::getLogDirectory() . 'status-remote_send-' $send_id '_' pb_backupbuddy::$options['log_serial'] . '.txt';
if ( ! 
file_exists$log_file ) ) {
    die( 
'Error #4438958945985: Unable to read log file `' $log_file '`.' );
}

// Display log.
echo '<h3>Remote Send Log</h3>';
echo 
'<textarea style="width: 100%; height: 80%;" wrap="off" readonly="readonly">';
$lines file_get_contents$log_file );
if ( 
false === $lines ) {
    echo 
'Error #849834: Unable to read log file `' $log_file '`.';
} else {
    
$lines explode"\n"$lines );
    foreach( (array)
$lines as $line ) {
        
$line json_decode$linetrue );
        
//print_r( $line );
        
if ( is_array$line ) ) {
            
$u '';
            if ( isset( 
$line['u'] ) ) { // As off v4.2.15.6. TODO: Remove this in a couple of versions once old logs without this will have cycled out.
                
$u '.' $line['u'];
            }
            echo 
pb_backupbuddy::$format->date$line['time'], 'G:i:s' ) . $u "\t\t";
            echo 
$line['run'] . "sec\t";
            echo 
$line['mem'] . "MB\t";
            echo 
$line['event'] . "\t";
            echo 
$line['data'] . "\n";
        }
    }
}
echo 
'</textarea>';

pb_backupbuddy::$ui->ajax_footer();
die();