Ejemplo n.º 1
0
 if (false !== $current_user) {
     $user_full_name = $current_user->first_name . ' ' . $current_user->last_name;
 }
 //Not going to use the restore Point SQL because IF the import failed then DB may be intact
 if (!$wp_restore->restore_database()) {
     fatal_error($task, '212', 'Database NOT restored.');
     //Do we want to recover the DB ?
 }
 end_status($task);
 $logger->log('**END RESTORE DATABASE**');
 $logger->log('*UPDATE DATABASE VALUES*');
 //update the session cookie
 wp_set_auth_cookie($user_id, true);
 //Cancel any jobs that were in the restored DB
 WPBackItUp_Job_v2::cancel_all_jobs('backup');
 WPBackItUp_Job_v2::cancel_all_jobs('cleanup');
 start_status('update_user');
 //Restored DB so current user may not be there.
 //If current user id doesnt exist then create it
 //if exists update to current properties
 if (!$wp_restore->update_credentials($user_id, $user_full_name, $current_user_login, $current_user_pass_hash, $current_user_email, $table_prefix)) {
     warning('215', 'Cant update user credentials.');
 }
 end_status('update_user');
 start_status('update_site_info');
 if (!$wp_restore->update_siteurl($table_prefix, $current_siteurl)) {
     warning('213', 'Cant update site url.');
 }
 if (!$wp_restore->update_homeurl($table_prefix, $current_homeurl)) {
     warning('214', 'Cant update home url.');
 }