} } } } // end form submitted. } elseif ($mode == 'edit') { // EDIT MODE. $settings = array('itxapi_username' => $itxapi_username, 'itxapi_token' => $itxapi_token); $account_info = pb_backupbuddy_destination_stash2::get_quota($settings); $itxapi_username = $destination_settings['itxapi_username']; } if ($mode == 'save' || $mode == 'edit' || $itxapi_token != '') { $default_name = NULL; if ($mode != 'save' && 'edit' != $mode) { $settings = array('itxapi_username' => $itxapi_username, 'itxapi_token' => $itxapi_token); $account_info = pb_backupbuddy_destination_stash2::get_quota($settings); if (!is_array($account_info)) { $pb_hide_test = true; $pb_hide_save = true; return false; } else { $pb_hide_test = false; $pb_hide_save = false; } $account_details = 'Welcome to your BackupBuddy Stash, <b>' . $itxapi_username . '</b>. Your account is '; if ($account_info['subscriber_locked'] == '1') { $account_details .= 'LOCKED'; } elseif ($account_info['subscriber_expired'] == '1') { $account_details .= 'EXPIRED'; } elseif ($account_info['subscriber_active'] == '1') { $account_details .= 'active';
} $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;