Ejemplo n.º 1
0
    }
    $last_modified = $file['uploaded_timestamp'];
    $size = (double) $file['size'];
    $backup_type = backupbuddy_core::getBackupTypeFromFile($file['filename']);
    // Generate array of table rows.
    while (isset($backup_list_temp[$last_modified])) {
        // Avoid collisions.
        $last_modified += 0.1;
    }
    $backup_list_temp[$last_modified] = array(array(base64_encode($file['url']), $file['filename']), pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($last_modified)) . '<br /><span class="description">(' . pb_backupbuddy::$format->time_ago($last_modified) . ' ago)</span>', pb_backupbuddy::$format->file_size($size), backupbuddy_core::pretty_backup_type($backup_type));
}
krsort($backup_list_temp);
$backup_list = array();
foreach ($backup_list_temp as $backup_item) {
    $backup_list[$backup_item[0][0]] = $backup_item;
}
unset($backup_list_temp);
$urlPrefix = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id'));
$quota = pb_backupbuddy_destination_stash2::get_quota($settings);
echo pb_backupbuddy_destination_stash2::get_quota_bar($quota);
// Render table listing files.
if (count($backup_list) == 0) {
    echo '<b>';
    _e('You have not completed sending any backups to this S3 destination for this site yet.', 'it-l10n-backupbuddy');
    echo '</b>';
} else {
    pb_backupbuddy::$ui->list_table($backup_list, array('action' => pb_backupbuddy::ajax_url('remoteClient') . '&function=remoteClient&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&remote_path=' . htmlentities(pb_backupbuddy::_GET('remote_path')), 'columns' => array('Backup File', 'Uploaded <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', 'File Size', 'Type'), 'hover_actions' => array($urlPrefix . '&cpy_file=' => 'Copy to Local', $urlPrefix . '&downloadlink_file=' => 'Get download link'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
}
// Display troubleshooting subscriber key.
echo '<br style="clear: both;">';
return;
Ejemplo n.º 2
0
         echo ' ' . __('To jump right in using the defaults just hit "Add Destination" below.', 'it-l10n-backupbuddy');
     } else {
         echo '<div style="text-align: center;">' . $account_details . '</div>';
     }
     if ($mode == 'add') {
         // Check to see if user already has a Stash with this username set up for this site. No need for multiple same account Stashes.
         foreach ((array) pb_backupbuddy::$options['remote_destinations'] as $destination) {
             if (isset($destination['itxapi_username']) && strtolower($destination['itxapi_username']) == strtolower($itxapi_username)) {
                 echo '<br><br>';
                 pb_backupbuddy::alert('Note: You already have a Stash destination set up under the provided iThemes account username.  It is unnecessary to create multiple Stash destinations that go to the same user account as they are effectively the same destination and a duplicate.');
                 break;
             }
         }
     }
     echo '<br><br>';
     echo pb_backupbuddy_destination_stash2::get_quota_bar($account_info);
     echo '<!-- STASH DETAILS: ' . print_r($account_info, true) . ' -->';
 }
 // end if NOT in save mode.
 // Form settings.
 $settings_form->add_setting(array('type' => 'text', 'name' => 'title', 'title' => __('Destination name', 'it-l10n-backupbuddy'), 'tip' => __('Name of the new destination to create. This is for your convenience only.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]', 'default' => $default_name));
 $settings_form->add_setting(array('type' => 'text', 'name' => 'full_archive_limit', 'title' => __('Full backup limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Full (complete) backup archives to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups. &nbsp;<span class="description">0 or blank for no limit.</span>'));
 $settings_form->add_setting(array('type' => 'text', 'name' => 'db_archive_limit', 'title' => __('Database only limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Database Only backup archives to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups. &nbsp;<span class="description">0 or blank for no limit.</span>'));
 $settings_form->add_setting(array('type' => 'text', 'name' => 'files_archive_limit', 'title' => __('Files only limit', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 5] - Enter 0 for no limit. This is the maximum number of Files Only backup archives to be stored in this specific destination. If this limit is met the oldest backup of this type will be deleted.', 'it-l10n-backupbuddy'), 'rules' => 'int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' backups. &nbsp;<span class="description">0 or blank for no limit.</span>'));
 $settings_form->add_setting(array('type' => 'title', 'name' => 'advanced_begin', 'title' => '<span class="dashicons dashicons-arrow-right"></span> ' . __('Advanced Options', 'it-l10n-backupbuddy'), 'row_class' => 'advanced-toggle-title'));
 $settings_form->add_setting(array('type' => 'text', 'name' => 'max_burst', 'title' => __('Send per burst', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 10] - This is the amount of data that will be sent per burst within a single PHP page load/chunk. Bursts happen within a single page load. Chunks occur when broken up between page loads/PHP instances. Reduce if hitting PHP memory limits. Chunking time limits will only be checked between bursts. Lower burst size if timeouts occur before chunking checks trigger.', 'it-l10n-backupbuddy'), 'rules' => 'required|int[0-9999999]', 'css' => 'width: 50px;', 'after' => ' MB', 'row_class' => 'advanced-toggle'));
 $settings_form->add_setting(array('type' => 'text', 'name' => 'max_time', 'title' => __('Max time per chunk', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 30] - Enter 0 for no limit (aka no chunking; bursts may still occur based on burst size setting). This is the maximum number of seconds per page load that bursts will occur. If this time is exceeded when a burst finishes then the next burst will be chunked and ran on a new page load. Multiple bursts may be sent within each chunk.', 'it-l10n-backupbuddy'), 'rules' => '', 'css' => 'width: 50px;', 'after' => ' secs. <span class="description">' . __('Blank for detected default:', 'it-l10n-backupbuddy') . ' ' . backupbuddy_core::detectMaxExecutionTime() . ' sec</span>', 'row_class' => 'advanced-toggle'));
 $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'ssl', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Encrypt connection', 'it-l10n-backupbuddy') . '*', 'tip' => __('[Default: enabled] - When enabled, all transfers will be encrypted with SSL encryption. Disabling this may aid in connection troubles but results in lessened security. Note: Once your files arrive on our server they are encrypted using AES256 encryption. They are automatically decrypted upon download as needed.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Enable connecting over SSL.', 'it-l10n-backupbuddy') . '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Files are always encrypted with AES256 upon arrival.</span>', 'rules' => '', 'row_class' => 'advanced-toggle'));
 $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'use_packaged_cert', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Use included CA bundle', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - When enabled, BackupBuddy will use its own bundled SSL certificate bundle for connecting to the server. Use this if SSL fails due to SSL certificate issues with your server.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Use included certificate bundle.', 'it-l10n-backupbuddy') . '</span>', 'rules' => '', 'row_class' => 'advanced-toggle'));
 if ($mode !== 'edit') {
     $settings_form->add_setting(array('type' => 'checkbox', 'name' => 'manage_all_files', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Manage all files', 'it-l10n-backupbuddy'), 'tip' => __('[Default: enabled] - When enabled, you have access to manage and view all files stored in your Stash account. You will be prompted for your password to access backups for sites other than this one.  If disabled the option is entirely removed for added security. For example, you may wish to disable this feature if a client has access and you want to keep them away from your files. This option can NOT be changed without deleting and re-creating the Stash destination for added security.', 'it-l10n-backupbuddy'), 'css' => '', 'rules' => '', 'row_class' => 'advanced-toggle'));
Ejemplo n.º 3
0
    }
    $last_modified = $file['uploaded_timestamp'];
    $size = (double) $file['size'];
    $backup_type = backupbuddy_core::getBackupTypeFromFile($file['filename']);
    // Generate array of table rows.
    while (isset($backup_list_temp[$last_modified])) {
        // Avoid collisions.
        $last_modified += 0.1;
    }
    $backup_list_temp[$last_modified] = array(array(base64_encode($file['url']), '<span title="' . $file['filename'] . '">' . basename($file['filename']) . '</span>'), pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($last_modified)) . '<br /><span class="description">(' . pb_backupbuddy::$format->time_ago($last_modified) . ' ago)</span>', pb_backupbuddy::$format->file_size($size), backupbuddy_core::pretty_backup_type($backup_type));
}
krsort($backup_list_temp);
$backup_list = array();
foreach ($backup_list_temp as $backup_item) {
    $backup_list[$backup_item[0][0]] = $backup_item;
}
unset($backup_list_temp);
$urlPrefix = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id'));
$quota = pb_backupbuddy_destination_stash2::get_quota($settings);
echo pb_backupbuddy_destination_stash2::get_quota_bar($quota, $settings, true);
// Render table listing files.
if (count($backup_list) == 0) {
    echo '<center><br><b>';
    _e('You have not completed sending any backups to this destination for this site yet.', 'it-l10n-backupbuddy');
    echo '</b></center>';
} else {
    pb_backupbuddy::$ui->list_table($backup_list, array('action' => pb_backupbuddy::ajax_url('remoteClient') . '&function=remoteClient&destination_id=' . htmlentities(pb_backupbuddy::_GET('destination_id')) . '&remote_path=' . htmlentities(pb_backupbuddy::_GET('remote_path')), 'columns' => array('Backup File', 'Uploaded <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', 'File Size', 'Type'), 'hover_actions' => array($urlPrefix . '&cpy_file=' => 'Copy to Local', $urlPrefix . '&downloadlink_file=' => 'Get download link'), 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
}
// Display troubleshooting subscriber key.
echo '<br style="clear: both;">';
return;