<?php if (pb_backupbuddy::_GET('file') != '') { $backup_archives = array(pb_backupbuddy::_GET('file')); echo '<div style="padding: 15px; background: #FFFFFF;">Restoring from backup <i>' . htmlentities(pb_backupbuddy::_GET('file')) . '</i></div> <form action="?ajax=2" method="post" target="restorebuddy_iframe">'; echo '<input type="hidden" name="file" value="' . pb_backupbuddy::_GET('file') . '">'; } else { ?> <div class="backup_select_buttons"> <button href="#pb_upload_modal" class="button button-secondary leanModal createdb_modal_link" style="font-size: 14px;">Upload a Backup</button> <button href="#pb_stash_modal" class="button button-secondary leanModal createdb_modal_link" style="font-size: 14px;">Restore from Stash</button> </div> <?php $backup_archives = get_archives_list(); if (0 == count($backup_archives)) { // No backups found. // Look for manually unzipped pb_backupbuddy::alert('<b>No BackupBuddy Zip backup found in this directory `' . ABSPATH . '`</b> - You must upload a backup file by FTP (into the same directory as this importbuddy.php file), the upload tab, or import from Stash via the Stash tab above to continue. <b>Do not rename the backup file from its original filename.</b> If you manually extracted/unzipped, upload the backup file, select it, then select <i>Advanced Troubleshooting Options</i> & click <i>Skip Zip Extraction</i>. Refresh this page once you have uploaded the backup.'); } else { // Found one or more backups. ?> <form action="?ajax=2" method="post" target="miniFrame"> <input type="hidden" name="pass_hash" value="<?php echo PB_PASSWORD; ?> ">
<?php pb_backupbuddy::set_greedy_script_limits(true); $data = array('detected_max_execution_time' => 30, 'backup_archives' => get_archives_list(), 'wordpress_exists' => wordpress_exists(), 'step' => '1'); $detected_max_execution_time = str_ireplace('s', '', ini_get('max_execution_time')); if (is_numeric($detected_max_execution_time)) { $data['detected_max_execution_time'] = $detected_max_execution_time; } /** * upload() * * Processes uploaded backup file. * * @return array True on upload success; false otherwise. */ function upload() { if (isset($_POST['upload']) && $_POST['upload'] == 'local') { if (pb_backupbuddy::$options['password'] != '#PASSWORD#') { $path_parts = pathinfo($_FILES['file']['name']); if (strtolower(substr($_FILES['file']['name'], 0, 6)) == 'backup' && strtolower($path_parts['extension']) == 'zip') { if (move_uploaded_file($_FILES['file']['tmp_name'], basename($_FILES['file']['name']))) { pb_backupbuddy::alert('File Uploaded. Your backup was successfully uploaded.'); return true; } else { pb_backupbuddy::alert('Sorry, there was a problem uploading your file.', true); return false; } } else { pb_backupbuddy::alert('Only properly named BackupBuddy zip archives with a zip extension may be uploaded.', true); return false;
<?php pb_backupbuddy::set_greedy_script_limits( true ); $data = array( 'detected_max_execution_time' => 30, 'backup_archives' => get_archives_list(), 'wordpress_exists' => wordpress_exists(), 'step' => '1', ); $detected_max_execution_time = str_ireplace( 's', '', ini_get( 'max_execution_time' ) ); if ( is_numeric( $detected_max_execution_time ) ) { $data['detected_max_execution_time'] = $detected_max_execution_time; } /** * upload() * * Processes uploaded backup file. * * @return array True on upload success; false otherwise. */ function upload() { if ( isset( $_POST['upload'] ) && ( $_POST['upload'] == 'local' ) ) { if ( pb_backupbuddy::$options['password'] != '#PASSWORD#' ) { $path_parts = pathinfo( $_FILES['file']['name'] ); if ( ( strtolower( substr( $_FILES['file']['name'], 0, 6 ) ) == 'backup' ) && ( strtolower( $path_parts['extension'] ) == 'zip' ) ) {