Ejemplo n.º 1
0
<?php

if (!defined('PB_IMPORTBUDDY') || true !== PB_IMPORTBUDDY) {
    die('<html></html>');
}
Auth::require_authentication();
// Die if not logged in.
$data = array();
pb_backupbuddy::load_view('dbreplace', $data);
Ejemplo n.º 2
0
 *
 *	@return		boolean		True if WordPress already exists; false otherwise.
 */
function wordpress_exists()
{
    if (file_exists(ABSPATH . 'wp-config.php')) {
        return true;
    } else {
        return false;
    }
}
function phpini_exists()
{
    return file_exists(ABSPATH . 'php.ini');
}
function htaccess_exists()
{
    return file_exists(ABSPATH . '.htaccess');
}
if ($mode == 'html') {
    pb_backupbuddy::load_view('html_1', $data);
} else {
    // API mode.
    upload();
    if (wordpress_exists() === true) {
    }
    if (phpini_exists() === true) {
    }
    if (htaccess_exists() === true) {
    }
}
Ejemplo n.º 3
0
<?php

$view_data['backups'] = pb_backupbuddy::$classes['core']->backups_list('default');
pb_backupbuddy::load_view('_backup-home', $view_data);
Ejemplo n.º 4
0
    $importbuddy_pass_match_fail = true;
}
/* END VERIFYING PASSWORD CONFIRMATIONS MATCH */
/* BEGIN REPLACING IMPORTBUDDY/REPAIRBUDDY_PASS_HASH WITH VALUE OF ACTUAL HASH */
// ImportBuddy hash replace.
if (str_replace(')', '', pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash')) != '' && md5(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash')) != pb_backupbuddy::$options['importbuddy_pass_hash']) {
    //echo 'posted value: ' . pb_backupbuddy::_POST( 'pb_backupbuddy_importbuddy_pass_hash' ) . '<br>';
    //echo 'hash: ' . md5( pb_backupbuddy::_POST( 'pb_backupbuddy_importbuddy_pass_hash' ) ) . '<br>';
    pb_backupbuddy::$options['importbuddy_pass_length'] = strlen(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash'));
    $_POST['pb_backupbuddy_importbuddy_pass_hash'] = md5(pb_backupbuddy::_POST('pb_backupbuddy_importbuddy_pass_hash'));
} else {
    // Keep the same.
    if ($importbuddy_pass_match_fail !== true) {
        // keep the same
        $_POST['pb_backupbuddy_importbuddy_pass_hash'] = pb_backupbuddy::$options['importbuddy_pass_hash'];
    }
}
// Set importbuddy dummy text to display in form box. Equal length to the provided password.
$data['importbuddy_pass_dummy_text'] = str_pad('', pb_backupbuddy::$options['importbuddy_pass_length'], ')');
/* BEGIN SAVE MULTISITE SPECIFIC SETTINGS IN SET OPTIONS SO THEY ARE AVAILABLE GLOBALLY */
if (is_multisite()) {
    // Save multisite export option to the global site/network options for global retrieval.
    $options = get_site_option('pb_' . pb_backupbuddy::settings('slug'));
    $options['multisite_export'] = pb_backupbuddy::_POST('pb_backupbuddy_multisite_export');
    update_site_option('pb_' . pb_backupbuddy::settings('slug'), $options);
    unset($options);
}
/* END SAVE MULTISITE SPECIFIC SETTINGS IN SET OPTIONS SO THEY ARE AVAILABLE GLOBALLY */
// Load settings view.
pb_backupbuddy::load_view('settings', $data);
Ejemplo n.º 5
0
 *
 *	@return		boolean		True if WordPress already exists; false otherwise.
 */
function wordpress_exists()
{
    if (file_exists(ABSPATH . 'wp-config.php')) {
        return true;
    } else {
        return false;
    }
}
function phpini_exists()
{
    return file_exists(ABSPATH . 'php.ini');
}
function htaccess_exists()
{
    return file_exists(ABSPATH . '.htaccess');
}
function index_exists()
{
    if (file_exists(ABSPATH . 'index.htm') === true) {
        return true;
    }
    if (file_exists(ABSPATH . 'index.html') === true) {
        return true;
    }
}
pb_backupbuddy::load_view('html_1');
// LOG IMPORTBUDDY VERSION INFORMATION.
pb_backupbuddy::status('details', 'Running ImportBuddy v' . pb_backupbuddy::$options['bb_version'] . '.');
Ejemplo n.º 6
0
					echo '{views/getting_started.php not found.}';
				}
				
				echo '</div>';
				
				plugin_information( $slug, $data );
			}
			?>
		</div>
	</div>
	<?php
} else { // STANDALONE
	pb_backupbuddy::$ui->title( 'Getting Started with ' . pb_backupbuddy::settings( 'name' ) . ' v' . pb_backupbuddy::settings( 'version' ) );
	
	if ( file_exists( pb_backupbuddy::plugin_path() . '/views/getting_started.php' ) ) {
		pb_backupbuddy::load_view( 'getting_started' );
	} else {
		echo '{views/getting_started.php not found.}';
	}
	
	plugin_information( pb_backupbuddy::settings( 'slug' ), array( 'name' => pb_backupbuddy::settings( 'name' ), 'path' => pb_backupbuddy::plugin_path() ) );
}



function plugin_information( $plugin_slug, $data ) {
	$plugin_path = $data['path'];
	?>
	
	<?php pb_backupbuddy::$ui->start_metabox( 'Plugin Information', true, 'width: 70%;' ); ?>
		<textarea readonly="readonly" rows="7" cols="65" wrap="off" style="width: 100%;"><?php echo "Version History:\n\n" ; readfile( $plugin_path . '/history.txt' ); ?></textarea>
Ejemplo n.º 7
0
            pb_backupbuddy::load_view('getting_started');
        } else {
            echo '{views/getting_started.php not found.}';
        }
        echo '</div>';
        plugin_information($slug, $data);
    }
    ?>
		</div>
	</div>
	<?php 
} else {
    // STANDALONE
    pb_backupbuddy::$ui->title('Getting Started with ' . pb_backupbuddy::settings('name') . ' v' . pb_backupbuddy::settings('version'));
    if (file_exists(pb_backupbuddy::plugin_path() . '/views/getting_started.php')) {
        pb_backupbuddy::load_view('getting_started', array('plugin_slug' => pb_backupbuddy::settings('slug')));
    } else {
        echo '{views/getting_started.php not found.}';
    }
    //plugin_information( pb_backupbuddy::settings( 'slug' ), array( 'name' => pb_backupbuddy::settings( 'name' ), 'path' => pb_backupbuddy::plugin_path() ) );
}
echo '</td><td>&nbsp;&nbsp;</td><td valign="top" style="padding-top: 40px;">';
pb_backupbuddy::$ui->start_metabox('Tutorials & Support', true, true);
?>
- <a href="http://ithemes.com/publishing/getting-started-with-backupbuddy/" target="_new" style="text-decoration: none;">Getting Started eBook</a><br>
- <a href="http://ithemes.com/backupbuddy-training/" target="_new" style="text-decoration: none;">Tutorial & Walkthrough Videos</a><br>
- <a href="http://ithemes.tv/category/backupbuddy/" target="_new" style="text-decoration: none;">Getting Started Videos</a><br>
- <a href="http://ithemes.com/codex/" target="_new" style="text-decoration: none;">Knowledge Base Codex</a><br>
- <a href="http://ithemes.com/support/" target="_new" style="text-decoration: none;">Support Forum</a>
<?php 
pb_backupbuddy::$ui->end_metabox();
Ejemplo n.º 8
0
        $wp_settings[] = array('Network Home URL', network_home_url(), 'network_home_url()');
    }
    $wp_settings[] = array('BackupBuddy local storage', backupbuddy_core::getBackupDirectory(), 'BackupBuddy Settings');
    $wp_settings[] = array('BackupBuddy temporary files', backupbuddy_core::getTempDirectory(), 'ABSPATH + Hardcoded location');
    $wp_settings[] = array('BackupBuddy logs', backupbuddy_core::getLogDirectory(), 'Upload Base + BackupBuddy');
    // Display WP settings..
    pb_backupbuddy::$ui->list_table($wp_settings, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('URLs & Paths', 'it-l10n-backupbuddy'), __('Value', 'it-l10n-backupbuddy'), __('Obtained via', 'it-l10n-backupbuddy')), 'css' => 'width: 100%;'));
    pb_backupbuddy::$ui->end_tab();
    // This page can take a bit to run.
    // Runs AFTER server information is displayed so we can view the default limits for the server.
    pb_backupbuddy::set_greedy_script_limits();
    pb_backupbuddy::$ui->start_tab('database');
    require_once 'server_info/database.php';
    echo '<br><br><a name="database_replace"></a>';
    echo '<div class="pb_htitle">' . 'Advanced: ' . __('Database Mass Text Replacement', 'it-l10n-backupbuddy') . '</div><br>';
    pb_backupbuddy::load_view('_server_tools-database_replace');
    pb_backupbuddy::$ui->end_tab();
    pb_backupbuddy::$ui->start_tab('files');
    require_once 'server_info/site_size.php';
    pb_backupbuddy::$ui->end_tab();
    pb_backupbuddy::$ui->start_tab('cron');
    require_once 'server_info/cron.php';
    pb_backupbuddy::$ui->end_tab();
    echo '<br style="clear: both;"><br><br>';
    pb_backupbuddy::$ui->end_tabs();
    // Handles thickbox auto-resizing. Keep at bottom of page to avoid issues.
    if (!wp_script_is('media-upload')) {
        wp_enqueue_script('media-upload');
        wp_print_scripts('media-upload');
    }
} else {
Ejemplo n.º 9
0
    $restore->determineDatabaseFiles();
    pb_backupbuddy::status('details', 'About to load Step 3.');
    ?>
	<script>
		setTimeout( function(){
			pageTitle( 'Step 3: Database Settings' );
			bb_showStep( 'databaseSettings', <?php 
    echo json_encode($restore->_state);
    ?>
 );
		}, 2000);
	</script>
	<?php 
}
// Load footer.
pb_backupbuddy::load_view('_iframe_footer');
// Deployment proceed.
if ('true' == pb_backupbuddy::_GET('deploy')) {
    $nextStepNum = 4;
    echo '<!-- AUTOPROCEED TO STEP ' . $nextStepNum . ' -->';
    //echo '<script>console.log( "' . print_r( $restore->_state, true ) . '" );</script>';
    // Write default state overrides.
    global $importbuddy_file;
    $importFileSerial = backupbuddy_core::get_serial_from_file($importbuddy_file);
    $state_file = ABSPATH . 'importbuddy-' . $importFileSerial . '-state.php';
    pb_backupbuddy::status('details', 'Writing to state file `' . $state_file . '`.');
    if (false === ($file_handle = @fopen($state_file, 'w'))) {
        pb_backupbuddy::status('error', 'Error #328937: Temp state file is not creatable/writable. Check your permissions. (' . $state_file . ')');
        return false;
    }
    if (false === fwrite($file_handle, "<?php die('Access Denied.'); // <!-- ?>\n" . base64_encode(serialize($restore->_state)))) {
Ejemplo n.º 10
0
<?php

if (pb_backupbuddy::_GET('backupbuddy_backup') == '') {
    pb_backupbuddy::$ui->title('Multisite: Export Site (EXPERIMENTAL)');
    $view_data['backups'] = backupbuddy_core::backups_list('default', true);
    // Second param true makes subsite mode only. Only lists backups for this subsite.
    // Load view.
    pb_backupbuddy::load_view('multisite_export', $view_data);
}
// End if.
// Handle MS export through the normal backup mechanism.
$export_only = true;
require_once 'backup.php';
Ejemplo n.º 11
0
<?php

if (!defined('PB_IMPORTBUDDY') || true !== PB_IMPORTBUDDY) {
    die('<html></html>');
}
Auth::require_authentication();
// Die if not logged in.
pb_backupbuddy::load_view('_iframe_header');
pb_backupbuddy::set_greedy_script_limits();
echo "<script>pageTitle( 'Step 6: Cleanup & Completion' );</script>";
echo "<script>bb_showStep( 'cleanupSettings' );</script>";
pb_backupbuddy::flush();
if ('true' != pb_backupbuddy::_GET('deploy')) {
    // deployment mode pre-loads state data in a file instead of passing via post.
    // Parse submitted restoreData restore state from previous step.
    $restoreData = pb_backupbuddy::_POST('restoreData');
    if (NULL === ($restoreData = json_decode(urldecode(base64_decode($restoreData)), true))) {
        // All the encoding/decoding due to UTF8 getting mucked up along the way without all these layers. Blech!
        $message = 'ERROR #83893c: unable to decode JSON restore data `' . htmlentities($restoreData) . '`. Restore halted.';
        if (function_exists('json_last_error')) {
            $message .= ' json_last_error: `' . json_last_error() . '`.';
        }
        pb_backupbuddy::alert($message);
        pb_backupbuddy::status('error', $message);
        die;
    }
} else {
    if (isset(pb_backupbuddy::$options['default_state_overrides']) && count(pb_backupbuddy::$options['default_state_overrides']) > 0) {
        // Default state overrides exist. Apply them.
        $restoreData = pb_backupbuddy::$options['default_state_overrides'];
        /*
Ejemplo n.º 12
0
    } else {
        $type = 'Unknown (' . $schedule['type'] . ')';
    }
    $interval = $schedule['interval'];
    $destinations = explode('|', $schedule['remote_destinations']);
    $destination_array = array();
    foreach ($destinations as $destination) {
        if (isset($destination) && $destination != '') {
            $destination_array[] = pb_backupbuddy::$options['remote_destinations'][$destination]['title'] . ' (' . pb_backupbuddy::$classes['core']->pretty_destination_type(pb_backupbuddy::$options['remote_destinations'][$destination]['type']) . ')';
        }
    }
    $destinations = implode(', ', $destination_array);
    $first_run = pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($schedule['first_run']));
    if (isset($schedule['last_run'])) {
        // backward compatibility before last run tracking added. Pre v2.2.11. Eventually remove this.
        if ($schedule['last_run'] == 0) {
            $last_run = '<i>' . __('Never', 'it-l10n-backupbuddy') . '</i>';
        } else {
            $last_run = pb_backupbuddy::$format->date(pb_backupbuddy::$format->localize_time($schedule['last_run']));
        }
    } else {
        // backward compatibility for before last run tracking was added.
        $last_run = '<i> ' . __('Unknown', 'it-l10n-backupbuddy') . '</i>';
    }
    $schedules[$schedule_id] = array($title, $type, $interval, $destinations, $first_run, $last_run);
}
// End foreach.
$data['schedules'] = $schedules;
// Load view.
pb_backupbuddy::load_view('scheduling', $data);
Ejemplo n.º 13
0
<?php

// Incoming variables: $backup from controllers/pages/_backup_home.php
if ('1' == pb_backupbuddy::_GET('skip_quicksetup')) {
    pb_backupbuddy::$options['skip_quicksetup'] = '1';
    pb_backupbuddy::save();
}
// Popup Quickstart modal if appears to be new install & quickstart not skip.
if (pb_backupbuddy::_GET('wizard') == '1' || '0' == pb_backupbuddy::$options['skip_quicksetup'] && 0 == count(pb_backupbuddy::$options['schedules']) && '' == pb_backupbuddy::$options['importbuddy_pass_hash']) {
    pb_backupbuddy::$ui->title('BackupBuddy Quick Setup Wizard');
    //echo "tb_show( 'BackupBuddy Quick Setup', '" . pb_backupbuddy::ajax_url( 'quickstart' ) . "&TB_iframe=1&width=640&height=455', null );";
    pb_backupbuddy::load_view('_quicksetup', array());
    return;
} else {
    pb_backupbuddy::$ui->title(__('Backup', 'it-l10n-backupbuddy') . ' <a href="javascript:void(0)" class="add-new-h2" onClick="jQuery(\'.backupbuddy-recent-backups\').toggle()">View recently made backups</a>');
}
wp_enqueue_script('thickbox');
wp_print_scripts('thickbox');
wp_print_styles('thickbox');
// Handle deleting profile.
if (pb_backupbuddy::_GET('delete_profile') != '' && is_numeric(pb_backupbuddy::_GET('delete_profile'))) {
    if (pb_backupbuddy::_GET('delete_profile') > 2) {
        if (isset(pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('delete_profile')])) {
            $profile_title = pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('delete_profile')]['title'];
            unset(pb_backupbuddy::$options['profiles'][pb_backupbuddy::_GET('delete_profile')]);
            pb_backupbuddy::save();
            pb_backupbuddy::alert('Deleted profile "' . htmlentities($profile_title) . '".');
        }
    } else {
        pb_backupbuddy::alert('Invalid profile ID. Cannot delete base profiles.');
    }
Ejemplo n.º 14
0
 */
function preflightScan()
{
    $issues = array();
    if (file_exists(ABSPATH . 'wp-config.php')) {
        $issues['wordpress_exists'] = 'WARNING: Existing WordPress installation found. It is strongly recommended that existing WordPress files and database be removed prior to migrating or restoring to avoid conflicts. You should not install WordPress prior to migrating.';
    }
    if (file_exists(ABSPATH . 'php.ini')) {
        $issues['php_ini_exists'] = 'WARNING: Existing php.ini file found. If your backup also contains a php.ini file it may overwrite the current one, possibly resulting in changes in cofiguration or problems. Make a backup of your existing file if your are unsure.';
    }
    if (file_exists(ABSPATH . '.htaccess')) {
        $issues['htaccess_exists'] = 'WARNING: Existing .htaccess file found. If your backup also contains a .htaccess file it may overwrite the current one, possibly resulting in changed in configuration or problems. Make a backup of your existing file if you are unsure.';
    }
    /* TODO: Move to post flight scan.
    	if ( ( file_exists( ABSPATH . 'index.htm' ) === true ) || ( file_exists( ABSPATH . 'index.html' ) === true ) ) {
    		$issues['index_exists'] = 'An index.htm(l) file exists in this site path. Depending on your server setup it may take precedence in loading instead of WordPress. If after restore your site loads an unexpected or blank page, try renaming or deleting the index.htm(l) file(s) in the site root, `' . ABSPATH . '`.';
    	}
    	*/
    // Look for directories named after a backup file that contain WordPress. -- improperly unzipped in the wrong location.
    $backup_dirs = glob(ABSPATH . 'backup-*/wp-login.php');
    if (!is_array($backup_dirs)) {
        $backup_dirs = array();
    }
    if (count((array) $backup_dirs) > 0) {
        $issues['manual_unzip_wrong_location'] = 'A manually unzipped backup may have been found in the following location(s). If you manually unzipped confirm the files were not unzipped into this subdirectory else they will need to be moved up out of the subdirectory into the same directory as importbuddy.php. Possible manually unzipped backups in a subdirectory: ' . implode(', ', $backup_dirs);
    }
    return $issues;
}
pb_backupbuddy::load_view('home', $data);
// LOG IMPORTBUDDY VERSION INFORMATION
pb_backupbuddy::status('details', 'Running ImportBuddy v' . pb_backupbuddy::$options['bb_version'] . '.');
Ejemplo n.º 15
0
		<?php 
    }
}
wp_enqueue_script('thickbox');
wp_print_scripts('thickbox');
wp_print_styles('thickbox');
pb_backupbuddy::$ui->title(__('Restore / Migrate', 'it-l10n-backupbuddy'));
/********* Begin Migrate Settings Form *********/
$migrate_form = new pb_backupbuddy_settings('migrate', false, '', 200);
// form_name, savepoint, action_destination, title_width
$migrate_form->add_setting(array('type' => 'text', 'name' => 'web_address', 'title' => __('Website address', 'it-l10n-backupbuddy'), 'tip' => __('Website address that corresponds to the FTP path.ß', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'default' => 'http://', 'css' => 'width: 200px;', 'after' => ' <span class="description">(ftp path must correspond to this address)</span>'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_server', 'title' => __('FTP server address', 'it-l10n-backupbuddy'), 'tip' => __('FTP server address. This must correspond to the website address URL, including path, to the destination site.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_username', 'title' => __('FTP username', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_password', 'title' => __('FTP password', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_path', 'title' => __('FTP remote path (optional)', 'it-l10n-backupbuddy'), 'tip' => __('This is the remote path / directory for the server. You may use an FTP client to connect to your FTP to determine the exact path.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'after' => ' <span class="description">(must correspond to website address)</span>', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'checkbox', 'name' => 'ftps', 'title' => __('Use FTPs encryption', 'it-l10n-backupbuddy'), 'options' => array('unchecked' => '0', 'checked' => '1'), 'rules' => 'required'));
$result = $migrate_form->process();
// Handles processing the submitted form (if applicable).
echo '<pre>' . print_r($result, true) . '</pre>';
if (count($result['errors']) > 0) {
    // Form errors.
} else {
    // No errors.
}
$view_data['migrate_form'] =& $migrate_form;
// For use in view.
/********* End Migrate Settings Form *********/
// Load view.
$view_data['backups'] = backupbuddy_core::backups_list('migrate');
pb_backupbuddy::load_view('migrate-home', $view_data);
Ejemplo n.º 16
0
<?php

$data = array();
$data['title'] = 'Authentication Required';
pb_backupbuddy::load_view('login', $data);